File management method and device, electronic equipment, storage medium and product

By analyzing and saving PLC configuration files into a unified structure format, the problem of different PLC configuration files formats of different manufacturers is solved, and the configuration file management of PLCs of different manufacturers is realized, which improves the management efficiency of the automated control system.

CN119759407APending Publication Date: 2025-04-04BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411935685.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

In the automated control system, there are configuration file format differences in PLC products of different manufacturers, which leads to the inability to quickly implement configuration export and switch when frequent configuration and maintenance are required, which reduces management efficiency.

Method used

By obtaining the configuration file of the target PLC, parsing and saving it into a unified structure format, allowing editing and then translating it into a configuration file that can be recognized by the target PLC, realizing configuration file management for PLCs of different manufacturers.

Benefits of technology

There is no need to deploy specific configuration tools for different manufacturers, which realizes unified management of PLC configuration files for different manufacturers, and improves the management efficiency of the automated control system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759407A_ABST
    Figure CN119759407A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a file management method, electronic equipment, a computer storage medium and a computer program product. The method comprises the steps that a first configuration file of a target PLC is acquired; according to a first structural body corresponding to a manufacturer to which the target PLC belongs, analyzing the first configuration file to obtain related information of the first configuration file; storing the related information according to a preset second structural body; and translating the edited related information into a second configuration file according to the first structural body when editing of the stored related information is completed. On the basis of the method provided by the invention, the PLC configuration files of different manufacturers are managed, and meanwhile, analysis and translation can be respectively performed according to the difference of the structural bodies between the configuration files corresponding to the different manufacturers, so that the management efficiency of an automatic control system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular, to a file management method, device, electronic device, storage medium and computer program product. Background Art

[0002] With the development of automatic control systems, the product characteristics, implementation principles, and configuration and maintenance methods of PLCs (Programmable Logic Controllers) produced by various manufacturers of automatic control systems are different. After customers purchase PLCs from different manufacturers, they need to set up a corresponding configuration tool to configure and maintain the PLCs of different manufacturers through the corresponding configuration tool. However, with the upgrade of products and changes in demand, the types of PLCs deployed in automatic control systems have increased. When it is necessary to frequently configure and maintain each PLC, not only can the configuration export switch not be realized quickly, but the management efficiency of the automatic control system is also reduced. Summary of the invention

[0003] In view of this, the purpose of the present application is to provide a file management method, device, electronic device, storage medium and computer program product to improve the problem of low management efficiency of the automation control system.

[0004] The embodiment of the present application is implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a file management method, including: obtaining a first configuration file of a target PLC; parsing the first configuration file according to a first structure corresponding to the manufacturer to which the target PLC belongs to obtain relevant information of the first configuration file; saving the relevant information according to a preset second structure, wherein the saved relevant information is editable information; upon completing the editing of the saved relevant information, translating the edited relevant information into a second configuration file according to the first structure.

[0006] In the embodiment of the present application, there is no need to deploy corresponding configuration tools for different manufacturers. After obtaining the configuration files of PLCs of different manufacturers, the configuration files are first parsed according to the first structure corresponding to the manufacturer to which the target PLC belongs, and then saved uniformly according to the second structure to achieve unified management of the relevant information of the configuration files. After completing the editing of the relevant information, the relevant information is translated into the configuration file according to the first structure. In this way, while managing the configuration files of PLCs of different manufacturers, they can also be parsed and translated separately according to the differences in the structures of the configuration files corresponding to different manufacturers, thereby improving the management efficiency of the automation control system.

[0007] In an optional implementation, the first configuration file is parsed according to a first structure corresponding to the manufacturer to which the target PLC belongs to obtain relevant information of the first configuration file, including: obtaining PLC manufacturer information and / or CPU model information contained in the first configuration file; determining the manufacturer to which the target PLC belongs based on the PLC manufacturer information and / or the CPU model information; obtaining a first structure corresponding to the manufacturer from a preset database, the preset database containing structures of various manufacturers including the manufacturer; parsing the first configuration file according to the first structure to obtain relevant information of the first configuration file.

[0008] In an embodiment of the present application, the manufacturer of the target PLC is determined based on the PLC manufacturer information and / or CPU model information contained in the first configuration file, so as to obtain the first structure corresponding to the manufacturer of the target PLC in the database, and the first configuration file of the target PLC produced by the manufacturer is parsed based on the first structure, so as to achieve management of configuration files of PLCs from different manufacturers while also being able to perform separate parsing based on the differences in structures between configuration files corresponding to different manufacturers, thereby improving the management efficiency of the automation control system.

[0009] In an optional implementation, the saving of the relevant information according to a preset second structure includes: converting the format of the relevant information according to the second structure; and saving the relevant information in the converted format to a corresponding interface.

[0010] In an embodiment of the present application, the relevant information is converted into the format of the second structure and saved to the corresponding interface, so that the relevant information can be processed in the data format of the second structure by calling the interface later, thereby achieving unified processing of configurations of different manufacturers.

[0011] In an optional embodiment, after the relevant information is saved according to a preset second structure, the method further includes: upon receiving a processing request sent by a user, calling the interface to map the relevant information in the converted format to a preset display interface, and the processing request is a request to process the relevant information in the converted format.

[0012] In an embodiment of the present application, relevant information may be mapped to a display interface so that the relevant information can be processed through the display interface to achieve secure management and control of the PLC configuration file.

[0013] In an optional embodiment, calling the interface to map the relevant information in the converted format to a preset display interface includes: checking whether the user has the authority to process the relevant information in the converted format; and if the user has the authority to process the relevant information in the converted format, calling the interface to map the relevant information in the converted format to the display interface.

[0014] In the embodiment of the present application, corresponding management policies can be assigned to configuration files of different manufacturers, and different users can be authorized so that each user has the authority to process different related information. When a user requests to process certain related information, the user's authority is checked to determine whether the user is allowed to process the related information, so as to improve the security of the information.

[0015] In an optional embodiment, the method further includes: when the user does not have the authority to process the relevant information in the converted format, sending an authorization notification corresponding to the user to a preset management end, so that the management end grants the user the authority to process the relevant information in the converted format based on the authorization notification.

[0016] In the embodiment of the present application, the management end performs authorization operations on the user, and the management end authorizes the user to ensure that only authorized users can display and process relevant information, thereby preventing illegal users from operating the information, thereby improving the security of the information.

[0017] In an optional embodiment, after translating the edited relevant information into a second configuration file according to the first structure, it also includes: based on a preset communication protocol, detecting whether the communication with the target PLC is in a normal state; if the communication with the target PLC is in a normal state, downloading the second configuration file to the target PLC.

[0018] In an embodiment of the present application, a communication protocol is used to detect whether the communication state with the target PLC is normal, so as to avoid data loss caused by file transfer in an abnormal communication state, thereby improving the security of information.

[0019] In a second aspect, the present application provides an electronic device, comprising: a memory and a processor, the processor being connected to the memory; the memory being used to store programs; and the processor being used to call the programs stored in the memory to execute the above-mentioned file management method.

[0020] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the above-mentioned file management method is executed.

[0021] In a fourth aspect, the present application provides a computer program product, including a computer program, which implements the above-mentioned file management method when executed by a processor.

[0022] In a fifth aspect, the present application provides a PLC engineering management system, including an acquisition unit, a parsing unit, a saving unit and a translation unit; the acquisition unit is used to acquire a first configuration file of a target PLC; the parsing unit is used to parse the first configuration file according to a first structure corresponding to the manufacturer to which the target PLC belongs, and obtain relevant information of the first configuration file; the saving unit is used to save the relevant information according to a preset second structure, wherein the saved relevant information is editable information; the translation unit is used to translate the edited relevant information into a second configuration file according to the first structure after completing the editing of the saved relevant information.

[0023] Other features and advantages of the present application will be described in the following description. The purpose and other advantages of the present application can be realized and obtained through the structures specifically pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0025] Figure 1 A method flow chart of a file management method provided in an embodiment of the present application;

[0026] Figure 2 A structural diagram of a data processing terminal provided in an embodiment of the present application connected to multiple PLCs;

[0027] Figure 3 The following is a schematic diagram of the interaction between the data processing terminal and the PLC provided in the embodiment of the present application;

[0028] Figure 4 A schematic diagram of the user authority verification process provided in the embodiment of the present application;

[0029] Figure 5 A schematic diagram of the structure of a PLC engineering management system according to an embodiment of the present application;

[0030] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The following embodiments can be used as examples to more clearly illustrate the technical solutions of the present application, and cannot be used to limit the scope of protection of the present application. It will be appreciated by those skilled in the art that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other.

[0032] It should be noted that similar numbers and letters represent similar items in the following figures, so once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. At the same time, in the description of this application, relational terms such as "first", "second", etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0033] Furthermore, the term "and / or" in this application is merely a term used to describe the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone.

[0034] In the description of the embodiments of the present application, unless otherwise clearly specified or limited, the technical term "connection" may refer to a direct connection or an indirect connection through an intermediate medium.

[0035] The present application provides a file management method, which can be applied to processors of various system platforms, computer terminals or various mobile devices. The method flow chart of the method is as follows: Figure 1 As shown, the method may include the following steps:

[0036] S101: Obtain a first configuration file of a target PLC.

[0037] In one implementation, when a file upload operation corresponding to the target PLC executed by the user is detected, an upload instruction is sent to the target PLC according to the file upload operation, and the target PLC uploads the first configuration file according to the upload instruction.

[0038] In the examples of this application, refer to Figure 2As shown in the structural diagram, the first configuration file uploaded by PLCs of different manufacturers can be obtained by the data processing end. The data processing end can be a PLC engineering management system. The PLC engineering management system can be an application software installed on the client or an operating terminal connected to multiple PLCs. Each PLC can be connected to the PLC engineering management system by wire or wirelessly.

[0039] S102: Parse the first configuration file according to the first structure corresponding to the manufacturer to which the target PLC belongs, and obtain relevant information of the first configuration file.

[0040] The relevant information of the first configuration file includes: at least one of program logic information, variable definition information, hardware configuration information, and communication configuration information.

[0041] Among them, the program logic information includes the main part of the PLC program (similar to the main function in a computer program) and the main control logic of the entire automation process.

[0042] The variable definition information includes a variable table, which defines various variables used in the PLC program, such as input variables (such as sensor signals), output variables (such as motor control signals), intermediate variables (used for calculations and logical judgments within the program), etc.; the data type of the variable (such as Boolean, integer, real number, etc.) and storage address are also determined in the variable table; for example, the signal of a temperature sensor is defined as a real number input variable, and its storage address may correspond to a certain input register of the PLC.

[0043] The communication configuration information includes network parameters such as communication protocol, IP address (for Ethernet communication), baud rate (for serial communication), etc.; the network parameters are related parameters for PLC to communicate with other devices (such as host computer, other PLCs or intelligent instruments).

[0044] Hardware configuration information includes PLC input and output information, power supply information, communication module information, etc.

[0045] In the embodiment of the present application, for the first configuration files of PLCs belonging to different manufacturers, the first structure corresponding to each manufacturer is obtained respectively, and the first configuration file of the PLC belonging to the manufacturer is parsed according to the first structure corresponding to each manufacturer.

[0046] In one embodiment, according to the first structure corresponding to the manufacturer to which the target PLC belongs, the specific implementation process of parsing the first configuration file may be: obtaining the PLC manufacturer information and / or CPU model information contained in the first configuration file; determining the manufacturer to which the target PLC belongs based on the PLC manufacturer information and / or CPU model information; obtaining the first structure corresponding to the manufacturer from a preset database; parsing the first configuration file according to the first structure to obtain relevant information of the first configuration file.

[0047] Among them, the first structure is the data format used to manage relevant configuration data in the target PLC. The manufacturer sets the PLC-related configuration parameters when shipping the PLC, which includes the data format used to manage relevant configuration data. When the PLC uploads the configuration data, the PLC generates a corresponding first configuration file based on the data format it supports.

[0048] After obtaining the first configuration file, the PLC manufacturer information and / or CPU model information are obtained from the first configuration file, the PLC manufacturer information includes information such as the manufacturer name and related identifiers, and the CPU model information includes the model identifier, etc. After obtaining the PLC manufacturer information and / or the CPU model information, the first structure corresponding to the manufacturer can be searched in a preset database according to the manufacturer name in the PLC manufacturer information and / or the model identifier in the CPU model information.

[0049] Among them, the preset database contains structures of various manufacturers including this manufacturer. Specifically, the preset database may also include information tables related to each structure, and the information table is used to record the correspondence between PLC manufacturer information and / or CPU model information and the structure; or, the structure of each manufacturer contained in the preset database may carry PLC manufacturer information and / or CPU model information related to the manufacturer.

[0050] S103: Save the relevant information according to the preset second structure.

[0051] Among them, the saved related information is editable information.

[0052] Optionally, the specific implementation process of saving the relevant information according to the second structure may be: converting the format of the relevant information according to the second structure; and saving the relevant information in the converted format to a corresponding interface.

[0053] In an embodiment of the present application, the relevant information obtained by parsing the first configuration file includes at least one of program logic information, variable definition information, hardware configuration information, and communication configuration information. Each type of relevant information corresponds to an interface, and each interface caches the corresponding relevant information. When the relevant information needs to be edited or viewed, the relevant information can be obtained by calling the interface to process the relevant information. That is, after the relevant information is saved according to the preset second structure, if a processing request sent by the user is received, the calling interface maps the relevant information in the converted format to a preset display interface, and the processing request is a request to process the relevant information in the converted format.

[0054] The second structure is a private data format supported by the data processing end. When the data processing end needs to process any information, the data format of the information needs to be converted according to the second structure. The data format of the second structure can be the data format of the ap16 file format.

[0055] S104: When the saved related information is edited, the edited related information is translated into a second configuration file according to the first structure.

[0056] In an embodiment of the present application, a user can view, edit, and process relevant information. If the user edits the relevant information, the relevant information is updated according to the user's editing results. At this time, the edited relevant information needs to be sent to the target PLC as a new configuration. Therefore, to ensure that the target PLC can normally receive the edited relevant information, the edited relevant information needs to be translated into a second configuration file, and the second configuration file is downloaded to the target PLC, so that the target PLC updates the configuration version according to the second configuration file.

[0057] The present application can obtain the first configuration files of the target PLCs of different manufacturers, and parse the first configuration files according to the first structures corresponding to each manufacturer, so as to obtain the relevant information of the first configuration files of the PLCs of different manufacturers. After obtaining the relevant information, the format conversion and saving can be uniformly performed according to the second structures, so as to realize the unified management of each configuration file. After the saved relevant information is edited, the edited relevant information is translated according to the original first structures, so that the second configuration file obtained after the translation is consistent with the data format of the first configuration file before parsing.

[0058] By using the method provided by the present application, it is not necessary to deploy corresponding configuration tools for different manufacturers. By storing the structures of different manufacturers in the database, when obtaining any configuration file, it is only necessary to obtain the PLC manufacturer information and / or CPU model information in the configuration file to obtain the manufacturer to which the PLC that uploaded the configuration file belongs, and then obtain the corresponding first structure from the database. After parsing the configuration file according to the first structure to obtain relevant information, it is uniformly saved according to the second structure to achieve unified management of the relevant information of the configuration file. After completing the editing of the relevant information, the relevant information is translated into the configuration file according to the first structure, which can achieve simultaneous management of the configuration files of PLCs of different manufacturers, and can also perform parsing and translation respectively according to the differences in the structures between the configuration files corresponding to different manufacturers, thereby improving the management efficiency of the automation control system.

[0059] In one embodiment, after obtaining the relevant information, the relevant information is converted into a format according to the second structure through an interface corresponding to the relevant information and then cached. The user can subsequently use the interface to obtain the relevant information in the converted format. The specific method of calling the relevant information can be: upon receiving a processing request sent by the user, the interface is called to map the relevant information in the converted format to a preset display interface. The processing request is a request to process the relevant information in the converted format.

[0060] Among them, the data processing end may support the processing of different data formats, but among the various data formats supported by the data processing end, there may be some data formats that do not support display. Therefore, the second structure in the present application can be a data format that can be used for display among the various private data formats supported by the data processing end. When the user needs to process the relevant information, an operation button can be displayed on the display interface, and the user issues a processing request for processing the relevant information in the converted format through the operation button. Since different relevant information corresponds to different interfaces, when the user only issues a processing request for a certain relevant information, it is only necessary to call the interface corresponding to the relevant information to map the relevant information to the display interface.

[0061] For example, the relevant information obtained after parsing the first configuration file includes: communication configuration information, program logic information and variable definition information. After the communication configuration information, program logic information and variable definition information are format-converted according to the second structure, they are saved to the corresponding interfaces respectively (i.e., the communication configuration information in the converted format is saved to the interface corresponding to the communication configuration information, the program logic information in the converted format is saved to the interface corresponding to the program logic information, and the variable definition information in the converted format is saved to the interface corresponding to the variable definition information); when the user needs to edit the variable definition information in the converted format, the user only needs to call the interface corresponding to the variable definition information to map the variable definition information in the converted format to the display interface.

[0062] Optionally, after the user completes editing the relevant information in the converted format on the display interface, the user can perform an edit completion operation on the display interface. If the user also needs to edit the next relevant information in the converted format on the display interface, then continue to request the processing request corresponding to the next relevant information in the converted format without performing the edit completion operation. When the data processing end detects that the user performs the edit completion operation, the edited relevant information is translated into a new configuration file (i.e., a second configuration file) according to the first structure, and the new configuration file is downloaded to the PLC to update the configuration of the PLC.

[0063] Based on the method of the above embodiment, the process of uploading and downloading configuration files between the data processing end and the PLC can be as follows: Figure 3 As shown, in Figure 3 In the embodiment of the present invention, when the user needs to maintain and process the configuration of the PLC, the file upload operation is performed, and the data processing end sends a file upload instruction to the PLC according to the file upload operation; after receiving the file upload instruction, the PLC generates a first configuration file according to the first structure supported by the PLC, and uploads the first configuration file. After obtaining the first configuration file uploaded by the PLC, the data processing end determines the manufacturer to which the PLC belongs, and obtains the first structure of the manufacturer from the database, so as to parse the first configuration file according to the first structure and obtain relevant information. The relevant information is formatted according to the second structure private to the data processing end and saved to the corresponding interface. When the user needs to edit the relevant information, a processing request is sent to the data processing end, and the data processing end calls the interface to map the relevant information in the converted format to the display interface, and the user edits the relevant information through the display interface. When the user completes editing the relevant information, the edited relevant information is translated according to the first structure, and the second configuration file obtained by the translation is downloaded to the PLC.

[0064] By setting up a database, structures of different manufacturers can be saved, so that when uploading configuration files according to PLCs of different manufacturers, they can be parsed according to the corresponding structures respectively, without setting up configuration tools for each manufacturer. At the same time, the relevant information obtained after parsing can be uniformly managed according to the second structure. After completing the editing of the relevant information, the relevant information can be translated into a configuration file according to the original first structure and downloaded to the PLC, thereby updating the configuration of the PLC. By applying the method provided in this embodiment, the management of configuration files of different manufacturers can be realized, and the management efficiency of each configuration file can be improved.

[0065] In one embodiment of the present application, in order to facilitate the user to process the relevant information, after the relevant information is converted into a format and saved in a corresponding interface, the relevant information can be processed by calling the interface. However, in the processing process, in order to ensure the security of the information, it is necessary to set the user's relevant permissions for processing the relevant information. Therefore, refer to Figure 4 As shown in the flowchart, the specific process of calling the interface to map the relevant information to the preset display interface may include the following steps:

[0066] S401: Check whether the user has the authority to process the relevant information in the converted format.

[0067] In this application, the user's processing rights for relevant information can be authorized through a preset management terminal. The management terminal can be managed by an intermediate administrator. The intermediate administrator has the authority to assign a junior administrator. When a user needs to process relevant information, the intermediate administrator can set the user as a junior administrator through the management terminal, and the management terminal sets the corresponding permission identifier. The permission identifier is used to limit the scope of authority of the junior administrator.

[0068] Optionally, checking whether the user has the authority to process the relevant information in the converted format may specifically be: obtaining the user's authority identifier, determining the user's authority scope through the authority identifier, and if the authority scope includes processing the relevant information, it indicates that the user has the authority to process the relevant information, otherwise the user does not have the authority to process the relevant information. If the user has the authority to process the relevant information, then continue to execute S402; otherwise, execute S403.

[0069] S402: Calling an interface to map the relevant information in the converted format to a display interface.

[0070] S403: Sending an authorization notification corresponding to the user to a preset management end, so that the management end grants the user the authority to process the relevant information in the converted format based on the authorization notification.

[0071] The management end may be a rights management program built into the data processing end, or a client connected to the data processing end.

[0072] In this application, when the management end grants a user the authority to process relevant information, it can set a corresponding permission identifier to limit the user's authority scope through the permission identifier to prevent the user from processing other relevant information that is not within the user's authority scope, thereby causing information leakage or tampering.

[0073] Optionally, in addition to checking the user's authority when the user needs to process relevant information, the user's authority may also be checked when the user requests to upload the PLC configuration file and downloads the configuration file to the PLC.

[0074] Optionally, in addition to receiving the relevant authorization operations of the intermediate administrator, the management terminal can also allow the senior administrator to manage the junior administrator and the intermediate administrator through the management terminal, and the senior administrator has a log record of the administrator's operation behavior (for example: when the intermediate administrator authorizes the junior administrator through the management terminal, the senior administrator records the relevant operations of the intermediate administrator through the management terminal). In addition, the management terminal can also generate the operation log corresponding to the above-mentioned S101-S104 process according to the log generation instruction sent by the senior administrator.

[0075] Based on the above embodiment, the management terminal can receive corresponding instructions sent by three levels of administrators, and the three levels of administrators can be primary, intermediate and senior respectively. The primary administrator can apply for the authority to configure the PLC through the management terminal, including uploading, downloading and editing the PLC configuration file; the intermediate administrator has the authority to assign the primary administrator, and the intermediate administrator can only allow the download program to a certain PLC IP address when configuring the primary administrator; the senior administrator has the ability to generate log records of the operation behaviors of the primary and intermediate administrators through the management terminal, which is convenient for subsequent tracing. The primary administrator user is created by the intermediate administrator, and the corresponding strategy is assigned. The strategy can be to set the control to allow or block the distribution of a certain manufacturer's PLC configuration file; allow or block the download control of the IP, allow or block the distribution of the variable address of DB1 (where DB stands for Data Block) containing the variable address, etc.

[0076] In one embodiment of the present application, in order to further ensure the security of information, it is necessary to perform a communication status check during the process of downloading the second configuration file to the target PLC. Therefore, after translating the edited relevant information into the second configuration file according to the first structure, it also includes: based on a preset communication protocol, detecting whether the communication state with the target PLC is normal; if the communication state with the target PLC is normal, downloading the second configuration file to the target PLC.

[0077] Optionally, when the second configuration file needs to be downloaded to the target PLC, the PLC to which the second configuration file needs to be downloaded may be determined through the PLC manufacturer information and / or CPU model information to avoid downloading the second configuration file to other PLCs.

[0078] In an embodiment of the present application, when downloading the second configuration file to the target PLC, it is determined whether the communication state with the target PLC is normal according to the communication protocol to avoid the loss of some files due to file transfer in an abnormal communication state, thereby improving the security of information.

[0079] According to the method provided in the above embodiment, the process of parsing, saving and translating the configuration file and downloading it has the following implementation scenarios:

[0080] The Siemens PLC engineering management system has a built-in Siemens PLC configuration file structure library (i.e., database), which can parse the configuration file according to the structure of the Siemens PLC (i.e., using the same parsing method as the Siemens PLC programming software). The Siemens PLC uploads the configuration file to the PLC engineering management system, where the PLC engineering management system and the Siemens PLC can establish communication through Ethernet; according to the model information in the file, it is determined that the manufacturer corresponding to the file is the Siemens PLC, and the configuration file is parsed through the built-in Siemens PLC structure library. The various related information obtained by parsing include program logic information, variable definition information, hardware configuration information, and communication configuration information. If the PLC needs to communicate with other devices (such as a host computer, other PLCs, or smart meters), the configuration file will contain network connection parameters. This includes communication protocol TCP / IP, IP address, and port number. After parsing the above data, encapsulate it into 4 interfaces, map the data in the 4 interfaces according to the private structure of the PLC engineering management system, and store the data in the ap16 format file. The stored information is displayed through the PLC engineering management system display interface. Users can intuitively adjust and edit the program logic information, variable definition information, hardware configuration information, and communication configuration information according to the program specifications and syntax of the PLC engineering management system (because different PLC programming software may have some differences in the code representation method). After editing, compile the program. If a compilation error occurs, an error message will be given. Users can modify it according to the error message until the compilation is successful and it can be saved in an AP16 format file. Before issuing, confirm that the communication between the PLC engineering management system and the Siemens PLC is normal, select the correct download target PLC device, determine which manufacturer's PLC the file corresponds to based on the PLC manufacturer information and CPU model information in the file, and then translate the configuration file content into the built-in manufacturer data structure based on the built-in manufacturer structure library and download it to the PLC.

[0081] Based on the same inventive concept, the present application also provides a PLC engineering management system 500. Figure 5 , Figure 5 This is a structural block diagram of a PLC engineering management system 500 provided in an embodiment of the present application. The PLC engineering management system 500 includes: an acquisition unit 501, a parsing unit 502, a storage unit 503 and a translation unit 504.

[0082] The acquisition unit 501 is used to acquire a first configuration file of a target PLC.

[0083] The parsing unit 502 is used to parse the first configuration file according to the first structure corresponding to the manufacturer to which the target PLC belongs, and obtain relevant information of the first configuration file.

[0084] The saving unit 503 is used to save the relevant information according to a preset second structure, wherein the saved relevant information is editable information.

[0085] The translation unit 504 is used to translate the edited relevant information into a second configuration file according to the first structure when the edit of the saved relevant information is completed.

[0086] In an optional embodiment, the parsing unit 502 is specifically used to obtain the PLC manufacturer information and / or CPU model information contained in the first configuration file; determine the manufacturer to which the target PLC belongs based on the PLC manufacturer information and / or the CPU model information; obtain a first structure corresponding to the manufacturer from a preset database, the preset database containing structures of various manufacturers including the manufacturer; parse the first configuration file according to the first structure to obtain relevant information of the first configuration file.

[0087] In an optional embodiment, the saving unit 503 is specifically used to convert the format of the relevant information according to the second structure; and save the relevant information in the converted format to a corresponding interface.

[0088] In an optional embodiment, the PLC engineering management system also includes a display unit 505, which is used to call the interface to map the relevant information in the converted format to a preset display interface when receiving a processing request sent by a user, and the processing request is a request to process the relevant information in the converted format.

[0089] In an optional embodiment, the PLC engineering management system also includes a verification unit 506, which is used to verify whether the user has the authority to process the relevant information in the converted format; if the user has the authority to process the relevant information in the converted format, the interface is called to map the relevant information in the converted format to the display interface.

[0090] In an optional embodiment, the verification unit 506 is also used to send an authorization notification corresponding to the user to a preset management end when the user does not have the authority to process the relevant information in the converted format, so that the management end grants the user the authority to process the relevant information in the converted format based on the authorization notification.

[0091] In an optional embodiment, the PLC engineering management system also includes a communication unit 507, which is used to detect whether it is in a normal communication state with the target PLC based on a preset communication protocol; if it is in a normal communication state with the target PLC, download the second configuration file to the target PLC.

[0092] The embodiment of the present application provides a PLC engineering management system 500, whose implementation principle and technical effects are the same as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.

[0093] like Figure 6 As shown, Figure 6 The structure block diagram of an electronic device 600 provided in an embodiment of the present application is shown. The electronic device 600 includes: a transceiver 601, a memory 602, a communication bus 603 and a processor 604. In some possible implementations, the electronic device 600 may include the above-mentioned PLC engineering management system 500.

[0094] The transceiver 601, the memory 602, and the processor 604 are directly or indirectly electrically connected to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses 603 or signal lines. The transceiver 601 is used to send and receive data. The memory 602 is used to store computer programs, such as storing Figure 5The software function module shown in is the PLC engineering management system 500. Among them, the PLC engineering management system 500 includes at least one software function module that can be stored in the memory 602 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 600. The processor 604 is used to execute the executable module stored in the memory 602, such as the software function module or computer program included in the PLC engineering management system 500. For example, the processor 604 is used to execute the file management method provided in the above embodiment.

[0095] Among them, the memory 602 can be, but is not limited to, random access memory (Random Access Memory, RAM), read only memory (Read Only Memory, ROM), programmable read-only memory (Programmable Read-Only Memory, PROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable read-only memory (Electric Erasable Programmable Read-Only Memory, EEPROM), etc.

[0096] Processor 604 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a graphics processor (GPU), an accelerated processing unit (Accelerated Processing Unit), a multimedia application processor (MAP), a microprocessor, etc.; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application may be implemented or executed. Alternatively, the processor 604 may also be any conventional processor, etc.

[0097] The electronic device 600 mentioned above includes but is not limited to mobile terminals such as mobile phones, laptop computers, tablet computers, etc., and fixed terminals such as digital TVs, desktop computers, etc.

[0098] An embodiment of the present application further provides a non-volatile computer-readable storage medium (hereinafter referred to as storage medium), on which a computer program is stored. When the computer program is run by a computer such as the electronic device 600 described above, the file management method shown above is executed.

[0099] The embodiment of the present application also provides a computer program product, including a computer program, which, when executed by the electronic device 600 as described above, implements the file management method as described above.

[0100] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0101] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0102] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0103] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a computer-readable storage medium, including several instructions for a computer device (which can be a personal computer, a laptop, a server, or an electronic device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned computer-readable storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0104] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A file management method, characterized in that: include: Get the first configuration file of the target PLC; Parsing the first configuration file according to the first structure corresponding to the manufacturer to which the target PLC belongs to obtain relevant information of the first configuration file; Saving the relevant information according to a preset second structure, wherein the saved relevant information is editable information; When the editing of the saved related information is completed, the edited related information is translated into a second configuration file according to the first structure.

2. The method according to claim 1, characterized in that The step of parsing the first configuration file according to the first structure corresponding to the manufacturer to which the target PLC belongs, and obtaining relevant information of the first configuration file includes: Obtaining PLC manufacturer information and / or CPU model information included in the first configuration file; Determine the manufacturer of the target PLC based on the PLC manufacturer information and / or the CPU model information; Acquire a first structure corresponding to the manufacturer from a preset database, wherein the preset database contains structures of various manufacturers including the manufacturer; The first configuration file is parsed according to the first structure to obtain relevant information of the first configuration file.

3. The method according to claim 1, characterized in that The storing of the relevant information according to the preset second structure includes: Convert the format of the relevant information according to the second structure; The relevant information in the converted format is saved to the corresponding interface.

4. The method according to claim 3, characterized in that After the relevant information is saved according to the preset second structure, the method further includes: When a processing request sent by a user is received, the interface is called to map the relevant information in the converted format to a preset display interface, and the processing request is a request to process the relevant information in the converted format.

5. The method according to claim 4, characterized in that The calling of the interface to map the relevant information in the converted format to a preset display interface includes: Checking whether the user has the authority to process the relevant information in the converted format; In the case where the user has the authority to process the relevant information in the converted format, the interface is called to map the relevant information in the converted format to the display interface.

6. The method according to claim 5, characterized in that The method further comprises: In the case that the user does not have the authority to process the relevant information in the converted format, an authorization notification corresponding to the user is sent to a preset management end, so that the management end grants the user the authority to process the relevant information in the converted format based on the authorization notification.

7. The method according to claim 2, characterized in that: After translating the edited related information into a second configuration file according to the first structure, the method further includes: Based on a preset communication protocol, detecting whether the communication with the target PLC is in a normal state; If the communication state with the target PLC is normal, the second configuration file is downloaded to the target PLC.

8. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is connected to the memory; The memory is used to store programs; The processor is used to call the program stored in the memory to execute the method according to any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. A computer program product, characterized in that The method comprises a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.