RTU compatible with multi-type digital sensor, and control method, device and medium thereofTechnical Field
The invention relates to the technical field of online safety and health monitoring of structures, in particular to an RTU compatible with multiple types of digital sensors, and a control method, equipment and a medium thereof.
Background
At present, when monitoring objects such as strain, stress, displacement and deformation are monitored in long-term monitoring projects such as engineering and scientific research, the types of sensors to be applied are various, manufacturers are numerous, communication protocols do not have uniform standards, when an RTU (remote terminal control system) collects digital sensors, corresponding communication protocols are needed to complete data collection and analysis, at present, the protocols of the sensors on the market are numerous, and the RTU can perform corresponding collection and data analysis processing after storing the protocols of each type of digital sensors.
When the RTU is used, corresponding digital sensors (a strain sensor, a stress sensor, a displacement sensor, a deformation sensor and the like) are needed to be used in different application scenes, each new type of digital sensor is added, RTU firmware needs to be upgraded, the sensors can be normally acquired after the sensors are added for acquiring and analyzing commands, the upgrading mode usually needs to be upgraded in a wired mode through a serial port line in cooperation with an upper computer, or the upgraded firmware is placed into a server, and wireless upgrading is conducted through a wireless communication module. In the two upgrading modes, the previous firmware codes need to be compiled and packaged after being rewritten, and the packaged codes are downloaded into the RTU. This approach has several disadvantages: (1) the time is long, the firmware needs to be compiled and packaged for upgrading the firmware, and the efficiency is low; (2) the firmware needs to be updated once every time a sensor is added, the development and maintenance period is long, and the system is not convenient to integrate quickly; (3) errors in modifying or compiling the firmware result in the RTU not operating properly.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide the RTU control method compatible with the multi-type digital sensors, and the RTU can acquire and analyze the data of the digital sensors with different types and different protocols without updating the firmware of the RTU, so that the system integration time is greatly shortened, and the risk of firmware updating errors is reduced.
The invention provides an RTU control method compatible with a plurality of types of digital sensors, which comprises the following steps:
sensor numbering, namely numbering digital sensors to be acquired;
establishing a mapping relation, analyzing and writing the acquisition and analysis of each pattern of digital sensors into functions, respectively storing the functions corresponding to each pattern of digital sensors into corresponding memory addresses in an internal memory of the microprocessor, and establishing the mapping relation between the memory addresses and the numbers of the digital sensors;
and the acquisition sensor acquires the number of the digital sensor to be acquired when the microprocessor needs to acquire and analyze the digital sensor, calculates the memory address of the corresponding acquisition and analysis function in the internal memory of the microprocessor according to the number of the digital sensor, and operates the function at the calculated memory address.
Further, in the sensor numbering step, the digital sensors to be acquired are numbered in a one-to-one incremental manner.
Further, in the sensor numbering step, if a new digital sensor appears, the new digital sensor is numbered in an increasing manner on the basis of the original number.
Further, in the step of establishing a mapping relationship, the mapping relationship between the memory address and the number of the digital sensor is a linear digital relationship.
Further, in the step of acquiring the sensor, when a new digital sensor needs to be acquired and analyzed, the acquisition and analysis functions of the new digital sensor are put into the server.
Further, in the step of acquiring the sensor, when acquisition and analysis of the digital sensor fail, the microprocessor acquires a new function from the server through the wireless communication module, and downloads the new function to a corresponding memory address in an internal memory of the microprocessor.
An electronic device, comprising: a processor;
a memory; and a program, wherein the program is stored in the memory and configured to be executed by the processor, the program comprising an RTU control method for performing the above-described compatible multi-type digital sensor.
A computer-readable storage medium having stored thereon a computer program for executing the above-described RTU control method compatible with multiple types of digital sensors by a processor.
The RTU compatible with the multi-type digital sensors comprises an acquisition module, a power supply module, a microprocessor and a wireless communication module, wherein the microprocessor is connected with the acquisition module, the power supply module and the wireless communication module, the acquisition module and the power supply module are connected with the digital sensors, the wireless communication module is connected with a server, a memory is arranged in the microprocessor, the microprocessor is used for numbering the digital sensors to be acquired, acquiring and analyzing each digital sensor to form a function, respectively storing the function corresponding to each digital sensor in the memory at the corresponding memory address, establishing a mapping relation between the memory address and the number of the digital sensor, acquiring the number of the digital sensor to be acquired when the digital sensor needs to be acquired and analyzed, calculating the memory address of the corresponding acquisition and analysis function in the memory through the number of the digital sensor, the function at the calculated memory address is run.
Further, the microprocessor is used for numbering the digital sensors to be acquired in a one-to-one incremental manner, if a new digital sensor appears, the new digital sensor is numbered in an incremental manner on the basis of the original number, when acquisition and analysis of the digital sensor fail, a new function is acquired in the server through the wireless communication module, and the new function is downloaded to a corresponding memory address in the memory; the server stores a new acquisition and analysis function of the digital sensor; the mapping relation between the memory address and the number of the digital sensor is a linear digital relation; the memory is a FLASH memory.
Compared with the prior art, the invention has the beneficial effects that:
the invention provides an RTU control method compatible with a plurality of types of digital sensors, which comprises the following steps: sensor numbering, namely numbering digital sensors to be acquired; establishing a mapping relation, analyzing and writing the acquisition and analysis of each pattern of digital sensors into functions, respectively storing the functions corresponding to each pattern of digital sensors into corresponding memory addresses in an internal memory of the microprocessor, and establishing the mapping relation between the memory addresses and the numbers of the digital sensors; and the acquisition sensor acquires the number of the digital sensor to be acquired when the microprocessor needs to acquire and analyze the digital sensor, calculates the memory address of the corresponding acquisition and analysis function in the internal memory of the microprocessor according to the number of the digital sensor, and operates the function at the calculated memory address. The invention relates to an electronic device and a readable storage medium, which are used for executing a dual-purpose multimode embedded device firmware wireless upgrading method. The invention also relates to an RTU compatible with the multi-type digital sensor. The invention can collect and analyze digital sensors with different types and different protocols, and automatically download and store new code segments by writing the collection and analysis of the digital sensors to be updated into functions to be placed in a server when a remote terminal control system (RTU) cannot find collection commands and analysis commands of the new digital sensors locally, and simultaneously, the code functions in the microprocessor are mapped to the memory of the FLASH memory one by one, the functions on the memory of the FLASH memory and the serial numbers of the sensors establish a mathematical linear relation, and different sensors execute different functions in the FLASH memory, thereby realizing that the collection and analysis code functions of the sensors to be updated can be automatically compatible with the sensors with different types and different protocols when being placed in the server. Compared with the prior art, the method does not need to update firmware codes of a remote terminal control system (RTU), and only needs to add acquisition and analysis commands of corresponding sensors on the server, write the acquisition and analysis commands into functions and place the functions into the server. The method is quicker and simpler, errors occur in the acquisition and analysis functions of the sensor needing to be updated, the execution of other regional codes is not influenced, and the stability and the fault tolerance of the system are improved.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical solutions of the present invention more clearly understood and to implement them in accordance with the contents of the description, the following detailed description is given with reference to the preferred embodiments of the present invention and the accompanying drawings. The detailed description of the present invention is given in detail by the following examples and the accompanying drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of an RTU control method compatible with multiple types of digital sensors according to the present invention;
fig. 2 is an internal schematic diagram of an RTU compatible with multiple types of digital sensors according to the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that any combination of the embodiments or technical features described below can be used to form a new embodiment without conflict.
An RTU control method compatible with multiple types of digital sensors, as shown in fig. 1, includes the following steps:
sensor numbering, namely numbering digital sensors to be acquired; specifically, the digital sensors to be acquired are numbered in an incremental manner one by one, and if a new digital sensor appears, the new digital sensor is numbered in an incremental manner on the basis of the original number, so that each digital sensor has a unique number.
Establishing a mapping relation, and analyzing and writing the collection and analysis of each type of digital sensor into a function, wherein the function is an internal code function, the function corresponding to each type of digital sensor is respectively stored in the internal memory of the microprocessor at the corresponding memory addresses A, B, C, D and E …, the internal memory of the microprocessor is a FLASH memory, and the mapping relation between the memory addresses A, B, C, D and E … and the serial number of the digital sensor is established.
The acquisition sensor acquires the number of the digital sensor to be acquired when the microprocessor needs to acquire and analyze the digital sensor, calculates the memory address of the acquisition and analysis function in the internal memory of the microprocessor according to the number of the digital sensor, and operates the function at the calculated memory address to realize the acquisition and analysis of the digital sensor. When a new digital sensor needs to be acquired and analyzed, the acquisition and analysis functions of the new digital sensor are put into the server. When the acquisition and the analysis of the digital sensor fail, the microprocessor acquires a new function from the server through the wireless communication module, downloads the new function to a corresponding memory address in an internal memory of the microprocessor, and then operates the function at the memory address.
An electronic device, comprising: a processor;
a memory; and a program, wherein the program is stored in the memory and configured to be executed by the processor, the program comprising instructions for executing the RTU control method compatible with the multiple types of digital sensors described above.
A computer-readable storage medium having stored thereon a computer program for execution by a processor of the above-described RTU control method compatible with multiple types of digital sensors.
Compatible polymorphic type digital sensor's RTU, as shown in FIG. 2, including collection module, power module, microprocessor, wireless communication module, microprocessor is connected with collection module, power module, wireless communication module, and collection module, power module are connected with digital sensor, if: when the vibrating wire sensor is collected, the microprocessor in the vibrating wire collecting instrument controls the collecting module, the microprocessor is connected with the collecting module through the printed circuit board, the microprocessor is connected with the power supply module through the printed circuit board, the microprocessor is connected with the wireless communication module through the printed circuit board, the wireless communication module is connected with the server, the collecting module is used for collecting the digital sensor, the power supply module is used for providing electric energy, a storage is arranged in the microprocessor, the microprocessor is used for numbering the digital sensors to be collected, the collection and the analysis of each type of the digital sensor are written into functions, the functions corresponding to each type of the digital sensor are respectively stored in the corresponding memory addresses in the storage, the mapping relation between the memory addresses and the serial numbers of the digital sensors is established, and when the digital sensors are required to be collected and analyzed, the serial numbers of the digital sensors to be collected are, and calculating the memory address of the corresponding acquisition and analysis function in the memory through the number of the digital sensor, and operating the function at the calculated memory address.
In one embodiment, the microprocessor is used for numbering digital sensors to be acquired in a one-to-one incremental manner, if a new digital sensor appears, the new digital sensor is numbered in an incremental manner on the basis of the original number, when acquisition and analysis of the digital sensor fail, a new function is acquired in the server through the wireless communication module, and the new function is downloaded to a corresponding memory address in the memory; the server stores the acquisition and analysis functions of a new digital sensor; the mapping relation between the memory address and the number of the digital sensor is a linear digital relation; the memory is a FLASH memory.
The invention provides an RTU control method compatible with a plurality of types of digital sensors, which comprises the following steps: sensor numbering, namely numbering digital sensors to be acquired; establishing a mapping relation, analyzing and writing the acquisition and analysis of each pattern of digital sensors into functions, respectively storing the functions corresponding to each pattern of digital sensors into corresponding memory addresses in an internal memory of the microprocessor, and establishing the mapping relation between the memory addresses and the numbers of the digital sensors; and the acquisition sensor acquires the number of the digital sensor to be acquired when the microprocessor needs to acquire and analyze the digital sensor, calculates the memory address of the corresponding acquisition and analysis function in the internal memory of the microprocessor according to the number of the digital sensor, and operates the function at the calculated memory address. The invention relates to an electronic device and a readable storage medium, which are used for executing a dual-purpose multimode embedded device firmware wireless upgrading method. The invention also relates to an RTU compatible with the multi-type digital sensor. The invention can collect and analyze digital sensors with different types and different protocols, and automatically download and store new code segments by writing the collection and analysis of the digital sensors to be updated into functions to be placed in a server when a remote terminal control system (RTU) cannot find collection commands and analysis commands of the new digital sensors locally, and simultaneously, the code functions in the microprocessor are mapped to the memory of the FLASH memory one by one, the functions on the memory of the FLASH memory and the serial numbers of the sensors establish a mathematical linear relation, and different sensors execute different functions in the FLASH memory, thereby realizing that the collection and analysis code functions of the sensors to be updated can be automatically compatible with the sensors with different types and different protocols when being placed in the server. Compared with the prior art, the method does not need to update firmware codes of a remote terminal control system (RTU), and only needs to add acquisition and analysis commands of corresponding sensors on the server, write the acquisition and analysis commands into functions and place the functions into the server. The method is quicker and simpler, errors occur in the acquisition and analysis functions of the sensor needing to be updated, the execution of other regional codes is not influenced, and the stability and the fault tolerance of the system are improved.
The foregoing is merely a preferred embodiment of the invention and is not intended to limit the invention in any manner; those skilled in the art can readily practice the invention as shown and described in the drawings and detailed description herein; however, those skilled in the art should appreciate that they can readily use the disclosed conception and specific embodiments as a basis for designing or modifying other structures for carrying out the same purposes of the present invention without departing from the scope of the invention as defined by the appended claims; meanwhile, any changes, modifications, and evolutions of the equivalent changes of the above embodiments according to the actual techniques of the present invention are still within the protection scope of the technical solution of the present invention.