Configuration file generation method and device, nonvolatile storage medium and electronic equipment
By obtaining device information and associated device information, inputting configuration file generation model, and generating configuration files to automatically determine the target communication protocol of the device, it solves the problem of time-consuming and low efficiency of manual configuration in the prior art, and realizes the efficient automatic configuration of the device and the improvement of data acquisition efficiency.
Patent Information
- Application Number
- CN202510253460.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-03
AI Technical Summary
In the prior art, the equipment management platform requires manual and frequent configuration of the equipment communication protocol, which results in long-term and low efficiency. Due to inconsistent equipment specifications, repeated development increases operation and maintenance costs.
By obtaining the device information of the device to be configured, determining its associated device, and inputting this information into the configuration file to generate a configuration file, generating a configuration file, automatically determining the target communication protocol, and realizing automatic configuration of the device.
It realizes efficient automatic configuration of the equipment, reduces configuration time and manual errors, improves data acquisition efficiency, and reduces operation and maintenance costs.
Smart Images

Figure CN120090930A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular, to a method and apparatus for generating a configuration file, a non-volatile storage medium, and an electronic device. Background Art
[0002] With the continuous development of technologies such as the Internet of Things, big data, artificial intelligence, and industrial Internet, the device management platform can achieve real-time control of information such as device operation management and maintenance data through data collection, reducing or avoiding production stoppages caused by device failures. However, due to the non-uniformity of device specifications on the market, the communication protocols supported by devices are also different, so manual configuration of communication protocols or even repeated development is required during data collection, greatly increasing the operation and maintenance costs.
[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention
[0004] Embodiments of the present application provide a method and apparatus for generating a configuration file, a non-volatile storage medium, and an electronic device, so as to at least solve the technical problems of long configuration time and low efficiency caused by manually configuring device communication protocols in the prior art.
[0005] According to one aspect of the embodiments of the present application, a method for generating a configuration file is provided, including: obtaining device information of a device to be configured, where the device information includes a device unique serial number, network topology structure information, device type, and supported communication protocols; determining associated devices of the device to be configured according to the device information of the device to be configured, where the associated devices include at least one of the following: devices having data interaction with the device to be configured, devices of the same device type as the device to be configured; inputting the device information of the device to be configured and the device information of the associated devices into a configuration file generation model, and obtaining a configuration file output by the configuration file generation model, where the configuration file includes the device unique serial number of the device to be configured and a target communication protocol corresponding to the device unique serial number.
[0006] Optionally, before inputting the device information of the device to be configured and the device information of the associated devices into the configuration file generation model, the method further includes: obtaining communication requirements of the device to be configured, where the communication requirements include at least one of the following: security requirements, transmission rate requirements, communication distance requirements; determining a set of candidate communication protocols from the communication protocols supported by the device to be configured according to the communication requirements, where the candidate communication protocols are communication protocols that meet the communication requirements of the device to be configured; inputting the set of candidate communication protocols into the configuration file generation model, and the configuration file generation model is used to determine a target communication protocol from the set of candidate communication protocols.
[0007] Optionally, obtaining the communication requirements of the device to be configured includes: determining the data information of the interaction data of the device to be configured from the system log file, where the data information includes the data confidentiality level of the interaction data; determining the communication requirements based on the data information.
[0008] Optionally, after obtaining the configuration file output by the configuration file generation model, the method further includes: generating a protocol switching instruction based on the configuration file, where the protocol switching instruction is used to instruct the device to be configured to switch the communication protocol to the target communication protocol; sending the protocol switching instruction to the device to be configured; receiving the response result corresponding to the protocol switching instruction, where the response result includes successful switching, failed switching, and specific error messages.
[0009] Optionally, in the case where the response result is a failed protocol switch, the method further includes: inputting the response result into the configuration file generation model; obtaining the configuration file output again by the configuration file generation model, generating the protocol switching instruction again based on the configuration file output again, sending the protocol switching instruction generated again to the device to be configured, and receiving the response result corresponding to the protocol switching instruction generated again until the response result corresponding to the protocol switching instruction generated again is successful switching.
[0010] Optionally, in the case where the response result is a successful protocol switch, the method further includes: receiving the reported data transmitted by the device to be configured; parsing the reported data according to the target communication protocol.
[0011] Optionally, determining the associated devices of the device to be configured based on the device information of the device to be configured includes: determining the devices that have data interaction with the device to be configured as the associated devices according to the network topology structure information; retrieving the devices with the same device type from the database as the associated devices according to the device type of the device to be configured.
[0012] Optionally, before inputting the device information of the device to be configured and the device information of the associated devices into the configuration file generation model, the method further includes: obtaining training data, where the training data includes historical configuration files, historical device information, and historical associated device information; training the configuration file generation model to be trained based on the training data, where the configuration file generation model is a pre-trained large language model.
[0013] Optionally, training the profile generation model to be trained based on training data includes: sending the profile generation model to be trained and the training parameter configuration of the profile generation model to be trained to multiple gateways. The multiple gateways are used to train the profile generation model to be trained distributed to the gateways based on the training data stored in the gateways and return the training parameter configuration of the trained profile generation model; receiving the training parameter configurations returned by the multiple gateways, calculating the sum and average of the values of each training parameter in the training parameter configuration; updating the training parameter configuration according to the sum and average calculated training parameters, and sending the updated training parameter configuration to each gateway for training again until the preset number of training times is reached.
[0014] Optionally, after obtaining the profile generated by the profile generation model, the method further includes: continuously detecting the status indicators of the device to be configured, where the status indicators include at least one of the following: communication delay duration, data acquisition success rate; and regenerating the profile when it is detected that the value of the status indicator is outside the preset normal range.
[0015] According to another aspect of the embodiments of the present application, there is also provided a profile generation device, including: an acquisition module, configured to acquire device information of a device to be configured, where the device information includes a device unique serial number, a network topology structure information, a device type, and a supported communication protocol; a determination module, configured to determine associated devices of the device to be configured according to the device information of the device to be configured, where the associated devices include at least one of the following: devices having data interaction with the device to be configured, devices of the same device type as the device to be configured; a generation module, configured to input the device information of the device to be configured and the device information of the associated devices into a profile generation model, and obtain the profile output by the profile generation model, where the profile includes the device unique serial number of the device to be configured and the target communication protocol corresponding to the device unique serial number.
[0016] According to another aspect of the embodiments of the present application, there is also provided a non-volatile storage medium storing a program, where when the program runs, it controls the device where the non-volatile storage medium is located to execute the profile generation method.
[0017] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including: a memory and a processor, where the processor is configured to run the program stored in the memory, and when the program runs, it executes the profile generation method.
[0018] According to another aspect of the embodiments of the present application, there is also provided a computer program product including a computer program, where when the computer program is executed by a processor, it implements the profile generation method.
[0019] In the embodiments of the present application, device information of a device to be configured is obtained, where the device information includes a device unique serial number, network topology information, device type, and supported communication protocols; associated devices of the device to be configured are determined based on the device information of the device to be configured, where the associated devices include at least one of the following: devices having data interaction with the device to be configured, devices of the same device type as the device to be configured; the device information of the device to be configured and the device information of the associated devices are input into a configuration file generation model, and a configuration file output by the configuration file generation model is obtained, where the configuration file includes the device unique serial number of the device to be configured and the target communication protocol corresponding to the device unique serial number. By retrieving the associated devices of the device to be configured and generating a configuration file based on the device information of the associated devices and the device to be configured, the purpose of automatically configuring a communication protocol for the device to be configured is achieved, thereby realizing the technical effect of efficiently configuring the communication protocol and improving the data collection efficiency, and further solving the technical problems of long configuration time and low efficiency caused by manually configuring the device communication protocol in the prior art. Brief Description of the Drawings
[0020] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The illustrative embodiments and descriptions thereof of the present application are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:
[0021] Figure 1 is a schematic structural diagram of a computer terminal provided according to an embodiment of the present application;
[0022] Figure 2 is a schematic flowchart of a configuration file generation method provided according to an embodiment of the present application;
[0023] Figure 3 is a schematic flowchart of a training method provided according to an embodiment of the present application;
[0024] Figure 4 is a schematic structural diagram of a configuration file generation device provided according to an embodiment of the present invention. Detailed Embodiments
[0025] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the 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 the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0026] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0027] For a better understanding of the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0028] Device: A device includes all devices with data acquisition capabilities during the production process, has the ability to record data points, and realizes data interaction with the gateway through its own point ports or PLCs (programmable logic controllers). Due to various reasons such as production years, regions, performance, models, manufacturers, etc., different devices have various different data encapsulation rules. To obtain the collected data, the corresponding encapsulation rules, that is, communication protocols, need to be parsed.
[0029] In the context of current industrial automation and intelligent manufacturing, the number of devices is huge and the types are diverse, and each device may use different communication protocols for data transmission. This diversity brings major challenges to device data acquisition and gateway scheduling management: when a device accesses or changes the communication protocol, technicians need to manually configure each device and set the corresponding communication protocol parameters. This process is not only time-consuming but also error-prone. Especially when the number of devices is large, it is difficult to ensure the efficiency and accuracy of manual configuration.
[0030] To solve this problem, relevant solutions are provided in the embodiments of the present application, which are described in detail below.
[0031] According to the embodiments of the present application, a method embodiment of a configuration file generation method is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described here can be executed in a different order than here.
[0032] The method embodiments provided by the embodiments of the present application can be executed on a mobile terminal, a computer terminal or a similar computing device. Figure 1A hardware block diagram of a computer terminal for implementing a configuration file generation method is shown. As Figure 1 shown, the computer terminal 10 may include one or more (shown as 102a, 102b,..., 102n in the figure) processors 102 (the processors 102 may include, but are not limited to, processing devices such as a microprocessor MCU or a field programmable gate array FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only illustrative and does not limit the structure of the above electronic device. For example, the computer terminal 10 may further include more or fewer components than Figure 1 shown, or have a different configuration from Figure 1 shown.
[0033] It should be noted that the above one or more processors 102 and / or other data processing circuits are generally referred to as "data processing circuits" herein. The data processing circuit may be embodied in whole or in part as software, hardware, firmware, or any combination thereof. In addition, the data processing circuit may be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 10. As involved in the embodiments of the present application, the data processing circuit is a processor control (such as the selection of a variable resistance terminal path connected to an interface).
[0034] The memory 104 may be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the configuration file generation method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the above configuration file generation method. The memory 104 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor 102, and these remote memories may be connected to the computer terminal 10 through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0035] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0036] The display can be, for example, a touch-screen liquid crystal display (LCD), which enables the user to interact with the user interface of the computer terminal 10.
[0037] Under the above operating environment, the embodiment of the present application provides a configuration file generation method, as Figure 2 shown, the method includes the following steps:
[0038] Step S202, obtain the device information of the device to be configured, where the device information includes the device unique serial number, network topology information, device type, and supported communication protocols.
[0039] As an optional implementation manner, before obtaining the device information of the device to be configured, it further includes receiving a registration request of the device to be configured and recording the device information of the device to be configured, which specifically includes the following steps:
[0040] 1. First, register the gateway device on the data acquisition platform.
[0041] Fill in information such as the specific model and unique serial number of the gateway, register the gateway device on the platform. After successful registration, the gateway has platform communication authentication, can report the collected data to the platform, and at the same time the platform can also send information such as files, installation packages, and instructions to the gateway device. After the gateway is registered, the network management or data acquisition platform realizes communication with the gateway through the corresponding MQ (Message Queue) protocol, which is a prerequisite for the gateway to report data.
[0042] 2. Bind the gateway and the subordinate devices on the platform.
[0043] The devices to be collected should be created in advance in the device model library of the platform. After the gateway is successfully registered, on the gateway device configuration page, select the corresponding device type, configure the unique serial number of the specific device, and bind it to the gateway, that is, the registration of the gateway subordinate devices is realized. Through this binding relationship, the gateway can collect the data of the collective subordinate devices.
[0044] Step S204: Determine the associated devices of the device to be configured based on the device information of the device to be configured, where the associated devices include at least one of the following: devices that have data interaction with the device to be configured, and devices of the same device type as the device to be configured.
[0045] As an optional implementation, determining the associated devices of the device to be configured based on the device information of the device to be configured includes: determining, based on the network topology structure information, the devices that have data interaction with the device to be configured as the associated devices; retrieving, based on the device type of the device to be configured, the devices of the same device type from the database as the associated devices.
[0046] Optionally, when receiving the information of the device to be configured, based on the network topology structure information, analyze the physical connection and data flow relationship between devices, identify the devices that have direct or indirect data interaction with the device to be configured, and mark them as associated devices. This process fully considers the network layout and data transmission path in the industrial field, providing a basis for determining the compatible communication protocol subsequently.
[0047] Optionally, based on the device type of the device to be configured, conduct a further in-depth analysis. By accessing the database, retrieve the devices of the same device type as the associated devices. This step utilizes the characteristics of device homogeneity. Even devices that are not directly physically connected may require similar communication configurations or share certain data as long as they belong to the same category, thus being included in the consideration scope of associated devices. The device type information in the database includes, but is not limited to, the model number, functional characteristics, etc. of the device, which helps the system more accurately judge the logical relationship between devices and ensure the compatibility and effectiveness of the communication protocol.
[0048] Step S206: Input the device information of the device to be configured and the device information of the associated devices into the configuration file generation model, and obtain the configuration file output by the configuration file generation model, where the configuration file includes the unique serial number of the device to be configured and the target communication protocol corresponding to the unique serial number of the device.
[0049] As an optional implementation, before inputting the device information of the device to be configured and the device information of the associated devices into the configuration file generation model, the method further includes: obtaining the communication requirements of the device to be configured, where the communication requirements include at least one of the following: security requirements, transmission rate requirements, communication distance requirements; determining a set of candidate communication protocols from the communication protocols supported by the device to be configured according to the communication requirements, where the candidate communication protocols are the communication protocols that meet the communication requirements of the device to be configured; inputting the set of candidate communication protocols into the configuration file generation model, and the configuration file generation model is used to determine the target communication protocol from the set of candidate communication protocols.
[0050] Optionally, after determining the associated devices of the device to be configured, the communication requirements of the device to be configured will be analyzed in depth, including but not limited to security requirements, transmission rate requirements, communication distance requirements, etc. According to the preset selection rules, the communication protocols corresponding to the communication requirements are selected and added to the set of candidate protocols. For example, for industrial devices involving sensitive data transmission, security requirements may become the primary condition for selecting communication protocols, and encrypted communication protocols need to be considered first; for devices distributed in a vast geographical area, communication distance requirements will become particularly important, and communication protocols with long-distance transmission capabilities may need to be selected. For example, the transmission distance of RS232 usually does not exceed 15 meters, while RS485 can support communication up to 1200 meters. For the device to be configured with long-distance data acquisition requirements for communication distance (such as remote device monitoring in industrial automation), RS485 (up to 1200 meters) is added to the set of candidate communication protocols.
[0051] Optionally, obtaining the communication requirements of the device to be configured includes: determining the data information of the interaction data of the device to be configured from the system log file, where the data information includes the data confidentiality level of the interaction data; determining the communication requirements based on the data information.
[0052] Optionally, the communication requirements can be obtained from the log file or from the communication requirement information recorded when registering to the gateway.
[0053] Optionally, when a new device is connected to the industrial network or the communication requirements of an existing device change, the interaction data information related to the device to be configured is captured from the log file. These information contain detailed records of data communication between devices, such as data exchange frequency, data size, data type, etc. Among them, special attention is paid to the data confidentiality level, which is an important basis for determining communication requirements. The data confidentiality level reflects the sensitivity of the data and the transmission security requirements, and is usually determined comprehensively based on the type of data (such as production data, control instructions, sensitive information, etc.), the usage scenario of the data (such as internal transmission, remote access, cloud service interaction, etc.), and the enterprise's security policy.
[0054] Subsequently, based on the captured data information, the communication requirements of the device to be configured are analyzed through a semantic analysis model. For example, if the log file shows that the data transmitted between devices contains a large amount of sensitive information and the data confidentiality level is marked as "high", the system will automatically identify that security requirements are the primary consideration in communication requirements. This means that in the subsequent screening and configuration of communication protocols, protocols that can provide advanced security functions such as data encryption and authentication, such as HTTPS, TLS / SSL, etc., will be given priority to ensure the confidentiality and security of data transmission, that is, the communication protocols that support TLS / SSL, etc. are added to the set of candidate protocols.
[0055] Optionally, after obtaining the configuration file generated by the configuration file generation model, the method further includes: generating a protocol switching instruction according to the configuration file, where the protocol switching instruction is used to instruct the device to be configured to switch the communication protocol to the target communication protocol; sending the protocol switching instruction to the device to be configured; receiving a response result corresponding to the protocol switching instruction, where the response result includes successful switching, failed switching, and specific error messages.
[0056] Optionally, the configuration file includes the unique device serial number of the device to be configured and the target communication protocol corresponding to the unique device serial number. Generating a protocol switching instruction according to the configuration file includes sending the file to the gateway corresponding to the device to be configured. The gateway reads the configuration file, obtains the correspondence between the device and the communication protocol, generates a protocol switching instruction according to the correspondence, and sends the protocol switching instruction to the corresponding device to be configured. The device to be configured receives the protocol switching instruction, switches according to the instruction, and returns a response result.
[0057] As an optional implementation manner, the platform also sends a multi-protocol application program to the gateway, and the multi-protocol application program is used to read the configuration file and obtain the correspondence between the device to be configured and the communication protocol.
[0058] Optionally, the configuration file is in json format. The platform automatically sends the configuration file generated by the configuration file generation model to the gateway and stores it in a specified file path for subsequent use. The file sending function is a basic function provided by the data acquisition platform, which can send files, instructions, and application programs to the gateway. When the sending type is an application program, corresponding instructions will be configured during sending to command the gateway to execute the instructions immediately after successfully receiving the application program, such as starting the application program.
[0059] Inside the multi-protocol application program, after the program starts, it schedules the configuration file, parses the file content, obtains json data, gets the association relationship between the devices under the gateway and the communication protocol, and saves it in the program running cache.
[0060] Preferably, in order to ensure the timeliness and fault tolerance rate of data after the device changes the protocol, the application program reads the content of the configuration file every second, and at the same time judges whether the configuration file has changed. If it has changed, the corresponding relationship saved in the cache is updated and takes effect during the next data acquisition.
[0061] Optionally, in the case where the response result is a protocol switching failure, the method further includes: inputting the response result into the configuration file generation model; obtaining the configuration file output by the configuration file generation model again, generating a protocol switching instruction according to the configuration file output again, sending the protocol switching instruction generated again to the device to be configured, and receiving the response result corresponding to the protocol switching instruction generated again until the response result corresponding to the protocol switching instruction generated again is successful switching.
[0062] Optionally, when the response result indicates successful protocol switching, the method further includes: receiving the reported data transmitted by the device to be configured; parsing the reported data according to the target communication protocol.
[0063] Optionally, when collecting data, the multi-protocol application in the gateway will find the corresponding communication protocol through the device unique serial number.
[0064] If the corresponding communication protocol is found, the corresponding communication protocol parsing method will be called according to the communication protocol encoding to parse the transmitted data. If the parsing is successful, the successfully parsed data will be reported to the platform for subsequent operations; if the parsing fails, the type of the device with parsing failure will also be sent to the platform to remind to update the communication protocol configuration of the device.
[0065] If the corresponding communication protocol cannot be found, or the corresponding device unique serial number cannot be found, the program will send the device information of the currently data-collecting device to the platform. The platform records the corresponding device information and takes this device as the device to be configured to generate a configuration file.
[0066] During the data parsing process, whether the communication protocol is not configured or the communication protocol configuration is incorrect, after notifying the platform, a new configuration file will be generated and sent to the corresponding path of the gateway. The multi-protocol application will detect the change of the configuration file when triggering the configuration file comparison next time, and then update the association relationship between the device and the communication protocol, which takes effect immediately. When collecting and reporting data next time, the updated rules will be used for data parsing.
[0067] As an optional implementation manner, before inputting the device information of the device to be configured and the device information of the associated device into the configuration file generation model, the method further includes: obtaining training data, where the training data includes historical configuration files, historical device information, and historical associated device information; training the configuration file generation model to be trained according to the training data, where the configuration file generation model is a pre-trained large language model.
[0068] Optionally, training the profile generation model to be trained based on training data includes: sending the profile generation model to be trained and the training parameter configuration of the profile generation model to be trained to multiple gateways. The multiple gateways are used to train the profile generation model to be trained distributed to the gateways based on the training data stored in the gateways, and return the training parameter configuration of the trained profile generation model; receiving the training parameter configurations returned by the multiple gateways, calculating the sum and average of the values of each training parameter in the training parameter configuration; updating the training parameter configuration according to the sum and average calculated training parameters, and sending the updated training parameter configuration to each gateway for training again until the preset number of training times is reached.
[0069] Optionally, Figure 3 shows a flowchart of a training method. As Figure 3 shown, the model is deployed on each gateway for training. Real-time federated learning completes the reporting of the training results of the (N - 1)th iteration and the global model distribution and training parameter configuration of the (N + 1)th iteration during the training process of the Nth iteration of the configuration file: during the training process of the Nth iteration, the configuration file generation model and the training parameter configuration of the (N - 1)th iteration are sent to multiple gateways, and local training is performed using the device acquisition data collected by the gateways; then the gateway reports the intermediate training results of the Nth iteration through the model server deployed by the network management platform or the data acquisition platform, and the model server performs federated aggregation on the training results (weighted average of the values of the training parameters as the training parameters for the (N + 1)th training), and sends the global model and training parameter configuration to be trained in the (N + 1)th iteration to the gateway until the preset number of iterations is reached.
[0070] Optionally, after obtaining the configuration file output by the configuration file generation model, the method further includes: continuously detecting the status indicators of the device to be configured, where the status indicators include at least one of the following: communication delay duration, data acquisition success rate; and regenerating the configuration file when it is detected that the value of the status indicator is outside the preset normal range.
[0071] Optionally, after the configuration file generation model initially outputs the configuration file, the gateway and its associated applications start to perform data collection and transmission tasks. However, the dynamic changes in the industrial environment may affect the efficiency and stability of data transmission. For example, if the network signal in the production area suddenly weakens, resulting in the communication delay duration exceeding the preset normal range, the system will immediately trigger the anomaly detection mechanism. Once it is detected that the communication delay duration significantly increases or the data collection success rate drops below the preset threshold, the platform will automatically initiate the process of regenerating the configuration file. First, it collects and analyzes the communication data of the device and its associated devices during the anomaly, including metric data such as transmission rate, to identify potential communication bottlenecks or protocol matching issues. Subsequently, the latest device status information and the updated network topology data are input into the configuration file generation model together. Based on this new information, the model re-evaluates the communication requirements of the devices to be configured and intelligently generates a new configuration file that adapts to the current environmental changes. The new configuration file may include adjusted communication protocols, optimized collection frequencies, or enhanced security policies to address communication delays or other abnormal status metrics and ensure the smooth progress of data collection.
[0072] By real-time monitoring the status metrics of the devices to be configured, the dynamic optimization and update of the configuration file are realized, ensuring the stability and efficiency of data collection and transmission in the complex and changeable industrial environment, greatly enhancing the flexibility and intelligence level of the industrial automation system, and having important technical value and application prospects for promoting the development of intelligent manufacturing and industrial Internet. Through continuous monitoring and intelligent adjustment, it can not only respond to emergencies in the industrial field in a timely manner, but also prevent potential communication failures, resolve abnormal situations in a timely manner, achieve continuous optimization of data collection and refined device management, which is an important manifestation of the adaptive and self-optimizing capabilities of the industrial data collection platform.
[0073] Through the above steps, the rapid and automatic configuration of newly registered devices can be achieved, and the configuration can be adjusted in a timely manner in case of device anomalies to ensure the normal operation of the production environment and improve the configuration efficiency and accuracy. At the same time, multiple protocol applications internally integrate and encapsulate various communication protocol parsing methods, and automatically execute the corresponding data parsing methods according to the configuration information. By encapsulating multiple communication protocols into one application program, frequent gateway request communications and the issuance of communication protocols are avoided. During the data collection process, regardless of the communication protocol used by the device, there is always only one application running on the gateway side, and it meets the requirements of different devices for different protocol parsing, saving the running space, simplifying the operations of the gateway and device management on the platform side, improving the data collection efficiency, and achieving cost reduction and efficiency increase in the industrial data collection field.
[0074] The embodiment of this application provides a configuration file generation device. Figure 4 This is the structural schematic diagram of the device, as Figure 4As shown in the figure, the device includes: an obtaining module 40, configured to obtain device information of a device to be configured, where the device information includes a device unique serial number, network topology information, device type, and supported communication protocols; a determining module 42, configured to determine associated devices of the device to be configured according to the device information of the device to be configured, where the associated devices include at least one of the following: devices having data interaction with the device to be configured, devices of the same device type as the device to be configured; a generating module 44, configured to input the device information of the device to be configured and the device information of the associated devices into a configuration file generation model, and obtain a configuration file output by the configuration file generation model, where the configuration file includes the device unique serial number of the device to be configured and a target communication protocol corresponding to the device unique serial number.
[0075] In some embodiments of the present application, before inputting the device information of the device to be configured and the device information of the associated devices into the configuration file generation model, the generating module 44 is further configured to: obtain communication requirements of the device to be configured, where the communication requirements include at least one of the following: security requirements, transmission rate requirements, communication distance requirements; determine a set of candidate communication protocols from the communication protocols supported by the device to be configured according to the communication requirements, where the candidate communication protocols are communication protocols that meet the communication requirements of the device to be configured; input the set of candidate communication protocols into the configuration file generation model, and the configuration file generation model is configured to determine a target communication protocol from the set of candidate communication protocols.
[0076] In some embodiments of the present application, the generating module 44 obtaining the communication requirements of the device to be configured includes: determining data information of interaction data of the device to be configured from a system log file, where the data information includes the data confidentiality level of the interaction data; determining the communication requirements according to the data information.
[0077] In some embodiments of the present application, after obtaining the configuration file output by the configuration file generation model, the generating module 44 is further configured to: generate a protocol switching instruction according to the configuration file, where the protocol switching instruction is used to instruct the device to be configured to switch the communication protocol to the target communication protocol; send the protocol switching instruction to the device to be configured; receive a response result corresponding to the protocol switching instruction, where the response result includes successful switching, failed switching, and specific error messages.
[0078] In some embodiments of the present application, when the response result is protocol switching failure, the generating module 44 is further configured to: input the response result into the configuration file generation model; obtain the configuration file output again by the configuration file generation model, generate a protocol switching instruction again according to the configuration file output again, send the protocol switching instruction generated again to the device to be configured, and receive the response result corresponding to the protocol switching instruction generated again until the response result corresponding to the protocol switching instruction generated again is successful switching.
[0079] In some embodiments of the present application, when the response result is that the protocol switch is successful, the generation module 44 is further configured to: receive the reported data transmitted by the device to be configured; and parse the reported data according to the target communication protocol.
[0080] In some embodiments of the present application, the determining module 42 determines the associated device of the device to be configured according to the device information of the device to be configured, including: determining, according to the network topology structure information, the device having data interaction with the device to be configured as the associated device; and retrieving, from the database according to the device type of the device to be configured, the devices having the same device type as the associated device.
[0081] In some embodiments of the present application, before inputting the device information of the device to be configured and the device information of the associated device into the configuration file generation model, it further includes: obtaining training data, where the training data includes historical configuration files, historical device information, and historical associated device information; and training the configuration file generation model to be trained according to the training data, where the configuration file generation model is a pre-trained large language model.
[0082] In some embodiments of the present application, training the configuration file generation model to be trained according to the training data includes: sending the configuration file generation model to be trained and the training parameter configuration of the configuration file generation model to be trained to multiple gateways, where the multiple gateways are used to train the configuration file generation model to be trained distributed to the gateways according to the training data stored in the gateways, and return the training parameter configuration of the trained configuration file generation model; receiving the training parameter configurations returned by the multiple gateways, calculating the sum and average of the values of each training parameter in the training parameter configuration; updating the training parameter configuration according to the sum and average calculated training parameters, and sending the updated training parameter configuration to each gateway for training again until the preset number of training times is reached.
[0083] In some embodiments of the present application, after obtaining the configuration file output by the configuration file generation model, it further includes: continuously detecting the status indicators of the device to be configured, where the status indicators include at least one of the following: communication delay duration, data acquisition success rate; and regenerating the configuration file when it is detected that the value of the status indicator is outside the preset normal range.
[0084] It should be noted that each module in the above configuration file generation device may be a program module (for example, a set of program instructions implementing a specific function), or a hardware module. For the latter, it may be presented in the following forms, but not limited to: the presentation form of each of the above modules is a processor, or the functions of each of the above modules are implemented by a processor.
[0085] An embodiment of the present application provides a non-volatile storage medium, in which a program is stored. When the program runs, it controls the device where the non-volatile storage medium is located to execute the following configuration file generation method: Obtain the device information of the device to be configured, where the device information includes the device unique serial number, network topology information, device type, and supported communication protocols; Determine the associated devices of the device to be configured according to the device information of the device to be configured, where the associated devices include at least one of the following: devices that have data interaction with the device to be configured, devices of the same device type as the device to be configured; Input the device information of the device to be configured and the device information of the associated devices into a configuration file generation model, and obtain the configuration file output by the configuration file generation model, where the configuration file includes the device unique serial number of the device to be configured and the target communication protocol corresponding to the device unique serial number.
[0086] An embodiment of the present application provides an electronic device, including: a memory and a processor, where the processor is used to run the program stored in the memory. When the program runs, it executes the following configuration file generation method: Obtain the device information of the device to be configured, where the device information includes the device unique serial number, network topology information, device type, and supported communication protocols; Determine the associated devices of the device to be configured according to the device information of the device to be configured, where the associated devices include at least one of the following: devices that have data interaction with the device to be configured, devices of the same device type as the device to be configured; Input the device information of the device to be configured and the device information of the associated devices into a configuration file generation model, and obtain the configuration file output by the configuration file generation model, where the configuration file includes the device unique serial number of the device to be configured and the target communication protocol corresponding to the device unique serial number.
[0087] An embodiment of the present application provides a computer program product, including a computer program, which when executed by a processor implements the following configuration file generation method: Obtain the device information of the device to be configured, where the device information includes the device unique serial number, network topology information, device type, and supported communication protocols; Determine the associated devices of the device to be configured according to the device information of the device to be configured, where the associated devices include at least one of the following: devices that have data interaction with the device to be configured, devices of the same device type as the device to be configured; Input the device information of the device to be configured and the device information of the associated devices into a configuration file generation model, and obtain the configuration file output by the configuration file generation model, where the configuration file includes the device unique serial number of the device to be configured and the target communication protocol corresponding to the device unique serial number.
[0088] In the above embodiments of the present application, the descriptions of each embodiment have their own emphases. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0089] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling, direct coupling, or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0090] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0091] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0092] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the related technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several 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 methods described in each embodiment of the present application. The foregoing storage medium includes: USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs and other various media that can store program codes.
[0093] The above is only the preferred embodiment of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A configuration file generation method, characterized in that: include: Obtaining device information of the device to be configured, wherein the device information includes a unique serial number of the device, network topology information, device type, and supported communication protocols; Determine an associated device of the device to be configured according to the device information of the device to be configured, wherein the associated device includes at least one of the following: a device with which the device to be configured has data interaction, and a device of the same device type as the device to be configured; Input the device information of the device to be configured and the device information of the associated device into a configuration file generation model, and obtain a configuration file output by the configuration file generation model, wherein the configuration file includes a unique device serial number of the device to be configured and a target communication protocol corresponding to the unique device serial number.
2. The configuration file generation method according to claim 1, characterized in that: Before inputting the device information of the device to be configured and the device information of the associated device into the configuration file generation model, the method further includes: Acquire the communication requirements of the device to be configured, wherein the communication requirements include at least one of the following: security requirements, transmission rate requirements, and communication distance requirements; According to the communication requirement, determining a set of communication protocols to be selected from the communication protocols supported by the device to be configured, wherein the communication protocols to be selected are communication protocols that meet the communication requirement of the device to be configured; The candidate communication protocol set is input into the configuration file generation model, and the configuration file generation model is used to determine the target communication protocol from the candidate communication protocol set.
3. The configuration file generation method according to claim 2, characterized in that: Acquiring the communication requirements of the device to be configured includes: Determine data information of the interaction data of the device to be configured from the system log file, wherein the data information includes a data confidentiality level of the interaction data; The communication requirement is determined according to the data information.
4. The configuration file generation method according to claim 1, characterized in that: After obtaining the configuration file output by the configuration file generation model, the method further includes: Generate a protocol switching instruction according to the configuration file, wherein the protocol switching instruction is used to instruct the device to be configured to switch the communication protocol to the target communication protocol; Sending the protocol switching instruction to the device to be configured; A response result corresponding to the protocol switching instruction is received, wherein the response result includes switching success, switching failure and specific error information.
5. The configuration file generation method according to claim 4, characterized in that: In the case where the response result is a protocol switching failure, the method further includes: Inputting the response result into the configuration file generation model; Obtain the configuration file re-output by the configuration file generation model, re-generate the protocol switching instruction based on the re-output configuration file, send the re-generated protocol switching instruction to the device to be configured, and receive a response result corresponding to the re-generated protocol switching instruction until the response result corresponding to the re-generated protocol switching instruction is a successful switch.
6. The configuration file generation method according to claim 4, characterized in that: When the response result is that the protocol switching is successful, the method further includes: Receiving the reported data transmitted by the device to be configured; The reported data is parsed according to the target communication protocol.
7. The configuration file generation method according to claim 1, characterized in that: Determining the associated device of the device to be configured according to the device information of the device to be configured includes: According to the network topology information, determine a device that has data interaction with the device to be configured as an associated device; According to the device type of the device to be configured, devices with the same device type are retrieved from the database as associated devices.
8. The configuration file generation method according to claim 1, characterized in that: Before inputting the device information of the device to be configured and the device information of the associated device into the configuration file generation model, the method further includes: Acquiring training data, wherein the training data includes historical configuration files, historical device information, and historical associated device information; A configuration file generation model to be trained is trained according to the training data, wherein the configuration file generation model is a pre-trained large language model.
9. The configuration file generation method according to claim 8, characterized in that: Training the configuration file generation model to be trained based on the training data includes: Sending the configuration file generation model to be trained and the training parameter configuration of the configuration file generation model to be trained to multiple gateways, wherein the multiple gateways are used to train the configuration file generation model to be trained distributed to the gateways according to the training data stored in the gateways, and return the training parameter configuration of the trained configuration file generation model; Receiving the training parameter configurations returned by the multiple gateways, and performing sum and average calculation on the values of the respective training parameters in the training parameter configurations; The training parameter configuration is updated according to the training parameters after the summed average calculation, and the updated training parameter configuration is sent again to each of the gateways for training until a preset number of training times is reached.
10. The configuration file generation method according to claim 1, characterized in that: After obtaining the configuration file output by the configuration file generation model, the method further includes: Continuously detecting the status indicator of the device to be configured, wherein the status indicator includes at least one of the following: communication delay duration, data collection success rate; When it is detected that the value of the status indicator is outside a preset normal range, the configuration file is regenerated.
11. A configuration file generating device, characterized in that: include: An acquisition module, used to acquire device information of the device to be configured, wherein the device information includes a unique serial number of the device, network topology information, device type, and supported communication protocols; A determination module, configured to determine an associated device of the device to be configured according to the device information of the device to be configured, wherein the associated device includes at least one of the following: a device with which the device to be configured has data interaction, and a device of the same device type as the device to be configured; A generation module is used to input the device information of the device to be configured and the device information of the associated device into a configuration file generation model, and obtain a configuration file output by the configuration file generation model, wherein the configuration file includes a unique device serial number of the device to be configured and a target communication protocol corresponding to the unique device serial number.
12. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the configuration file generation method according to any one of claims 1 to 10.
13. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the configuration file generation method according to any one of claims 1 to 10 is executed when the program is run.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the configuration file generating method according to any one of claims 1 to 10 is implemented.