A method for identifying data units for electricity consumption information collection based on group number and bit number

By using a mathematical mapping function based on group number and position number and displacement calculation, the problems of high resource consumption and large computational latency in the existing technology are solved, and efficient data unit identification encoding and decoding is realized, which is suitable for multi-channel high-density data communication in smart grids.

CN120711095BActive Publication Date: 2025-10-28CHENGDU SUN HIGH-TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511234540.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-01
Publication Date
2025-10-28
Estimated Expiration
2045-09-01

AI Technical Summary

Technical Problem

Existing technologies, in the process of encoding and decoding data unit identifiers in accordance with the Q/GDW 1376.1 standard, suffer from bottlenecks such as high resource consumption, large computational latency, and difficulty in handling high-concurrency data transmission, and cannot meet the needs of multi-channel high-density data communication in smart grids.

Method used

An encoding and decoding method based on group number and position number is adopted. The measurement point number and function item number are converted into unique group number and position number through mathematical mapping function. Combined with displacement calculation, efficient identification encoding and decoding is achieved, avoiding table lookup and floating-point operation, which is suitable for resource-constrained embedded terminals.

Benefits of technology

It achieves efficient data unit identifier encoding and decoding in high-concurrency environments, is compatible with the Q/GDW 1376.1 standard, reduces resource consumption, and improves system response speed and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120711095B_ABST
    Figure CN120711095B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of power information acquisition and communication, and provides a method for identifying power consumption information acquisition data units based on group number and tag number. This method converts the measurement point number and function item number into group number and tag number within the group, respectively, and combines them to form information point identifiers and information class identifiers for constructing data unit identifiers. On the master station side, the system receives the number input, performs number mapping, and completes the data identifier construction and frame structure generation. On the terminal side, the system parses the received data frame, extracts the identifier field, and reverse-derives the original number to access the corresponding measurement point and function item data. This method eliminates the need for table lookups, avoids floating-point operations, supports efficient encoding and fast decoding, and is compatible with existing protocol structures. It has advantages such as clear structure, simple calculation, and low communication load, making it suitable for large-scale power information acquisition systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power information acquisition and communication, and specifically relates to a method for identifying power consumption information acquisition data units based on group number and tag number. Background Technology

[0002] With the rapid development of smart grids and the continuous improvement of information management levels for power users, the demand for data communication between power metering terminals, data collectors, concentrators, and the master station is increasing, especially in multi-channel, high-frequency data acquisition scenarios, which places higher demands on the structured coding efficiency, system response speed, and resource utilization of data transmission. To standardize communication standards for data acquisition systems, the State Grid Corporation of China has formulated and implemented the enterprise standard Q / GDW 1376.1 Communication Protocol for Power User Electricity Consumption Information Acquisition System Part 1: Communication Protocol between Master Station and Acquisition Terminal. This standard clearly defines the composition structure and encoding method of data unit identifiers, providing a unified specification for the representation of different measurement points and information categories in data frames.

[0003] In this standard, the data unit identifier consists of two parts: the information point identifier (DA) and the information category identifier (DT), used to indicate the location of the measurement point and the type of information, respectively. The information point identifier (DA) consists of DA1 and DA2, where DA1 is the intra-group identifier and DA2 is the information point group identifier; the information category identifier (DT) consists of DT1 and DT2, where DT1 is the intra-category identifier and DT2 is the information category group identifier. This structured design of group and identifiers theoretically supports the effective identification of 2040 measurement points and 248 functional items, exhibiting good scalability and uniformity.

[0004] In existing technologies, the encoding and decoding process of data unit identifiers mainly relies on the following methods: First, the group number and position number are obtained by performing integer division and modulo operations on the measurement point number or function item number; second, the position number is extracted using a lookup table method or a circular shift method; third, the decoding process relies on floating-point functions or lookup table structures for inverse operations. These methods achieve support for the Q / GDW standard to a certain extent, but still have several technical shortcomings.

[0005] On the one hand, traditional lookup table methods rely on a pre-built 256-byte offset table structure, which not only consumes valuable RAM or Flash resources but is also difficult to deploy in embedded platforms or resource-constrained devices. On the other hand, if floating-point logarithmic functions are used for bit parsing, the computational latency is significant, and most embedded chips lack hardware floating-point support, resulting in low processing efficiency. Furthermore, in high-concurrency data transmission or multi-task scheduling scenarios, existing implementations struggle to balance computational accuracy and system response speed, increasing the risk of communication bottlenecks.

[0006] In summary, while existing technologies comply with the requirements of the Q / GDW 1376.1 standard, they lack an implementation method that can simultaneously achieve high computational efficiency, low resource consumption, and accurate encoding and decoding capabilities, making it difficult to meet the actual needs of multi-channel, high-density data communication scenarios in smart grids. Summary of the Invention

[0007] To address the problems in the existing technology, this invention provides a method for identifying data units used in electricity consumption information collection based on group number and tag number, comprising the following steps:

[0008] Based on the preset measurement point number pn, calculate the corresponding information point identifier DA. The DA includes the position number DA1 and the group number DA2. The DA1 is an 8-bit byte containing only one bit of 1, and the DA2 is an unsigned integer.

[0009] The formula for calculating DA1 is as follows: ;

[0010] The formula for calculating DA2 is as follows: ;

[0011] Based on the preset function item number fn, calculate the corresponding information class identifier DT, where DT includes the tag number DT1 and the group number DT2, and DT1 is isomorphic to DA1;

[0012] The formula for calculating DT1 is as follows: ;

[0013] The formula for calculating DT2 is as follows: ;

[0014] The DA and DT are used as data acquisition units and encoded and transmitted between the main station and the acquisition terminal.

[0015] After receiving the data, the terminal or master station decodes and recovers pn and fn using the following formula:

[0016] ,

[0017] ,

[0018] in A function to determine the unique position of a 1 bit in an 8-bit byte.

[0019] Furthermore, .

[0020] Furthermore, if DA1 = 0x00 and DA2 = 0x00, it indicates an invalid information point address, which should be ignored by both the master station and the terminal.

[0021] If DA1 contains multiple bits that are "1", it is determined to be non-normal encoding and an abnormal response is triggered.

[0022] If DA2 = 0x00 or greater than 0xFF, it is considered a communication format error, and the data frame is discarded.

[0023] The function satisfies only in DA1 Defined under certain conditions, other values ​​should be marked as invalid input.

[0024] Furthermore, if DT1 = 0x00 or multiple bits are "1" simultaneously, the error is discarded or recorded.

[0025] If DT2 < 1 or > 255, the exception handling mechanism is triggered;

[0026] like If it is not an integer, then The function is undefined, therefore it is considered illegal input.

[0027] For all function item numbers Range detection is performed before encoding.

[0028] Furthermore, when constructing the read request frame, the master station specifies the measurement point number pn and the function item number fn;

[0029] The main station encodes pn and fn as DA1, DA2, DT1, and DT2 respectively;

[0030] Generate data unit identifier = DA1 + DA2 + DT1 + DT2;

[0031] The master station generates a complete request frame and sends the frame to the target terminal.

[0032] Furthermore, after receiving the request frame from the master station, the terminal extracts DA and DT from the data unit identifier field and parses out pn and fn;

[0033] Search the local database of the terminal for the measurement data value corresponding to the measurement point pn and function item fn;

[0034] Repeat the DA and DT fields from the original request frame, add the measurement data values, generate a complete response frame, and send it to the main station.

[0035] Furthermore, after receiving the frame sent back by the terminal, the master station extracts the DA and DT fields and restores pn and fn;

[0036] The main site displays or stores the received data based on the meanings of pn and fn.

[0037] Furthermore, Calculated using the following method:

[0038] like ,return , indicates illegal input;

[0039] Initialize variables ;

[0040] like (i.e., the high 4 bits are all 0), execute:

[0041] ,

[0042] ,

[0043] like (That is, the remaining 2 bits are still 0), execute:

[0044] ,

[0045] ,

[0046] calculate:

[0047] ,

[0048] Return k.

[0049] This invention constructs a data unit identifier encoding and decoding method based on group number and position number mapping, achieving efficient mapping and parsing of measurement point numbers and information class numbers in communication messages. Through mathematical transformation of measurement point numbers and function item numbers, they are mapped to unique group number and position number pairs respectively. Combined with displacement calculation, position number inversion is achieved, ensuring full compatibility with the existing Q / GDW 1376.1 communication protocol while logically guaranteeing the one-to-one correspondence and reversibility of the identifiers.

[0050] This method avoids the storage space consumption issues associated with traditional table lookup algorithms, while also avoiding reliance on floating-point operations and complex function calls, making it suitable for deployment on resource-constrained embedded terminals or microcontroller platforms. In high-concurrency or multi-threaded environments, this method can perform identifier encoding and parsing in parallel, exhibiting good timeliness and scalability. Attached Figure Description

[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0052] Figure 1 This is the main flowchart of the present invention. Detailed Implementation

[0053] To make the technical solution of the present invention clearer and more explicit, the present invention will be further described below with reference to specific embodiments. It should be understood that the embodiments are only used to illustrate the present invention and do not constitute a limitation on the scope of protection of the present invention.

[0054] This invention provides a method for identifying data units in electricity consumption information collection based on group number and tag number. It is applicable to systems conforming to the Q / GDW 1376.1 Electricity User Electricity Consumption Information Collection System Communication Protocol Part 1: Communication Protocol between Master Station and Collection Terminal standard. The aim is to perform unified and efficient identification encoding and decoding operations on multiple measurement points and data categories in communication data frames. It achieves a compact expression of measurement point numbers and information category numbers, and, in conjunction with mathematical mapping relationships, automates and programmatically processes message construction and parsing.

[0055] In the Q / GDW 1376.1 standard, the data unit identifier consists of the information point identifier (DA) and the information class identifier (DT), representing the information point and information type, as shown in Table 1.

[0056] Table 1 Data Unit Identifier Definition

[0057]

[0058] Information point DA consists of two bytes: information point element DA1 and information point group DA2. DA2 uses binary encoding to represent the information point group, and DA1 represents 1 to 8 information points in a certain information point group. Together, they form the information point identifier pn (n=1 to 2040), as shown in Table 2.

[0059] Table 2 Information Point Format

[0060]

[0061] When both DA1 and DA2 are "0", it indicates a terminal information point. This indicates that when DA1=FFH and DA2=00H, it represents all valid measurement points (excluding...). ).

[0062] The information point identifier pn corresponds to different information class identifiers Fn, which can be measurement point number, total group number, control cycle, DC analog quantity port number, or task number.

[0063] The information class DT consists of two bytes: information class element DT1 and information class group DT2. DT2 uses binary encoding to represent the information class group, and DT1 represents the 1 to 8 information types of a certain information class group. Together, they constitute the information class identifier. The format is shown in Table 3.

[0064] Table 3 Information Category Format

[0065]

[0066] A data unit is data organized according to its identifier, including parameters, commands, etc. The data organization order is as follows: first, data is processed in ascending order of pn, then in ascending order of Fn. That is, after processing all information classes Fn for one information point pi, the next data point is processed. The processing involves the terminal responding to the master station's parameter or data requests. If the terminal does not have a required data item, the corresponding flag bit of DT in the response message will be cleared. If the terminal only lacks part of a data item, then each byte of the missing part of the data item should be filled with "EEH".

[0067] In traditional electricity consumption information collection systems, measurement points are usually represented by bytes or word strings. Their identification method lacks structured expression and makes it difficult to balance the scalability of address space and computational efficiency. Especially in scenarios where terminal resources are limited or multiple tasks communicate concurrently, there is a certain frame parsing bottleneck.

[0068] Based on the DA / DT definition in the Q / GDW specification, this invention proposes a clear mapping function and inverse transformation logic, which enables the data unit identifier to have good compatibility and computing performance in embedded systems, concentrators and master station communication systems.

[0069] In the specific implementation process, the master station or acquisition terminal can automatically calculate the corresponding group number (DA2, DT2) and tag number (DA1, DT1) based on the measurement point number (pn) or information category number (fn), and construct the key fields in the data frame accordingly. During the reverse parsing process, the terminal extracts the DA and DT bytes from the received frame, and can quickly restore the corresponding pn and fn, thereby realizing the correct identification and classification of specific measurement data or control categories.

[0070] Example 1: Identification and Decoding Process of Information Point Identifier (DA)

[0071] In the State Grid Corporation of China's enterprise standard Q / GDW 1376.1, a data unit identification structure consisting of information point identifiers (Data Address, DA) is defined to achieve unique identification and access control of measurement point information between the master station and the acquisition terminal.

[0072] The standard specifies that the information point identifier consists of two parts:

[0073] DA1: One byte This is used to identify the position number within a group. It uses a bitwise encoding method, meaning that only one bit is allowed to be "1" and the rest of the bits are "0", thus representing the 1st to 8th information points in the current group.

[0074] DA2: One byte Used to identify the group number, it adopts a consecutive numbered binary encoding method, and the value range is 1~255.

[0075] Together, these two elements form a unique identifier for the measurement point, represented as:

[0076] ,

[0077] By combining DA1 and DA2, the entire measurement point numbering space can be expanded as follows:

[0078] Maximum number of measurement points = 255 × 8 = 2040 data points

[0079] This method has good structure, compactness and parsing efficiency, and is widely used in the data interaction process between concentrators, electricity meters and master stations.

[0080] The process of encoding information point numbers into DA.

[0081] Let the measurement point be numbered as follows:

[0082] This is used to uniformly number all physical or logical information points.

[0083] The present invention provides the following mathematical mapping, which encodes the measurement point number pn into the corresponding (DA1,DA2) value.

[0084] Calculation of group number DA2:

[0085] The group number of a measurement point is its position in the entire set of information points divided by the group number of each of the eight points in the group. The calculation formula is as follows:

[0086] ,

[0087] in, Taking the largest integer less than or equal to x is called "rounding down".

[0088] Calculation of tag number DA1:

[0089] The intra-group number is the sequence number of the measurement point within its group, numbered from 1 to 8, and is represented in the byte by setting only one bit.

[0090] The internal position number of the group is:

[0091] ,

[0092] Then the value of DA1 is the byte with the k-th bit (numbered from the least significant bit 1) set to 1, and its value is:

[0093] ,

[0094] ,

[0095] This expression is the mathematical closed form of DA1, and for any The only certainty.

[0096] The decoding process of DA inverse solution to measurement point number:

[0097] During communication, after receiving the (DA1, DA2) bytes, the receiver needs to reconstruct them into the corresponding measurement point number pn. This invention provides the following inverse mapping relationship:

[0098] ,

[0099] in:

[0100] Group number;

[0101] It is a function used to parse the position of the only bit in DA1 with a value of "1", numbered from 1 to 8 from the least significant bit.

[0102] The mathematical definition of a function is as follows:

[0103] Suppose that the value of DA1 satisfies:

[0104] ,

[0105] Right now:

[0106] ,

[0107] but:

[0108] ,

[0109] This definition is based on the following logic:

[0110] ,

[0111] but Therefore .

[0112] Therefore, we can obtain the position number within the group by simply taking the binary logarithm of DA1 and adding one.

[0113] Example verification:

[0114] If DA1 = 0x10 = 16, then , That is, the 5th in the group;

[0115] If DA1 = 0x04 = 4, then , .

[0116] By combining DA2, the measurement point number can be uniquely solved.

[0117] Specific examples of the encoding process

[0118] Let the measurement point be numbered as follows:

[0119] ,

[0120] Calculate group number:

[0121] ,

[0122] Calculate the tag number within the group:

[0123] ,

[0124] have to:

[0125] ,

[0126] Example of decoding process:

[0127] Suppose that the received data is:

[0128] ,

[0129] Decoding DA1:

[0130] ,

[0131] Restore measurement point number:

[0132] ,

[0133] Furthermore, to enhance system robustness, this invention also specifies the following exception handling mechanism:

[0134] If DA1 = 0x00 and DA2 = 0x00, it indicates an invalid information point address, which should be ignored by both the master station and the terminal.

[0135] If DA1 is invalid, that is, it contains multiple bits that are "1" at the same time, such as DA1 = 0x18 (binary 00011000), then it is determined to be non-standard encoding and an abnormal response can be triggered.

[0136] If DA2 is outside the valid range, i.e. DA2 = 0x00 or > 0xFF, it should be considered a communication format error and the data frame should be discarded.

[0137] The function satisfies only in DA1 Defined under certain conditions, other values ​​should be marked as invalid input.

[0138] Example 2: Identification and Decoding Process of Information Class Identifier (DT)

[0139] This embodiment focuses on the identification mechanism used to describe data function categories in a power user electricity consumption information collection system, specifically explaining the encoding rules, decoding methods, and mathematical mapping principles of the Data Type (DT) identifier. This mechanism can achieve unified identification of various collected data types such as voltage, current, active energy, reactive power, and frequency.

[0140] The structural definition of the information class identifier (DT):

[0141] According to the definition in the Information Collection Communication Protocol Q / GDW 1376.1, the information class identifier consists of two fields:

[0142] DT1: One byte (8 bits) is used to identify the function item number within the class group. It uses a bitwise encoding method, that is, only one bit is "1".

[0143] DT2: One byte (8 bits) is used to represent the data function category group number, which is encoded using natural numbers.

[0144] Therefore, the complete information class identifier DT is represented as:

[0145] ,

[0146] The maximum number of functional items that can be represented is:

[0147] ,

[0148] This type of identification method can uniformly encode all function types (such as phase A voltage, total active power, current demand, etc.), and is suitable for communication scenarios such as master station reading, terminal reporting, and event reporting.

[0149] Encoding process from function item number to DT

[0150] Let the function item number be:

[0151] ,

[0152] This invention provides the following mapping relationship:

[0153] Calculation of class group number DT2:

[0154] ,

[0155] in, This indicates rounding down to the nearest integer.

[0156] Calculation of the group number DT1:

[0157] ,

[0158] ,

[0159] ,

[0160] Note: Only the first DT1 value is present. One bit is "1" and the rest are "0", indicating that the first bit in the group is "1". Each function item.

[0161] This encoding mechanism enables a unique mapping from the function item number fn to the two-byte DT.

[0162] Decoding process of information class identifiers:

[0163] The decoding process involves restoring the DT field to its corresponding function item number fn, and the calculation formula is as follows:

[0164] ,

[0165] Among them, the function The bit number used to calculate the unique "1" bit in DT1 (starting from the least significant bit) is defined as:

[0166] ,

[0167] The definition of this function is the same as in Example 1.

[0168] Decoding example:

[0169] Let DT1 = 0x20 = 32, DT2 = 0x05 = 5;

[0170] but:

[0171] ,

[0172] ,

[0173] Therefore, the function item number corresponding to this DT field is 38, which may represent a measurement data such as "total positive active energy" or "total apparent power".

[0174] The following lists some typical functional items and their corresponding DT encoding methods (for illustration only, not limited to fixed numbers):

[0175] Table 4 DT Encoding

[0176]

[0177] This invention can efficiently map and restore the above function item numbers, ensuring the consistency of functions in communication commands and response frames.

[0178] Furthermore, to ensure the legality of data unit identifiers and the system's fault tolerance, this invention specifies the following boundary detection rules:

[0179] If DT1 = 0x00 or multiple bits are "1" at the same time, it indicates an illegal bit number within the class group, and should be discarded or the error recorded.

[0180] If DT2 < 1 or > 255, it indicates that the group number is out of bounds, and the exception handling mechanism should be triggered.

[0181] like If it is not an integer (i.e., DT1 is not a power of 2), then The function is undefined and should be considered illegal input.

[0182] For all function item numbers Range testing should be performed before encoding.

[0183] Example 3: As Figure 1 As shown, this illustrates the embedding and processing of the DA / DT field in the main station query command and terminal response frame.

[0184] In the State Grid enterprise standard Q / GDW 1376.1, the communication interaction between the master station and the acquisition terminal is based on a request-response structure, which is widely used for the acquisition of data such as voltage, current, and electrical energy.

[0185] The master station accesses specific data units in the terminal by issuing "read data" commands, specifying the address of the target data unit in the command. This address is identified by the following two structures:

[0186] Data Address (DA): Used to specify which measurement point in the terminal;

[0187] Data Type (DT): Used to specify which type of data is being measured, such as voltage, electrical energy, power, etc.

[0188] This invention uses a “group number + position number” encoding method to accurately construct DA and DT into the communication frame, and completes the terminal response construction and master station frame parsing through a symmetrical mathematical decoding method, thereby improving the structured expression capability and instruction processing efficiency of the communication process.

[0189] Embedding process of DA and DT in the main station request frame:

[0190] When constructing a read request frame, the master station needs to specify:

[0191] Measurement point number pn;

[0192] Function item number fn.

[0193] The main station encodes pn and fn according to the rules in Embodiments 1 and 2 of this invention as follows:

[0194] ,

[0195] ,

[0196] Combine them as:

[0197] ,

[0198] Then, embed the above two fields into the "Data Unit Identifier Field" part of the data field structure to generate the following structure:

[0199] Data unit identifier = DA1 + DA2 + DT1 + DT2

[0200] The master station then encapsulates the communication header, control field, address field and other fields to form a complete request frame, and sends the frame to the target terminal through the link layer or network layer.

[0201] Construction and feedback process of DA / DT fields in terminal response frames:

[0202] After receiving the request frame from the master station, the acquisition terminal extracts DA and DT from the data unit identifier field and performs the following operations:

[0203] Perform a reverse mapping on the DA to restore the measurement point number:

[0204] ,

[0205] Perform a reverse mapping on DT to restore the function item number:

[0206] ,

[0207] Search the local database on the terminal for the data values ​​corresponding to the measurement point pn and function item fn. ,For example:

[0208] This represents the "total active power at point 129".

[0209] This indicates the voltage of phase A at point 12.

[0210] Construct the response frame data field:

[0211] Repeat the DA and DT fields from the original request frame;

[0212] Add the corresponding data value (e.g., a 4-byte floating-point number or a BCD encoded value);

[0213] Additional fields such as time stamps, data flags, and status words can be added optionally.

[0214] Finally, a complete response frame is generated and sent back to the master station via the link layer.

[0215] The process of the main station parsing DA / DT and data values ​​in the response frame:

[0216] After receiving the frame returned by the terminal, the master station extracts the DA and DT fields and restores them using the following mathematical inverse mapping:

[0217] Measurement point number:

[0218] ,

[0219] Function item number:

[0220] ,

[0221] The main site can determine the database or system interface based on... The meaning of this is to automatically classify and display data, perform curve analysis, or store it in a historical database.

[0222] Example 4: DA / DT Encoding / Decoding Implementation Mechanism Based on Branch-Shift Algorithm

[0223] This embodiment provides a method for extracting the tag number of information point identifier (DA) and information class identifier (DT) based on the branch displacement algorithm. It is used to solve the problems of long table lookup time, high space consumption and unsuitability for resource-constrained platforms in traditional methods, and achieve low complexity and high efficiency of identifier decoding.

[0224] Although rigorous mathematical mapping relationships are given in Examples 1-3, in practical engineering, floating-point logarithmic functions (such as...) are directly used. Using this method to calculate the bit positions in DA1 or DT1 will lead to the following problems:

[0225] Embedded chips do not support floating-point operations or have large operation latency;

[0226] If a lookup table method is used, a 256-byte bit location table needs to be stored, which occupies valuable RAM or Flash space;

[0227] In multi-core systems or high-concurrency scenarios, table lookups are susceptible to cache invalidation, which can affect system response time.

[0228] Therefore, this embodiment proposes a pure logic implementation method based on the branch-shift algorithm for rapid implementation.

[0229] It achieves efficient encoding and decoding of DA and DT, and features "zero table lookup, zero division, and zero floating point".

[0230] Let the input parameters be... For an 8-bit unsigned integer, satisfying:

[0231] ,

[0232] Define function Used to return The position of the only 1 in the middle is denoted as:

[0233] ,

[0234] This function uses the following branch displacement calculation steps:

[0235] 1. If ,return , indicates illegal input;

[0236] 2. Initialize variables ;

[0237] 3. If (i.e., the high 4 bits are all 0), execute:

[0238] ,

[0239] ,

[0240] 4. If (That is, the remaining 2 bits are still 0), execute:

[0241] ,

[0242] ,

[0243] calculate:

[0244] ,

[0245] 5. Return k.

[0246] This algorithm requires only 1 to 3 steps of judgment and multiplication operations, and its computational complexity is much lower than that of traditional circular shift methods. It can complete the decoding of DA1 or DT1 in constant time.

[0247] For any module structures not specifically defined in this invention, the existing technical descriptions shall prevail. The prior art mentioned in the foregoing background and specific embodiments sections can be considered part of this invention and used to understand the meaning of certain technical features or parameters.

Claims

1. A method for identifying data units in electricity consumption information collection based on group number and tag number, characterized in that, The method is applicable to the processing of electricity consumption information data conforming to the Q / GDW 1376.1 communication protocol, and includes the following steps: Based on the preset measurement point number pn, calculate the corresponding information point identifier DA. The DA includes the bit number DA1 and the group number DA2. The DA1 is an 8-bit byte containing only one bit of 1, and the DA2 is an unsigned integer. The formula for calculating DA1 is as follows: ; The formula for calculating DA2 is as follows: ; Based on the preset function item number fn, calculate the corresponding information class identifier DT, where DT includes the tag number DT1 and the group number DT2, and DT1 is isomorphic to DA1; The formula for calculating DT1 is as follows: ; The formula for calculating DT2 is as follows: ; The DA and DT are used as data acquisition units and encoded and transmitted between the main station and the acquisition terminal. Indicates rounding down; After receiving the data, the terminal or master station decodes and recovers pn and fn using the following formula: ; ; HighestBit() is a function that determines the unique position of a 1 bit in an 8-bit byte; 。 2. The method for identifying data units of electricity consumption information collection based on group number and tag number according to claim 1, characterized in that: If DA1 = 0x00 and DA2 = 0x00, it indicates an invalid information point address, which should be ignored by both the master station and the terminal. If DA1 contains multiple bits that are "1", it is determined to be non-canonical encoding and an abnormal response is triggered. If DA2 = 0x00 or greater than 0xFF, it is considered a communication format error, and the data frame is discarded. The HighestBit function is satisfied only in DA1. Defined under certain conditions, other values ​​should be marked as invalid input.

3. The method for identifying electricity consumption information collection data units based on group number and tag number according to claim 1, characterized in that: If DT1 = 0x00 or multiple bits are "1" at the same time, discard or record the error; If DT2 < 1 or DT2 > 255, the exception handling mechanism is triggered; like If the input is not an integer, it is considered an illegal input. For all function item numbers Range detection is performed before encoding.

4. The method for identifying data units of electricity consumption information collection based on group number and tag number according to claim 1, characterized in that: When constructing the read request frame, the master station specifies the measurement point number pn and the function item number fn; The main station encodes pn and fn as DA1, DA2, DT1, and DT2 respectively; Generate data unit identifier = DA1 + DA2 + DT1 + DT2 The master station generates a complete request frame and sends the frame to the target terminal.

5. The method for identifying electricity consumption information collection data units based on group number and tag number according to claim 1, characterized in that: After receiving the request frame from the master station, the terminal extracts DA and DT from the data unit identifier field and parses out pn and fn; Search the local database of the terminal for the measurement data value corresponding to the measurement point pn and function item fn; Repeat the DA and DT fields from the original request frame, add the measurement data values, generate a complete response frame, and send it to the main station.

6. The method for identifying data units of electricity consumption information collection based on group number and tag number according to claim 1, characterized in that: After receiving the frame sent back by the terminal, the master station extracts the DA and DT fields and restores pn and fn. The main site displays or stores the received data based on the meanings of pn and fn.

7. The method for identifying data units of electricity consumption information collection based on group number and tag number according to claim 1, characterized in that: HighestBit(x) is calculated as follows: If x=0, return k=0, indicating invalid input; Initialize variable n ← 7; If x < 16, execute: n←n-4 x←x×16 If x < 64, execute: n←n-2 x←x×4 calculate: , Return k.

Citation Information

Patent Citations

  • Internet of Things equipment data processing method, meter reading system and equipment terminal

    CN117938911A