Binary file analysis method, device, equipment and medium

A binary file and parsing method technology, applied in the field of binary file parsing, can solve problems such as difficulty in meeting log parsing requirements, inability to apply to various binary file parsing occasions, etc., to reduce duplication of work and ensure flexibility.

Pending Publication Date: 2020-05-01
HANGZHOU ZHONGHEN ELECTRIC CO LTD
View PDF7 Cites 3 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, the existing general parsing algorithms can only do simple one-to-one text conversion, that is, a binary value can only correspond to one text field; there are also general parsing algorithms based on fixed protocols, but it is necessary to limit the length of each data block and order
Existing general-purpose parsing algorithms are difficult to meet complex log parsing requirements, and cannot be applied to parsing occasions of various binary files

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Binary file analysis method, device, equipment and medium
  • Binary file analysis method, device, equipment and medium
  • Binary file analysis method, device, equipment and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0042] Embodiment 1 provides a method for parsing a binary file, which aims to display the relationship between binary members by establishing a tree structure of the structure. When parsing a binary file, a recursive algorithm is used to obtain the parsed text. In this way, it can adapt to binary membership relationships of various depths and binary structures of various lengths without repeated programming.

[0043] A recursive function refers to a function that calls the function itself. The definition of a recursive function is as follows: For a certain function f(x), its domain is the set A, then if for a certain value X0 in the set A, its function The value f(x0) is determined by f(f(x0)), then f(x) is called a recursive function. The recursive function will stop the recursive call when the termination condition is reached. The termination condition is usually that there is no element to call. The recursive function will return the linked list after the recursive call en...

Embodiment 2

[0096] Embodiment 2 discloses a device corresponding to the binary file parsing method of the above embodiment, which is the virtual device structure of the above embodiment, please refer to Figure 4 shown, including:

[0097] A construction module 210, configured to obtain a parsing rule description file, and call a recursive function to construct a tree structure according to the parsing rule description file;

[0098] The receiving module 220 is used to receive the binary file, and convert the binary file into several binary structures;

[0099] The parsing module 230 is used to recursively invoke the tree structure of the plurality of binary structures in order to obtain the parsing text of the binary file.

[0100] Preferably, the parsing rule description file includes members, membership relationships, and binary value translation tables of the members, wherein the members include member tags and member IDs, and the member tags are divided into replacement tags and add...

Embodiment 3

[0116] Figure 5 A schematic structural diagram of an electronic device provided in Embodiment 3 of the present invention, such as Figure 5 As shown, the electronic device includes a processor 310, a memory 320, an input device 330, and an output device 340; the number of processors 310 in a computer device may be one or more, Figure 5 Take a processor 310 as an example; the processor 310, memory 320, input device 330 and output device 340 in the electronic device can be connected by bus or other methods, Figure 5 Take connection via bus as an example.

[0117] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs and modules, such as the program instructions / modules corresponding to the method for detecting the movement state of the relay armature in the embodiment of the present invention (for example, a binary file parsing device The building module 210, the receiving module 220 and the parsing modul...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a binary file analysis method, which relates to the technical field of embedded software development. The invention is used for solving the problem of complicated binary valueconversion of the existing equipment, and comprises the following steps of: obtaining an analysis rule description file, and calling a recursive function to construct a structural body tree structureaccording to the analysis rule description file; receiving a binary file, and converting the binary file into a plurality of binary structure bodies; and sequentially recursively calling the structurebody tree structure through the plurality of binary structure bodies to obtain an analysis text of the binary file. The invention further discloses a binary file analysis device, electronic equipmentand a computer storage medium. According to the method, a tree structure is constructed through a recursive calling method, and then the binary file is analyzed by taking the tree structure as an analysis rule of a recursive function.

Description

technical field [0001] The invention relates to the technical field of embedded software development, in particular to a binary file parsing method, device, equipment and medium. Background technique [0002] Status information and operation logs of embedded products are commonly used data in the daily use and maintenance of equipment. This type of data has the characteristics of huge data volume and high storage frequency. Due to the limited storage resources and low computing power of embedded devices, it is difficult to read and write a large amount of text data at high frequency. Therefore, the current common practice is to store the status information and operation logs of products in files in the form of binary structures. , and convert it into a readable text file through specific parsing software when necessary. [0003] At present, there are many types of embedded products, and the binary meanings stored in different embedded products are different, requiring diffe...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/20G06F8/41G06F16/903
CPCG06F8/20G06F8/427G06F16/90344
Inventor 康安刘涛徐文彬撒陇峰唐珊
Owner HANGZHOU ZHONGHEN ELECTRIC CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products