Disclosure of Invention
In view of the above, it is necessary to provide a method and an apparatus for configuring parameters of a measuring instrument, a computer device and a storage medium, which can configure the parameters of the installed measuring instrument in real time.
A method of configuring parameters of a measuring instrument, the method comprising:
the method comprises the steps that a handheld terminal scans an identification code of a measuring instrument to obtain a meter address of the measuring instrument and sends the meter address to a server;
when the configuration parameters corresponding to the meter address do not exist in the database, the server sends a command for inputting the configuration parameters to the handheld terminal;
the handheld terminal acquires configuration parameters according to the instruction for inputting the configuration parameters and sends the configuration parameters to the server;
and the server establishes connection with the measuring instrument according to the configuration parameters and stores the configuration parameters and the meter address in the database in a correlation manner when the connection is successful.
In one embodiment, after the steps of scanning an identification code of a measurement instrument by the handheld terminal, obtaining a meter address of the measurement instrument, and sending the meter address to the server, the method includes: when the configuration parameters corresponding to the meter address exist in the database, the server sends a configuration parameter modification instruction to the handheld terminal; the handheld terminal acquires the modified configuration parameters according to the configuration parameter modification instruction and sends the configuration parameters to the server; and the server establishes connection with the measuring instrument according to the modified configuration parameters, and stores the modified configuration parameters and the meter address in the database in a correlation manner when the connection is successful.
In one embodiment, before the server sends an instruction for inputting configuration parameters to the handheld terminal when the configuration parameters corresponding to the meter address do not exist in the database, the method includes: and the server searches in a database according to the meter address and judges whether the database has configuration parameters corresponding to the meter address.
In one embodiment, the step of searching, by the server, in a database according to the meter address and determining whether a configuration parameter corresponding to the meter address exists in the database includes: the server searches in a database according to the meter address and judges whether the meter address is prestored in the database; and if the meter address is prestored in the database, judging whether the configuration parameters corresponding to the meter address exist in the database.
In one embodiment, the configuration parameters include a collection terminal number, a serial communication port number and installation position information; the server establishes connection with the measuring instrument according to the configuration parameters, and stores the configuration parameters and the meter address association to the database when the connection is successful, wherein the server comprises the following steps: the server sends connection information to the acquisition terminal corresponding to the acquisition terminal number; the connection information comprises a serial communication port number and installation position information; the acquisition terminal sends connection information to the measuring instrument according to the serial communication port number and the installation position information; when the measuring instrument receives the connection information, replying connection success information to the acquisition terminal; the acquisition terminal forwards the connection success information to the server; and when the server receives the connection success information, the server stores the configuration parameters and the meter address in the database in a correlation manner.
In one embodiment, after the server establishes a connection with the measurement instrument according to the configuration parameters and stores the configuration parameters and the meter address association to the database when the connection is successful, the method includes: the handheld terminal sends a command for reading the switching-on and switching-off state to the server; the server sends the command for reading the switching-on and switching-off states to the measuring instrument according to the configuration parameters; the measuring instrument acquires switching-on/off state information according to the switching-on/off state reading instruction and sends the switching-on/off state information to the server; and the server sends the switching-on/off state information to the handheld terminal.
In one embodiment, after the server establishes a connection with the measurement instrument according to the configuration parameters and stores the configuration parameters and the meter address association to the database when the connection is successful, the method includes: the handheld terminal sends a data acquisition instruction to the server; the server sends the data acquisition instruction to the measuring instrument according to the configuration parameters; the measuring instrument obtains the reading of the measuring instrument according to the data acquisition instruction and sends the reading to the server; and the server sends the reading of the measuring instrument to the handheld terminal.
A parameter configuration apparatus of a measuring instrument, the apparatus comprising:
the scanning module is used for scanning the identification code of the measuring instrument by the handheld terminal, obtaining the meter address of the measuring instrument and sending the meter address to the server;
the parameter acquisition instruction sending module is used for sending an instruction for inputting the configuration parameters to the handheld terminal by the server when the configuration parameters corresponding to the meter address do not exist in the database;
the configuration parameter acquisition module is used for acquiring configuration parameters by the handheld terminal according to the instruction for inputting the configuration parameters and sending the configuration parameters to the server;
and the connection module is used for establishing connection between the server and the measuring instrument according to the configuration parameters and storing the configuration parameters and the meter address into the database in a correlation manner when the connection is successful.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
the method comprises the steps that a handheld terminal scans an identification code of a measuring instrument to obtain a meter address of the measuring instrument and sends the meter address to a server;
when the configuration parameters corresponding to the meter address do not exist in the database, the server sends a command for inputting the configuration parameters to the handheld terminal;
the handheld terminal acquires configuration parameters according to the instruction for inputting the configuration parameters and sends the configuration parameters to the server;
and the server establishes connection with the measuring instrument according to the configuration parameters and stores the configuration parameters and the meter address in the database in a correlation manner when the connection is successful.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
the method comprises the steps that a handheld terminal scans an identification code of a measuring instrument to obtain a meter address of the measuring instrument and sends the meter address to a server;
when the configuration parameters corresponding to the meter address do not exist in the database, the server sends a command for inputting the configuration parameters to the handheld terminal;
the handheld terminal acquires configuration parameters according to the instruction for inputting the configuration parameters and sends the configuration parameters to the server;
and the server establishes connection with the measuring instrument according to the configuration parameters and stores the configuration parameters and the meter address in the database in a correlation manner when the connection is successful.
According to the parameter configuration method and device of the measuring instrument, the computer equipment and the storage medium, the handheld terminal scans the identification code of the measuring instrument on the installation site to obtain the meter address of the measuring instrument, so that the configuration parameters are input, the correctness of the input configuration parameters can be ensured, the server establishes connection for the measuring instrument according to the configuration parameters to confirm the validity of the configuration parameters, and the efficiency and the accuracy of parameter configuration of the measuring instrument are improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The parameter configuration method of the measuring instrument can be applied to the application environment shown in fig. 1. Thehandheld terminal 102 communicates with theserver 104 through a network, theserver 104 is in communication connection with thedatabase 105, theserver 106 is connected with at least oneacquisition terminal 106, and theacquisition terminal 106 is connected with a plurality ofmeasuring instruments 108. Thehandheld terminal 102 scans the identification code of themeasuring instrument 108, obtains the meter address of themeasuring instrument 108, and sends the meter address to theserver 104; when the configuration parameters corresponding to the meter address do not exist in thedatabase 105, theserver 104 sends an instruction for inputting the configuration parameters to thehandheld terminal 102; thehandheld terminal 102 acquires configuration parameters according to the instruction for inputting the configuration parameters, and sends the configuration parameters to theserver 104; theserver 104 establishes a connection with themeasurement instrument 108 according to the configuration parameters, and stores the configuration parameters and the meter address association to thedatabase 105 when the connection is successful. Thehandheld terminal 102 may be, but not limited to, various notebook computers, smart phones, tablet computers, and portable wearable devices, and theserver 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, there is provided a parameter configuration method of a measuring instrument, including the steps of:
s110, the handheld terminal scans the identification code of the measuring instrument to obtain the meter address of the measuring instrument and sends the meter address to the server.
The handheld terminal can be a mobile phone or a tablet personal computer, and the measuring instrument comprises an electric energy meter, a water meter and a gas meter. The identification code is a bar code or a two-dimensional code attached to or printed on the surface of the measuring instrument, and the meter address of the measuring instrument can be obtained by scanning the bar code or the two-dimensional code. The hand-held terminal and the server communicate through a mobile network.
Specifically, an installer needs to configure parameters of the measuring instrument after the measuring instrument is installed, firstly logs in an APP installed in the handheld terminal to obtain parameter configuration permission, scans a bar code on the surface of the measuring instrument through the APP installed in the handheld terminal to obtain a meter address of the measuring instrument, and then sends the meter address to the server.
And S120, when the configuration parameters corresponding to the meter address do not exist in the database, the server sends an instruction for inputting the configuration parameters to the handheld terminal.
Wherein, the database prestores the meter address of the measuring instrument, the acquisition terminal number and the serial communication port number of the acquisition terminal. The server inquires the configuration parameters corresponding to the meter addresses according to the meter addresses, and can judge whether the meter addresses are subjected to parameter configuration. The configuration parameters include an acquisition terminal number, a serial communication port number, and installation position information.
And S130, the handheld terminal acquires the configuration parameters according to the instruction for inputting the configuration parameters and sends the configuration parameters to the server.
And after receiving the configuration parameter input instruction, the handheld terminal displays a window for inputting the configuration parameters, and an installer inputs the configuration parameters in the window. For example, as shown in fig. 4, the collection terminal number is selected in the selection terminal dialog box, the serial communication port number is input in the selection COM dialog box, the installation address of the measuring instrument, such as sunshine building 1 unit 16 floor 601 room, is input in the selection sub-unit dialog box, and the name of the measuring instrument is input in the dialog box for inputting the name of the table, and the installation address may be used as the name of the measuring instrument.
S140, the server establishes connection with the measuring instrument according to the configuration parameters, and stores the configuration parameters and the meter address in the database in a correlation manner when the connection is successful.
The server can measure the connection address of the instrument according to the configuration parameters, and establishes connection with the measuring instrument according to the connection address, wherein the connection is communication connection, namely the server can send and receive messages to the measuring instrument. After the server is successfully connected with the measuring instrument, the server can find the corresponding measuring instrument according to the configuration parameters, and at the moment, the configuration parameters and the meter address are stored in the database in an associated mode.
According to the parameter configuration method of the measuring instrument, the handheld terminal scans the identification code of the measuring instrument on the installation site to obtain the meter address of the measuring instrument, then the configuration parameters are input, the correctness of the input configuration parameters can be ensured, the server establishes connection for the measuring instrument according to the configuration parameters to confirm the validity of the configuration parameters, and the efficiency and the accuracy of parameter configuration of the measuring instrument are improved.
In one embodiment, the identification code is a bar code or a two-dimensional code; the handheld terminal scans the identification code of the measuring instrument, obtains the meter address of the measuring instrument, and sends the meter address to the server, and the method comprises the following steps: the handheld terminal scans a bar code or a two-dimensional code of the measuring instrument to obtain a meter address of the measuring instrument and sends the meter address to the server.
In one embodiment, after the steps of scanning an identification code of a measurement instrument by the handheld terminal, obtaining a meter address of the measurement instrument, and sending the meter address to the server, the method includes: when the configuration parameters corresponding to the meter address exist in the database, the server sends a configuration parameter modification instruction to the handheld terminal; the handheld terminal acquires the modified configuration parameters according to the configuration parameter modification instruction and sends the configuration parameters to the server; and the server establishes connection with the measuring instrument according to the modified configuration parameters, and stores the modified configuration parameters and the meter address in the database in a correlation manner when the connection is successful.
In the embodiment, the parameter of the measuring instrument can be modified after the configuration parameter of the measuring instrument is changed through the instruction for modifying the configuration parameter, and the accuracy of the modified configuration parameter can be verified on site, so that the efficiency and the accuracy of modifying the configuration parameter of the measuring instrument are improved.
In one embodiment, before the server sends an instruction for inputting configuration parameters to the handheld terminal when the configuration parameters corresponding to the meter address do not exist in the database, the method includes: and the server searches in a database according to the meter address and judges whether the database has configuration parameters corresponding to the meter address.
In the measuring instrument which has performed parameter configuration, corresponding configuration parameters are stored in the database.
In one embodiment, the step of searching, by the server, in a database according to the meter address and determining whether a configuration parameter corresponding to the meter address exists in the database includes: the server searches in a database according to the meter address and judges whether the meter address is prestored in the database; and if the meter address is prestored in the database, judging whether the configuration parameters corresponding to the meter address exist in the database.
The meter address can be stored in a database in advance, a user can document all the measuring instruments in advance, whether the measuring instruments are already filed is judged by judging whether the meter address is prestored in the database, and the unfinished configuration parameters of the measuring instruments which are not filed are searched.
In one embodiment, after the step of the server searching in the database according to the meter address and determining whether the meter address is pre-stored in the database, the method includes: and if the meter address is not prestored in the database, storing the meter address into the database.
In one embodiment, the configuration parameters include a collection terminal number, a serial communication port number, and installation location information. The step S140 includes: s141, the server sends connection information to the acquisition terminal corresponding to the acquisition terminal number; the connection information comprises a serial communication port number and installation position information; s142, the acquisition terminal sends connection information to the measuring instrument according to the serial communication port number and the installation position information; s143, when the measuring instrument receives the connection information, replying connection success information to the acquisition terminal; s144, the acquisition terminal forwards the connection success information to the server; s145, when receiving the connection success information, the server stores the configuration parameters and the meter address in the database in a correlation manner.
In one embodiment, after the server establishes a connection with the measurement instrument according to the configuration parameters and stores the configuration parameters and the meter address association to the database when the connection is successful, the method includes: the handheld terminal sends a command for reading the switching-on and switching-off state to the server; the server sends the command for reading the switching-on and switching-off states to the measuring instrument according to the configuration parameters; the measuring instrument acquires switching-on/off state information according to the switching-on/off state reading instruction and sends the switching-on/off state information to the server; and the server sends the switching-on/off state information to the handheld terminal.
For example, as shown in fig. 5, after the handheld terminal sends the command of reading the switching state, the handheld terminal receives switching information, and an installer can compare and judge the switching state of the measurement instrument with the actual switching state of the measurement instrument on the site according to the switching information of the handheld terminal, so as to verify the accuracy of the collected switching state information.
In one embodiment, after the server establishes a connection with the measurement instrument according to the configuration parameters and stores the configuration parameters and the meter address association to the database when the connection is successful, the method includes: the handheld terminal sends a data acquisition instruction to the server; the server sends the data acquisition instruction to the measuring instrument according to the configuration parameters; the measuring instrument obtains the reading of the measuring instrument according to the data acquisition instruction and sends the reading to the server; and the server sends the reading of the measuring instrument to the handheld terminal.
The handheld terminal can send a data acquisition instruction to the server in real time, the server acquires the reading of the measuring instrument from the measuring instrument corresponding to the address according to the configuration parameters, and of course, the time for acquiring the data can be set in the data acquisition instruction, for example, the data is acquired after 15 seconds, and then the server acquires the reading of the measuring instrument after 15 seconds from the measuring instrument. The installer can compare and judge the reading of the meter of the handheld terminal with the reading of the actual measuring meter on the spot, so that the accuracy of the collected meter reading is verified.
In one embodiment, after the steps of establishing connection with the measurement instrument by the server according to the configuration parameters and storing the configuration parameters and the meter address association to the database when the connection is successful, the method includes: the management terminal sends a meter file maintenance data downloading instruction to the server, wherein the meter file maintenance data downloading instruction comprises configuration parameters; the server downloads meter file maintenance data from a database according to the meter file maintenance data instruction and sends the meter file maintenance data to the management terminal; the management terminal establishes user information according to the meter file maintenance data to form meter file user relation data; the management terminal sends the meter file user relation data to the server; and the server stores the meter archive user relation data to the database.
The property personnel who manages the measuring instrument searches for meter file maintenance data in the server according to the installation position in the configuration parameters at the management terminal, establishes user information for the meter file maintenance data to form meter file user relation data, and then introduces the meter file user relation data into the database of the server, so that the user meter binding relation can be successfully established.
It should be understood that although the various steps in the flow charts of fig. 2-3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-3 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 6, a parameter configuration apparatus for a measuring instrument is provided, which includes ascanning module 210, a parameter acquisitioninstruction sending module 220, a configurationparameter obtaining module 230, and aconnection module 240, where:
thescanning module 210 is configured to scan the identification code of the measurement instrument by using the handheld terminal, obtain a meter address of the measurement instrument, and send the meter address to the server.
A parameter acquisitioninstruction sending module 220, configured to, when the configuration parameter corresponding to the meter address does not exist in the database, send, by the server, an instruction for inputting the configuration parameter to the handheld terminal.
A configurationparameter obtaining module 230, configured to, by the handheld terminal, obtain a configuration parameter according to the instruction for inputting the configuration parameter, and send the configuration parameter to the server.
Aconnection module 240, configured to establish, by the server, a connection with the measurement instrument according to the configuration parameter, and store, in the database, the configuration parameter and the meter address in an associated manner when the connection is successful.
In one embodiment, the parameter configuration apparatus of the measurement instrument further includes: a modification instruction sending module, configured to, when a configuration parameter corresponding to the meter address exists in the database, send, by the server, an instruction to modify the configuration parameter to the handheld terminal; the modification parameter acquisition module is used for acquiring the modified configuration parameters by the handheld terminal according to the configuration parameter modification instruction and sending the modified configuration parameters to the server; theconnection module 240 is further configured to establish a connection with the measurement instrument by the server according to the modified configuration parameter, and store the modified configuration parameter and the meter address in the database in an associated manner when the connection is successful.
In one embodiment, the parameter configuration apparatus of the measurement instrument further includes: and the searching module is used for searching in a database by the server according to the meter address and judging whether the database has configuration parameters corresponding to the meter address.
In one embodiment, the lookup module comprises: the first judgment unit is used for searching in a database by the server according to the meter address and judging whether the meter address is prestored in the database; and the second judging unit is used for judging whether the configuration parameters corresponding to the meter addresses exist in the database or not if the meter addresses are prestored in the database.
In one embodiment, the configuration parameters include a collection terminal number, a serial communication port number, and installation location information. Theconnection module 240 includes: the connection information sending unit is used for sending connection information to the acquisition terminal corresponding to the acquisition terminal number by the server; the connection information comprises a serial communication port number and installation position information; the forwarding unit is used for sending connection information to the measuring instrument by the acquisition terminal according to the serial communication port number and the installation position information; the successful information replying unit is used for replying connection successful information to the acquisition terminal when the measuring instrument receives the connection information; a success information forwarding unit, configured to forward, by the acquisition terminal, the connection success information to the server; and the storage unit is used for storing the configuration parameters and the meter address into the database in a correlation manner when the server receives the connection success information.
In one embodiment, the parameter configuration apparatus of the measurement instrument further includes: the instruction sending module is used for sending an instruction for reading the switching-on/off state to the server by the handheld terminal; the instruction forwarding module is used for sending the reading switching-off and switching-on state instruction to the measuring instrument by the server according to the configuration parameters; the switching-on/switching-off state information acquisition module is used for acquiring switching-on/switching-off state information by the measuring instrument according to the switching-on/switching-off state reading instruction and sending the switching-on/switching-off state information to the server; and the switching-on/switching-off state information forwarding module is used for the server to send the switching-on/switching-off state information to the handheld terminal.
In one embodiment, the parameter configuration apparatus of the measurement instrument further includes: the data acquisition instruction sending module is used for sending an acquisition data instruction to the server by the handheld terminal; the data acquisition instruction forwarding module is used for sending the data acquisition instruction to the measuring instrument by the server according to the configuration parameters; the measuring instrument reading acquisition module is used for acquiring the reading of the measuring instrument according to the data acquisition instruction by the measuring instrument and sending the reading to the server; and the measuring instrument reading forwarding module is used for sending the measuring instrument reading to the handheld terminal by the server.
For specific limitations of the parameter configuration device of the measuring instrument, reference may be made to the above limitations of the parameter configuration method of the measuring instrument, and details thereof are not repeated here. The various modules in the parameter configuration device of the measuring instrument can be wholly or partially realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for storing configuration parameter data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of configuring a parameter of a measuring instrument.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is further provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above method embodiments when executing the computer program.
In an embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned method embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.