A SVG interactive acquisition method, system and SVG device configurable with multiple protocols
Through the SVG interactive acquisition method that can be configured with multi-protocols, and the SVG configuration file and multi-protocol selection, the problems of poor configurability and insufficient flexibility of the SVG data acquisition method in the prior art are solved, efficient and flexible data acquisition and uploading are achieved, and operation and maintenance costs are reduced.
Patent Information
- Application Number
- CN202210707380.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-06-21
AI Technical Summary
The existing SVG data acquisition methods have poor configurability, lack of data packet verification mechanism, and insufficient flexibility, which leads to the inability to quickly adapt when equipment updates or on-site conditions change, increasing operating costs.
It provides a multi-protocol interactive acquisition method, which can initialize parameters through the SVG configuration file to realize packet framing and encapsulation, adopts a secondary verification method and timeout retransmission mechanism to ensure the integrity and reliability of data packets, and supports the choice of multiple up-sending protocols.
It improves the flexibility of data collection, processing and upload, reduces communication, time and labor costs, reduces operation and maintenance pressure, and realizes visual monitoring and flexible function expansion of SVG equipment.
Smart Images

Figure CN115484321B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of static VAR generators, and in particular to a SVG interactive acquisition method and system capable of configuring multiple protocols, and an SVG device. Background Art
[0002] SVG (Static Var Generator) is a static var generator, which can follow the change of load reactive power to achieve dynamic compensation of reactive power on the substation side and has high real-time power quality management equipment. SVG is currently the best solution in the field of reactive power control and is widely used in power quality management of distribution substations. However, SVG does not have the function of communicating with the master station, and cannot intuitively reflect the management effect and management ability of SVG, nor can it directly expand advanced functions.
[0003] There are two main ways to achieve SVG device perception. One is the supporting service of SVG device manufacturers, which customizes the smart terminal embedded APP to adapt to the current scene requirements with the device to realize data collection and upload. This type of embedded APP is not open source and has different implementation methods.
[0004] However, the SVG data collection application implemented in the prior art still has the following shortcomings:
[0005] The existing methods have poor configurability. Only the SVG acquisition data items are configured through the data point table, and other variable parameters cannot be configured, such as whether to configure variable message length, data item parsing method, etc. The scalability of subsequent functions and the adaptability of the program are poor. In this mode, once the SVG device point table is significantly updated, or the data forwarding timeliness requirements change, it is impossible to make configuration changes through the configuration file to achieve the purpose of quickly transitioning to the latest working state, which is not conducive to on-site application and transformation.
[0006] The existing method does not have a data message verification mechanism. The field data interaction of the vast majority of SVG devices on the market uses RS485 serial communication, among which the MODBUS communication protocol is widely used due to its easy deployment and maintenance. The existing method does not perform strict data verification on the MODBUS transmission process, and adopts a fixed one-frame or multi-frame data transmission. In this mode, if there is signal interference and other scenes in the field transmission process, the data message will be incompletely sent, and the MODBUS data frame itself does not carry the message number. In the absence of strict data message verification, it will cause data confusion or loss, thereby affecting the accuracy of this round of data collection.
[0007] Existing methods lack flexibility. Existing SVG acquisition programs are all developed and debugged when the equipment is first deployed and installed, which only meets the minimum requirements for equipment deployment and use, and most of the logic relies on the code logic of the program source code. With the long-term use of the equipment and the transformation and upgrading of the area where it is located, the operating conditions of the equipment will inevitably change. Once this method faces any changes in logic, such as changes in the master station, changes in the data upload protocol, etc., it is necessary to contact the initial developer to modify the source code, and the resulting time and labor costs are uncontrollable. Moreover, the effect of the modification cannot be guaranteed, and redevelopment is required when necessary, which greatly increases the operating cost.
[0008] The following patent documents that have been published also have shortcomings.
[0009] 1) CN202010315960.2 A universal MODBUS protocol data parsing method. This invention embodiment relates to the field of communication software development technology, and specifically to a universal MODBUS protocol data parsing method. This invention embodiment provides a universal MODBUS protocol data parsing method, provides a flexible MODBUS protocol configuration data method, and achieves protocol data parsing requirements. Under the premise of satisfying visual data, the acquisition software can be finalized once developed, and changes in device data definition do not affect the acquisition software itself, greatly reducing software development costs.
[0010] This patent focuses on improving the key elements of data definition, including: data name, subordinate data block, data address, data volume (length), data type, data coefficient, byte order, word order. It focuses on establishing a universal MODBUS protocol data parsing method. However, the SVG data collection method is relatively fixed, and the data parsing form also has inherent industry standards. This invention does not solve the business application problems in actual applications, such as the autonomous selection of the upload protocol.
[0011] 2) CN202010638087.0 A multi-protocol adaptive meter data acquisition algorithm, this invention belongs to the technical field of data acquisition software, specifically relates to a data processing method of data acquisition software. Automatically match some of the current mainstream meter protocols and adaptively collect data.
[0012] This invention provides an adaptive data collection process method. By unifying the communication standards of the device data collection end, users do not need to set communication parameters and communication protocols when using it. The configuration is simple and the data collection platform is ready for use. At the same time, the customer's self-configuration process is also a personalized process of device-side parameters.
[0013] This invention provides different automatic matching algorithms based on the characteristics of the key fields of the returned data to calculate the current specific protocol type. It is a trial-and-error protocol selection method. There are fewer SVG collection and upload protocol options, and once selected, they will be used continuously without frequent changes. Therefore, this invention is not applicable to actual situations and will increase the operating burden. Summary of the invention
[0014] The present invention provides an SVG interactive acquisition method capable of configuring multiple protocols. The method of the present invention can improve the flexibility of data acquisition, processing and uploading, and reduce communication, time and labor costs.
[0015] Configurable multi-protocol SVG interactive acquisition methods include:
[0016] Step 1: Establish serial communication and read the SVG configuration file to obtain configuration parameters;
[0017] Step 2: Determine the framing mode based on the parameter configuration of the SVG configuration file, and encapsulate the MODBUS acquisition message of the length type;
[0018] Step 3: Verify the integrity of the sent and received messages by calling the serial port;
[0019] Step 4: After the message is successfully verified, the message is parsed based on the processing type to obtain the correct data carried by the message;
[0020] Step 5: Upload the protocol based on the parameter configuration of the SVG configuration file, parse the data and package it in accordance with the corresponding upload protocol to realize the data push function;
[0021] Step 6: After completing steps 1 to 5, enter the blocking state;
[0022] When the next round of collection begins, the SVG configuration file is read again to start the message collection process.
[0023] It should be further explained that in step 1, the configuration file is based on the json format.
[0024] The SVG configuration files include:
[0025] Set the Devname data item to the name of the called serial port device;
[0026] Set the BPS to StopBit data items as serial port configuration parameters;
[0027] Set Address to the SVG device address for framing;
[0028] Set the Timeout data item to the retransmission waiting time in seconds;
[0029] Set resent_times to the number of retransmissions;
[0030] Set loop_time to the acquisition cycle period in minutes.
[0031] It should be further explained that the SVG configuration file also includes:
[0032] Set the data_frame_type data item to the framing type, 0 means only one frame is sent, 1 means one frame is sent for each acquisition point;
[0033] The collected message collects data of all collection points in one frame, or collects data of one collection point in each frame;
[0034] Set the uploading_protocol data item to the uploading protocol type, which is divided into IEC104 and MQTT protocols. The sample configuration selects the MQTT protocol;
[0035] Set the Contains data item to the collection point data parameter.
[0036] It should be further explained that, in the method, the way of framing the collected message is to obtain the data parameters in the configuration file, and read out the parameters of each data in the structure parameters of the data parameters for framing.
[0037] It should be further explained that it also includes: a secondary verification method to verify the integrity of the message, the specific method includes:
[0038] MODBUS framing and concurrent frames start to accumulate the number of times sent;
[0039] After sending, call the receiving interface;
[0040] If there is no message reply within the set time, choose to resend;
[0041] If a message is received within the set time, a CRC check is performed according to the MODBUS data frame format and compared with the CRC check bit of the message to verify the integrity of the message;
[0042] If the accuracy of the data frame is verified, data analysis is performed;
[0043] If the CRC check fails, choose to resend.
[0044] It should be further explained that in the method,
[0045] Extract the data area content corresponding to the qualified message, perform data analysis, and parse out the data content carried by the qualified message;
[0046] The content of the data area of the data message is one or more hexadecimal digits, and the hexadecimal addition, subtraction, multiplication and division operation interfaces are configured;
[0047] Determine what kind of data operation to perform on the data in the data area based on the ratio and calc_method data items in the configuration file;
[0048] Call the corresponding calculation interface through calc_method;
[0049] The corresponding calculation parameters are called through ratio.
[0050] It should be further explained that the data uploading method is to upload the locally processed data to the remote master station; the data uploading methods include:
[0051] Based on the uploading_protocol data item in the configuration file, determine and select the uploading protocol mode;
[0052] The uploading_protocol protocol in the configuration file example is MQTT, which means that the data is sent up using the MQTT protocol for message integration and framing.
[0053] After the data is sent, it enters the blocking mode, at which time the system enters the sleep mode. After the blocking time ends, the configuration file is read again.
[0054] The present invention also provides a configurable multi-protocol adaptive SVG interactive acquisition system, the system comprising: a configuration parameter initialization module, a data frame interaction module, a data analysis module, a data uploading module and a blocking control module;
[0055] The configuration parameter initialization module is used to establish serial port communication, read the SVG configuration file, and obtain the configuration parameters; the framing mode is determined based on the parameter configuration of the SVG configuration file, and the MODBUS acquisition message of the length type is encapsulated;
[0056] The data frame interaction module is used to verify the integrity of the sent and received messages by calling the serial port;
[0057] The data parsing module is used to parse the message based on the processing type after the message is successfully verified, and obtain the correct data carried by the message;
[0058] The data upload module is used to upload the protocol based on the parameter configuration of the SVG configuration file, parse the data and package it according to the upload protocol to realize the data push function;
[0059] The blocking control module is used to put the system into a blocking state. When the next round of collection starts, the SVG configuration file is re-read to carry out the message collection process.
[0060] The present invention also provides an SVG device, comprising: a wireless communication unit, an audio / video input unit, a user input unit, a sensing unit, an output unit, a memory, an interface unit, a processor and a power supply unit;
[0061] A memory for storing a computer program and a configurable multi-protocol SVG interactive acquisition method;
[0062] A processor is used to execute the computer program and the SVG interactive acquisition method that can be configured with multiple protocols to implement the steps of the SVG interactive acquisition method that can be configured with multiple protocols.
[0063] It can be seen from the above technical solutions that the present invention has the following advantages:
[0064] The SVG interactive acquisition method and system configurable with multiple protocols provided by the present invention can realize protocol upload based on parameter configuration of SVG configuration file, parse the data to package it in accordance with the corresponding uploading protocol, and realize data push function. Before configuring the configuration file, the configuration method can be flexibly initialized, and the variable parameters, variable protocols, variable configurations, etc. required for a data acquisition can be configured outside the program in the form of configuration files.
[0065] In order to solve the problems of the prior art, the present invention also designs a combination of a secondary verification process and a timeout retransmission mechanism, which can greatly reduce the bit error rate caused by communication failures; avoid data loss caused by communication failures, and avoid the dead loop of long-term no-response state, thus reducing communication pressure.
[0066] The configurable multi-protocol SVG interactive acquisition method and system provided by the present invention can also convert the operation that previously required modifying the underlying source code to be changed into a method of modifying the configuration file, which can reduce the operation and maintenance pressure of operation and maintenance personnel.
[0067] The present invention has strong adaptability and can adapt to various hardware data collection tasks based on the MODBUS protocol by only modifying the configuration file, without the need to purchase additional value-added services from the manufacturer, and also reduces communication costs;
[0068] The adaptive uploading protocol selection method provided by the present invention can solve the protocol conversion problem caused by the change of the master station and the like through early packaging and integration, thereby greatly reducing the operation and maintenance workload. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0070] Figure 1 It is a flow chart of the SVG interactive acquisition method that can be configured with multiple protocols;
[0071] Figure 2 It is a schematic diagram of the SVG interactive acquisition system that can be configured with multiple protocols;
[0072] Figure 3 The present invention is a flow chart of an embodiment of a configurable multi-protocol SVG interactive acquisition method. DETAILED DESCRIPTION
[0073] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] The configurable multi-protocol SVG interactive collection method provided by the present invention is based on the Internet of Things technology of power transmission and transformation equipment, builds a mature cloud-edge collaborative mechanism for power quality management, and incorporates SVG equipment into the distribution station side perception. Through the deployment of various intelligent terminals in the substation, various operating data of SVG equipment are collected, and real-time data is uploaded, thereby realizing visual monitoring of SVG. At the same time, SVG equipment has a variety of different operating modes, corresponding to different power quality problems. After SVG is connected to the substation side perception, the function can be expanded to realize the setting of the operating mode according to the current substation situation.
[0075] The configurable multi-protocol SVG interactive acquisition method of the present invention is implemented through an SVG device, which includes: a wireless communication unit, an audio / video input unit, a user input unit, a sensing unit, an output unit, a memory, an interface unit, a processor and a power supply unit; the memory is used to store a computer program and the configurable multi-protocol SVG interactive acquisition method; the processor is used to execute the computer program and the configurable multi-protocol SVG interactive acquisition method to implement the steps of the configurable multi-protocol SVG interactive acquisition method.
[0076] The communication method in the SVG device can be based on wireless local area network (Wi-Fi, WLAN, Wireless Local Area Networks), wireless broadband (Wibro), Worldwide Interoperability for Microwave Access (Wimax), High Speed Downlink Packet Access (HSDPA, High Speed Downlink Packet Access) and other methods for data communication.
[0077] The display unit can display the data of the data interaction collection process of the SVG device. The SVG device has a related user interface (UI) or graphical user interface (GUI). When the SVG device is in the SVG interactive collection mode, the display unit can display the captured message data information and / or the received message data information, etc.
[0078] The processor of the SVG device can be implemented by using at least one of an application specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a processor, a controller, a microcontroller, a microprocessor, an electronic unit designed to perform the functions described herein, and in some cases, such an implementation can be implemented in a controller. For software implementation, implementations such as processes or functions can be implemented with separate software modules that allow execution of at least one function or operation. The software code can be implemented by a software application (or program) written in any appropriate programming language, and the software code can be stored in a memory and executed by a controller.
[0079] In one embodiment of the present invention, Figure 1 As shown, a possible embodiment will be given below to illustrate its specific implementation scheme in a non-limiting manner.
[0080] Step 1: Establish serial communication and read the SVG configuration file to obtain configuration parameters;
[0081] Step 2: Determine the framing mode based on the parameter configuration of the SVG configuration file, and encapsulate the MODBUS acquisition message of the length type;
[0082] Step 3: Verify the integrity of the sent and received messages by calling the serial port;
[0083] Here, the serial port is called to collect and send messages, receive data messages and verify the integrity of the messages. Based on the verification results, it is determined whether the data message is valid and whether to continue the process or resend the message;
[0084] Step 4: After the message is successfully verified, the message is parsed based on the processing type to obtain the correct data carried by the message;
[0085] Step 5: Upload the protocol based on the parameter configuration of the SVG configuration file, parse the data and package it in accordance with the corresponding upload protocol to realize the data push function;
[0086] Step 6: After completing steps 1 to 5, enter the blocking state;
[0087] When the next round of collection begins, the SVG configuration file is read again to start the message collection process.
[0088] The method of the present invention solves the problem that once there is any change in logic, such as a change in the master station, the data upload protocol needs to be changed, and the original developer needs to be contacted to modify the source code, resulting in uncontrollable time and labor costs. The SVG interactive acquisition method that can be configured with multiple protocols of the present invention ensures the modification effect and improves the operating cost.
[0089] The present invention realizes configurability of parameters such as collected data items, serial port parameters, and data processing methods. At the same time, a strict data message verification mechanism is added, and when data communication is interfered, the erroneous data frame can be discarded to ensure that the corresponding correct data message is received and parsed. The present invention also takes into account the subsequent scalability of the collection program and provides a variety of data upload protocol options. Without modifying the underlying source code, the function conversion can be completed simply and quickly, which improves the flexibility of the solution and reduces communication, time and labor costs.
[0090] Based on the above SVG interactive acquisition method, the present invention also provides a configurable multi-protocol adaptive SVG interactive acquisition system, such as Figure 2 and Figure 3 As shown, the system includes: a configuration parameter initialization module, a data frame interaction module, a data parsing module, a data uploading module and a blocking control module;
[0091] The configuration parameter initialization module is based on a configuration file in json format. The main function of the configuration parameter initialization module is to read the configuration file and obtain the configuration parameters. Among them, json is a lightweight data exchange format. The concise and clear hierarchical structure is the characteristic of json format, which is conducive to programmers' writing and reading, and is also conducive to computer parsing and generation, improving efficiency. Therefore, the configuration files of the present invention all adopt this file format. The following is an example of the content of a configuration file with json structure:
[0092]
[0093]
[0094] The Devname data item is the name of the serial port device being called, the BPS to StopBit data items are the serial port configuration parameters, and the Address is the SVG device address for framing. The Timeout data item is the retransmission waiting time in seconds, resent_times is the number of retransmissions, and loop_time is the acquisition cycle in minutes.
[0095] The data item data_frame_type is the framing category, 0 means only one frame is sent, and 1 means each acquisition point sends one frame. Due to the composition principle of the MODBUS protocol frame format, a frame message can carry one or more data, so the acquisition message can choose to collect data of all acquisition points in one frame, or collect data of one acquisition point in each frame. The significance of this choice is that all acquisitions in one frame can improve acquisition efficiency, reduce the frequency of interaction with the device, and reduce communication pressure, but errors in the internal registers can cause errors in all collected data, and although multi-frame acquisition increases the interaction frequency, it can guarantee data accuracy to the greatest extent. Therefore, the present invention adds this option to better adapt to different application scenarios.
[0096] The uploading_protocol data item is the uploading protocol type, which is mainly divided into IEC104 and MQTT protocols. The sample configuration selects the MQTT protocol.
[0097] The Contains data item is the data parameter of the acquisition point. The sample configuration takes the A phase voltage data as an example. It includes the identification of the acquisition point, the model to which it belongs, the symbol type, the function code, the starting address, the data length, the data type, the data amplification ratio and the data parsing method. The data identification, the model to which it belongs and the symbol type are used by the master station to distinguish the data items, the function code, the starting address and the data length are used for MODBUS framing, and the data type, the amplification ratio and the data parsing method are used for data parsing.
[0098] The above data items constitute the entire configuration. After the configuration parameter initialization module is read successfully, all the data is stored in the program running memory in the form of structure scalars. Other functional modules depend on this.
[0099] The data frame interaction module involved in the present invention is mainly used to call the serial port receiving interface function, and its core functions are framing, sending, receiving and verifying message integrity.
[0100] The collected message framing is based on the data parameters obtained in the configuration file in the configuration parameter initialization module, and the specific parameters of each data item are taken out from the corresponding structure parameters for framing.
[0101] The present invention Figure 3 As shown, it is used to verify the message integrity. Figure 3Here, i represents the number of retransmissions. The number of retransmissions and the set time T are defined by the configuration file.
[0102] The frame starts to be sent, and the number of transmissions begins to accumulate. When the transmission is completed, the receiving interface is called. If there is no message reply within the set time, resend is selected; if a message is received within the set time, the message integrity must be verified. According to the MODBUS data frame format, CRC check can be performed again, and compared with the CRC check bit of the message to ensure the integrity of the data frame; if the data frame is verified to be accurate, data parsing can be performed directly. If the CRC check fails, resend is also selected.
[0103] The above is the process of sending and receiving MODBUS messages, in which a retransmission mechanism is added to reduce the number of frame leaks in data reception, and the secondary CRC check calculation ensures the correctness of the data frame. If there is a hardware communication failure in the actual application, the limit on the number of retransmissions can also ensure that there is no dead loop in the program, and the entire program will not be affected by individual data.
[0104] As for the process of sending and receiving MODBUS messages, the MODBUS protocol is a universal protocol. This communication protocol is supported on many smart devices, such as power monitoring meters, smart sensors, etc.
[0105] MODBUS communication protocols include MODBUS ASCAII communication and MODBUS RTU communication on serial links, and MODBUS TCP communication based on TCP / IP. Currently, most low-voltage electrical equipment on the market uses MODBUS RTU communication based on serial links. The following focuses on MODBUS RTU communication.
[0106] The information frame format of MODBUS RTU is as follows:
[0107] Start Address Function Data CRC End ≥3.5char 8bits 8bits Nx 8 bits 16 bits ≥3.5char
[0108] Start: Start code, indicating the beginning of an information frame. MODBUS RTU communication uses time as the beginning of the information frame. It is mainly used to detect the idle time on the transmission line. The length is 3.5 characters. The length of a character is related to the data bit, stop bit, start bit, parity bit, and baud rate.
[0109] Address: Address code (one byte), which indicates the station number of the slave. The station number of the slave is given or set by the slave device. For example, for a monitoring instrument, the station number of the instrument can be set in the instrument parameters.
[0110] Function: Function code (one byte), describing the read and write operations on the slave station, whether to read data from the slave station or write data to the slave station. Common function codes are shown in Appendix 1:
[0111] Data: Data area (N bytes). The data area mainly consists of two parts. One part is called the address of the data area, and the other part is called the content of the data area. If the operation of the sensor needs to be controlled, the operating code of the sensor is called the content of the data area, and the place where the operating code needs to be written is called the data area address.
[0112] CRC: Check code (2 bytes), CRC check is performed on the data from the station number to the data area. It is a commonly used check code with error detection and correction capabilities. It is widely used in early communications. Cyclic redundancy check code is often used for data verification of external storage and computer synchronous communication. It can ensure the integrity and correctness of sent and received messages.
[0113] End: The end code, like the start code, is also determined by time.
[0114] Schedule 1
[0115] Function code Chinese name Register information address 01 Read coil status 00001-09999 02 Read (switch) input status 10001-19999 03 Read Holding Registers 40001-49999 04 Read Input Register 30001-39999 05 Writing a single coil 00001-09999 06 Writing a Single Holding Register 40001-49999 15 Writing multiple coils 00001-09999 16 Writing multiple holding registers 40001-49999
[0116] The data analysis module involved in the present invention is used to extract the data area content of the qualified data message, perform data analysis, and parse out the data content carried by the data message. According to the characteristics of the MODBUS protocol, the content of the data area of the data message is a 1-bit or multi-bit hexadecimal number, which can be expressed in a single data form, and almost all the acquisition parameters involved must be converted into base, coefficient, etc.
[0117] The present invention integrates the most basic hexadecimal addition, subtraction, multiplication and division operation interfaces, and determines what kind of data operation is performed on the data in the data area based on the ratio and calc_method data items of the configuration file. The calc_method is used to determine which calculation interface to call, and the ratio is used to determine the calculation parameters. The configuration file example calc_method method in the configuration parameter initialization module description is division, and the ratio is 10.0, that is, the division processing interface is called, and the data / 10 operation is performed, and the data content carried by the data message of this collection point is obtained. It is flexible and efficient to use, and a variety of different data types can be quickly configured at one time.
[0118] For the data uploading module involved in the present invention, its function is to upload data, that is, to upload the locally processed data to the remote master station. The data uploading module is based on the uploading_protocol data item of the configuration file. The present invention can independently judge and select the uploading protocol mode. The configuration file example uploading_protocol protocol in the configuration parameter initialization module description is MQTT, that is, this data uploading automatically performs message integration and framing in the MQTT protocol mode.
[0119] The blocking control module is used to enter the blocking mode after the data uploading module completes data uploading. At this time, the program is dormant. After the blocking time is over, the configuration file is re-read to avoid program restart caused by the modification of the configuration file.
[0120] The SVG interactive acquisition method and system with configurable multi-protocols provided by the present invention can realize protocol upload based on parameter configuration of SVG configuration file, parse the data to package it in accordance with the uploading protocol, and realize data push function. Before configuring the configuration file, the configuration method can be flexibly initialized, and the variable parameters, variable protocols, variable configurations, etc. required for a data acquisition can be configured outside the program in the form of configuration files.
[0121] In order to solve the problems of the prior art, the present invention also designs a combination of a secondary verification process and a timeout retransmission mechanism, which can greatly reduce the bit error rate caused by communication failures; avoid data loss caused by communication failures, and avoid the dead loop of long-term no-response state, thus reducing communication pressure.
[0122] The configurable multi-protocol SVG interactive acquisition method and system provided by the present invention can also convert the operation that previously required modifying the underlying source code to be changed into a method of modifying the configuration file, which can reduce the operation and maintenance pressure of operation and maintenance personnel.
[0123] The present invention has strong adaptability and can adapt to various hardware data collection tasks based on the MODBUS protocol by only modifying the configuration file, without the need to purchase additional value-added services from the manufacturer, and also reduces communication costs;
[0124] The adaptive uploading protocol selection method provided by the present invention can solve the protocol conversion problem caused by the change of the master station and the like through early packaging and integration, thereby greatly reducing the operation and maintenance workload.
[0125] The configurable multi-protocol SVG interactive acquisition method and system provided by the present invention is a combination of the units and algorithm steps of each example described in the embodiments disclosed herein, and can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0126] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A configurable multi-protocol SVG interactive acquisition method, characterized in that: Methods include: Step 1: Establish serial communication and read the SVG configuration file to obtain configuration parameters; Step 2: Determine the framing mode based on the parameter configuration of the SVG configuration file, and encapsulate the MODBUS acquisition message of the length type; Step 3: Verify the integrity of the sent and received messages by calling the serial port; Step 4: After the message is successfully verified, the message is parsed based on the processing type to obtain the correct data carried by the message; Step 5: Upload the protocol based on the parameter configuration of the SVG configuration file, parse the data and package it in accordance with the corresponding upload protocol to realize the data push function; Step 6: After completing steps 1 to 5, enter the blocking state; When the next round of collection begins, the SVG configuration file is read again to start the message collection process.
2. The configurable multi-protocol SVG interactive acquisition method according to claim 1, characterized in that: In step 1, the configuration file is based on the json format.
3. The configurable multi-protocol SVG interactive acquisition method according to claim 1, characterized in that: The SVG configuration files include: Set the Devname data item to the name of the called serial port device; Set the BPS to StopBit data items as serial port configuration parameters; Set Address to the SVG device address for framing; Set the Timeout data item to the retransmission waiting time in seconds; Set resent_times to the number of retransmissions; Set loop_time to the acquisition cycle period in minutes.
4. The configurable multi-protocol SVG interactive acquisition method according to claim 1, characterized in that: The SVG profile also includes: Set the data_frame_type data item to the framing type, 0 means only one frame is sent, 1 means one frame is sent for each acquisition point; The collected message collects data of all collection points in one frame, or collects data of one collection point in each frame; Set the uploading_protocol data item to the uploading protocol type, which is divided into IEC104 and MQTT protocols. The sample configuration selects the MQTT protocol; Set the Contains data item to the collection point data parameter.
5. The configurable multi-protocol SVG interactive acquisition method according to claim 1, characterized in that: In the method, the way of collecting message framing is to obtain the data parameters in the configuration file, and read out the parameters of each data in the structure parameters of the data parameters for framing.
6. The configurable multi-protocol SVG interactive acquisition method according to claim 1, characterized in that: It also includes: a secondary verification method to verify the integrity of the message, the specific method includes: MODBUS framing and concurrent frames start to accumulate the number of times sent; Call the receiving interface after sending; If there is no message reply within the set time, choose to resend; If a message is received within the set time, a CRC check is performed according to the MODBUS data frame format and compared with the CRC check bit of the message to verify the integrity of the message; If the accuracy of the data frame is verified, data analysis is performed; If the CRC check fails, choose to resend.
7. The configurable multi-protocol SVG interactive acquisition method according to claim 1, characterized in that: In the method, Extract the data area content corresponding to the qualified message, perform data analysis, and parse out the data content carried by the qualified message; The content of the data area of the data message is one or more hexadecimal digits, and the hexadecimal addition, subtraction, multiplication and division operation interfaces are configured; Determine what kind of data operation to perform on the data in the data area based on the ratio and calc_method data items in the configuration file; Call the corresponding calculation interface through calc_method; The corresponding calculation parameters are called through ratio.
8. The configurable multi-protocol SVG interactive acquisition method according to claim 1, characterized in that: The data upload method is to upload the locally processed data to the remote master station; the data upload methods include: Based on the uploading_protocol data item in the configuration file, determine and select the uploading protocol mode; The uploading_protocol protocol in the configuration file example is MQTT, which means that the data is sent up using the MQTT protocol for message integration and framing. After the data is sent, it enters the blocking mode, at which time the system enters the sleep mode. After the blocking time ends, the configuration file is read again.
9. A configurable multi-protocol adaptive SVG interactive acquisition system, characterized in that: The system adopts the configurable multi-protocol SVG interactive acquisition method as described in any one of claims 1 to 8; The system includes: a configuration parameter initialization module, a data frame interaction module, a data analysis module, a data uploading module and a blocking control module; The configuration parameter initialization module is used to establish serial port communication, read the SVG configuration file, and obtain the configuration parameters; the framing mode is determined based on the parameter configuration of the SVG configuration file, and the MODBUS acquisition message of the length type is encapsulated; The data frame interaction module is used to verify the integrity of the sent and received messages by calling the serial port; The data parsing module is used to parse the message based on the processing type after the message is successfully verified, and obtain the correct data carried by the message; The data upload module is used to upload the protocol based on the parameter configuration of the SVG configuration file, parse the data and package it according to the upload protocol to realize the data push function; The blocking control module is used to put the system into a blocking state. When the next round of collection starts, the SVG configuration file is re-read to carry out the message collection process.
10. An SVG device, characterized in that: include: a wireless communication unit, an audio / video input unit, a user input unit, a sensing unit, an output unit, a memory, an interface unit, a processor, and a power supply unit; A memory for storing a computer program and a configurable multi-protocol SVG interactive acquisition method; A processor is used to execute the computer program and the SVG interactive acquisition method that can be configured with multiple protocols to implement the steps of the SVG interactive acquisition method that can be configured with multiple protocols as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Universal MODBUS protocol data analysis method
CN111431784A
A Multi-Protocol Adaptive Meter Data Acquisition Method
CN111770105B
Transformer substation access control system data acquisition system and method
CN114095586A
Methods and systems for programmatic creation of an interactive demonstration presentation for an envisioned software product
US20210150125A1