Serial port function self-adaption method, device and equipment of acquisition terminal and storage medium

By setting parameters and synchronizing functions of the serial port of the collection terminal, the problem that the collection terminal equipment cannot adapt to changes in serial port functions is solved, real-time updating and reuse of functions are realized, the operation and maintenance process is simplified, and the flexibility of the collection terminal is improved. and efficiency.

CN118540609APending Publication Date: 2024-08-23SHENZHEN CLOU ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410738826.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Existing acquisition terminal equipment cannot realize the self-adaptation of serial port functions, resulting in the need to restart the terminal when changing functions, which is time-consuming and not conducive to on-site operation and maintenance.

Method used

By setting parameters for the serial port of the collection terminal, and using the communication management APP and meter reading management APP to perform function changes and synchronization, the real-time update and reuse of the serial port functions can be achieved to avoid restarting.

Benefits of technology

It simplifies the operation and maintenance steps of the collection terminal, saves operation and maintenance time, realizes rapid switching and synchronization of serial port functions, and improves the flexibility and efficiency of the collection terminal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540609A
    Figure CN118540609A
Patent Text Reader

Abstract

The invention belongs to the technical field of electricity meter acquisition terminals, and discloses a serial port function self-adaption method, device and equipment of an acquisition terminal and a storage medium. The method comprises the following steps: setting parameters of a serial port of an acquisition terminal, and determining a serial port function of the acquisition terminal according to the set parameters; sending the determined serial port function of the acquisition terminal to a data processing center APP through the communication management APP for modification processing; and synchronously sending the changed serial port function of the acquisition terminal to a meter reading management APP, and updating the serial port function of the acquisition terminal in real time by the meter reading management APP. According to the serial port function self-adaption method of the acquisition terminal, the serial port function of the acquisition terminal is determined according to the set parameters, and the determined serial port function of the acquisition terminal is synchronously sent to the meter reading management APP through the communication management APP, so that multiplexing of the serial port function of the acquisition terminal is realized, the operation and maintenance steps of the acquisition terminal are simplified, and the operation efficiency of the acquisition terminal is improved. And the operation and maintenance time is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of electric meter data acquisition terminals, and in particular relates to a serial port function self-adaptation method, device, equipment and storage medium of a data acquisition terminal. Background Art

[0002] The electric energy data acquisition terminal is a device that collects electricity information from each information collection point, referred to as the acquisition terminal. The acquisition terminal can realize the acquisition, data management, two-way data transmission, data forwarding and execution of control commands of electric energy meter data. The new generation of electric energy information acquisition terminal adopts APP design. Multiple APPs in the acquisition terminal share serial port resources. The serial port of the acquisition terminal can be used to connect to the main station to realize operation and maintenance functions, and can also be connected to the meter to realize the reading of meter data items.

[0003] On-site operation and maintenance personnel need to call the serial port functions of different collection terminals according to the actual needs of the site. The usual practice is to configure the serial port parameters of the collection terminal and then restart the collection terminal so that the collection terminal APP initializes the program according to the serial port configuration. If the serial port function of the collection terminal is meter reading, the meter reading management APP will create a new meter reading thread. If the serial port function of the collection terminal is operation and maintenance, the communication management APP will create a new communication thread. After modifying the serial port function in this way, the terminal needs to be restarted to take effect. However, the new generation of power consumption information collection terminals are based on embedded Linux systems, and there are many APP programs in the collection terminals. Restarting the collection terminal is time-consuming. After the collection terminal is used on site, it is best not to restart it to avoid introducing unnecessary problems.

[0004] Therefore, how to achieve the serial port function adaptation of the acquisition terminal is a technical problem that needs to be solved urgently. Summary of the invention

[0005] In order to solve the technical problem that the existing acquisition terminal equipment is unable to adapt to the serial port function of the acquisition terminal, the present invention provides a method, device, equipment and storage medium for adapting the serial port function of the acquisition terminal.

[0006] In a first aspect, the present invention provides a method for self-adapting serial port functions of an acquisition terminal, comprising:

[0007] Setting parameters for the serial port of the acquisition terminal, and determining the serial port function of the acquisition terminal according to the set parameters;

[0008] Send the determined serial port function of the acquisition terminal to the data processing center APP for modification through the communication management APP;

[0009] The modified serial port function of the acquisition terminal is synchronously sent to the meter reading management APP, and the meter reading management APP updates the serial port function of the acquisition terminal in real time.

[0010] Preferably, determining the serial port function of the acquisition terminal according to the configured parameters includes:

[0011] The serial port function of the acquisition terminal is determined according to the function set for the serial port of the acquisition terminal.

[0012] Preferably, determining the serial port function of the acquisition terminal according to the function set for the serial port of the acquisition terminal includes:

[0013] If the serial port of the acquisition terminal is set as a maintenance port, the serial port function of the acquisition terminal is a maintenance function;

[0014] If the serial port of the acquisition terminal is set as a meter reading port, the serial port function of the acquisition terminal is determined according to whether a configuration table file is set in the meter reading port.

[0015] Preferably, determining the function of the meter reading port according to whether a configuration table file is set in the meter reading port includes:

[0016] If a configuration table file is set in the meter reading port, the serial port function of the acquisition terminal is the meter reading function;

[0017] If the configuration table file is not set in the meter reading port, the serial port function of the acquisition terminal is a maintenance function.

[0018] Preferably, the method further comprises:

[0019] Create a communication thread;

[0020] When the serial port of the acquisition terminal is in the meter reading function, the communication management APP controls the communication thread to be closed;

[0021] When the serial port of the acquisition terminal is in maintenance function, the communication management APP controls the communication thread to open and processes the data information received by the serial port of the acquisition terminal.

[0022] Preferably, the method further comprises:

[0023] Create a meter reading thread;

[0024] When the serial port of the acquisition terminal is in maintenance function, the meter reading management APP controls the meter reading thread to be closed;

[0025] When the serial port of the acquisition terminal is in the meter reading function, the meter reading management APP controls the meter reading thread to open, and reads the electric energy meter data collected by the acquisition terminal.

[0026] Preferably, the method further comprises:

[0027] The serial port function of the acquisition terminal is queried in real time through the LCD screen of the acquisition terminal or the main station of the acquisition terminal.

[0028] In a second aspect, the present invention further provides a serial port function self-adaptation device of an acquisition terminal, the device being used to implement the serial port function self-adaptation method of the acquisition terminal as described in any one of the first aspects above, comprising:

[0029] A determination module, used to set parameters of the serial port of the acquisition terminal and determine the serial port function of the acquisition terminal according to the set parameters;

[0030] The modification module sends the determined serial port function of the acquisition terminal to the data processing center APP of the acquisition terminal for modification processing through the communication management APP;

[0031] The updating module is used to synchronously send the modified serial port function of the collection terminal to the meter reading management APP of the collection terminal, and the meter reading management APP updates the serial port function of the collection terminal in real time.

[0032] In the third aspect, the present invention also provides a device, including a processor and a memory coupled to the processor, the memory storing program instructions executable by the processor; when the processor executes the program instructions stored in the memory, the serial port function adaptation method of the acquisition terminal as described in any one of the first aspects above is implemented.

[0033] In a fourth aspect, the present invention further provides a storage medium, wherein program instructions are stored in the storage medium, and when the program instructions are executed by a processor, a method for serial port function adaptation of an acquisition terminal as described in any one of the first aspects above is implemented.

[0034] Compared with the prior art, the serial port function adaptive method of the collection terminal provided by the present invention determines the serial port function of the collection terminal according to the set parameters, and synchronously sends the determined serial port function of the collection terminal to the meter reading management APP through the communication management APP, thereby realizing the multiplexing of the serial port function of the collection terminal, simplifying the operation and maintenance steps of the collection terminal, and saving operation and maintenance time. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only part of the embodiments of the present invention, rather than all of the embodiments. For ordinary technicians in this field, without paying creative work, other drawings obtained based on these drawings all fall within the scope of protection of the present invention.

[0036] Figure 1 A flowchart of a serial port function adaptation method of a collection terminal provided by an embodiment of the present invention;

[0037] Figure 2 A schematic diagram of the structure of a serial port function adaptive device of a collection terminal provided by an embodiment of the present invention;

[0038] Figure 3 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0039] Figure 4 A schematic diagram of a storage medium structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0041] In order to make the description of the content of the present invention more detailed and complete, the following is an illustrative description of the implementation method and specific examples of the present invention; however, this is not the only form of implementing or applying the specific embodiments of the present invention. The implementation method covers the features of multiple specific embodiments and the method steps and their sequence for constructing and operating these specific embodiments. However, other specific embodiments can also be used to achieve the same or equal functions and step sequences. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein.

[0043] In the description of the embodiments of the present invention, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present invention, “multiple” means two or more than two, and other quantifiers are similar. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention, and the embodiments of the present invention and the features in the embodiments may be combined with each other without conflict.

[0044] Please refer to Figure 1 , Figure 1 The present invention provides a flow chart of a method for self-adapting the serial port function of a collection terminal, which can be executed by software and / or hardware devices. Figure 1 As shown, the serial port function adaptation method of the acquisition terminal may include:

[0045] Step S101, setting parameters for the serial port of the acquisition terminal, and determining the serial port function of the acquisition terminal according to the set parameters. Specifically, in the embodiment of the present invention, the serial port of the acquisition terminal can be parameterized first, and the function, baud rate, data bit, stop bit, check bit, data flow control and other information of the serial port can be set.

[0046] Step S102: Send the determined serial port function of the acquisition terminal to the data processing center APP for modification through the communication management APP. Specifically, in the embodiment of the present invention, if the serial port function of the acquisition terminal is changed, the communication management APP updates the serial port function and sends the updated serial port function to the data processing center APP.

[0047] Step S103, synchronously send the modified serial port function of the acquisition terminal to the meter reading management APP, and the meter reading management APP updates the serial port function of the acquisition terminal in real time. Specifically, in the embodiment of the present invention, the data management center synchronously sends the modified serial port function of the acquisition terminal to the meter reading management APP, and the operation and maintenance function and meter reading function of the serial port of the acquisition terminal can be switched on site according to actual needs, and the synchronization of serial port functions between the APPs of the acquisition terminal is realized.

[0048] As an implementation mode, determining the serial port function of the acquisition terminal according to the configured parameters includes: determining the serial port function of the acquisition terminal according to the function set for the serial port of the acquisition terminal. Specifically, in an embodiment of the present invention, the communication is performed with the communication management APP through the LCD display screen or the main station of the acquisition terminal, and the serial port function of the acquisition terminal is determined to be a maintenance function or a meter reading function according to the function set for the serial port of the acquisition terminal.

[0049] As an implementation mode, the serial port function of the acquisition terminal is determined according to the function set for the serial port of the acquisition terminal, including: if the serial port of the acquisition terminal is set as a maintenance port, the serial port function of the acquisition terminal is a maintenance function; if the serial port of the acquisition terminal is set as a meter reading port, the serial port function of the acquisition terminal is determined according to whether a configuration table file is set in the meter reading port. Specifically, in an embodiment of the present invention, if the serial port of the acquisition terminal is set as a maintenance port, the port is fixed as a maintenance function. When the serial port of the acquisition terminal is set as a meter reading port, the serial port function of the acquisition terminal is determined to be a maintenance function or a meter reading function according to whether a configuration table file is set in the meter reading port.

[0050] As an implementation mode, the function of the meter reading port is determined according to whether a configuration table file is set in the meter reading port, including: if a configuration table file is set in the meter reading port, the serial port function of the acquisition terminal is a meter reading function; if a configuration table file is not set in the meter reading port, the serial port function of the acquisition terminal is a maintenance function. Specifically, in the embodiment of the present invention, if there is a configuration table file under the meter reading port, the meter reading port is set to the meter reading function, otherwise the meter reading port is still used as a maintenance function.

[0051] As an implementation method, the method further includes: creating a communication thread; when the serial port of the acquisition terminal is a meter reading function, the communication management APP controls the communication thread to be closed; when the serial port of the acquisition terminal is a maintenance function, the communication management APP controls the communication thread to be opened, and processes the data information received by the serial port of the acquisition terminal. Specifically, in an embodiment of the present invention, the communication management APP creates a fixed communication thread. When the serial port of the acquisition terminal is a meter reading function, the communication management APP controls the communication thread to be closed, and does not receive and process the serial port data of the acquisition terminal. When the serial port of the acquisition terminal is a maintenance function, the serial port of the acquisition terminal is opened. When the serial port is opened successfully, the received data is processed and responded. This thread management method enables the communication management APP to respond to changes in the serial port parameters of the acquisition terminal in a timely manner without restarting the terminal.

[0052] As an implementation mode, the method further includes: creating a meter reading thread; when the serial port of the acquisition terminal is in a maintenance function, the meter reading management APP controls the meter reading thread to be closed; when the serial port of the acquisition terminal is in a meter reading function, the meter reading management APP controls the meter reading thread to be opened, and reads the electric energy meter data collected by the acquisition terminal. Specifically, in an embodiment of the present invention, the meter reading management APP creates a meter reading thread in a fixed manner, and when the serial port of the acquisition terminal is switched to a meter reading port, the meter reading management APP opens the serial port, and when the serial port is successfully opened, the meter under the channel is read. When the serial port is switched to a maintenance port, the meter reading management APP controls the meter reading thread to be closed, and does not execute the meter reading process. This thread management method enables the meter reading management APP to respond promptly to changes in the serial port parameters of the acquisition terminal without restarting the terminal.

[0053] As an implementation mode, the method further includes: querying the serial port function of the acquisition terminal in real time through the LCD screen of the acquisition terminal or the main station of the acquisition terminal. Specifically, in the embodiment of the present invention, the user can also query the actual function of the serial port in real time on the LCD screen of the acquisition terminal or the main station of the acquisition terminal.

[0054] Based on the above-mentioned serial port function self-adaptation method of the acquisition terminal, the present invention also provides a serial port function self-adaptation device of the acquisition terminal, please refer to Figure 2 , Figure 2 A structural schematic diagram of a serial port function adaptive device of a collection terminal provided in an embodiment of the present invention, the device comprises: a determination module 21, used for setting parameters of the serial port of the collection terminal, and determining the serial port function of the collection terminal according to the set parameters; a change module 22, sending the determined serial port function of the collection terminal to the data processing center APP of the collection terminal for change processing through the communication management APP; an update module 23, used for synchronously sending the modified serial port function of the collection terminal to the meter reading management APP of the collection terminal, and the meter reading management APP updates the serial port function of the collection terminal in real time.

[0055] The serial port function adaptation device of the acquisition terminal provided in the embodiment of the present invention can execute the technical solution of the serial port function adaptation method of the acquisition terminal in any of the above-mentioned embodiments. Its implementation principle and beneficial effects are similar to the implementation principle and beneficial effects of the serial port function adaptation method of the acquisition terminal. Please refer to the implementation principle and beneficial effects of the serial port function adaptation method of the acquisition terminal, which will not be repeated here.

[0056] Please refer to Figure 3 , Figure 3 Schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 3As shown, the electronic device 30 includes a processor 31 and a memory 32 coupled to the processor 31. The memory 32 stores program instructions for implementing the serial port function adaptation method of the above-mentioned acquisition terminal. The processor 31 is used to execute the program instructions stored in the memory 32 to determine whether the program runs time-consuming. Among them, the processor 31 can also be called a CPU (Central Processing Unit). The processor 31 may be an integrated circuit chip with signal processing capabilities. The processor 31 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0057] Please refer to Figure 4 , Figure 4 A schematic diagram of a storage medium structure provided for an embodiment of the present invention. The storage medium 40 of the embodiment of the present invention stores program instructions 41 that can implement the serial port function adaptation method of the acquisition terminal described above, wherein the program instructions 41 can be stored in the above storage medium in the form of a software product, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.

[0058] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0059] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units. The above is only an implementation mode of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present invention.

[0060] The above are only preferred embodiments of the present invention, and are not intended to limit the present invention in any form. Although the present invention has been disclosed as above in the form of preferred embodiments, it is not intended to limit the present invention. Any technical personnel in the field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any brief modifications, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention are still within the scope of the technical solution of the present invention.

Claims

1. A serial port function adaptive method for an acquisition terminal, characterized in that: include: Setting parameters of the serial port of the acquisition terminal, and determining the serial port function of the acquisition terminal according to the set parameters; Send the determined serial port function of the acquisition terminal to the data processing center APP for modification through the communication management APP; The modified serial port function of the acquisition terminal is synchronously sent to the meter reading management APP, and the meter reading management APP updates the serial port function of the acquisition terminal in real time.

2. The serial port function adaptive method of the acquisition terminal according to claim 1, characterized in that: The serial port function of the acquisition terminal is determined according to the configured parameters, including: The serial port function of the acquisition terminal is determined according to the function set for the serial port of the acquisition terminal.

3. The serial port function adaptive method of the acquisition terminal according to claim 2, characterized in that: Determining the serial port function of the acquisition terminal according to the function set for the serial port of the acquisition terminal includes: If the serial port of the acquisition terminal is set as a maintenance port, the serial port function of the acquisition terminal is a maintenance function; If the serial port of the acquisition terminal is set as a meter reading port, the serial port function of the acquisition terminal is determined according to whether a configuration table file is set in the meter reading port.

4. The serial port function adaptive method of the acquisition terminal according to claim 3, characterized in that: The determining the function of the meter reading port according to whether a configuration table file is set in the meter reading port includes: If a configuration table file is set in the meter reading port, the serial port function of the acquisition terminal is the meter reading function; If the configuration table file is not set in the meter reading port, the serial port function of the acquisition terminal is a maintenance function.

5. The serial port function adaptive method of the acquisition terminal according to claim 4, characterized in that: The method further comprises: Create a communication thread; When the serial port of the acquisition terminal is in the meter reading function, the communication management APP controls the communication thread to be closed; When the serial port of the acquisition terminal is in maintenance function, the communication management APP controls the communication thread to open and processes the data information received by the serial port of the acquisition terminal.

6. The serial port function adaptive method of the acquisition terminal according to claim 5, characterized in that: The method further comprises: Create a meter reading thread; When the serial port of the acquisition terminal is in maintenance function, the meter reading management APP controls the meter reading thread to be closed; When the serial port of the acquisition terminal is in the meter reading function, the meter reading management APP controls the meter reading thread to open, and reads the electric energy meter data collected by the acquisition terminal.

7. The serial port function adaptive method of the acquisition terminal according to claim 6, characterized in that: The method further comprises: The serial port function of the acquisition terminal is queried in real time through the LCD screen of the acquisition terminal or the main station of the acquisition terminal.

8. A serial port function adaptive device for a collection terminal, characterized in that: The device is used to implement the serial port function adaptation method of the acquisition terminal according to any one of claims 1 to 7, comprising: A determination module, used to set parameters of the serial port of the acquisition terminal and determine the serial port function of the acquisition terminal according to the set parameters; The modification module sends the determined serial port function of the acquisition terminal to the data processing center APP of the acquisition terminal for modification processing through the communication management APP; The updating module is used to synchronously send the modified serial port function of the collection terminal to the meter reading management APP of the collection terminal, and the meter reading management APP updates the serial port function of the collection terminal in real time.

9. A device, characterized in that: It includes a processor and a memory coupled to the processor, wherein the memory stores program instructions that can be executed by the processor; when the processor executes the program instructions stored in the memory, the serial port function adaptation method of the acquisition terminal as described in any one of claims 1 to 7 is implemented.

10. A storage medium, characterized in that: The storage medium stores program instructions, and when the program instructions are executed by the processor, the method for serial port function adaptation of the acquisition terminal according to any one of claims 1 to 7 can be implemented.