Electric energy meter protocol de-framing method and device, electronic equipment and storage medium

Through the frame and solution frame functions designed for data types, combined with the application protocol data unit analysis and dichotomous search technology of the State Grid 698 protocol, the problem of high difficulty in code expansion and maintenance in traditional methods is solved, and code saving and easy maintenance are achieved and efficient expansion improves the efficiency and reliability of smart grid communication.

CN119316498APending Publication Date: 2025-01-14SHENZHEN TECHRISE ELECTRONICS

Patent Information

Application Number
CN202411308922.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

When dealing with the power meter protocol, the traditional object-oriented framing and disframing design method leads to code expansion, high maintenance difficulty, low efficiency and waste of resources. Especially when frequent protocol expansion and functional requirements increase, the repeated writing of disframing and framing is performed. Functions cause waste of resources.

Method used

It adopts a general frame and solution frame function designed for data type, combines the application protocol data unit analysis and dichotomy of the State Grid 698 protocol to find object configuration information, and performs frame or solution frame operations based on object and sub-member information, simplifying the code logic. Improves code reusability and maintainability.

Benefits of technology

It effectively solves the problems of large code size, high maintenance difficulty and low efficiency, realizes code space saving, easy maintenance, and efficient expansion, and improves the reliability and efficiency of smart grid communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316498A_ABST
    Figure CN119316498A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an electric energy meter protocol de-framing method and device, electronic equipment and a storage medium, and relates to the technical field of communication protocol processing, and the method comprises the steps: obtaining a service type and an object identifier according to APDU analysis of a state grid 698 protocol, obtaining object configuration information through searching by a dichotomy method, and obtaining an object identifier; obtaining member number limitation, operation authority and multiple sub-member information of the object, reading corresponding sub-member data information, if the service type is a read object, framing according to the data type and length of the multiple sub-member data information, and if the service type is a write object, framing according to the data type and length of the multiple sub-member data information; if yes, deframing is carried out according to the data type and length of the data information of the multiple sub-members, and the data information is written into corresponding data source positions and stored. According to the method, the problems of large code volume, high maintenance difficulty, low efficiency and resource waste caused by repeatedly compiling the framing and de-framing functions in the prior art are solved by designing the universal framing and de-framing functions for the data types and combining the configuration parameters and the linked list lookup technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of communication protocol processing, and in particular to a method, device, electronic equipment and storage medium for de-framing an electric energy meter protocol. Background Art

[0002] With the rapid development of smart grid technology, State Grid's 698 protocol, as an important standard for power communication, plays a key role in data exchange between power equipment such as electricity meters.

[0003] However, the traditional object-oriented framing and deframing design methods gradually exposed many problems in the face of the growing functional requirements of electric energy meters and frequent protocol expansion. Although manufacturers use object-oriented methods to define many objects and their deframing and framing functions, this method leads to a sharp expansion of the code volume and significantly increases the difficulty of maintenance. Especially when the read and write operations of the same object or the members between different objects need to follow the same protocol format, the practice of repeatedly writing deframing and framing functions is not only inefficient, but also causes a huge waste of resources.

[0004] Therefore, there is an urgent need for an electric meter protocol deframing method that can simplify the 698 protocol application layer framing and deframing process of the State Grid, improve code reusability and maintainability, and improve the reliability and efficiency of smart grid communications. Summary of the invention

[0005] The embodiments of the present invention provide a method for de-framing an electric energy meter protocol to solve the problem of repeated writing of de-framing and framing functions in the prior art, resulting in large code size, high maintenance difficulty, low efficiency and waste of resources. The technical solution is as follows:

[0006] According to one aspect of the present invention, a method for deframing an electric energy meter protocol comprises: obtaining a service type and an object identifier according to the application protocol data unit of the State Grid 698 protocol, performing a binary search on the object identifier to obtain object configuration information; obtaining a member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, and reading corresponding sub-member data information according to each sub-member information; if the service type is to read an object, framing is performed according to the data type and length of the multiple sub-member data information; if the service type is to write an object, deframing is performed according to the data type and length of the multiple sub-member data information and writing into the corresponding data source location and saving.

[0007] In one of the embodiments, the object configuration information is a structure; the object configuration information includes the maximum index of the object, read and write permissions, special tags, data types and sub-member information.

[0008] In one embodiment, the sub-member information is a structure; the sub-member information includes the object's operation mode, data source length, RAM address, EEPROM address, default value address, sub-member data offset, sub-member data length, number of identical sub-members, sub-member data information and next-level sub-member information.

[0009] In one of the embodiments, the sub-member data information is a structure or a structure array; the sub-member data information includes the data type, data length, number of next-level sub-members, and next-level sub-member information of the sub-member.

[0010] According to one aspect of the present invention, a device for deframing an electric energy meter protocol comprises: an object information search module, for obtaining a service type and an object identifier according to the application protocol data unit of the State Grid 698 protocol, and performing a binary search on the object identifier to obtain object configuration information; a member information reading module, for obtaining a member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, and reading corresponding sub-member data information according to each sub-member information; a data framing module, for framing according to the data type and length of multiple sub-member data information when the service type is to read the object; and a data deframing module, for deframing according to the data type and length of multiple sub-member data information when the service type is to write the object, and writing and saving the deframing into the corresponding data source location.

[0011] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the electric energy meter protocol de-framing method as described above.

[0012] According to one aspect of the present invention, a storage medium stores computer-readable instructions thereon, wherein the computer-readable instructions are executed by one or more processors to implement the electric energy meter protocol de-framing method as described above.

[0013] The beneficial effects brought by the technical solution provided by the present invention are:

[0014] In the above technical scheme, the present invention first parses the application protocol data unit of the State Grid 698 protocol to obtain the service type and object identifier, performs a binary search on the object identifier to obtain the object configuration information, and then obtains the member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, reads the corresponding sub-member data information according to each sub-member information, and if the service type is to read the object, the frame is assembled according to the data type and length of the multiple sub-member data information; if the service type is to write the object, the frame is unframed according to the data type and length of the multiple sub-member data information and written into the corresponding data source location and saved. By designing a general framing and unframing function for the data type, combined with configuration parameters and linked list search technology, it has the advantages of code space saving, easy maintenance, efficient expansion, etc. It is an innovative framing and unframing implementation method, which can effectively solve the problems of repeated writing of unframing and framing functions in the prior art, resulting in large code volume, high maintenance difficulty, low efficiency and waste of resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0016] Figure 1 is a flow chart of a method for de-framing an electric energy meter protocol according to an exemplary embodiment;

[0017] Figure 2 It is a flowchart of a reading object in a method of de-framing an electric energy meter protocol in an application scenario;

[0018] Figure 3 yes Figure 2 A schematic diagram of the process of framing sub-member data information in the corresponding application scenario;

[0019] Figure 4 yes Figure 2 Schematic diagram of the process of writing objects in the corresponding application scenario;

[0020] Figure 5 yes Figure 4 A schematic diagram of the process of deframing sub-member data information in the corresponding application scenario;

[0021] Figure 6 is a block diagram of a device for de-framing a protocol of an electric energy meter according to an exemplary embodiment;

[0022] Figure 7 is a hardware structure diagram of an electronic device according to an exemplary embodiment;

[0023] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0024] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.

[0025] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0026] State Grid 698 Protocol: It is an important specification for electric energy meter communication in China's power industry. This protocol is an object-oriented communication protocol, widely used in data exchange between master station and acquisition terminal, acquisition terminal and electric energy meter, master station and electric energy meter. This protocol specifies the communication protocol, data format, transmission method, etc. between electric energy meter and acquisition equipment, ensuring the stable and accurate transmission of electric energy data.

[0027] APDU: Application Protocol Data Unit, is a protocol for communication between smart cards and card readers. APDU defines the data format and rules transmitted in the interaction, allowing the card reader to send instructions and receive responses.

[0028] The present invention provides an electric energy meter protocol deframing method, which designs a universal framing and deframing function for data types, combines configuration parameters and linked list search technology, has the advantages of code space saving, easy maintenance, efficient expansion, etc., solves the problem of repeated writing of deframing and framing functions in the prior art, resulting in large code volume, high maintenance difficulty, low efficiency and waste of resources. The electric energy meter protocol deframing method is suitable for an electric energy meter protocol deframing device, which can be an electronic device. The electric energy meter protocol deframing method in the embodiment of the present invention can be applied to a variety of scenarios, such as electric energy meter protocol deframing, etc.

[0029] See also Figure 1 , an embodiment of the present invention provides a method for de-framing an electric energy meter protocol, which is applicable to electronic equipment.

[0030] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.

[0031] like Figure 1 As shown, the method may include the following steps:

[0032] Step 110, parse the application protocol data unit of the State Grid 698 protocol to obtain the service type and object identifier, and perform a binary search on the object identifier to obtain the object configuration information.

[0033] Specifically, an APDU (Application Protocol Data Unit) is parsed from the received data packet. The APDU includes a service type (such as a read object, a write object, etc.) and an object identifier (usually an ID or index for uniquely identifying an object).

[0034] Furthermore, a binary search algorithm is used to search for the object identifier in the existing object configuration information table. The object configuration information table is a data structure containing all object configuration information, usually stored in some form (such as an array, hash table, etc.). The binary search algorithm quickly locates the object configuration information by continuously halving the search interval until the corresponding object identifier is found or it is determined that the object does not exist.

[0035] Step 130, obtaining the member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, and reading the corresponding sub-member data information according to each sub-member information.

[0036] Specifically, the member number limit (such as the maximum number of members), operation permissions (such as read-only, write-only, read-write, etc.) and sub-member information list of the object are extracted from the object configuration information.

[0037] Furthermore, the sub-member information list is traversed, and for each sub-member, the corresponding sub-member data is read according to its information (such as operation mode, data source length, RAM address, EEPROM address, etc.), and the RAM address or EEPROM address of the sub-member information is used to read the data from the corresponding storage location.

[0038] Step 150: If the service type is a read object, framing is performed according to the data types and lengths of the plurality of sub-member data information.

[0039] Specifically, first confirm that the service type is a read object, then traverse all sub-member data information, and frame the read data according to the format of the State Grid 698 protocol based on the data type and length of each sub-member. During the framing process, it is necessary to ensure that the data sequence, format, checksum, etc. meet the protocol requirements.

[0040] Step 170: If the service type is to write an object, deframe the data according to the data type and length of the data information of the plurality of sub-members and write the data into the corresponding data source location and save it.

[0041] Specifically, first confirm that the service type is a write object, then parse the data to be written from the received data packet, and deframe it according to the format of the State Grid 698 protocol. During the deframing process, it is necessary to verify whether the integrity and format of the data meet the protocol requirements. According to the RAM address or EEPROM address of the sub-member information, the deframed data is written to the corresponding storage location. If there are default values ​​or fields that require special processing, they should also be processed accordingly before writing. After writing the data, perform some additional save operations according to system requirements, such as updating the data in the EEPROM, generating log files, etc.

[0042] In a possible implementation, the object configuration information is a structure, and the object configuration information includes the maximum index of the object, read and write permissions, special tags, data types, and child member information.

[0043] In one possible implementation, the sub-member information is a structure, which includes the object's operation mode, data source length, RAM address, EEPROM address, default value address, sub-member data offset, sub-member data length, number of identical sub-members, sub-member data information and next-level sub-member information.

[0044] In a possible implementation, the sub-member data information is a structure or a structure array, and the sub-member data information includes the data type of the sub-member, the data length, the number of next-level sub-members, and next-level sub-member information.

[0045] Through the above process, the present invention first obtains the service type and object identifier according to the application protocol data unit of the State Grid 698 protocol, performs a binary search on the object identifier to obtain the object configuration information, and then obtains the member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, reads the corresponding sub-member data information according to each sub-member information, and if the service type is a read object, frames are formed according to the data type and length of the multiple sub-member data information; if the service type is a write object, frames are deframed according to the data type and length of the multiple sub-member data information and written into the corresponding data source location and saved. By designing a general framing and deframing function for the data type, combined with configuration parameters and linked list search technology, it has the advantages of code space saving, easy maintenance, efficient expansion, etc., and is an innovative framing and deframing implementation method, thereby effectively solving the problems of large code volume, high maintenance difficulty, low efficiency and resource waste caused by repeated writing of deframing and framing functions in the prior art.

[0046] In one application scenario, Figure 2 A flowchart of reading objects in an energy meter protocol de-framing method is shown. Figure 3 It shows a flowchart of writing objects. Figure 4 The schematic diagram of the process of sub-member data information framing is shown. Figure 5 A schematic diagram of the process of deframing sub-member data information is shown;.

[0047] like Figure 2 As shown, first determine whether the service type is read. If so, give the protocol object to find the configuration information, then obtain the first sub-member information according to the configuration information, and then traverse each sub-member: obtain the original data according to the sub-member data source information until the data of all sub-members are obtained, find the configuration information based on the protocol object, and then obtain the first sub-member information according to the configuration information, and then traverse each sub-member: frame according to the framing information of the sub-member information until all sub-members are framed, and then end the reading object.

[0048] like Figure 3 As shown, the child member data information is a structure array. After the first grandchild member is framed, the next grandchild member information will continue to be read until the last grandchild member. The information of each grandchild class member is obtained by traversing the linked list for framing.

[0049] like Figure 4As shown, first determine whether the service type is write. If so, give the protocol object to find the configuration information, then get the first sub-member information according to the configuration information, and then traverse each sub-member: parse the original data according to the sub-member data information of the sub-member information until the original data of all sub-members are obtained, find the configuration information based on the protocol object, and then get the first sub-member information according to the configuration information, and then traverse each sub-member: write the data source location according to the data source information of the sub-member information and save it until the data of all sub-members are written and saved, and then end the write object.

[0050] like Figure 5 As shown, the child member data information is a structure array. After the first grandchild member is deframed, the next grandchild member information will continue to be read until the last grandchild member. The information of each grandchild class member is obtained by traversing the linked list for deframing.

[0051] Through the above process, the embodiment of the present invention effectively solves the problem of large code volume and difficult maintenance in traditional object-oriented design by designing a general framing and deframing function for data types and combining configuration parameters and linked list search technology. This solution has the advantages of code space saving, easy maintenance, and efficient expansion, and is an innovative framing and deframing implementation method.

[0052] The following is an embodiment of the device of the present invention, which can be used to execute the electric energy meter protocol de-framing method involved in the present invention. For details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment of the electric energy meter protocol de-framing method involved in the present invention.

[0053] See also Figure 6 In an embodiment of the present invention, a device 800 for de-framing a protocol of an electric energy meter is provided.

[0054] The electric energy meter protocol deframing device 800 includes but is not limited to: an object information search module 810 , a member information reading module 830 , a data framing module 850 and a data deframing module 870 .

[0055] Among them, the object information search module 810 is used to parse the application protocol data unit of the State Grid 698 protocol to obtain the service type and object identifier, and perform a binary search on the object identifier to obtain the object configuration information.

[0056] The member information reading module 830 is used to obtain the member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, and read the corresponding sub-member data information according to each sub-member information.

[0057] The data framing module 850 is used to perform framing according to the data types and lengths of multiple sub-member data information when the service type is to read an object.

[0058] The data de-framing module 870 is used to de-frame and write and save the corresponding data source location according to the data type and length of the data information of multiple sub-members when the service type is writing an object.

[0059] It should be noted that, when the electric energy meter protocol deframing is provided in the above embodiment, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the electric energy meter protocol deframing device will be divided into different functional modules to complete all or part of the functions described above.

[0060] In addition, the embodiments of the electric energy meter protocol deframing device and the electric energy meter protocol deframing method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0061] Figure 7 The present invention schematically illustrates the structure of an electronic device according to an exemplary embodiment.

[0062] It should be noted that the electronic device is only an example adapted to the present invention and cannot be considered to provide any limitation on the scope of use of the present invention. The electronic device cannot be interpreted as requiring dependence on or having Figure 7 One or more components of exemplary electronic device 2000 are shown.

[0063] The hardware structure of the electronic device 2000 may vary greatly due to differences in configuration or performance, such as Figure 7 As shown, the electronic device 2000 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU) 270.

[0064] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the electronic device 2000 .

[0065] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted by the present invention, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc. Figure 7 As shown, this is not intended to be a specific limitation.

[0066] The memory 250 is a carrier for storing resources, which may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method may be temporary storage or permanent storage.

[0067] Among them, the operating system 251 is used to manage and control various hardware devices and application programs 253 on the electronic device 2000 to enable the central processing unit 270 to calculate and process the massive data 255 in the memory 250. It can be Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0068] The application program 253 is a computer-readable instruction that performs at least one specific task based on the operating system 251, and may include at least one module ( Figure 7 (not shown), each module may respectively contain computer-readable instructions for the electronic device 2000. For example, the electric energy meter protocol de-framing device may be regarded as an application 253 deployed in the electronic device 2000.

[0069] The data 255 may be signal information, etc., stored in the memory 250 .

[0070] The central processor 270 may include one or more processors, and is configured to communicate with the memory 250 through at least one communication bus to read the computer-readable instructions stored in the memory 250, thereby realizing the operation and processing of the mass data 255 in the memory 250. For example, the electric energy meter protocol de-framing method is completed by the central processor 270 reading a series of computer-readable instructions stored in the memory 250.

[0071] In addition, the present invention can also be implemented by hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present invention is not limited to any specific hardware circuits, software, or a combination of the two.

[0072] See also Figure 8 In an embodiment of the present invention, an electronic device 4000 is provided. The electronic device 4000 may include: a desktop computer, a laptop computer, a server, etc. with sensor recognition capability.

[0073] exist Figure 8 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0074] The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0075] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception, etc. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0076] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0077] The memory 4003 can be a ROM (Read On Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrical Erasable Programmable Read On Memory), a CD-ROM (Compact Disk Read On Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 4000, but is not limited to this.

[0078] Computer-readable instructions are stored in the memory 4003 , and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .

[0079] The computer-readable instructions are executed by one or more processors 4001 to implement the electric energy meter protocol de-framing method in the above-mentioned embodiments.

[0080] In addition, an embodiment of the present invention provides a storage medium on which computer-readable instructions are stored. The computer-readable instructions are executed by one or more processors to implement the electric energy meter protocol de-framing method as described above.

[0081] A computer program product is provided in an embodiment of the present invention. The computer program product includes computer-readable instructions, which are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements the electric energy meter protocol deframing method as described above.

[0082] Compared with the related art, the present invention has the following beneficial effects:

[0083] 1. The present invention first parses the application protocol data unit of the State Grid 698 protocol to obtain the service type and the object identifier, performs a binary search on the object identifier to obtain the object configuration information, and then obtains the member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, reads the corresponding sub-member data information according to each sub-member information, and if the service type is a read object, frames are formed according to the data types and lengths of the multiple sub-member data information; if the service type is a write object, frames are deframed according to the data types and lengths of the multiple sub-member data information and written into the corresponding data source location and saved. By designing a general framing and deframing function for the data type, combined with configuration parameters and linked list search technology, it has the advantages of code space saving, easy maintenance, efficient expansion, etc., and is an innovative framing and deframing implementation method, thereby effectively solving the problems of repeated writing of deframing and framing functions in the prior art, resulting in large code volume, high maintenance difficulty, low efficiency and resource waste.

[0084] 2. The present invention can improve the accuracy and efficiency of data processing: by accurately parsing APDU, the service type and object identifier can be accurately identified, thereby ensuring the correctness of subsequent operations. The binary search method is used to search for object configuration information, which can significantly improve the search speed compared to linear search, especially when the number of objects is large.

[0085] 3. The present invention can enhance the flexibility and scalability of the system: dynamically adjust the member number limit, operation authority, etc. of the object according to the object configuration information, so that the system can flexibly adapt to different application scenarios and needs. Taking the scalability of the system into consideration, the system's functions can be easily expanded by adding new object identifiers and configuration information.

[0086] 4. The present invention can optimize the data interaction process: framing and deframing are performed according to the data type and length of the sub-member data information, which simplifies the data interaction process and reduces the possibility of errors. Both the reading object and the writing object can provide a corresponding data processing mechanism to support complex data interaction requirements.

[0087] 5. The present invention can improve the security and stability of the system: through the management of operating permissions, illegal operations can be effectively prevented and the security of the system can be improved. During the data transmission process, the data can be verified through frame verification and other methods to ensure the integrity and correctness of the data, thereby improving the stability of the system.

[0088] 6. The present invention facilitates system maintenance and upgrading: it adopts a modular design, and each part is relatively independent, which facilitates system maintenance and upgrading. By following the State Grid 698 protocol, the system can achieve seamless docking with other devices or systems that follow the protocol, reducing the difficulty of system integration and maintenance.

[0089] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0090] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for de-framing an electric energy meter protocol, characterized in that: The method comprises: According to the application protocol data unit of the State Grid 698 protocol, the service type and the object identifier are obtained by parsing, and the object identifier is searched by binary search to obtain the object configuration information; Obtaining the member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, and reading corresponding sub-member data information according to each sub-member information; If the service type is a read object, framing is performed according to the data types and lengths of the plurality of sub-member data information; If the service type is to write an object, the data is deframed according to the data type and length of the plurality of sub-member data information, written into the corresponding data source location and saved.

2. The electric energy meter protocol de-framing method according to claim 1, characterized in that: The object configuration information is a structure; the object configuration information includes the maximum index of the object, read and write permissions, special tags, data types and sub-member information.

3. The electric energy meter protocol de-framing method according to claim 1, characterized in that: The sub-member information is a structure; the sub-member information includes the object's operation mode, data source length, RAM address, EEPROM address, default value address, sub-member data offset, sub-member data length, number of identical sub-members, sub-member data information and next-level sub-member information.

4. The electric energy meter protocol de-framing method according to claim 1, characterized in that: The sub-member data information is a structure or a structure array; the sub-member data information includes the data type, data length, number of next-level sub-members, and next-level sub-member information of the sub-member.

5. A device for de-framing an electric energy meter protocol, characterized in that: The device comprises: An object information search module is used to parse the application protocol data unit of the State Grid 698 protocol to obtain the service type and object identifier, and perform a binary search on the object identifier to obtain the object configuration information; A member information reading module, used to obtain the member number limit, operation authority and multiple sub-member information of the object according to the object configuration information, and read the corresponding sub-member data information according to each sub-member information; A data framing module, used for framing according to the data types and lengths of the plurality of sub-member data information when the service type is a read object; The data de-framing module is used to de-frame and write into the corresponding data source location and save according to the data type and length of the plurality of sub-member data information when the service type is writing an object.

6. An electronic device, characterized in that: include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the electric energy meter protocol de-framing method according to any one of claims 1 to 4.

7. A storage medium having computer-readable instructions stored thereon, characterized in that: The computer-readable instructions are executed by one or more processors to implement the electric energy meter protocol de-framing method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • DL / T719 protocol analysis method and electric quantity acquisition terminal

    CN115633107A

  • Computing devices with mult-layer file systems

    US20140324804A1

Cited By

  • Electric energy meter data storage method and system

    CN120743900A