A decoding data structure method and related device

By using interface functions in decoding dynamic link library DLL in software development, the problem of large amount of code writing for decoding data structures is solved, which improves development efficiency and reduces the maintenance workload of decoding DLLs.

CN114168226BActive Publication Date: 2025-04-25UNISOC CHONGQING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111492519.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-08
Publication Date
2025-04-25
Estimated Expiration
2041-12-08

AI Technical Summary

Technical Problem

During the software development process, the amount of code required to decode the data structure in the communication primitive is huge, resulting in a reduced efficiency of software development.

Method used

By calling two interface functions in the decoding dynamic link library DLL, loading the script file and decoding the received data frames, obtaining the communication primitive name and frame header information, avoiding writing corresponding decoding functions for each communication primitive.

Benefits of technology

This reduces the amount of code writing, improves software development efficiency, and even if there are new communication primitives or changes in data structure, the update work of decoding DLLs is not large.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168226B_ABST
    Figure CN114168226B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a method for decoding data structure and related devices. The method includes: calling a first interface function to load multiple script files; calling a second interface function and a script file corresponding to a communication primitive identifier to determine the communication primitive name and frame header information corresponding to the communication primitive identifier, the communication primitive identifier is obtained by decoding a received data frame; outputting the communication primitive name and frame header information corresponding to the communication primitive identifier; the first interface function and the second interface function are interface functions of the same decoding dynamic link library DLL. By decoding the two interface functions in the dynamic link library DLL, the received data frame can be decoded to obtain the communication primitive name and frame header information, without having to write a corresponding decoding function for each communication primitive, thereby reducing the amount of code writing and improving software development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a decoding data structure method and related devices. Background Art

[0002] Data structure is a collection of data elements with structural characteristics. It studies the logical structure and physical structure of data and the relationship between them, defines appropriate operations for this structure, designs corresponding algorithms, and ensures that the new structure obtained after these operations still maintains the original structure type. In short, data structure is a collection of data elements that have one or more specific relationships between each other, that is, a collection of data elements with "structure".

[0003] In the process of software development, it is necessary to decode the communication primitives in each software module to facilitate the R&D personnel to locate various problems. The communication primitives will include multiple data structures. In order to decode, it is necessary to develop corresponding decoding functions for the communication primitives in each software module, including each data structure, to decode the communication primitives in the corresponding software module.

[0004] It can be seen that the method for decoding the data structure requires a huge amount of code to be written, thereby reducing the efficiency of software development. Summary of the invention

[0005] The embodiments of the present application provide a method for decoding a data structure and a related device, which can improve software development efficiency.

[0006] In the first aspect, the embodiment of the present application provides a method for decoding data structure. The method includes: calling a first interface function to load multiple script files; calling a second interface function and a script file corresponding to a communication primitive identifier to determine a communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding a received data frame; outputting the communication primitive name and frame header information corresponding to the communication primitive identifier; the first interface function and the second interface function are interface functions of the same decoding dynamic link library DLL.

[0007] It can be seen that this method can decode the received data frame by decoding the two interface functions in the dynamic link library DLL to obtain the communication primitive name and frame header information. There is no need to write a corresponding decoding function for each communication primitive, thereby reducing the amount of code writing and improving software development efficiency. At the same time, even if there are new communication primitives, the decoding DLL needs to be updated, and the workload of the update is not large.

[0008] In an optional implementation, according to the script file corresponding to the communication primitive identifier, the third interface function is called to decode the communication primitive data stream to obtain a decoding result data stream, where the communication primitive data stream is a communication primitive data stream obtained by decoding a received data frame; the decoding result data stream is output; the third interface function is an interface function in the decoding dynamic link library DLL.

[0009] In an optional implementation, a decoding data stream module is called to decode the decoding result data stream to obtain a decoded data stream; and the decoded data stream is displayed in a tree structure.

[0010] It can be seen that after decoding the decoding result data stream, the decoded data stream is displayed in a tree structure. The tree structure can clearly show all parameters, which is helpful for developers or maintenance personnel to locate various problems.

[0011] In an optional implementation, multiple script files are automatically generated by scanning the source code of multiple software modules; wherein the multiple script files are used to describe data structures, substructures, parameter names, parameter types, parameter value ranges, and meanings of parameter values.

[0012] In an optional implementation manner, the decoding dynamic link library DLL is a universal data structure decoding dynamic link library DLL.

[0013] That is to say, the decoding dynamic link library DLL can decode all data structures, avoiding the need to develop decoding DLLs for each communication primitive separately, thereby reducing the amount of code writing; at the same time, since the decoding DLL is universal, there is no need to update the decoding DLL even if new communication primitives are added or data structures are changed, thereby reducing the workload required for decoding DLL maintenance and saving human resources.

[0014] In a second aspect, an embodiment of the present application provides a decoding data structure device, the communication device comprising:

[0015] A calling unit, used for calling the first interface function and loading multiple script files;

[0016] The calling unit is further used to call the second interface function and the script file corresponding to the communication primitive identifier, and determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame;

[0017] The output unit is used to output the communication primitive name and frame header information corresponding to the communication primitive identifier.

[0018] In addition, in this aspect, other optional implementations of the decoding data structure device can refer to the relevant content of the first aspect mentioned above, and will not be described in detail here.

[0019] In a third aspect, an embodiment of the present application provides a terminal device, wherein the terminal device includes:

[0020] Memory for storing computer programs;

[0021] The processor invokes a computer program to:

[0022] Call the first interface function to load multiple script files;

[0023] Calling the second interface function and the script file corresponding to the communication primitive identifier to determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame;

[0024] Output the communication primitive name and frame header information corresponding to the communication primitive identifier;

[0025] The first interface function and the second interface function are the same interface function of decoding dynamic link library DLL.

[0026] In addition, in this aspect, other optional implementations of the terminal device can refer to the relevant content of the first aspect mentioned above and will not be described in detail here.

[0027] In a fourth aspect, an embodiment of the present application provides a chip, wherein the chip is used for:

[0028] Used to call the first interface function and load multiple script files;

[0029] It is also used to call the second interface function and the script file corresponding to the communication primitive identifier, and determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame;

[0030] It is also used to output the communication primitive name and frame header information corresponding to the communication primitive identifier.

[0031] In addition, in this aspect, other optional implementations of the chip can refer to the relevant content of the first aspect above, and will not be described in detail here.

[0032] In a fifth aspect, an embodiment of the present application provides a module device, the module device includes a communication module, a power module, a storage module and a chip module, wherein:

[0033] The power module is used to provide electrical energy to the module device;

[0034] The storage module is used to store data and instructions;

[0035] The communication module is used for internal communication of the module device, or for communication between the module device and an external device;

[0036] The chip module is used for:

[0037] Call the first interface function to load multiple script files;

[0038] Decoding the received data frame to obtain a communication primitive identifier of the data frame;

[0039] Calling the second interface function and the script file corresponding to the communication primitive identifier to determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame;

[0040] Output the communication primitive name and frame header information corresponding to the communication primitive identifier;

[0041] The first interface function and the second interface function are the same interface function of decoding dynamic link library DLL.

[0042] In addition, in this aspect, other optional implementations of the module device can refer to the relevant content of the first aspect mentioned above, and will not be described in detail here.

[0043] In the sixth aspect, a computer-readable storage medium is characterized in that the computer-readable storage medium stores a computer program, and the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is used to execute the program involved in any of the methods described in the first aspect above.

[0044] In a seventh aspect, a computer program product is provided, characterized in that it comprises computer instructions, which, when executed on a computer, perform any of the methods described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a schematic diagram of a decoding data structure provided by an embodiment of the present application;

[0046] Figure 2 It is a flowchart of a method for decoding a data structure provided in an embodiment of the present application;

[0047] Figure 3 It is a flowchart of another method for decoding a data structure provided in an embodiment of the present application;

[0048] Figure 4 This is a schematic diagram of a format of a decoding result data stream provided in an embodiment of the present application;

[0049] Figure 5 is a structural diagram of a communication device provided in an embodiment of the present application;

[0050] Figure 6 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0051] Figure 7 It is a structural schematic diagram of a module device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application.

[0053] See also Figure 1 , Figure 1 This is a schematic diagram of a decoding data structure provided by an embodiment of the present application. In order to improve the efficiency of software development, this application combines Figure 1 The following scheme for decoding communication primitives is provided:

[0054] like Figure 1 As shown, the personal computer (PC) software loads multiple script files (such as inter-process communication (IPC) script files, physical layer (PHY) script files, L1C script files, L3 protocol script files, etc.) by calling the first interface function in the decoding dynamic link library (DLL). The PC software decodes the received data frame to obtain the communication primitive identifier and communication primitive data stream corresponding to the data frame. The PC software calls the second interface function in the decoding dynamic link library DLL, and determines the communication primitive name and frame header information according to the script file corresponding to the communication primitive identifier.

[0055] In an optional implementation, the PC software calls the third interface function in the decoding dynamic link library DLL according to the script file corresponding to the communication primitive identifier to decode the communication primitive data stream and obtain the decoding result data stream.

[0056] In an optional implementation, the PC software calls a decoding data stream module to decode the decoding result data stream to obtain a decoded data stream.

[0057] It can be seen that in the above scheme, when using the script file to decode the communication primitive, the received data frame can be decoded by decoding the three interface functions in the dynamic link library DLL to obtain the decoded data stream, without having to write a corresponding decoding function for each communication primitive, thereby greatly reducing the amount of code to be written, thereby improving software development efficiency. In addition, even if there are new communication primitives, the workload of updating the decoding DLL is not large.

[0058] Based on the above description, see Figure 2 , Figure 2 is a flowchart of a method for decoding a data structure provided by an embodiment of the present application, such as Figure 2 As shown, the decoding data structure method may include but is not limited to the following steps:

[0059] S201. Call the first interface function and load multiple script files.

[0060] The first interface function may be a BOOL Load_Script_File (CStringstrScriptFile) function for decoding the script file in the dynamic link library DLL, which is responsible for loading the script file.

[0061] In an optional implementation, multiple script files are automatically generated by scanning source code (such as C language source code) of multiple software (such as Lay3, IPC, HPY, Packet Switch (PS), etc.) modules. The multiple script files are used to describe data structures, substructures, parameter names, parameter types, parameter value ranges, and meanings of parameter values. It can be seen that by automatically generating by scanning the source code of each software module, the script files can be updated in time.

[0062] It is understandable that the automatic generation of script files in the embodiments of the present application can be achieved through automatic script file generation software.

[0063] In another optional implementation, multiple script files are written and generated for multiple software modules. It is understandable that in this way, script files can be written according to the needs of different personnel to meet the needs of different personnel for script files.

[0064] S202. Call the script file corresponding to the second interface function and the communication primitive identifier, and determine the communication primitive name and frame header information corresponding to the communication primitive identifier.

[0065] Among them, the second interface function can be a decoding message name CStringDecode_Message_Name (UINT unMsgID) function in the decoding dynamic link library DLL, which can decode the communication primitive identifier according to the script file corresponding to the communication primitive identifier to obtain the communication primitive name and frame header information as described in step S202.

[0066] The communication primitive identifier is obtained by decoding the received data frame, and specifically, can be obtained by decoding the frame header of the data frame.

[0067] S203. Output the communication primitive name and frame header information corresponding to the communication primitive identifier.

[0068] In an optional implementation, the decoding dynamic link library DLL is a general data structure decoding DLL. The decoding dynamic link library DLL is obtained by extending the Microsoft Foundation Classes (MFC), and includes a script management class that is responsible for managing each script file and its defined data structure, substructure, and managing all parameter names, parameter types, parameter value ranges, and parameter value meanings. The decoding data structure method described in the present application can realize the decoding of any communication primitive data structure in the communication field through interface functions and script files, and output a decoding result data stream in a specific format; through the three interface functions in the decoding DLL, the received data frame can be decoded to obtain the communication primitive name and its data structure, so the positioning speed of the data structure in the script file by the decoding DLL has nothing to do with the number of data structures; in addition, even if the communication primitive is added and the data structure is changed, there is no need to update the decoding DLL, thereby reducing the workload required for the maintenance of the decoding DLL and saving human resources.

[0069] It can be seen that in the embodiment of the present application, the first interface function is called to load multiple script files; the second interface function and the script file corresponding to the communication primitive identifier are called to determine the communication primitive name and frame header information corresponding to the communication primitive identifier, and the communication primitive identifier is obtained by decoding the received data frame; the communication primitive name and frame header information corresponding to the communication primitive identifier are output; the first interface function and the second interface function are interface functions of the same decoding DLL. The received data frame can be decoded by the two interface functions in the decoding DLL to obtain the communication primitive name and frame header information, without having to write a corresponding decoding function for each communication primitive, thereby reducing the amount of code writing and improving software development efficiency. At the same time, since the decoding DLL is universal, even if the communication primitive is added and the data structure is changed, there is no need to update the decoding DLL, thereby reducing the workload required for the maintenance of the decoding DLL and saving human resources.

[0070] See also Figure 3 , Figure 3 is a flowchart of another method for decoding a data structure provided by an embodiment of the present application, such as Figure 3 As shown, the decoding data structure method may include but is not limited to the following steps:

[0071] S301. Start the personal computer (PC) software.

[0072] Among them, when the PC software is started, various script files can be managed through the script management class of the decoding DLL; the PC software can be a tool software that uses script files and a decoding dynamic link library DLL; the PC software directly calls the decoding DLL, so the PC software is independent of the definition of the data structure and the number of data structures; the PC software can adapt to the changes of various software modules, thereby reducing the workload required for PC software maintenance and saving human resources.

[0073] S302. Call the first interface function and load multiple script files.

[0074] For the relevant description of step S302, please refer to the above Figure 2 The relevant contents of step S201 in the decoding data structure method shown are not described in detail here.

[0075] S303. Whether log data is received. If log data is received, execute step S304; if log data is not received, execute step S303.

[0076] S304. Whether a complete log data frame is received. If a complete log data frame is received, execute step S305; if a complete log data frame is not received, execute step S303.

[0077] S305. Decode the received log data frame to obtain a communication primitive identification (Identity document, ID) and a communication primitive data stream.

[0078] Among them, the log data frame is the received data frame. It can be seen that by decoding the received data frame, not only the communication primitive identifier of the data frame can be obtained, but also the communication primitive data stream of the data frame can be obtained. Figure 1 As shown, decoding of the data frame can obtain the communication primitive identifier and the communication primitive data stream.

[0079] S306. Call the script file corresponding to the second interface function and the communication primitive identifier, and determine the communication primitive name and frame header information corresponding to the communication primitive identifier.

[0080] For the relevant description of step S306, please refer to the above Figure 2 The relevant contents in step S202 in the decoding data structure method shown are not described in detail here.

[0081] S307. Output the communication primitive name and frame header information corresponding to the communication primitive identifier.

[0082] After step S307 is completed, step S303 may be continued to perform the next round of judgment, decoding and other operations.

[0083] In an optional implementation manner, after the above step S306 is completed, the decoding data structure method may further include step S308:

[0084] S308. Whether it is necessary to decode the communication primitive data stream. If it is necessary to decode the communication primitive data stream, execute step S309; ​​if it is not necessary to decode the communication primitive data stream, execute step S303.

[0085] Since the communication primitive data stream includes one or more data structures, the operation of decoding the communication primitive data stream can also be referred to as decoding the data structure. Correspondingly, the communication primitive data stream obtained by decoding the received log data frame can also be referred to as the obtained data structure.

[0086] S309. Call the third interface function to decode the communication primitive data stream to obtain a decoding result data stream.

[0087] Among them, the third interface function can be a decoding message Decode_Message(UINT unMsgID,BYTE*pSurData,int nSurDataLen,BYTE*pTargetData,int&nTargetDataLen) function in the decoding dynamic link library DLL, which can decode the communication primitive data stream according to the script file corresponding to the communication primitive identifier to obtain the decoding result data stream as described in step S309.

[0088] In an optional implementation, according to the script file corresponding to the communication primitive identifier, the third interface function is called to decode the communication primitive data stream to obtain a decoding result data stream. The communication primitive data stream is the communication primitive data stream obtained by decoding the received data frame in step S305; the decoding result data stream is output; and the third interface function is an interface function in the decoding dynamic link library DLL.

[0089] In an optional implementation manner, after the above step S309 is completed, the decoding data structure method may further include step S310:

[0090] S310. Call the decoding data stream module to decode the decoding result data stream to obtain a decoded data stream.

[0091] S311. Display the decoded data stream in a tree structure.

[0092] For example, the decoded data stream is displayed in a tree structure on the user interface (UI). That is, the PC software can call the decoding DLL to decode the communication primitive data stream and output the decoded result data stream; then, the PC software calls the decoding data stream module to decode the decoded result data stream to obtain the decoded data stream; further, the decoded data stream is displayed in a tree structure on the user interface (UI).

[0093] For example, the decoded data stream can be Figure 4 The output is in the format shown, where length indicates the length of the data frame, ID is the level in the tree structure, string, string terminator '\0', and so on.

[0094] In addition, the decoded data stream is decoded again, and after the decoded data stream is obtained, it is displayed in a tree structure, which is helpful for developers or maintenance personnel to locate various software problems, thereby improving the efficiency of software development or software maintenance.

[0095] After step S311 is completed, step S303 may be continued to perform the next round of judgment, decoding and other operations.

[0096] It can be seen that in the embodiment of the present application, when it is determined that the log data is received and the log data is a complete log data frame, the received data frame can be decoded by the three interface functions in the decoding DLL to obtain the decoded data stream, without having to write a corresponding decoding function for each communication primitive, thereby reducing the amount of code written and improving software development efficiency. In addition, since the decoding DLL is universal, even if the communication primitive is added and the data structure is changed, there is no need to update the decoding DLL, thereby reducing the workload required for the maintenance of the decoding DLL and saving human resources.

[0097] See also Figure 5 , Figure 5 : is a schematic diagram of a structure of a decoding data structure device provided by an embodiment of the present invention, and the communication device may include:

[0098] The calling unit 501 is used to call the first interface function and load multiple script files;

[0099] The calling unit 501 is further used to call the second interface function and the script file corresponding to the communication primitive identifier, and determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame;

[0100] The output unit 502 is used to output the communication primitive name and frame header information corresponding to the communication primitive identifier.

[0101] In an optional implementation manner, the calling unit 501 is further configured to:

[0102] According to the script file corresponding to the communication primitive identifier, calling the third interface function to decode the communication primitive data stream to obtain a decoding result data stream, wherein the communication primitive data stream is a communication primitive data stream obtained by decoding the received data frame;

[0103] The output unit 502 outputs the decoding result data stream; the third interface function is an interface function in the decoding dynamic link library DLL.

[0104] In an optional implementation manner, the device further includes a display unit 503, and the display unit 503 is used to:

[0105] Calling a decoding data stream module to decode the decoding result data stream to obtain a decoded data stream;

[0106] The decoded data stream is displayed in a tree structure.

[0107] In an optional implementation manner, the device further includes a processing unit 504, and the processing unit 504 is configured to:

[0108] The plurality of script files are automatically generated by scanning source codes of the plurality of software modules;

[0109] The multiple script files are used to describe the data structure, substructure, parameter name, parameter type, parameter value range and the meaning of the parameter value.

[0110] In an optional implementation manner, the processing unit 504 is further configured to:

[0111] The decoding dynamic link library DLL is a universal data structure decoding dynamic link library DLL;

[0112] The decoding dynamic link library DLL includes a first interface function, a second interface function and a third interface function. The embodiment of the present application and the above method embodiment are based on the same concept, and the technical effects they bring are also the same. Please refer to the description of the above method embodiment for the specific principles, which will not be repeated here.

[0113] See also Figure 6 , Figure 6 6 is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device includes a processor 601, a transceiver 602, a memory 603 and a user interface 604. The processor 601 and the memory 603 are connected via one or more communication buses.

[0114] The transceiver 602 is used to send or receive data. The user interface 604 is used to enable the user to interact with the computer device and exchange information. The memory 603 is used to store commands or computer programs. The memory 603 may include a read-only memory and a random access memory, and provides commands and data to the processor 601. A part of the memory 603 may also include a non-volatile random access memory.

[0115] The user interface 604 may include a display screen (Display) for output, a speaker, a keyboard (Keyboard), a touch screen, a sound pickup device, etc. for input. It should be noted that the keyboard here can be either a physical keyboard, a touch screen virtual keyboard, or a keyboard that combines a physical keyboard and a touch screen virtual keyboard.

[0116] The processor 601 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, and optionally, the processor 601 may also be any conventional processor, etc.

[0117] The terminal device may be a terminal in the above method embodiment, and the processor 601 may be configured to execute the computer program or command stored in the memory 603, so that the terminal device executes:

[0118] Call the first interface function to load multiple script files;

[0119] Calling the second interface function and the script file corresponding to the communication primitive identifier to determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame;

[0120] Output the communication primitive name and frame header information corresponding to the communication primitive identifier;

[0121] The first interface function and the second interface function are the same interface function of decoding dynamic link library DLL.

[0122] The embodiments of the present application and the above-mentioned method embodiments are based on the same concept, and the technical effects they bring are also the same. For the specific principles, please refer to the description of the above-mentioned method embodiments, which will not be repeated here.

[0123] See also Figure 7 , Figure 7 701, a power module 702, a storage module 703 and a chip module 704, wherein: the power module is used to provide power to the module device; the storage module is used to store data and commands; the communication module is used to communicate within the module device, or for the module device to communicate with external devices;

[0124] The chip module 704 is used for:

[0125] Call the first interface function to load multiple script files;

[0126] Calling the second interface function and the script file corresponding to the communication primitive identifier to determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame;

[0127] Output the communication primitive name and frame header information corresponding to the communication primitive identifier;

[0128] The first interface function and the second interface function are the same interface function of decoding dynamic link library DLL.

[0129] For other implementations of the module device, please refer to the relevant contents of the above method embodiment, which will not be described in detail here.

[0130] The embodiments of the present application and the above-mentioned method embodiments are based on the same concept, and the technical effects they bring are also the same. For the specific principles, please refer to the description of the above-mentioned method embodiments, which will not be repeated here.

[0131] An embodiment of the present application further provides a chip, comprising: a processor, a memory, and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps described in the above method embodiment.

[0132] An embodiment of the present application also provides a computer-readable storage medium storing a computer program or instructions, which implements the steps described in the above method embodiment when executed.

[0133] The embodiment of the present application also provides a computer program product, including a computer program or instructions, which implement the steps described in the above method embodiment when executed.

[0134] The various devices and products described in the above embodiments include modules / units, which may be software modules / units or hardware modules / units, or may be partially software modules / units and partially hardware modules / units. For example, for each device or product that applies to or integrates a chip, each module / unit contained therein can be implemented in the form of hardware such as circuits, or at least some modules / units can be implemented in the form of software programs, which run on the integrated processor inside the chip, and the remaining modules / units can be implemented in the form of hardware such as circuits; for each device or product that applies to or integrates a chip module, each module / unit contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same part of the chip module (for example, a chip, a circuit module, etc.) or in different components, at least some / units can be implemented in the form of software programs, which run on the integrated processor inside the chip module, and the remaining modules / units can be implemented in the form of hardware such as circuits; for each device or product that applies to or integrates a terminal, the modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, a chip, a circuit module, etc.) or in different components in the terminal, or at least some modules / units can be implemented in the form of software programs, which run on the integrated processor inside the terminal, and the remaining modules / units can be implemented in the form of hardware such as circuits.

[0135] The steps of the method or algorithm described in the embodiment of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). In addition, the ASIC can be located in a terminal device or a network device. Of course, the processor and the storage medium can also be present in a terminal device or a network device as discrete components.

[0136] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiments of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server, or data center to another website site, computer, server, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).

[0137] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the embodiments of the present application. It should be understood that the above description is only the specific implementation method of the embodiments of the present application and is not intended to limit the protection scope of the embodiments of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the embodiments of the present application should be included in the protection scope of the embodiments of the present application.

Claims

1. A method for decoding a data structure, characterized in that: The method comprises: Call the first interface function to load multiple script files; Calling the second interface function and the script file corresponding to the communication primitive identifier in the plurality of script files, determining the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame; Output the communication primitive name and frame header information corresponding to the communication primitive identifier; According to the script file corresponding to the communication primitive identifier, calling the third interface function to decode the communication primitive data stream to obtain a decoding result data stream, wherein the communication primitive data stream is a communication primitive data stream obtained by decoding the received data frame; Outputting the decoding result data stream; The first interface function, the second interface function and the third interface function are interface functions of the same decoding dynamic link library DLL.

2. The method according to claim 1, characterized in that The method further comprises: Calling a decoding data stream module to decode the decoding result data stream to obtain a decoded data stream; The decoded data stream is displayed in a tree structure.

3. The method according to claim 1 or 2, characterized in that: The plurality of script files are automatically generated by scanning source codes of the plurality of software modules; The multiple script files are used to describe the data structure, substructure, parameter name, parameter type, parameter value range and the meaning of the parameter value.

4. The method according to claim 1 or 2, characterized in that: The decoding dynamic link library DLL is a universal data structure decoding dynamic link library DLL.

5. A decoding data structure device, characterized in that: The device comprises: A calling unit, used for calling the first interface function and loading multiple script files; The calling unit is further used to call the second interface function and the script file corresponding to the communication primitive identifier in the multiple script files, and determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame; An output unit, used to output the communication primitive name and frame header information corresponding to the communication primitive identifier; The calling unit is further used to call a third interface function to decode the communication primitive data stream according to the script file corresponding to the communication primitive identifier to obtain a decoding result data stream, wherein the communication primitive data stream is a communication primitive data stream obtained by decoding the received data frame; The output unit is further used to output the decoding result data stream; The first interface function, the second interface function and the third interface function are interface functions of the same decoding dynamic link library DLL.

6. The device according to claim 5, characterized in that Calling a decoding data stream module to decode the decoding result data stream to obtain a decoded data stream; The decoded data stream is displayed in a tree structure.

7. The device according to claim 5 or 6, characterized in that The plurality of script files are automatically generated by scanning source codes of the plurality of software modules; The multiple script files are used to describe the data structure, substructure, parameter name, parameter type, parameter value range and the meaning of the parameter value.

8. The device according to claim 5 or 6, characterized in that The decoding dynamic link library DLL is a universal data structure decoding dynamic link library DLL.

9. A terminal device, characterized in that: The terminal device includes a processor and a memory, the processor and the memory are connected to each other, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 4.

10. A chip, characterized in that: The chip is used to call the first interface function and load multiple script files; The chip is further used to call the second interface function and the script file corresponding to the communication primitive identifier in the multiple script files, and determine the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame; The chip is further used to output the communication primitive name and frame header information corresponding to the communication primitive identifier; The chip is further used to call a third interface function to decode the communication primitive data stream according to the script file corresponding to the communication primitive identifier to obtain a decoding result data stream, wherein the communication primitive data stream is a communication primitive data stream obtained by decoding the received data frame; The chip is also used to output the decoding result data stream; The first interface function, the second interface function and the third interface function are interface functions of the same decoding dynamic link library DLL.

11. A module device, characterized in that: The module device includes a communication module, a power module, a storage module and a chip module, wherein: The power module is used to provide electrical energy to the module device; The storage module is used to store data and instructions; The communication module is used for internal communication of the module device, or for communication between the module device and an external device; The chip module is used for: Call the first interface function to load multiple script files; Calling the second interface function and the script file corresponding to the communication primitive identifier in the plurality of script files, determining the communication primitive name and frame header information corresponding to the communication primitive identifier, wherein the communication primitive identifier is obtained by decoding the received data frame; Output the communication primitive name and frame header information corresponding to the communication primitive identifier; According to the script file corresponding to the communication primitive identifier, calling the third interface function to decode the communication primitive data stream to obtain a decoding result data stream, wherein the communication primitive data stream is a communication primitive data stream obtained by decoding the received data frame; Outputting the decoding result data stream; The first interface function, the second interface function and the third interface function are interface functions of the same decoding dynamic link library DLL.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 4.

13. A computer program product, characterized in that The method comprises computer instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and system for converting test script language into executable instruction

    CN102426534A

  • Software structure based on DLL

    CN104536746A