CN114138542A - Data configuration method of electric energy meter, electric energy meter and readable storage medium - Google Patents

Data configuration method of electric energy meter, electric energy meter and readable storage medium Download PDF

Info

Publication number
CN114138542A
CN114138542A CN202111231022.5A CN202111231022A CN114138542A CN 114138542 A CN114138542 A CN 114138542A CN 202111231022 A CN202111231022 A CN 202111231022A CN 114138542 A CN114138542 A CN 114138542A
Authority
CN
China
Prior art keywords
data
packet
electric energy
upper computer
energy meter
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
Application number
CN202111231022.5A
Other languages
Chinese (zh)
Inventor
邓鹏飞
宋慧娜
张宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wasion Group Co Ltd
Original Assignee
Wasion Group Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wasion Group Co Ltd filed Critical Wasion Group Co Ltd
Priority to CN202111231022.5A priority Critical patent/CN114138542A/en
Publication of CN114138542A publication Critical patent/CN114138542A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0877Cache access modes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Quality & Reliability (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a data configuration method of an electric energy meter, the electric energy meter and a readable storage medium. The data configuration method of the electric energy meter comprises the following steps: receiving each data sub-packet sent by an upper computer according to a time sequence, and sequentially storing each data sub-packet in a cache region; checking whether each data sub-packet in the cache area has abnormal receiving; if the receiving abnormality is determined, cleaning each data sub-packet in the cache region, and sending data configuration failure information to an upper computer so that the upper computer can resend the data sub-packets; and if the receiving exception does not exist, transferring each data sub-packet in the cache area to a destination address storage area for storage. The method and the device can avoid the condition that the function operation is abnormal due to the wrong parameter configuration of the electric energy meter.

Description

Data configuration method of electric energy meter, electric energy meter and readable storage medium
Technical Field
The invention relates to the field of electric energy meters, in particular to a data configuration method of an electric energy meter, the electric energy meter and a readable storage medium.
Background
At present, the host computer is carrying out parameter setting to the electric energy meter, when needing to transmit bigger data packet, because the restriction of the RAM (random access memory) memory that establishes in the electric energy meter, can only receive comparatively little data packet once (and if will increase the RAM memory that establishes in the electric energy meter, will improve the cost of electric energy meter greatly), consequently, to bigger data packet, the host computer often can transmit through the mode of subcontracting, namely, through dividing into the form of a plurality of comparatively little data subcontractors with a comparatively big data packet, send the electric energy meter in proper order to realize the normal transmission of data.
However, in the current data packetization transmission process, abnormal data transmission conditions caused by unstable network communication signals and other reasons often occur, for example, a data packet is missing in the data packetization received by the electric energy meter, and the receiving abnormality such as disordered sequence of each data packet occurs, and if the received data packet is incomplete or disordered sequence, the parameter configuration of the electric energy meter is wrong, and further the function operation of the electric energy meter is abnormal.
How to avoid the abnormal condition of the function operation caused by the wrong parameter configuration of the electric energy meter has become a technical problem to be solved urgently.
Disclosure of Invention
The embodiment of the invention provides a data configuration method of an electric energy meter, the electric energy meter and a readable storage medium, and aims to solve the technical problem that when parameter configuration is carried out on the electric energy meter in the prior art, parameter configuration errors are easy to occur, and the electric energy meter is abnormal in function operation.
In order to achieve the above object, the present invention provides a data configuration method for an electric energy meter, where the data configuration method for an electric energy meter includes:
receiving each data sub-packet sent by an upper computer according to a time sequence, and sequentially storing each data sub-packet in a cache region;
checking whether each data sub-packet in the cache area has abnormal receiving;
if the receiving abnormality is determined, cleaning each data sub-packet in the cache region, and sending data configuration failure information to an upper computer so that the upper computer can resend the data sub-packets;
and if the receiving exception does not exist, transferring each data sub-packet in the cache area to a destination address storage area for storage.
Optionally, the step of receiving each data sub-packet sent by the upper computer in time sequence includes:
judging whether a multi-packet identifier sent by an upper computer is received;
if the multi-packet identifier is received, determining that the upper computer sends data in a packet mode;
the step of receiving each data sub-packet sent by the upper computer according to the time sequence comprises the following steps:
and if the upper computer is determined to send data in a sub-packet mode, receiving each data sub-packet sent by the upper computer according to the time sequence.
Optionally, after the step of determining whether the multi-packet flag identifier sent by the upper computer is received, the method further includes:
if the multi-packet identifier is not received, determining that the upper computer sends data in a total packet mode;
and receiving a data total packet sent by the upper computer, and directly storing the data total packet to a destination address storage area.
Optionally, before the step of checking whether there is an abnormal reception in each data packet in the buffer, the method further includes:
judging whether a preset sending completion identifier is received or not;
if the sending completion identifier is received, executing: and checking whether each data sub-packet in the buffer area has abnormal receiving.
Optionally, the data configuration method further includes:
and if the sending completion identifier is not received within a preset time length from the time when the data packet sent last time is received, determining that abnormal receiving exists.
Optionally, the step of transferring each packet of data in the cache area to the destination address storage area for storage includes:
splicing the data sub-packets in the cache region to obtain a data total packet;
and transferring the data total packet to a destination address storage area for storage.
Optionally, the step of checking whether there is an abnormal reception in each data packet in the buffer area includes:
receiving a preset theoretical check value sent by an upper computer;
calculating to obtain an actual check value in a preset check mode according to the zone bit information of each data sub-packet in the cache region;
comparing the theoretical verification value with the actual verification value;
if the receiving abnormity is determined to exist, the step of cleaning each data sub-packet in the cache region comprises the following steps:
and if the theoretical check value is inconsistent with the actual check value, cleaning each data sub-packet in the cache region.
Optionally, after the step of transferring each packet of data in the cache region to the destination address storage region for storage, the method includes:
and sending the information of successful data configuration to the upper computer.
The invention also provides an electric energy meter, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps of the data configuration method of the electric energy meter when being executed by the processor.
The invention also provides a readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for configuring data of an electric energy meter according to any one of the preceding claims.
It should be noted that, when at least one data sub-packet is missing in the data sub-packets received by the electric energy meter due to unstable network communication signals and other reasons, the present invention does not adopt a scheme of re-transmitting the missing data packet by the upper computer, but instead adopts a method of clearing each data sub-packet in the buffer area and transmitting data configuration failure information to the upper computer so that the upper computer re-transmits the data sub-packet, thereby avoiding the receiving delay condition of the data sub-packet causing the electric energy meter to receive repeated data sub-packets, and it should be noted that the re-transmitting of the missing data sub-packet by the upper computer may cause the problem of disordered data sub-packet storage sequence.
The invention does not adopt the existing method of receiving each data packet sent by an upper computer according to time sequence and sequentially and directly storing each data packet to a destination address storage area, thereby avoiding the condition that the parameter configuration of the electric energy meter is wrong to cause abnormal function operation. The invention firstly receives each data sub-packet sent by an upper computer according to time sequence, stores each data sub-packet in a buffer area in sequence, checks whether each data sub-packet of the buffer area has abnormal receiving, judges whether the abnormal receiving condition such as incomplete data sub-packet receiving or disordered data sub-packet storing sequence exists, and further clears each data sub-packet of the buffer area if the abnormal receiving condition exists, and sends data configuration failure information to the upper computer, so that the upper computer resends the data sub-packet, thereby finding out abnormal data transmission in time, preventing the conditions of missing of the data sub-packet received by the electric energy meter and disordered data sub-packet storing sequence caused by various external interference factors such as unstable network communication signals, and further avoiding the conditions of flying or crash of the electric energy meter caused by wrong parameter configuration of the electric energy meter, and ensuring the normal operation of the functions of the electric energy meter, and further performing the step of transferring each data packet in the cache area to a destination address storage area for storage if the receiving abnormity does not exist, so as to finish the firmware upgrade or parameter update of the electric energy meter and realize the correct configuration of the parameters of the electric energy meter. The invention provides a new data verification mechanism, overcomes the defects of the existing parameter configuration method, and can ensure the correctness and reliability of parameter configuration of the electric energy meter.
Drawings
FIG. 1 is a schematic structural diagram of an electric energy meter according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a first embodiment of a data configuration method of an electric energy meter according to the present invention;
FIG. 3 is a partial schematic flow chart of a second embodiment of a data configuration method for an electric energy meter according to the present invention;
fig. 4 is a schematic flowchart of a data configuration method of an electric energy meter according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic diagram of an electric energy meter structure of a hardware operating environment according to an embodiment of the present invention. The electric energy meter may include: a processor 1001, such as a CPU, a network interface 1003, a memory 1004, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The network interface 1003 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 1004 may alternatively be a storage device separate from the processor 1001. It is understood that the electric energy meter should further include a display screen, and optionally, the electric energy meter may further include RF (Radio Frequency) circuits, sensors, audio circuits, WiFi modules, and the like.
The invention provides a data configuration method of an electric energy meter.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of a data configuration method of an electric energy meter according to the present invention, where the data configuration method of the electric energy meter includes:
s100, receiving each data sub-packet sent by an upper computer according to a time sequence, and sequentially storing each data sub-packet in a cache region;
the host computer is used for setting parameters of the electric energy meter, and when a relatively large data packet needs to be transmitted, the host computer can only receive the relatively small data packet once due to the limitation of a Random Access Memory (RAM) memory in the electric energy meter, so that the host computer can often transmit the relatively large data packet in a sub-packet mode, namely, the relatively large data packet is divided into a plurality of relatively small data sub-packets and sequentially transmitted to the electric energy meter to realize the normal transmission of data.
It is understood that the upper computer can be a PC or a mobile phone having a function of processing data, but not limited thereto. It should be noted that, in an embodiment, a user may directly generate, by operating the upper computer, relevant data information for performing data configuration on the electric energy meter, convert the data information into a data packet that conforms to a standard communication protocol and is recognizable and receivable by the electric energy meter, and send the data packet to the electric energy meter, so as to upgrade firmware or update parameters of the electric energy meter. In another embodiment, a user can also generate relevant data information for data configuration of the electric energy meter by operating an external device connected with the upper computer and send the data information to the upper computer, and the upper computer receives the data information, converts the data information into a data packet which conforms to a standard communication protocol and can be identified and received by the electric energy meter, and sends the data packet to the electric energy meter so as to realize firmware upgrade or parameter update of the electric energy meter.
The cache region may be referred to as a flash cache.
Step S200, checking whether each data packet in the buffer area has abnormal receiving;
the receiving abnormality includes that at least one data sub-packet is missing from the data sub-packets received by the electric energy meter, the sequence of each data sub-packet is disordered, and if the data sub-packets received by the electric energy meter are incomplete or disordered, the parameter configuration of the electric energy meter is wrong, and further the function operation of the electric energy meter is abnormal.
Further, before the step S200, the method further includes:
step a, judging whether a preset sending completion identifier is received or not;
the step S200 includes:
step b, if receiving the sending completion identifier, executing: and checking whether each data sub-packet in the buffer area has abnormal receiving.
It should be noted that, when the electric energy meter receives the preset sending completion identifier, it is determined that all of the plurality of data sub-packets split from the data main packet have been received. In an embodiment, the preset sending completion identifier is a "last block", and when the electric energy meter receives the sending completion identifier of the "last block", it is determined that all the data sub-packets split from the data main packet are completely received, and at this time, it may be started to check whether all the data sub-packets in the buffer area have abnormal receiving.
Further, the data configuration method in the embodiment of the present invention further includes:
and if the sending completion identifier is not received within a preset time length from the time when the data packet sent last time is received, determining that abnormal receiving exists.
It can be understood that the electric energy meter does not receive the sending completion identifier due to unstable network communication signals, and if the sending completion identifier is not received, it can be determined that the data sub-package received by the electric energy meter has incomplete reception or disordered storage sequence to a great extent, so that it can be determined that abnormal reception exists, and the correctness and stability of the parameter configuration of the electric energy meter are improved.
Step S300, if the receiving abnormity is determined, cleaning each data sub-packet in the cache region, and sending data configuration failure information to an upper computer so that the upper computer can resend the data sub-packets;
the data configuration failure information can also comprise a trigger instruction which enables the upper computer to trigger to generate early warning information, so that a user can know the data configuration failure of the upper computer.
In step S400, if it is determined that there is no reception anomaly, each data packet in the cache area is transferred to the destination address storage area for storage.
The method for storing the data packets in the cache area comprises the following steps of transferring each data packet in the cache area to a destination address storage area for storage, and specifically comprises the following steps: and after copying each data sub-packet of the cache region, storing the data sub-packet into a destination address storage region, and emptying each data sub-packet of the cache region when the destination address storage region finishes storing each data sub-packet.
The embodiment does not adopt the existing method of receiving each data sub-packet sent by an upper computer according to a time sequence and sequentially and directly storing each data sub-packet to a destination address storage area, thereby avoiding the condition that the parameter configuration of the electric energy meter is wrong, which causes the abnormal operation of the function. The embodiment comprises the steps of firstly receiving each data sub-packet sent by an upper computer according to a time sequence, sequentially storing each data sub-packet in a cache region, checking whether each data sub-packet in the cache region has a step of abnormal reception, so as to judge whether the conditions of incomplete data sub-packet reception or disordered data sub-packet storage sequence exist, and further, if the abnormal reception exists, cleaning each data sub-packet in the cache region, and sending data configuration failure information to the upper computer, so that the upper computer resends the data sub-packet, thereby timely finding out abnormal data transmission, preventing the conditions of missing of the data sub-packet received by an electric energy meter and disordered data sub-packet storage sequence caused by various external interference factors such as network communication signals, and further avoiding the conditions of program runaway or dead halt of the electric energy meter caused by wrong parameter configuration of the electric energy meter, and ensuring the normal operation of the functions of the electric energy meter, and further performing the step of transferring each data packet in the cache area to a destination address storage area for storage if the receiving abnormity does not exist, so as to finish the firmware upgrade or parameter update of the electric energy meter and realize the correct configuration of the parameters of the electric energy meter. The embodiment provides a new data verification mechanism, overcomes the defects of the existing parameter configuration method, and can ensure the correctness and reliability of the parameter configuration of the electric energy meter.
It should be noted that, when at least one data sub-packet is missing in the data sub-packets received by the electric energy meter due to unstable network communication signals, the embodiment does not adopt a scheme of retransmitting the missing data packet by the upper computer, but instead adopts a method of clearing each data sub-packet in the buffer area and transmitting data configuration failure information to the upper computer so that the upper computer retransmits the data sub-packet, thereby avoiding that the electric energy meter receives repeated data sub-packets due to the delay of receiving the data sub-packets, and it should be noted that the missing data sub-packets are retransmitted by the upper computer, which may cause a disorder of the data sub-packet storage sequence.
Further, the step of transferring each packet of data in the cache area to the destination address storage area for storage includes:
c, splicing the data sub-packets in the cache region to obtain a data total packet;
as will be understood by those skilled in the art, each data sub-packet has a corresponding flag bit, and each flag bit stores a sequence number, such as 0, 1, 2, and 3 … …, and a data total packet can be obtained by combining each data sub-packet in the buffer according to a standard combination rule according to the sequence number of the flag bit corresponding to each data sub-packet.
And d, transferring the data total packet to a destination address storage area for storage.
In this embodiment, a data total packet is obtained by splicing the data sub-packets in the cache region; therefore, the storage efficiency of transferring the data total packet to a destination address storage area for storage is improved, and the configuration efficiency of the electric energy meter for parameter configuration is further improved.
Further, after the step of transferring each packet of data in the cache area to the destination address storage area for storage, the method further includes:
and sending the information of successful data configuration to the upper computer.
According to the implementation, the information of successful data configuration is sent to the upper computer, so that the information can be fed back to the working personnel at the first time, and the parameters of the electric energy meter are successfully configured.
Further, the step of receiving each data packet transmitted by the upper computer in time sequence includes:
step e, judging whether a multi-packet identifier sent by an upper computer is received;
step f, if the multi-packet identifier is received, determining that the upper computer sends data in a packet mode;
and if the multi-packet identifier is not received, determining that the upper computer transmits data in a total packet mode.
The step of receiving each data sub-packet sent by the upper computer according to the time sequence comprises the following steps:
and h, receiving each data sub-packet sent by the upper computer according to the time sequence if the upper computer is determined to send the data in the sub-packet mode.
It should be noted that the multi-pack flag identifier is preset by those skilled in the art, for example, the multi-pack flag identifier is "multi-pack flag". When the electric energy meter receives the preset multi-packet mark identifier, the upper computer is confirmed to transmit in a sub-packet mode, namely, a larger data total packet is divided into a plurality of smaller data sub-packets and sequentially sent to the electric energy meter so as to realize normal transmission of data.
Still further, after the step of determining whether the multi-packet flag identifier sent by the upper computer is received, the method further includes:
step i, if the multi-packet identifier is not received, determining that the upper computer sends data in a total packet mode;
and j, receiving a data total packet sent by the upper computer, and directly storing the data total packet to a destination address storage area.
It can be understood that, if the electric energy meter does not receive the preset multi-packet flag identifier, it is determined that the upper computer transmits the identifier in a total packet manner, that is, a smaller data total packet is directly sent to the electric energy meter (the data total packet is not split into a plurality of data sub-packets). Because the data total packet does not have the conditions of data packet missing and disordered storage sequence caused by various external interference factors such as unstable network communication signals, the data total packet can be directly stored in the destination address storage area, and the parameter configuration efficiency of the electric energy meter is improved under the condition of ensuring the correct parameter configuration of the electric energy meter.
Further, referring to fig. 3, which is a schematic partial flow chart of a second embodiment of the data configuration method of the electric energy meter according to the present invention, based on the first embodiment, the step S200 includes:
step S210, receiving a preset theoretical check value sent by an upper computer;
step S220, calculating to obtain an actual check value in a preset check mode according to the zone bit information of each data sub-packet in the cache region;
as will be appreciated by those skilled in the art, there is corresponding flag information for each packet.
Step S230, comparing the theoretical verification value with the actual verification value;
if the receiving abnormity is determined to exist, the step of cleaning each data sub-packet in the cache region comprises the following steps:
step S310, if the theoretical check value is inconsistent with the actual check value, cleaning each data sub-packet in the cache region.
If the theoretical check value is consistent with the actual check value, determining that no receiving abnormity exists; and if the theoretical check value is inconsistent with the actual check value, determining that receiving abnormity exists.
In one embodiment, the predetermined check mode is a crc (cyclic Redundancy check) check mode. As will be understood by those skilled in the art, CRC, i.e., cyclic redundancy check, is one of the most commonly used error checking codes in the field of data communication, and is characterized in that the lengths of the information field and the check field can be arbitrarily selected. For example, a CRC16 check method is adopted, the data check formula is X16+ X12+ X5+1, and calculation is performed by combining flag bit information of each data packet, and by the check method, only 1/65536 error probability exists for a random number of 2 bytes, so that accuracy of data check can be greatly improved. For another example, the upper computer calculates the check value of 4 bytes of each data packet by using the CRC32 check method, and then compares the calculated actual check value with the theoretical check value sent by the upper computer.
In another embodiment, the preset verification method is as follows: and verifying whether the data length is correct. The actual check value is the actual length of the data total packet, and the theoretical check value is the theoretical length of the data total packet. The preset checking mode is as follows: determining the data length of each data sub-packet according to the zone bit information corresponding to each data sub-packet in the cache region; calculating the actual length of the total data packet according to the data length of each data sub-packet; comparing the actual length of the data total packet with the preset theoretical length of the data total packet sent by the upper computer; if the actual length is consistent with the theoretical length, determining that no receiving abnormity exists; and if the actual length is inconsistent with the theoretical length, determining that receiving abnormity exists.
In another embodiment, the preset verification method is as follows: and verifying whether the sequence of storing the data sub-packets in sequence is correct or not. The actual check value is the actual ordering of the sequence numbers of the data sub-packets which are stored in sequence, and the theoretical check value is the theoretical ordering of the sequence numbers of the data sub-packets which are stored in sequence. The preset checking mode is as follows: determining the actual sequence number corresponding to each data sub-packet according to the zone bit information corresponding to each data sub-packet in the cache region; determining the actual sequence of the sequence numbers of the data sub-packets stored in sequence according to the actual sequence numbers corresponding to the data sub-packets and the storage positions corresponding to the data sub-packets; comparing the actual sequence with a theoretical sequence of sequence numbers which are stored in sequence by each data sub-packet sent by an upper computer; if the actual ordering is consistent with the theoretical ordering, determining that no receiving abnormity exists; and if the actual sequence is inconsistent with the theoretical sequence, determining that receiving abnormity exists.
As can be understood by those skilled in the art, the storage order of the data sub-packets may be determined according to the storage locations of the data sub-packets in the buffer.
In the embodiment, an actual check value is calculated in a preset check mode by receiving a preset theoretical check value sent by an upper computer and according to the zone bit information of each data sub-packet in a cache region; and comparing the theoretical check value with the actual check value, so as to judge whether the conditions of receiving abnormity, such as incomplete receiving of each data packet or disordered sequence of storing each data packet, exist, find out data transmission abnormity in time, prevent the conditions of program runaway or crash of the electric energy meter, and the like, caused by parameter configuration errors of the electric energy meter, ensure the normal operation of the functions of the electric energy meter, and further overcome the defects of the conventional parameter configuration method.
In order to facilitate a thorough understanding of the present invention, the following example of the present invention is given, and many specific details are set forth in the following example of the present invention in order to provide a thorough understanding of the present invention. The invention can be implemented in many ways other than those described herein and those skilled in the art will appreciate that the invention is not limited to the first embodiment without departing from the spirit of the invention.
Referring to fig. 4, fig. 4 is a schematic flow chart illustrating a data configuration method of an electric energy meter according to an embodiment of the present invention. The following is a specific implementation procedure of the first embodiment, which is:
(1) the electric energy meter judges whether the received data is multi-packet data;
according to the standard communication protocol of the electric energy meter, when data is divided into a plurality of packets of data, a plurality of packets of marks are generated, and the data received by the electric energy meter can be determined to be the plurality of packets of data according to the plurality of packets of marks.
(2) Sequentially storing the multiple packets of data into a cache flash;
the storage position of the next packet of data in the cache flash can be obtained by accumulating the data length of each packet, and the total length of the whole data packet can be obtained after all data are received.
(3) Judging whether the received data is complete;
and if the CRC (cyclic Redundancy check) of the data received in the cache flash is the same as the CRC sent by the upper computer, the electric energy meter can determine that the received data has no problem.
(4) Transferring the data in the cache flash to a destination address;
at this time, knowing the total length of the received data, the data in the cache flash is transferred to the destination address.
In the conventional communication field, when dealing with the above packetization, the data packets received first are often buffered in a random access memory (ram), and after all the data packets are received completely, whether the data is complete is checked, and if the data is complete, all the data is successfully received. However, in the field of electric energy meters, since hardware RAMs of the electric energy meters are generally small, it is difficult to adopt the RAMs for caching. According to the method, the received data packets are stored in the cache flash, and after all the data packets are successfully received, the data in the cache flash are transferred to the destination address in the electric meter, so that the flash transfer can be used for overcoming the defect of low hardware resources of the electric energy meter, resources are saved, receiving errors of a plurality of packets of data are avoided, and the normal operation of the functions of the electric energy meter is ensured.
The invention also proposes a readable storage medium on which the computer program is stored. The readable storage medium may be the Memory 1004 in the electric energy meter of fig. 1, and may also be at least one of a ROM (Read-only Memory)/RAM (Random Access Memory), a magnetic disk, and an optical disk, where the storage medium includes several pieces of information for enabling the electric energy meter to perform the method according to the embodiments of the present invention.
The specific embodiment of the storage medium of the present invention is substantially the same as the embodiments of the data configuration method of the electric energy meter, and is not described herein again.
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 system 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 system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A data configuration method of an electric energy meter is characterized by comprising the following steps:
receiving each data sub-packet sent by an upper computer according to a time sequence, and sequentially storing each data sub-packet in a cache region;
checking whether each data sub-packet in the cache area has abnormal receiving;
if the receiving abnormality is determined, cleaning each data sub-packet in the cache region, and sending data configuration failure information to an upper computer so that the upper computer can resend the data sub-packets;
and if the receiving exception does not exist, transferring each data sub-packet in the cache area to a destination address storage area for storage.
2. The data arrangement method according to claim 1, wherein the step of receiving each data packet transmitted by the upper computer in time sequence comprises:
judging whether a multi-packet identifier sent by an upper computer is received;
if the multi-packet identifier is received, determining that the upper computer sends data in a packet mode;
the step of receiving each data sub-packet sent by the upper computer according to the time sequence comprises the following steps:
and if the upper computer is determined to send data in a sub-packet mode, receiving each data sub-packet sent by the upper computer according to the time sequence.
3. The data configuration method according to claim 2, wherein after the step of determining whether the multi-packet flag identifier sent by the upper computer is received, the method further comprises:
if the multi-packet identifier is not received, determining that the upper computer sends data in a total packet mode;
and receiving a data total packet sent by the upper computer, and directly storing the data total packet to a destination address storage area.
4. The data allocation method according to claim 1, wherein before the step of checking whether there is an abnormal reception in each of the data packets in the buffer, the method further comprises:
judging whether a preset sending completion identifier is received or not;
if the sending completion identifier is received, executing: and checking whether each data sub-packet in the buffer area has abnormal receiving.
5. The data configuration method of claim 4, wherein the data configuration method further comprises:
and if the sending completion identifier is not received within a preset time length from the time when the data packet sent last time is received, determining that abnormal receiving exists.
6. The data allocation method according to claim 1, wherein the step of transferring each packet of data in the buffer area to the destination address storage area for storage comprises:
splicing the data sub-packets in the cache region to obtain a data total packet;
and transferring the data total packet to a destination address storage area for storage.
7. The data allocation method according to claim 1, wherein the step of checking whether there is an abnormal reception in each of the data packets in the buffer area comprises:
receiving a preset theoretical check value sent by an upper computer;
calculating to obtain an actual check value in a preset check mode according to the zone bit information of each data sub-packet in the cache region;
comparing the theoretical verification value with the actual verification value;
if the receiving abnormity is determined to exist, the step of cleaning each data sub-packet in the cache region comprises the following steps:
and if the theoretical check value is inconsistent with the actual check value, cleaning each data sub-packet in the cache region.
8. The data allocation method according to claim 1, wherein the step of transferring each of the data packets in the buffer area to the destination address storage area for storage is followed by:
and sending the information of successful data configuration to the upper computer.
9. An electric energy meter, characterized by comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the data configuration method of the electric energy meter according to any one of claims 1 to 8.
10. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the data configuration method of an electric energy meter according to any one of claims 1 to 8.
CN202111231022.5A 2021-10-21 2021-10-21 Data configuration method of electric energy meter, electric energy meter and readable storage medium Pending CN114138542A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111231022.5A CN114138542A (en) 2021-10-21 2021-10-21 Data configuration method of electric energy meter, electric energy meter and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111231022.5A CN114138542A (en) 2021-10-21 2021-10-21 Data configuration method of electric energy meter, electric energy meter and readable storage medium

Publications (1)

Publication Number Publication Date
CN114138542A true CN114138542A (en) 2022-03-04

Family

ID=80394516

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111231022.5A Pending CN114138542A (en) 2021-10-21 2021-10-21 Data configuration method of electric energy meter, electric energy meter and readable storage medium

Country Status (1)

Country Link
CN (1) CN114138542A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115284268A (en) * 2022-08-01 2022-11-04 法奥意威(苏州)机器人系统有限公司 Data verification method and device, robot system, electronic device and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115284268A (en) * 2022-08-01 2022-11-04 法奥意威(苏州)机器人系统有限公司 Data verification method and device, robot system, electronic device and storage medium
CN115284268B (en) * 2022-08-01 2023-11-21 法奥意威(苏州)机器人系统有限公司 Data verification method, device, robot system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112217599B (en) Data frame receiving method and device, and communication method and system
EP3840265A1 (en) Method and apparatus for feeding back hybrid automatic repeat request of downlink data
US10153887B2 (en) Patch download with improved acknowledge mechanism
EP2141849A2 (en) System for transmitting and receiving packets with an error check code
CN103973421A (en) File transmitting method and device
CN113746892B (en) Remote upgrading method and wireless terminal equipment
CN111752579A (en) Bluetooth terminal upgrading method and device, storage medium and electronic equipment
CN114138542A (en) Data configuration method of electric energy meter, electric energy meter and readable storage medium
US20200213041A1 (en) Method and device for setting out-of-order value of network
US10033489B1 (en) Managing communications based on network conditions
CN109067503B (en) Data retransmission method and device
CN116466986A (en) Equipment software upgrading method and device of energy storage system, communication module and medium
CN114138541A (en) Data configuration method of electric energy meter, electric energy meter and readable storage medium
EP1662704A2 (en) Monitoring system, apparatus to be monitored, monitoring apparatus and monitoring method
CN114679383A (en) Firmware upgrading method, device, equipment, cascade system and storage medium
CN112217600A (en) Data frame receiving method and device, and communication method and system
CN114489718A (en) Firmware upgrading method, device, equipment and storage medium of tree connection system
CN111769913A (en) Data transmission method, electronic equipment and computer readable storage medium
US10277365B2 (en) Communication apparatus, communication control method, and computer program
CN112217601A (en) Data frame communication method and system
CN113986606B (en) Elevator program upgrading method, system, device and storage medium
CN117544280A (en) Message transmission method, system, device, equipment and storage medium
CN109660628B (en) Locomotive-vehicle-ground communication method
WO2023103985A1 (en) Microwave device-based data transmission method and apparatus, storage medium, and electronic device
CN117714550A (en) Data transmission method, system, equipment and storage medium

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