CN117111867A - Electric energy meter display method and device, electric energy meter and storage medium - Google Patents
Electric energy meter display method and device, electric energy meter and storage medium Download PDFInfo
- Publication number
- CN117111867A CN117111867A CN202311085508.1A CN202311085508A CN117111867A CN 117111867 A CN117111867 A CN 117111867A CN 202311085508 A CN202311085508 A CN 202311085508A CN 117111867 A CN117111867 A CN 117111867A
- Authority
- CN
- China
- Prior art keywords
- data
- displayed
- display
- information
- electric energy
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
The application provides an electric energy meter display method and device, an electric energy meter and a storage medium; the method comprises the following steps: acquiring first information of an object to be displayed; the first information comprises a first identifier of an object to be displayed and a display time period, and the first information meets display rules defined in a communication protocol used by the electric energy meter; converting the first information to obtain a second identifier of the object to be displayed; the second identifier meets a reading rule defined in a communication protocol used by the electric energy meter; reading operation is carried out based on the second identifier corresponding to the object to be displayed, and data content corresponding to the object to be displayed, which is stored in the data table, is obtained; the data table is used for storing second identifications and data contents corresponding to display objects related to the electric energy meter respectively; based on the display time period indicated by the first information, the data content corresponding to the object to be displayed is displayed on the electric energy meter, so that the data content of all the display objects can be supported to be displayed under the condition that the display meter in the electric energy meter is not required to be expanded, and the limitation of the prior art is broken.
Description
Technical Field
The application relates to the technology of instruments and meters, in particular to a method and a device for displaying an electric energy meter, the electric energy meter and a storage medium.
Background
The electric energy meter can display the data content of the display objects such as electric quantity, voltage, current, power and the like through the liquid crystal display; in the prior art, a table is generally made of display objects which can support display of an electric energy meter and display identifiers corresponding to the display objects, the table can be called as a display table, and when the table is displayed, corresponding data contents are searched in the table according to the display identifiers of the objects to be displayed, and then the table is displayed on the electric energy meter.
The above-described method is applicable only to display objects existing in the meter, and display objects not existing in the meter cannot be displayed on the electric energy meter, so that there is a limitation in the prior art.
Disclosure of Invention
In view of this, the method, the device, the equipment and the storage medium for displaying the electric energy meter provided by the application support displaying the data content of all display objects under the condition that the display meter in the electric energy meter is not required to be expanded, and break the limitation existing in the prior art.
According to an aspect of an embodiment of the present application, there is provided a method for displaying an electric energy meter, including: acquiring first information of an object to be displayed; the first information comprises a first identification and a display time period of the object to be displayed, and the first information meets display rules defined in a communication protocol used by the electric energy meter; converting the first information to obtain a second identifier of the object to be displayed; the second identifier meets a reading rule defined in a communication protocol used by the electric energy meter; reading operation is carried out based on the second identification of the object to be displayed, and data content corresponding to the object to be displayed and stored in a data table is obtained; the data table is used for storing second identifiers and data contents corresponding to all display objects related to the electric energy meter respectively; and displaying the data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
According to an aspect of an embodiment of the present application, there is provided an electric energy meter display device including: the acquisition module is used for acquiring first information of an object to be displayed; the first information comprises a first identification and a display time period of the object to be displayed, and the first information meets display rules defined in a communication protocol used by the electric energy meter; the conversion module is used for converting the first information to obtain a second identifier of the object to be displayed; the second identifier meets a reading rule defined in a communication protocol used by the electric energy meter; the reading module is used for executing reading operation based on the second identifier of the object to be displayed to obtain data content corresponding to the object to be displayed, which is stored in the data table; the data table is used for storing second identifiers and data contents corresponding to all display objects related to the electric energy meter respectively; and the display module is used for displaying the data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
According to an aspect of an embodiment of the present application, there is provided an electric energy meter including a memory and a processor, the memory storing a computer program executable on the processor, the processor implementing the method according to the embodiment of the present application when executing the program.
According to an aspect of an embodiment of the present application, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method provided by the embodiment of the present application.
In the embodiment of the application, the data table stored in the electric energy meter is fully utilized, when the content to be displayed is displayed, the data content of the object to be displayed is read from the data table based on the communication reading operation according to the second identifier, and then the read data content is displayed based on the display time period defined by the display rule; on one hand, the existing display table is not required to be expanded, and the problem that the electric energy meter is used/displayed in a blocking manner due to overlarge memory occupation is avoided; on the other hand, because the existing data table comprises all the display objects, the data table is subjected to communication reading operation based on the second identifier, and then the content data corresponding to the objects to be displayed are displayed based on the display time period indicated by the first information, so that the data content of the display objects required by any user can be timely and intuitively displayed, namely, the data content can be the data content of the display objects in the display table or not, and the limitation of the prior art is broken.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application. It is evident that the drawings in the following description are only some embodiments of the present application and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
FIG. 1 is a schematic diagram of a logic branch structure of a display table according to an embodiment of the present application;
fig. 2 is a schematic diagram of an implementation flow of a display method of an electric energy meter according to an embodiment of the present application;
fig. 3 is a schematic implementation flow chart of a display method of an electric energy meter according to an embodiment of the present application;
Fig. 4 is a schematic implementation flow chart of a display method of an electric energy meter according to an embodiment of the present application;
fig. 5 is a schematic diagram of an implementation flow of a display method of an electric energy meter according to an embodiment of the present application;
fig. 6 is a schematic diagram of an implementation flow of a display method of an electric energy meter according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a display device of an electric energy meter according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electric energy meter according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the specific technical solutions of the present application will be described in further detail below with reference to the accompanying drawings in the embodiments of the present application. The following examples are illustrative of the application and are not intended to limit the scope of the application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
In the following description reference is made to "some embodiments," "this embodiment," "an embodiment of the application," and examples, etc., which describe a subset of all possible embodiments, but it is to be understood that "some embodiments" may be the same subset or different subsets of all possible embodiments and may be combined with one another without conflict.
The electric energy meter can display the data content of the display objects such as electric quantity, voltage, current, power and the like through the liquid crystal display; in the prior art, a display object which can support display of the electric energy meter is usually tabulated with a display identifier corresponding to the display object, and when the display object is displayed, corresponding data content is searched in the table according to the display identifier of the object to be displayed, and then the data content is displayed on the electric energy meter.
In the above description, the electric energy meter can support the display object displayed and the table made of the corresponding display mark to be called as a display table.
Because the display table needs to satisfy the display rules defined in the communication protocol used by the electric energy meter, in some embodiments, the display table further includes a display time period for the display object that can support display.
It can be understood that for a certain display object, the data content may be more, but the data content that can be displayed by the display screen in the electric energy meter is limited, and all the data content of the display object may not be displayed simultaneously during display, so that the display content of the display object needs to be displayed in time slots; wherein the duration of each time period may be the same. Therefore, each time period of the data content of the display object needs to be added to the display table in association with the display identification of the display object to display different data content of the display object in different display time periods.
For example, the data content of a certain display object needs two time periods to be displayed completely, and the two time periods are respectively time period 1 and time period 2, and then the time period 1 and the time period 2 need to be respectively associated with the display identification of the display object and then added into the display table.
Alternatively, for different display objects, they may be displayed in different time periods, and all the display objects to be displayed are circularly displayed, where the duration of each time period may be the same. The user sees a smaller amount of data per time period for easy recording by the user, which also requires adding the object identification of each display object to the data table after associating the object identification with the time period for which the data content of the display object is to be displayed.
Illustratively, the display objects to be displayed include an electric quantity, a voltage, a power and the like, the electric quantity is displayed in a time period 1, the voltage is displayed in a time period 2, the power is displayed in a time period 3, the electric quantity is required to be associated with the time period 1, the voltage is required to be associated with the time period 2, and the power is added to the data table after being associated with the time period 3.
For a more intuitive understanding of a display table, table 1 is an example of a display table:
| Sequence number | First information | Display object |
| 1 | 00.00.04.01-00 | Current active total power |
| 2 | 00.00.04.0x-00 | Current active rate x electric quantity |
| 3 | 00.10.04.01-00 | Current positive active total electric quantity |
| 4 | 00.10.04.0x-00 | Current forward active rate x electric quantity |
| 5 | 00.20.04.01-00 | Current reverse active total power |
| 6 | 00.20.04.0x-00 | Current reverse active rate x electric quantity |
| … | ……… | ……… |
As shown in table 1, taking the first display object as an example, the first display object is the current active total power, and the corresponding display identifier is the first 4 bytes in the first information: 00.00.04.01, the display time period is the last byte in the first information: 00. a display period of 00 indicates that the display content of the display object needs to be displayed in each period, i.e., the display object does not need to be displayed in time periods. In some embodiments, the display time period of the display object may also be 01 or 02, 01 representing the data content of the display object displayed in time period 1, and 02 representing the data content of the display object displayed in time period 2. Table 1 is merely given as an example of display identification of a display object and a corresponding period of time, and is not limited thereto.
Of course, the form of the display table in table 1 is also merely an example, and in some embodiments, as shown in fig. 1, the display table may be represented by using a logical branching structure, and in the case of table lookup display, the branching structure is used to jump to a corresponding display object, which is not an example in the embodiment of the present application.
However, as the functions of the electric energy meter are gradually increased, the data in the electric energy meter are multiplied, if the data are required to be displayed on the electric energy meter, in the related art, the data are required to be added into the display meter according to the existing mode to expand the display meter, so that larger memory is occupied, the normal use of the electric energy meter can be affected, and the problem of using or displaying the electric energy meter is caused.
The existing electric energy meter is stored with a communication meter which is made based on communication identifications of all display objects in the electric energy meter, and an example of the communication meter is given in table 2, and the communication meter is similar to the display meter, except that 1) the communication meter comprises the communication identifications based on the communication rule of the electric energy meter, but does not comprise information related to the display time period; 2) The communication table contains the mapping relation between all the display objects and the corresponding communication identifications.
| Sequence number | Communication identifier | Display object |
| 1 | 00.00.04.01 | Current active total power |
| 2 | 00.00.04.0x | Current active rate x electric quantity |
| 3 | 00.10.04.01 | Current positive active total electric quantity |
| 4 | 00.10.04.0x | Current forward active rate x electric quantity |
| 5 | 00.20.04.01 | Current reverse active total power |
| 6 | 00.20.04.0x | Current reverse active rate x electric quantity |
| … | ……… | ……… |
Table 2 is only an example of a communication table, and the present application is not limited thereto, as long as it can include a mapping relationship between all display objects and corresponding communication identifiers.
In other related technologies, the electric energy meter does not expand the display meter, so that the electric energy meter only supports the data content of the display object of the display part, for the display object which does not support the display, the upper computer software connected with the electric energy meter performs communication reading operation, reads and stores the unsupported display object as a file based on the communication meter shown in table 2, so that the user cannot intuitively and timely see the display content of the display object from the electric energy meter, and the user experience is poor.
Therefore, the related art display method of the electric energy meter can cause the electric energy meter to use or display a card, or does not support displaying the data content of all display objects, which has certain defects.
Based on the above, the embodiment of the application provides a display method of an electric energy meter, which can support to display the data content of all display objects under the condition that the display meter in the electric energy meter is not required to be expanded, and overcomes the defects of the existing display method.
Fig. 2 is a schematic diagram of an implementation flow of a display method according to an embodiment of the present application; the display method is applied to the electric energy meter, as shown in fig. 2, and comprises the following steps 201 to 204:
Step 201, obtaining first information of an object to be displayed; the first information comprises a first identification of an object to be displayed and a display time period, and the first information meets display rules defined in a communication protocol used by the electric energy meter.
As shown in table 1, according to the display rule in the electric energy meter, the first information includes the first identification, i.e., the above-mentioned display identification, and the display period. The first 4 bytes in the first information are used to characterize the first identification and the last byte is used to characterize the display period. The first identifier is used for identifying the mark of the object to be displayed, and the display time period is the time period required to be displayed when the data content of the display object is displayed.
Step 202, converting the first information to obtain a second identifier of the object to be displayed; the second identification meets a reading rule defined in a communication protocol used by the electric energy meter.
The second identifier, i.e. the communication identifier mentioned above, in some embodiments, the display time period in the first information may be deleted to obtain the second identifier, and as shown in tables 1 and 2, the last byte used to characterize the display time period in the first information is deleted, so that the obtained content is the second identifier.
In some embodiments, the communication protocols satisfied by the first information and the second identifier are the same, so, as shown in table 1 and table 2, the second identifier and the first identifier may be the same, so, when the electric energy meter performs a reading operation, the same identifier as the display identifier can be used to read the data content of the object to be displayed, and another identifier is not required to be set to read the data content of the object to be displayed.
Step 203, performing a read operation based on the second identifier of the object to be displayed, to obtain the data content corresponding to the object to be displayed stored in the data table; the data table is used for storing second identifiers and data contents corresponding to all display objects related to the electric energy meter.
The data table in this step is the communication table mentioned in the above embodiment, and as described above, the table contains all the display objects, so that the data content of the object to be displayed can be read regardless of whether the object to be displayed exists in the table 1, by performing a read operation on the communication table based on the communication identifier of the object to be displayed, instead of performing a read operation on the display table based on the display identifier.
In some embodiments, the data table is read based on the second identifier, so that return data of the read operation can be obtained, and then the return data is analyzed based on the number of display time periods corresponding to the data content of the object to be displayed, so as to obtain the data content of the object to be displayed.
It will be appreciated that, as described above, the data content of the object to be displayed may be relatively large, so that the object to be displayed cannot be displayed on the display screen of the electric energy meter at the same time, and needs to be displayed in time periods (also referred to as split-screen display), so that when the returned data is parsed, the number of time periods in which the data content of the object to be displayed needs to be considered, that is, whether the object to be displayed needs to be displayed in a split-screen manner needs to be considered, so that the whole data content of the object to be displayed needs to be displayed in the required display time period.
And 204, displaying the data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
After the data content corresponding to the object to be displayed is obtained, displaying the data content in the display time period based on the display time period indicated by the first information.
It can be understood that in the embodiment of the application, the communication table stored in the electric energy meter is fully utilized, when the content to be displayed is displayed, the data content of the object to be displayed is read from the communication table based on communication reading operation by utilizing the communication identifier, and then the read data content is displayed based on the display time period defined by the display rule, so that on one hand, the existing display table is not required to be expanded, and the problem of using/displaying the card of the electric energy meter caused by overlarge memory occupation is avoided; on the other hand, because the communication table comprises all the display objects, the communication table is subjected to communication reading operation based on the communication identification, and then the read data content is displayed based on the display time period defined by the display rule, so that the data content of the display object required by any user can be timely and intuitively displayed, namely, the data content can be the data content of the display object in the display table or not the data content of the display object in the display table, and the limitation of the prior art is broken.
According to the analysis, when analyzing the returned data, the number of display time periods corresponding to the data content of the object to be displayed needs to be considered, that is, whether the data content of the object to be displayed needs to be displayed in a split screen or not needs to be considered. This is because the number of display periods corresponding to the data content of the object to be displayed is different, the format of the return data obtained by the read operation is also different, and accordingly, the processing manner of the return data is also different.
Based on this, the embodiment of the application provides a display method of an electric energy meter, which aims at explaining that when a display time period corresponding to the data content of an object to be displayed is 1. How to parse the obtained returned data to obtain the display content data of the object to be displayed, the implementation flow diagram of the display method is shown in fig. 3, and the implementation flow diagram includes the following steps 301 to 306:
step 301, obtaining first information of an object to be displayed.
The first information includes a display identification of an object to be displayed and a display period.
Step 302, converting the first information to obtain a second identifier of the object to be displayed.
The second identity is the communication identity.
Step 303, performing a read operation on the communication table based on the second identifier of the object to be displayed, and obtaining return data of the read operation; the return data includes a data element including a data type and an element value.
In some embodiments, the communications protocol used by the power meter is the DL/T698.45-2017 protocol that encodes content data within the meter using an abstract syntax of asn.1, under which the data elements returned include data types and element values.
In some embodiments, the 1 st byte in the return data characterizes the data type, and the remaining bytes in the return data are used to characterize the element value.
Step 304, retrieving the element value of the data element based on the data type of the data element.
Illustratively, the return data is: 12 09 6d. In the return data, the 1 st byte 12 is a data type, the data type corresponding to the 12 is a long integer, and the last two bytes 09 6d are used for representing element values.
When determining the element value of the data element, firstly taking out the data 09D in the byte used for representing the element value, and converting hexadecimal 09D based on the data type of the long integer to obtain the converted decimal value 2413, wherein 2413 is the element value of the data element.
In step 305, the element values are converted to obtain data contents.
Illustratively, 2413 is an element value of the data element, which is converted, i.e., the decimal point is shifted one bit to the left, resulting in 241.3. I.e. the resulting data content was 241.3V.
And step 306, displaying the data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
Illustratively, if the display period indicated by the first information is period 1, the data content 241.3V corresponding to the display object is displayed in period 1.
The embodiment of the application further provides a display method of the electric energy meter, which aims at explaining that when the display time period corresponding to the data content of the object to be displayed is larger than 1. How to parse the returned data obtained by the reading operation to obtain the display content data of the object to be displayed, the implementation flow diagram of the display method is shown in fig. 4, and the implementation flow diagram includes the following steps 401 to 410:
step 401, obtaining first information of an object to be displayed.
The first information includes a display identification of an object to be displayed and a display period.
Step 402, converting the first information to obtain a second identifier of the object to be displayed.
The second identity is the communication identity.
Step 403, performing a read operation on the communication table based on the second identifier of the object to be displayed, so as to obtain return data of the read operation; the return data includes an element type, an element number, and a plurality of data elements corresponding to the element number.
It should be noted that, if the number of display time periods corresponding to the data content of the object to be displayed is greater than 1, it indicates that it needs to use multiple time periods to completely display the data content of the object to be displayed, that is, the data content needs to be displayed in a split screen. Each first information only carries one display time period, so that a plurality of first information needs to be acquired when the data content of the object to be displayed is displayed; the communication identifiers in each piece of first information are the same, and the display time periods are different.
Correspondingly, for each piece of first information, the first information is converted into a second identifier, namely, the electric energy meter executes the reading operation based on the same plurality of second identifiers, and the return data of the reading operation is obtained.
Illustratively, in some embodiments, the communication protocol used by the power meter is the DL/T698.45-2017 protocol that encodes content data within the table using an abstract syntax of asn.1, under which the returned data includes an element type, an element number, and a plurality of data elements corresponding to the element number.
Illustratively, a read operation is performed on the plurality of second identifications with return data 01 03 12 096D 12 096D 12 09 6D. Wherein,
The type of the representing element 01 is an array type, that is, when the data elements are arranged in sequence, one array, that is, a plurality of data elements are arranged in sequence, and the plurality of data elements are in one-to-one correspondence with the plurality of first information, more specifically, the plurality of data elements are in one-to-one correspondence with the display time periods indicated in the plurality of first information.
03 characterizes the number of data elements, i.e. the number of data elements is 3.
The arrays 12 09 6d are sequentially arranged, and 3 arrays are in one-to-one correspondence with the plurality of first information, more specifically, 3 data elements are data elements corresponding to 3 display periods, respectively.
Step 404, for each piece of information, the element number value is initialized to 0, and the byte pointer is initialized to the position corresponding to the element type in the return data.
Illustratively, the return data is as exemplified above, with the byte pointer initially pointing to 01.
And step 405, updating the byte pointer to the position corresponding to the initial data element according to the element type.
As described above, the element type is an array type, and then the byte pointer is updated to the position of the first array, i.e., the position corresponding to the initial data element, specifically, the byte pointer is updated to the position of the first byte of the initial element, and the byte pointer points to the first 12.
Step 406 determines whether the data element pointed to by the byte pointer matches the display period indicated by the first information.
The above-mentioned plurality of data elements are in one-to-one correspondence with the plurality of display periods, and therefore, for each display period, the data content to be displayed for each display period needs to be obtained from the return data. Determining, in the current time period, whether the data element pointed by the byte pointer matches the current display time period/the display time period indicated by the first information; if yes, go to step 408; otherwise, step 407 is performed.
For example, if the first information matches the first data element, that is, the data content corresponding to the first data element needs to be displayed in the display period indicated by the first information. And the current time period to be displayed is the time period indicated by the first information, and the current byte pointer points to the position corresponding to the initial data element, then the initial data element matches the display time period indicated by the first information, so step 408 is executed to take out the element value in the data element.
If the first information matches the third data element, that is, the data content corresponding to the third data element needs to be displayed in the time period indicated by the first information, and the current time period to be displayed is the time period indicated by the first information, the current byte pointer points to the position corresponding to the initial data element, but not the position of the third data element, and the initial data element does not match the time period indicated by the first information, step 407 is performed until the pointer points to the third data element, specifically until the pointer points to the first byte of the third element.
Step 407, the byte pointer is updated to the next data element, and step 406 is performed back.
Step 408, retrieving the element value in the data element according to the data type in the data element indicated by the byte pointer.
It will be appreciated that if the data element pointed by the byte pointer matches the display time period indicated by the current first information, the data element pointed by the byte pointer is fetched, then the element value of the data element is determined based on the method of step 304, and then the element value is fetched.
And 409, converting the element values to obtain the data content.
In some embodiments, the element values may be converted to obtain the data content based on the method of step 305, which is not described herein.
And step 410, displaying the data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
It can be understood that if the number of time periods corresponding to the data content of the object to be displayed is greater than 1, the corresponding element value needs to be taken out in each time period, and the element value is converted to obtain the data content of the corresponding time period for displaying. That is, for each first information or each time period, the operations of steps 404 to 410 are executed until the element value corresponding to the last time period is taken out for display, so that the display of all the data contents of the object to be displayed can be completed in a plurality of time periods.
In some embodiments, even if the display period corresponding to the data content of the object to be displayed is 1, the format of the returned data is different and the processing manner of the returned data is different due to different communication protocols used by the electric energy meter. The embodiment of fig. 2 describes a method for processing returned data under a communication protocol, and the present application further provides an embodiment in which a communication protocol used by the electric energy meter is different from a communication protocol used by the electric energy meter in the embodiment of fig. 2, and the format of returned data in the embodiment is different from the format of returned data in the embodiment of fig. 2, and the processing method is also different.
Fig. 5 is a schematic implementation flow chart of the electric energy meter display method provided in the embodiment; as shown in fig. 5, the method includes the following steps 501 to 509:
step 501, obtaining first information of an object to be displayed.
Step 502, converting the first information to obtain a second identifier of the object to be displayed.
Step 503, performing a read operation on the communication table based on the second identifier of the object to be displayed, so as to obtain return data of the read operation; the return data is a data element comprising data length information and a data field.
In this embodiment, the communication protocol used by the electric energy meter is the DL/T645-2007 protocol. Accordingly, in the return data of the embodiment of the present application, the first byte is used to represent the data length information, and the remaining bytes are used to represent the data field.
Step 504, the byte pointer is initialized to the starting position of the data field.
Assume that the return data is N bytes in length, wherein the first byte characterizes the data length and the 2 nd through nth bytes characterize the data field.
Illustratively, the return data in this embodiment includes 06 33 34 34 35 73 56, the first byte 06 characterizes the data length information, the remaining bytes characterize the data field, and the initial position of the byte pointer is the start position of the data field, i.e., the byte pointer point 33.
Step 505, based on the data length information, fetches the first data in the data field using the byte pointer.
As an example, if the first byte 06 represents that the data length is 6 bytes, the byte pointer fetches the data corresponding to the 6 bytes as the first data, that is, the fetched first data is: 33 34 34 35 73 56.
Step 506, performing scrambling operation on the first data based on the preset scrambling value to obtain second data.
In some real-time examples, the preset scrambling code value is 33, and the scrambling operation is performed on the first data, that is, the data of each byte in the first data is subtracted by 33, so that the obtained second data is: 00 01 01 02 40 23.
And step 507, deleting the second identifier contained in the second data to obtain third data.
In some embodiments, the second identifier of the object to be displayed is 00 01 01 02, and after deleting the second identifier, the third data is 4023.
Step 508, converting the third data into a big-end format to obtain data content.
In this embodiment, the storage format of the third data is a small-end format, i.e., the high byte of the data field is stored in the high address, the low byte is stored in the low address, the high byte is 40 stored in the high address, the low byte 23 is stored in the low address, and the resulting data content is 4023.
The storage format of the third data is converted to the big-end format, i.e., the high byte 40 is stored in the low address, the low byte 23 is stored in the high address, and the resulting data is 2340.
In some embodiments, the data 2340 in the big-end mode is converted in the manner of step 305 to obtain the data content 234.0V.
Step 509, displaying data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
The embodiment of the application further provides a display method of the electric energy meter, the communication protocol used in the embodiment is different from the communication protocol used in fig. 2 and 5, and the processing method of the returned data is different from the processing method of the embodiment in fig. 2 and 5. The display method includes the following steps 601 to 607:
Step 601, obtaining first information of an object to be displayed.
Step 602, converting the first information to obtain a second identifier of the object to be displayed.
Step 603, performing a read operation on the communication table based on the second identifier of the object to be displayed, so as to obtain return data of the read operation; the return data comprises a data element comprising data length information and a data field.
In this embodiment, the communication protocol used by the electric energy meter is a Modbus-RTU protocol, and under this protocol, the returned data includes data length information and a data field. The first byte in the returned data is used to characterize the data length information and the remaining bytes are used to characterize the data field.
Assuming that the return data includes M bytes, 1 st byte characterizes length information, 2 nd to M bytes characterize the data field, and M-1 = the length to which the length information corresponds. Illustratively, the return data is 02 09 59. 02 characterizes the data length as 2 bytes.
Step 604, the byte pointer is initialized to the starting position of the data field.
As illustrated above, the return data is 02 09 59. The byte pointer is initially the location of the second byte. The byte pointer points to 09.
Step 605, based on the data length information, fetches the fourth data in the data field using the byte pointer.
In the example above, where the data length is 2, then 2 bytes, 09 and 59, are fetched using the pointer.
And step 606, performing binary conversion on the fourth data to obtain the data content.
In some embodiments, the data in the data field is hexadecimal, converting hexadecimal 09 59 to hexadecimal, resulting in 2393, and then converting the converted element values again based on the method in step 305, resulting in data content 241.3V.
And step 607, displaying the data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
It will be appreciated that in the embodiments of the present application, related data such as user information is involved, and when the embodiments of the present application are applied to specific products or technologies, user permissions or agreements need to be obtained, and the collection, use and processing of related data need to comply with relevant laws and regulations and standards of relevant countries and regions.
It should be noted that although the steps of the methods of the present application are depicted in the accompanying drawings in a particular order, this does not require or imply that the steps must be performed in that particular order, or that all illustrated steps be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step to be performed, and/or one step decomposed into multiple steps to be performed, etc.; or, the steps in different embodiments are combined into a new technical scheme.
Based on the foregoing embodiments, the embodiments of the present application provide an electric energy meter display device, where the device includes each module included, and each unit included in each module may be implemented by a processor; of course, the method can also be realized by a specific logic circuit; in an implementation, the processor may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 7 is a schematic structural diagram of a display device of an electric energy meter according to an embodiment of the present application, as shown in fig. 7, the device 70 includes an acquisition module 71, a conversion module 72, a readout module 73, and a display module 74, where:
an acquisition module 71, configured to acquire first information of an object to be displayed; the first information comprises a first identification and a display time period of the object to be displayed, and the first information meets display rules defined in a communication protocol used by the electric energy meter.
A conversion module 72, configured to convert the first information to obtain a second identifier of the object to be displayed; the second identification satisfies a reading rule defined in a communication protocol used by the electric energy meter.
A reading module 73, configured to perform a reading operation based on the second identifier of the object to be displayed, so as to obtain data content corresponding to the object to be displayed, where the data content is stored in a data table; the data table is used for storing second identifiers and data contents corresponding to all display objects related to the electric energy meter respectively;
And the display module 74 is configured to display, on the electric energy meter, data content corresponding to the object to be displayed based on the display time period indicated by the first information.
In some embodiments, the conversion module 72 is configured to delete the display period in the first information to obtain the second identifier.
In some embodiments, the readout module 73 is configured to perform a read operation based on the second identifier, so as to obtain return data of the read operation; and analyzing the returned data based on the number of the display time periods corresponding to the data content of the object to be displayed, so as to obtain the data content.
In some embodiments, in a case that the number of display time periods corresponding to the data content of the object to be displayed is 1, the return data includes a data element, where the data element includes a data type and an element value; a reading module 73, configured to take out an element value in the data element based on the data type of the data element; and converting the element values to obtain the data content.
In some embodiments, when the number of display time periods corresponding to the data content of the object to be displayed is greater than 1, the number of the first information is a plurality of pieces, and the display time periods indicated by the plurality of pieces of first information are different; the return data comprises a plurality of data elements corresponding to the first information one by one, wherein the element type and the element number of the return data are included; a readout module 73, configured to initialize, for each first information, an element number value to 0, and an element pointer to a position corresponding to an element type in the returned data; updating the byte pointer to a position corresponding to the initial data element according to the element type; determining whether the data element pointed by the byte pointer is matched with the display time period indicated by the first information; if yes, the element value in the data element is taken out according to the data type in the data element indicated by the byte pointer; otherwise, updating the byte pointer to the next data element, and returning to execute the steps of determining whether the data element pointed by the byte pointer is matched with the display time period indicated by the first information or not until the element value in the data element matched with the display time period indicated by the first information is taken out; and converting the element values to obtain the data content.
In some embodiments, in a case that the number of display time periods corresponding to the data content of the object to be displayed is 1, the return data includes a data element, where the data element includes data length information and a data field; a read-out module 73 for initializing a byte pointer to a start position of the data field; retrieving first data in the data field using the byte pointer based on the data length information; scrambling operation is carried out on the first data based on a preset scrambling value, so that second data are obtained; deleting a second identifier contained in the second data to obtain third data; and converting the third data into a big-end format to obtain the data content.
In some embodiments, in a case that the number of display time periods corresponding to the data content of the object to be displayed is 1, the return data includes a data element, where the data element includes data length information and a data field; a read module 73 for initializing the byte pointer to a start position of the data field; fetching fourth data using the byte pointer based on the data length information; and converting the fourth data into a big-end format to obtain the data content.
The description of the apparatus embodiments above is similar to that of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus of the present application, please refer to the description of the embodiments of the method of the present application.
It should be noted that, in the embodiment of the present application, the division of the modules by the display device of the electric energy meter shown in fig. 7 is schematic, and is merely a logic function division, and another division manner may be adopted in actual implementation. In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units. Or in a combination of software and hardware.
It should be noted that, in the embodiment of the present application, if the above-mentioned electric energy meter display method is implemented in the form of a software function module, and sold or used as a separate product, the method may also be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be embodied essentially or in a part contributing to the related art in the form of a software product stored in a storage medium, comprising several instructions for causing an electric energy meter to perform all or part of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, an optical disk, or other various media capable of storing program codes. Thus, embodiments of the application are not limited to any specific combination of hardware and software.
An embodiment of the present application provides an electric energy meter, fig. 8 is a schematic diagram of hardware entities of the electric energy meter according to the embodiment of the present application, as shown in fig. 8, the electric energy meter 80 includes a memory 81 and a processor 82, where the memory 81 stores a computer program that can be run on the processor 82, and the processor 82 implements steps in the method provided in the embodiment described above when executing the program.
It should be noted that, the memory 81 is configured to store instructions and applications executable by the processor 82, and may also cache data (for example, image data, audio data, voice communication data, and video communication data) to be processed or already processed by each module in the processor 82 and the electric energy meter 80, which may be implemented by a FLASH memory (FLASH) or a random access memory (Random Access Memory, RAM).
An embodiment of the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps in the electric energy meter display method provided in the above embodiment.
The embodiment of the application provides a computer program product containing instructions, which when run on a computer, cause the computer to execute the steps in the electric energy meter display method provided by the embodiment of the method.
It should be noted here that: the description of the storage medium and apparatus embodiments above is similar to that of the method embodiments described above, with similar benefits as the method embodiments. For technical details not disclosed in the storage medium, the storage medium and the device embodiments of the present application, please refer to the description of the method embodiments of the present application.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" or "some embodiments" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" or "in some embodiments" in various places throughout this specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present application, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by the functions and internal logic thereof, and should not constitute any limitation on the implementation process of the embodiments of the present application. The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. The foregoing description of various embodiments is intended to highlight differences between the various embodiments, which may be the same or similar to each other by reference, and is not repeated herein for the sake of brevity.
The term "and/or" is herein merely an association relation describing associated objects, meaning that there may be three relations, e.g. object a and/or object B, may represent: there are three cases where object a alone exists, object a and object B together, and object B alone exists.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments are merely illustrative, and the division of the modules is merely a logical function division, and other divisions may be implemented in practice, such as: multiple modules or components may be combined, or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or modules, whether electrically, mechanically, or otherwise.
The modules described above as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules; can be located in one place or distributed to a plurality of network units; some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated in one processing unit, or each module may be separately used as one unit, or two or more modules may be integrated in one unit; the integrated modules may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read Only Memory (ROM), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the above-described integrated units of the present application may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the embodiments of the present application may be embodied essentially or in a part contributing to the related art in the form of a software product stored in a storage medium, comprising several instructions for causing an electric energy meter to perform all or part of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
The methods disclosed in the method embodiments provided by the application can be arbitrarily combined under the condition of no conflict to obtain a new method embodiment.
The features disclosed in the several product embodiments provided by the application can be combined arbitrarily under the condition of no conflict to obtain new product embodiments.
The features disclosed in the embodiments of the method or the apparatus provided by the application can be arbitrarily combined without conflict to obtain new embodiments of the method or the apparatus.
The foregoing is merely an embodiment of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (10)
1. An electric energy meter display method, comprising:
acquiring first information of an object to be displayed; the first information comprises a first identification and a display time period of the object to be displayed, and the first information meets display rules defined in a communication protocol used by the electric energy meter;
converting the first information to obtain a second identifier of the object to be displayed; the second identifier meets a reading rule defined in a communication protocol used by the electric energy meter;
reading operation is carried out based on the second identification of the object to be displayed, and data content corresponding to the object to be displayed and stored in a data table is obtained; the data table is used for storing second identifiers and data contents corresponding to all display objects related to the electric energy meter respectively;
And displaying the data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
2. The method of claim 1, wherein the converting the first information to obtain the second identifier of the object to be displayed comprises:
and deleting the display time period in the first information to obtain the second identifier.
3. The method according to claim 2, wherein the performing a read operation based on the second identifier of the object to be displayed, to obtain the data content corresponding to the object to be displayed stored in the data table, includes:
executing a reading operation based on the second identifier to obtain returned data of the reading operation;
and analyzing the returned data based on the number of the display time periods corresponding to the data content of the object to be displayed, so as to obtain the data content.
4. A method according to claim 3, wherein, in the case where the number of display periods corresponding to the data content of the object to be displayed is 1, the return data includes a data element, and the data element includes a data type and an element value;
The analyzing the returned data to obtain the data content includes:
retrieving an element value in the data element based on the data type of the data element;
and converting the element values to obtain the data content.
5. A method according to claim 3, wherein in the case where the number of display time periods corresponding to the data content of the object to be displayed is greater than 1, the number of the first information is plural, and the display time periods respectively indicated by the plural first information are different; the return data comprises a plurality of data elements corresponding to the first information one by one, wherein the element type and the element number of the return data are included;
the analyzing the returned data to obtain the data content includes:
for each piece of first information, initializing an element number value to be 0, and initializing a byte pointer to be a position corresponding to the element type in the returned data;
updating the byte pointer to a position corresponding to the initial data element according to the element type;
determining whether the data element pointed by the byte pointer is matched with the display time period indicated by the first information;
if yes, the element value in the data element is taken out according to the data type in the data element indicated by the byte pointer;
Otherwise, updating the byte pointer to the next data element, and returning to execute the steps of determining whether the data element pointed by the byte pointer is matched with the display time period indicated by the first information or not until the element value in the data element matched with the display time period indicated by the first information is taken out;
and converting the element values to obtain the data content.
6. A method according to claim 3, wherein, in the case that the number of display time periods corresponding to the data content of the object to be displayed is 1, the return data includes a data element, and the data element includes data length information and a data field;
the analyzing the returned data to obtain the data content includes:
initializing a byte pointer as a starting position of the data field;
retrieving first data in the data field using the byte pointer based on the data length information;
scrambling operation is carried out on the first data based on a preset scrambling value, so that second data are obtained;
deleting a second identifier contained in the second data to obtain third data;
and converting the third data into a big-end format to obtain the data content.
7. A method according to claim 3, wherein, in the case that the number of display time periods corresponding to the data content of the object to be displayed is 1, the return data includes a data element, and the data element includes data length information and a data field;
the analyzing the returned data to obtain the data content includes:
initializing a byte pointer as a starting position of a data field;
fetching fourth data using the byte pointer based on the data length information;
and carrying out binary conversion on the fourth data to obtain the data content.
8. A display device for an electric energy meter, comprising:
the acquisition module is used for acquiring first information of an object to be displayed; the first information comprises a first identification and a display time period of the object to be displayed, and the first information meets display rules defined in a communication protocol used by the electric energy meter;
the conversion module is used for converting the first information to obtain a second identifier of the object to be displayed; the second identifier meets a reading rule defined in a communication protocol used by the electric energy meter;
the reading module is used for executing reading operation based on the second identifier of the object to be displayed to obtain data content corresponding to the object to be displayed, which is stored in the data table; the data table is used for storing second identifiers and data contents corresponding to all display objects related to the electric energy meter respectively;
And the display module is used for displaying the data content corresponding to the object to be displayed on the electric energy meter based on the display time period indicated by the first information.
9. An electric energy meter comprising a memory and a processor, the memory storing a computer program executable on the processor, the processor implementing the method according to an embodiment of the application when executing the program.
10. A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method provided by embodiments of the present application.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311085508.1A CN117111867A (en) | 2023-08-25 | 2023-08-25 | Electric energy meter display method and device, electric energy meter and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311085508.1A CN117111867A (en) | 2023-08-25 | 2023-08-25 | Electric energy meter display method and device, electric energy meter and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117111867A true CN117111867A (en) | 2023-11-24 |
Family
ID=88794362
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202311085508.1A Pending CN117111867A (en) | 2023-08-25 | 2023-08-25 | Electric energy meter display method and device, electric energy meter and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117111867A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119248329A (en) * | 2024-09-19 | 2025-01-03 | 宁夏隆基宁光仪表股份有限公司 | A method for synchronizing information between an electric energy meter and a user interface unit |
| CN119619576A (en) * | 2025-02-11 | 2025-03-14 | 北京市腾河智慧能源科技有限公司 | Electric energy meter data display method, device and storage medium |
-
2023
- 2023-08-25 CN CN202311085508.1A patent/CN117111867A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119248329A (en) * | 2024-09-19 | 2025-01-03 | 宁夏隆基宁光仪表股份有限公司 | A method for synchronizing information between an electric energy meter and a user interface unit |
| CN119619576A (en) * | 2025-02-11 | 2025-03-14 | 北京市腾河智慧能源科技有限公司 | Electric energy meter data display method, device and storage medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN117111867A (en) | Electric energy meter display method and device, electric energy meter and storage medium | |
| CN110445860B (en) | Message sending method, device, terminal equipment and storage medium | |
| CN111354099B (en) | Data processing method, data processing device and diagnostic equipment | |
| CN110795069A (en) | Code analysis method, intelligent terminal and computer readable storage medium | |
| CN111694795A (en) | File online preview method, device, terminal and medium | |
| CN113836126B (en) | Data cleaning method, device, equipment and storage medium | |
| CN104580310A (en) | Log processing method and server | |
| KR20120127204A (en) | Method and apparatus for stabilized binary differencing | |
| CN110516220B (en) | Report data input method, system and related equipment | |
| EP3598738A1 (en) | Video synthesis method, apparatus and device, and video playing method, apparatus and device | |
| CN107800816B (en) | IP address database establishing method and terminal equipment | |
| CN108845995B (en) | Data processing method, data processing apparatus, storage medium, and electronic apparatus | |
| CN108073709B (en) | Data recording operation method, device, equipment and storage medium | |
| CN107832341B (en) | AGNSS user duplicate removal statistical method | |
| CN109614592B (en) | Text processing method and device, storage medium and electronic equipment | |
| CN116320648B (en) | Bullet screen drawing method and device and electronic equipment | |
| CN112131183A (en) | Linear access method of OFD electronic file | |
| CN116414859B (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
| CN111162792A (en) | Compression method and device for power load data | |
| CN109558375B (en) | Optimized file storage method, storage medium, equipment and system | |
| CN110175256A (en) | A kind of image data retrieval method, apparatus, equipment and storage medium | |
| CN118012656A (en) | Damaged PDF document repairing method, device, equipment and storage medium | |
| CN106815282B (en) | data access method and device | |
| CN110245114B (en) | Data processing method and device | |
| CN101621577B (en) | Short message processing method and short message processing terminal |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |