Protocol description text construction method, device, equipment and storage medium

Through the protocol description text construction method in the field of industrial Internet of Things, using sending frames as text features, it automatically finds and constructs similar protocol description text, solving the problem of low efficiency in building protocol description text in terminal equipment, and achieving more efficient protocol description text construction.

CN116016692BActive Publication Date: 2025-04-25KONGTROLINK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211686127.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-27
Publication Date
2025-04-25
Estimated Expiration
2042-12-27

AI Technical Summary

Technical Problem

In the field of industrial Internet of Things, the protocol description text construction of terminal devices is less efficient, and developers need to manually find and write protocol description text.

Method used

By determining at least one transmission frame in the first protocol description text and taking the transmission frame as a text feature, the reference protocol description text is determined in the second protocol description text, thereby automatically constructing the remaining content in the first protocol description text.

Benefits of technology

It improves the efficiency and accuracy of finding similar protocol description texts in massive protocol description texts, reduces the manual construction work of developers, and significantly improves the construction efficiency of protocol description texts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016692B_ABST
    Figure CN116016692B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for constructing a protocol description text, and relates to the field of data processing technology. The method includes: determining at least one sending frame in a first protocol description text, the first protocol description text being a protocol description text under construction of a first device; using at least one sending frame as a text feature of the first protocol description text, determining a reference protocol description text of the first protocol description text in a second protocol description text, the second protocol description text being a completed protocol description text of the second device; and determining the remaining content in the first protocol description text except for at least one sending frame according to the reference protocol description text. Thus, by utilizing the sending frame in the protocol description text under construction, a protocol description text suitable for reference is determined in the completed protocol description text, and the protocol description text under construction is improved with reference to the protocol description text, thereby improving the construction efficiency of the protocol description text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, device, equipment and storage medium for constructing a protocol description text. Background Art

[0002] In the field of industrial Internet of Things, the number and types of terminal devices are very large, and corresponding device communication protocols need to be developed specifically for the terminal devices.

[0003] In the related art, engineers write and develop corresponding protocol description texts for the terminal device based on the communication protocol provided by the device manufacturer of the terminal device.

[0004] However, the construction efficiency of the protocol description text of the device in the above method is low. Summary of the invention

[0005] The present application provides a method, apparatus, device and storage medium for constructing a protocol description text, so as to solve the problem of low efficiency in constructing a protocol description text.

[0006] In a first aspect, the present application provides a method for constructing a protocol description text, comprising: determining at least one sending frame in a first protocol description text, wherein the first protocol description text is a protocol description text of a first device that is in the process of being constructed; using the at least one sending frame as a text feature of the first protocol description text, determining a reference protocol description text of the first protocol description text in a second protocol description text, wherein the second protocol description text is a constructed protocol description text of a second device, and the second device is a different device from the first device; and determining, based on the reference protocol description text, the remaining content of the first protocol description text except for the at least one sending frame.

[0007] In a possible implementation manner, determining at least one sending frame in the first protocol description text includes: determining the nth sending frame in the first protocol description text, where n is greater than or equal to 1.

[0008] In a possible implementation, the method of determining a reference protocol description text of the first protocol description text in a second protocol description text by taking the at least one sending frame as the text feature of the first protocol description text includes: determining the nth sending frame in the second protocol description text; and determining the reference protocol description text in the second protocol description text based on the nth sending frame in the first protocol description text and the nth sending frame in the second protocol description text.

[0009] In a possible implementation, determining the reference protocol description text in the second protocol description text according to the nth send frame in the first protocol description text and the nth send frame in the second protocol description text includes: text matching the nth send frame in the first protocol description text with the nth send frame in the second protocol description text to determine a similar send frame of the nth send frame in the first protocol description text; and determining that the reference protocol description text is the protocol description text to which the similar send frame belongs.

[0010] In a possible implementation, determining the remaining content in the first protocol description text except for the at least one sending frame based on the reference protocol description text includes: extracting protocol elements from the reference protocol description text; and completing blank elements to be configured in the remaining content based on the protocol elements.

[0011] In one possible implementation, the at least one sending frame is the nth sending frame in the first protocol description text, and the extracting of protocol elements from the reference protocol description text includes: extracting the allowed configuration field of the mth sending frame in the reference protocol description text, where m is not equal to n; the blank element includes a blank field, and the completing of the blank elements to be configured in the remaining content according to the protocol element includes: determining the blank field of the mth sending frame in the first protocol description text as the allowed configuration field of the mth sending frame in the reference protocol description text.

[0012] In a possible implementation, extracting protocol elements from the reference protocol description text includes: extracting protocol elements related to response frame parsing from the reference protocol description file; and completing blank elements to be configured in the remaining content according to the protocol elements includes: adding the protocol elements related to response frame parsing to the first protocol description text.

[0013] In a second aspect, the present application provides a protocol description text construction device, comprising:

[0014] A sending frame determining unit, configured to determine at least one sending frame in a first protocol description text, wherein the first protocol description text is a protocol description text of a first device that is in a construction process;

[0015] a reference text determining unit, configured to determine a reference protocol description text of the first protocol description text in a second protocol description text by taking the at least one transmission frame as a text feature of the first protocol description text, wherein the second protocol description text is a constructed protocol description text of a second device, and the second device is a different device from the first device;

[0016] The remaining content determination unit is used to determine the remaining content in the first protocol description text except the at least one sending frame according to the reference protocol description text.

[0017] In a third aspect, the present application provides an electronic device, including: at least one processor and a memory;

[0018] Memory stores computer-executable instructions;

[0019] At least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the protocol description text construction method provided in the first aspect above.

[0020] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the protocol description text construction method provided in the first aspect above.

[0021] In a fifth aspect, the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the protocol description text construction method provided in the first aspect above.

[0022] The protocol description text construction method, device, equipment and storage medium provided in the present application determine at least one sending frame in the first protocol description text, the first protocol description text is the protocol description text of the first device in the construction process, and the remaining content in the first protocol description text except for at least one sending frame is still to be constructed; the at least one sending frame is used as the text feature of the first protocol description text, and the reference protocol description text of the first protocol description text is determined in the second protocol description text, the second protocol description text is the constructed protocol description text of the second device, and the second device is a different device from the first device; according to the reference protocol text, the remaining content in the first protocol description text except for at least one occurrence frame is determined, that is, the reference protocol text is used as a reference object to construct the remaining content in the first protocol description text, obtain the complete first protocol description text, and complete the construction of the first protocol description text. Thus, based on at least one sending frame in the protocol description text in the construction process and the constructed protocol description text, the automatic construction of the protocol description text in the construction process is realized, without the need for developers to construct all the content in the protocol description text one by one, which effectively improves the construction efficiency of the protocol description text. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0024] Figure 1 The following is an illustration of the application scenarios applicable to the embodiments of the present application: Figure 1 ;

[0025] Figure 2 The following is an illustration of the application scenarios applicable to the embodiments of the present application: Figure 2 ;

[0026] Figure 3 A schematic diagram of the structure of the protocol description file provided in the embodiment of the present application;

[0027] Figure 4 Schematic diagram of the process of constructing the protocol description text provided in the embodiment of the present application Figure 1 ;

[0028] Figure 5 Schematic diagram of the process of constructing the protocol description text provided in the embodiment of the present application Figure 2 ;

[0029] Figure 6 An example diagram of constructing a protocol description text provided in an embodiment of the present application;

[0030] Figure 7 Schematic diagram of the process of constructing the protocol description text provided in the embodiment of the present application Figure 3 ;

[0031] Figure 8 A schematic diagram of the structure of a protocol description text construction device provided in an embodiment of the present application;

[0032] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0033] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0034] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0035] In the related art, a development engineer develops a corresponding protocol description text for a terminal device according to the communication protocol provided by the device manufacturer of the terminal device. The development engineer needs to rely on professional skills to find protocol elements that can be used to construct the protocol description text in the communication protocol, which is inefficient.

[0036] In order to improve the efficiency of constructing the protocol description text, the protocol description texts of other terminal devices with similar device models to the current terminal device can be found, and the protocol description texts of other terminal devices can be modified based on them. However, when there are many protocol description texts, there are many similar device models, and there are many other terminal devices corresponding to similar device models. In addition, the similarity of device models is related to the similarity of communication protocols, but not necessarily. It is possible that an unsuitable protocol description text is selected as the basis for protocol modification, and the efficiency improvement effect is limited.

[0037] Therefore, how to quickly and accurately select similar protocol description texts from massive amounts of protocol description texts is a key breakthrough point in shortening the protocol description text construction cycle.

[0038] To solve the above problems, the present application provides a method, device, equipment and storage medium for constructing a protocol description text. In the present application, considering that the communication protocol of the terminal device is mainly composed of a sending frame and a data response frame and the communication protocol has a certain integrity, if the sending frames of the two devices have a high similarity, then the similarity of their data response frames is also high, and the similarity of the parsing rules of their data response frames is also high. Taking at least one sending frame in the first protocol description text as a text feature, determining the reference protocol description text of the first protocol description text in the second protocol description text is equivalent to determining a protocol description text similar to the first protocol description text; based on the reference protocol description text, determining the remaining content in the first protocol description text except for the at least one sending frame. Thereby, the efficiency and accuracy of finding similar protocol description texts in massive protocol description texts are improved, thereby improving the efficiency of constructing protocol description texts.

[0039] Figure 1 The following is an illustration of the application scenarios applicable to the embodiments of the present application: Figure 1 .like Figure 1 As shown, the device involved in the application scenario includes a protocol description text construction device 110 and a database 120, in which multiple completed protocol description texts can be stored. When constructing a protocol description text, the protocol description text construction device 110 can obtain multiple protocol description texts from the database 120, determine similar protocol description texts in the multiple protocol description texts based on at least one sending frame in the protocol description text being constructed, and refer to the similar protocol description text to improve the protocol description text being constructed. The protocol description text construction device 110 can be a server or a terminal, Figure 1 Take the server as an example.

[0040] The terminal may be a personal digital assistant (PDA), a handheld device (such as a smart phone, a tablet computer), a computing device (such as a personal computer (PC)), a vehicle-mounted device, a wearable device (such as a smart watch, a smart bracelet), and a smart home device (such as a smart display device). The server may be a distributed server, a centralized server, a cloud server, etc.

[0041] Figure 2 The following is an illustration of the application scenarios applicable to the embodiments of the present application: Figure 2 .like Figure 2 As shown, the devices involved in the application scenario include an edge computing host or a programmable logic controller (PLC), and also include a terminal device. In the communication protocol, it may include a sending frame (also called a data sending frame, a data query frame) and a data response frame, wherein the sending frame is sent by the edge computing host or PLC to the terminal device, and the data response frame is sent by the terminal device to the edge computing host or PLC. The protocol description text mainly describes the sending frame and the information related to the parsing of the data response frame, so that the edge computing host or PLC can send a sending frame that the terminal device can parse to the terminal device based on the protocol description text, and parse the data response frame returned by the terminal device.

[0042] Figure 3 This is a schematic diagram of the structure of the protocol description file provided in the embodiment of the present application. Figure 3 As shown, in the protocol description text of the terminal device, the protocol type, device model, device manufacturer, software version number, number of data frames, sending frame vector, data parsing rules (i.e., signal point parsing rules) and other contents can be described. Among them, the sending frame vector is the sending frame (i.e., the query frame), which can be expressed as: sending frame 1: XXX (the frame structure of sending frame 1); sending frame 2: XXX (the frame structure of sending frame 2); ...; sending frame k: XXX (the frame structure of sending frame k). Among them, the data parsing rules are the parsing rules of the response frame corresponding to the sending frame, and specifically may include the parsing rules of multiple signal points in the response frame, for example: signal point 1: parsing rules; signal point 2: parsing rules; ...; signal point m: parsing rules.

[0043] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0044] refer to Figure 4 , Figure 4 Schematic diagram of the process of constructing the protocol description text provided in the embodiment of the present application Figure 1 .like Figure 4 As shown, the protocol description text construction method provided in this embodiment includes:

[0045] S401, determining at least one sending frame in a first protocol description text, where the first protocol description text is a protocol description text of a first device that is in a construction process.

[0046] The first device is a terminal device. For the sake of distinction, the protocol description text of the first device in the process of being constructed is referred to as the first protocol description text.

[0047] In this embodiment, at least one sending frame in the first protocol description text can be pre-constructed by a professional based on the communication protocol provided by the device manufacturer of the first device. For example, a total of 10 sending frames need to be constructed in the first protocol description text, and one of the sending frames is pre-constructed by a professional. Compared with constructing the entire first protocol description text, constructing one or several sending frames in the first protocol description text greatly reduces the time consumption of the professional. After the professional constructs at least one sending frame in the first protocol description text, the sending frame can be stored in a database, and the sending frame can be input into the protocol description text construction device. Therefore, in this embodiment, at least one sending frame in the first protocol description text can be obtained from the database or the at least one sending frame input by the user can be received.

[0048] S402, using at least one sent frame as a text feature of a first protocol description text, determining a reference protocol description text of the first protocol description text in a second protocol description text, wherein the second protocol description text is a constructed protocol description text of a second device, and the second device and the first device are different devices.

[0049] The second device may be one or more terminal devices. For the convenience of description, the protocol description text of the second device is referred to as the second protocol description text.

[0050] In this embodiment, the second protocol description text can be obtained from the protocol database. Taking at least one sending frame in the first protocol description text as the text feature of the first protocol description text, the at least one sending frame is matched with the sending frame in the second protocol description text. Considering that the communication protocol of the terminal device is mainly composed of a sending frame and a data response frame and the communication protocol has a certain integrity, if the sending frames of the two devices have a high similarity, then the similarity of their data response frames is also high, and the similarity of the parsing rules of the data response frames is also high. Therefore, based on the matching result of the sending frame in the first protocol description text and the sending frame in the second protocol description text, a protocol description text similar to the first protocol description text can be selected in the second protocol description text. Considering that the protocol description text is used as a reference object for constructing the first protocol description text, for the convenience of distinction, the protocol description text is called a reference protocol description text.

[0051] As an example, the first device is device A, and the second device includes device B, device D, and device C. The protocol description texts of device B, device D, and device C have been constructed. Now it is necessary to construct the protocol description text of device A. Professionals can first construct at least one sending frame in the protocol description text of device A, and then use the at least one sending frame as a text feature to search for a reference protocol description text similar to the protocol description text of device A in the protocol description text of B, the protocol description text of device D, and the protocol description text of device C, so as to further construct the protocol description text of device A based on the reference protocol description text.

[0052] S403: Determine the remaining content of the first protocol description text except for at least one transmission frame according to the reference protocol description text.

[0053] In this embodiment, when determining the reference protocol description text, the protocol content may be extracted from the reference protocol description text, for example, the transmission frame, data parsing rules, software version, etc. The remaining content in the first protocol description text may be generated based on the extracted protocol content.

[0054] In an embodiment of the present application, based on at least one transmission frame in the first protocol description text, a reference protocol description text similar to the first protocol description text is searched in the constructed second protocol description text, thereby improving the search efficiency and accuracy of similar protocol description texts. Based on the reference protocol description text, the remaining content of the first protocol description text is determined to obtain a complete first protocol description text, after which the first protocol description text can be modified and corrected by professionals. Since the reference protocol description text and the first protocol description text are highly similar, the accuracy of generating the first protocol description text based on the reference protocol description text is high, and after generating the first protocol description text, the workload of professionals in modifying and correcting the first protocol description text is greatly reduced, effectively improving the construction efficiency of the protocol description text.

[0055] In some embodiments, at least one transmission frame in the first protocol description text may be the nth transmission frame in the first protocol description text, where n is greater than or equal to 1. Thus, professionals only need to develop the nth transmission frame in the first protocol description text, and can determine the remaining content in the first protocol description text based on the nth transmission frame and the second protocol description text, thereby improving the construction efficiency of the protocol description text.

[0056] refer to Figure 5 , Figure 5 Schematic diagram of the process of constructing the protocol description text provided in the embodiment of the present application Figure 2 .like Figure 5 As shown, the protocol description text construction method includes:

[0057] S501, determining the nth sending frame in the first protocol description text, where n is greater than or equal to 1.

[0058] Among them, the first protocol description text can refer to the aforementioned embodiment and will not be described in detail.

[0059] In this embodiment, the nth sending frame in the first protocol description text can be pre-constructed by professionals based on the communication protocol provided by the device manufacturer of the first device. Compared with constructing the entire first protocol description text, constructing the nth sending frame in the first protocol description text consumes very little time and does not reduce the construction efficiency of the entire first protocol description text. The nth sending frame in the first protocol description text can be obtained from the database or the nth sending frame can be received from the user input.

[0060] Furthermore, n is 1, and S501 may include: determining the first transmission frame in the first protocol description text. Professionals may construct the first transmission frame in the first protocol description text based on the communication protocol provided by the device manufacturer of the first device, and other transmission frames need to be determined based on the reference protocol description text.

[0061] S502: Determine the nth sending frame in the second protocol description text.

[0062] The second protocol description text may refer to the aforementioned embodiment and will not be described in detail.

[0063] In this embodiment, the second protocol description text may be obtained from the protocol database. For each second protocol description text, the nth transmission frame in the second protocol description text may be identified according to the arrangement order of the transmission frames in the second protocol description text.

[0064] S503: Determine a reference protocol description text in the second protocol description text according to the nth sent frame in the first protocol description text and the nth sent frame in the second protocol description text.

[0065] In this embodiment, for similar protocol description texts, the nth sending frame is similar, therefore, the nth sending frame in the first protocol description text can be compared with the nth sending frame in the second protocol description text to determine the similarity between the nth sending frame in the first protocol description text and the nth sending frame in the second protocol description text; among the nth sending frames in the second protocol description text, determine the sending frame with the highest similarity to the nth sending frame in the first protocol description text; determine the reference protocol description text as the protocol description text to which the sending frame with the highest similarity belongs. Thus, based on the similarity between the nth sending frame in the first protocol description text and the nth sending frame in the second protocol description text, the accuracy and search efficiency of the reference protocol description text are improved.

[0066] In one possible implementation, S303 includes: text matching the nth send frame in the first protocol description text with the nth send frame in the second protocol description text to determine a similar send frame of the nth send frame in the first protocol description text; and determining that the reference protocol description text is the protocol description text to which the similar send frame belongs.

[0067] In this implementation, the nth sending frame in the first protocol description text can be matched with the nth sending frame in the second protocol description text to obtain the similarity between the nth sending frame in the first protocol description text and the nth sending frame in the second protocol description text; the similar sending frame is determined to be the sending frame with the highest similarity with the nth sending frame in the first protocol description text among the nth sending frames in the second protocol description text; and the reference protocol description text is determined to be the protocol description text to which the similar sending frame belongs. Thus, by means of text matching, the accuracy of the similarity between the nth sending frame in the first protocol description text and the nth sending frame in the second protocol description text is improved, thereby improving the accuracy of the reference protocol description text.

[0068] S504: Determine the remaining content of the first protocol description text except for at least one transmission frame according to the reference protocol description text.

[0069] The implementation principle and technical effects of S504 may refer to the aforementioned embodiments and will not be described in detail.

[0070] In an embodiment of the present application, based on the similarity between the nth transmission frame in the first protocol description text and the nth transmission frame in the second protocol description text, a reference protocol description text similar to the first protocol description text is searched in the second protocol description text, thereby improving the search efficiency and accuracy of similar protocol description texts. The remaining content of the first protocol description text is determined based on the reference protocol description text to obtain a complete first protocol description text. Since the reference protocol description text has a high degree of similarity with the first protocol description text, the accuracy of generating the first protocol description text based on the reference protocol description text is high. After the first protocol description text is generated, the workload of professionals in modifying and correcting the first protocol description text is greatly reduced, effectively improving the efficiency of constructing the protocol description text.

[0071] As an example, Figure 6 This is an example diagram of the protocol description text construction provided in the embodiment of this application. Figure 6 As shown, first, the developer can develop the first sending frame based on the protocol text T provided by the device manufacturer of the device D, and input the first sending frame into the protocol matcher; then, the protocol matcher can load all the protocol description files (equivalent to the second protocol description file) S = [s1, s2, ..., sn] in the protocol library, where s1, s2, ..., sn represent the 1st, 2nd, ..., nth protocol description files respectively, identify the first sending frame in all the loaded protocol description files, and form a matching data set M (m1, m2, ..., mn) from the first sending frames in all the protocol description files; then, use the text matching algorithm to find the sending frame that is most similar to the input first sending frame in the matching data set M, and determine the protocol description file where the most similar sending frame is located; finally, create the protocol description text of the device D according to the protocol description file where the most similar sending frame is located.

[0072] refer to Figure 7 , Figure 7 Schematic diagram of the process of constructing the protocol description text provided in the embodiment of the present application Figure 3 .like Figure 7 As shown, the protocol description text construction method provided in this embodiment includes:

[0073] S701, determine at least one sending frame in a first protocol description text, where the first protocol description text is a protocol description text of a first device that is in a construction process.

[0074] S702, using at least one sent frame as a text feature of a first protocol description text, determining a reference protocol description text of the first protocol description text in a second protocol description text, wherein the second protocol description text is a constructed protocol description text of a second device, and the second device and the first device are different devices.

[0075] The implementation principles and technical effects of S701 to S702 may refer to the aforementioned embodiments and will not be described in detail.

[0076] S703: extract protocol elements from the reference protocol description text.

[0077] In this embodiment, the protocol element is an element related to the communication protocol and supports flexible configuration. The protocol description text may include protocol elements related to sending frames and / or protocol elements related to signal parsing. Therefore, the protocol elements related to sending frames and / or protocol elements related to signal parsing may be extracted from the reference protocol description text.

[0078] S704: Complete the blank elements to be configured in the remaining content according to the protocol elements.

[0079] In this embodiment, after the protocol element is extracted from the reference protocol description text, the protocol element may be added to the blank element to be configured in the remaining content of the first protocol description text to complete the blank element to be configured in the remaining content.

[0080] In a possible implementation, at least one transmission frame in the first protocol description text is the nth transmission frame in the first protocol description text, and the blank element includes a blank field. At this time, S703 may include: extracting the allowed configuration field of the mth transmission frame in the reference protocol description text, where m is not equal to n; S704 may include: determining that the blank field of the mth transmission frame in the first protocol description text is determined as the allowed configuration field of the mth transmission frame in the reference protocol description text.

[0081] In this implementation, when at least one transmission frame in the first protocol description text is the nth transmission frame in the first protocol description text, the remaining content in the first protocol description text includes the mth transmission frame. Since the first protocol description text is similar to the reference protocol description text, the mth transmission frame in the first protocol description text is similar to the mth transmission frame in the reference protocol description text. The mth transmission frame in the first protocol description text can be determined by referring to the mth transmission frame in the reference protocol description text. For the construction of the transmission frame, it is mainly necessary to determine what content is configured in the allowed configuration field in the frame structure of the transmission frame. Therefore, the allowed configuration field of the mth transmission frame can be extracted from the reference protocol description text, that is, the protocol elements extracted from the reference protocol description text include the allowed configuration field of the mth transmission frame in the reference protocol description text, and the blank field of the mth transmission frame in the first protocol description text is determined as the allowed configuration field of the mth transmission frame in the reference protocol description text.

[0082] For example, the allowed configuration fields of the mth sending frame in the reference protocol description text include the protocol type field and the protocol address field. Then the blank fields of the mth sending frame in the first protocol description text can be determined as the protocol type field and the protocol address field, so that the allowed configuration fields in the frame structure of the mth sending frame in the first protocol description text also include the protocol type field and the protocol address field.

[0083] When n is equal to 1, if m is equal to 2, the second sending frame in the first protocol description text can be constructed; if m is equal to 3, the third sending frame in the first protocol description text can be constructed. In this way, multiple sending frames in the first protocol description text can be constructed.

[0084] In a possible implementation, the protocol elements related to signal parsing include protocol elements related to response frame parsing, and S703 may include: extracting protocol elements related to response frame parsing from the reference protocol description file; and S704 may include: adding the protocol elements related to response frame parsing to the first protocol description text. Thus, the construction of the protocol elements related to response frame parsing in the first protocol description text is achieved, and the construction efficiency of the first protocol description text is improved.

[0085] Among them, the protocol elements related to the response frame parsing may include the signal point parsing rules of the response frame.

[0086] As an example, all transmission frames extracted from the reference protocol description text can be expressed as:

[0087] The first frame to be sent:

[0088] 0x7E,0x32,0x31,0x31,0x34,0x30,0x34,0x31,0x43,0x45,0x30,0x30,0x32,0x46,0x44,0x46,0x43,0x46,0x46,0x0D

[0089] The second frame is sent:

[0090] 0x7E,0x32,0x31,0x31,0x34,0x30,0x34,0x34,0x43,0x45,0x30,0x30,0x32,0x46,0x44,0x46,0x43,0x46,0x43,0x0D

[0091] Article 3 Send frame:

[0092] 0x7E,0x32,0x31,0x31,0x34,0x31,0x34,0x30,0x46,0x45,0x30,0x30,0x32,0x45,0x46,0x46,0x43,0x46,0x42,0x0D

[0093] Article 4 Send frame:

[0094] 0x7E,0x32,0x31,0x31,0x34,0x31,0x34,0x32,0x46,0x45,0x30,0x30,0x32,0x45,0x46,0x46,0x43,0x46,0x39,0x0D

[0095] Article 5 Send frame:

[0096] 0x7E,0x32,0x31,0x31,0x34,0x31,0x34,0x33,0x46,0x45,0x30,0x30,0x32,0x45,0x46,0x46,0x43,0x46,0x38,0x0D

[0097] Article 6 Send frame:

[0098] 0x7E,0x32,0x31,0x31,0x34,0x32,0x34,0x30,0x46,0x45,0x30,0x30,0x32,0x45,0x46,0x46,0x43,0x46,0x41,0x0D

[0099] Article 7 Send frame:

[0100] 0x7E,0x32,0x31,0x31,0x34,0x32,0x34,0x33,0x46,0x45,0x30,0x30,0x32,0x45,0x46,0x46,0x43,0x46,0x37,0x0D

[0101] Article 8 Send frame:

[0102] 0x7E,0x32,0x31,0x31,0x34,0x32,0x34,0x35,0x46,0x45,0x30,0x30,0x32,0x45,0x46,0x46,0x43,0x46,0x35,0x0D

[0103] The above numbers such as 0x7E and 0x32 represent protocol elements in the transmitted frame, that is, they indicate the allowed configuration field.

[0104] Among them, the signal point analysis rules can be expressed as a signal point analysis matrix, which may include the frame index corresponding to the signal point, the name of the signal point, the data type of the signal point, the number of bytes occupied by the signal point data, the starting bit of the signal point data, the number of bits occupied by the signal point data, the calculated value of the signal point data, the unit of the signal point data, etc.

[0105] As an example, the signal point parsing rules may be shown in the following table:

[0106]

[0107]

[0108] In the above table, the signal point with a frame index of 1 is the signal point in the data response frame corresponding to the first transmission frame, and the signal point with a frame index of 3 is the signal point in the data response frame corresponding to the third transmission frame.

[0109] In the embodiment of the present application, at least one transmission frame in the first protocol description text is used as a text feature to search for a reference protocol description text in the second protocol description text, thereby improving the search efficiency and accuracy of the reference protocol description text; based on the reference protocol description text, the blank elements in the first protocol description text are completed, especially the remaining transmission frames and / or signal parsing rules in the first protocol description text are completed to construct a complete first protocol description text. Thus, the construction efficiency of the first protocol description text is improved.

[0110] The following are device embodiments of the present application, which can be used to execute the corresponding method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the corresponding method embodiments of the present application.

[0111] Figure 8This is a schematic diagram of the structure of the protocol description text construction device provided in the embodiment of the present application. Figure 8 As shown, the protocol description text construction device 800 provided in this embodiment includes:

[0112] A sending frame determining unit 801 is used to determine at least one sending frame in a first protocol description text, where the first protocol description text is a protocol description text in a construction process of a first device;

[0113] A reference text determining unit 802 is configured to determine a reference protocol description text of the first protocol description text in a second protocol description text using at least one sent frame as a text feature of the first protocol description text, wherein the second protocol description text is a constructed protocol description text of a second device, and the second device is a different device from the first device;

[0114] The remaining content determination unit 803 is used to determine the remaining content of the first protocol description text except for at least one transmission frame according to the reference protocol description text.

[0115] In a possible implementation manner, the sending frame determining unit 801 is specifically configured to: determine the nth sending frame in the first protocol description text, where n is greater than or equal to 1.

[0116] In one possible implementation, the reference text determination unit 802 is specifically used to: determine the nth sending frame in the second protocol description text; and determine the reference protocol description text in the second protocol description text based on the nth sending frame in the first protocol description text and the nth sending frame in the second protocol description text.

[0117] In a possible implementation, in the process of determining a reference protocol description text in the second protocol description text based on the nth sending frame in the first protocol description text and the nth sending frame in the second protocol description text, the reference text determination unit 802 is specifically used to: perform text matching on the nth sending frame in the first protocol description text and the nth sending frame in the second protocol description text to determine a similar sending frame of the nth sending frame in the first protocol description text; and determine that the reference protocol description text is the protocol description text to which the similar sending frame belongs.

[0118] In a possible implementation, the remaining content determining unit 803 is specifically configured to: extract protocol elements from the reference protocol description text; and complete blank elements to be configured in the remaining content according to the protocol elements.

[0119] In a possible implementation, at least one transmission frame is the nth transmission frame in the first protocol description text, and in the process of extracting the protocol element from the reference protocol description text, the remaining content determination unit 803 is specifically used to: extract the allowed configuration field of the mth transmission frame in the reference protocol description text, where m is not equal to n. The blank element includes a blank field, and in the process of completing the blank element to be configured in the remaining content according to the protocol element, the remaining content determination unit 803 is specifically used to: determine the blank field of the mth transmission frame in the first protocol description text as the allowed configuration field of the mth transmission frame in the reference protocol description text.

[0120] In a possible implementation, in the process of extracting protocol elements from the reference protocol description text, the remaining content determination unit 803 is specifically used to: extract protocol elements related to response frame parsing from the reference protocol description file. In the process of completing the blank elements to be configured in the remaining content according to the protocol elements, the remaining content determination unit 803 is specifically used to: add the protocol elements related to response frame parsing to the first protocol description text.

[0121] It is worth noting that the protocol description text construction device provided in the above embodiments can be used to execute the various steps in the protocol description text construction method provided in any of the above embodiments. The specific implementation methods and technical effects are similar and will not be repeated here.

[0122] The above-mentioned device embodiments provided in the present application are merely illustrative, and the module division therein is merely a logical function division, and there may be other division methods in actual implementation. For example, multiple modules can be combined or integrated into another system. The coupling between the modules can be achieved through some interfaces, which are usually electrical communication interfaces, but it is not excluded that they may be mechanical interfaces or other forms of interfaces. Therefore, the modules described as separate components may or may not be physically separated, and may be located in one place or distributed to different locations of the same or different devices.

[0123] Fig. 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig. 9 As shown, the electronic device 900 may include: at least one processor 901 and a memory 902 . Fig. 9 An electronic device is shown using a processor as an example.

[0124] The memory 902 is used to store the program of the processor 901. Specifically, the program may include program code, and the program code includes computer operation instructions.

[0125] The memory 902 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0126] The processor 901 is configured to execute the computer program stored in the memory 902 to implement each step in the protocol description text construction method in the above method embodiments.

[0127] The processor 901 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0128] Optionally, the memory 902 can be independent or integrated with the processor 901. When the memory 902 is a device independent of the processor 901, the electronic device 900 may further include: a bus 903 for connecting the processor 901 and the memory 902. The bus may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.

[0129] Optionally, in a specific implementation, if the memory 902 and the processor 901 are integrated on a chip, the memory 902 and the processor 901 can communicate through an internal interface.

[0130] The present application also provides a computer-readable storage medium, which may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes. Specifically, the computer-readable storage medium stores computer execution instructions. When at least one processor of an electronic device executes the computer execution instructions, the electronic device executes the various steps of the protocol description text construction method provided in the above-mentioned various implementation methods.

[0131] The embodiment of the present application also provides a computer program product, which includes a computer program, and the computer program is stored in a readable storage medium. At least one processor of the electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device implements the various steps of the protocol description text construction method provided in the above various embodiments.

[0132] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0133] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for constructing a protocol description text, characterized in that: include: Determine at least one sending frame in a first protocol description text, where the first protocol description text is a protocol description text of a first device that is in a construction process; Taking the at least one sending frame as a text feature of the first protocol description text, determining a reference protocol description text having a similar sending frame as the first protocol description text in a second protocol description text, wherein the second protocol description text is a constructed protocol description text of a second device, and the second device and the first device are different devices; According to the reference protocol description text, the remaining content in the first protocol description text except for the at least one sending frame is determined.

2. The method for constructing a protocol description text according to claim 1, characterized in that: The determining at least one sending frame in the first protocol description text comprises: Determine the nth sending frame in the first protocol description text, where n is greater than or equal to 1.

3. The method for constructing a protocol description text according to claim 2, characterized in that: The step of determining a reference protocol description text of the first protocol description text in the second protocol description text by taking the at least one sent frame as a text feature of the first protocol description text comprises: Determine the nth transmission frame in the second protocol description text; The reference protocol description text is determined in the second protocol description text according to the nth sent frame in the first protocol description text and the nth sent frame in the second protocol description text.

4. The method for constructing a protocol description text according to claim 3, characterized in that: The step of determining the reference protocol description text in the second protocol description text according to the nth sent frame in the first protocol description text and the nth sent frame in the second protocol description text comprises: Performing text matching on the nth send frame in the first protocol description text and the nth send frame in the second protocol description text to determine a similar send frame to the nth send frame in the first protocol description text; The reference protocol description text is determined to be the protocol description text to which the similar transmission frame belongs.

5. The method for constructing a protocol description text according to any one of claims 1 to 4, characterized in that: The determining, according to the reference protocol description text, the remaining content in the first protocol description text except for the at least one transmission frame comprises: Extracting protocol elements from the reference protocol description text; According to the protocol element, the blank elements to be configured in the remaining content are completed.

6. The method for constructing a protocol description text according to claim 5, characterized in that: The at least one transmission frame is the nth transmission frame in the first protocol description text, and the extracting protocol elements from the reference protocol description text includes: Extracting the allowed configuration field of the mth transmission frame in the reference protocol description text, where m is not equal to n; The blank element includes a blank field, and the completing the blank element to be configured in the remaining content according to the protocol element includes: Determine that the blank field of the mth sending frame in the first protocol description text is determined as the allowed configuration field of the mth sending frame in the reference protocol description text.

7. The method for constructing a protocol description text according to claim 5, characterized in that: The step of extracting protocol elements from the reference protocol description text comprises: Extracting protocol elements related to response frame parsing from the reference protocol description file; The step of completing the blank elements to be configured in the remaining content according to the protocol elements includes: The protocol element related to the response frame parsing is added to the first protocol description text.

8. A device for constructing a protocol description text, characterized in that: include: A sending frame determining unit, configured to determine at least one sending frame in a first protocol description text, wherein the first protocol description text is a protocol description text of a first device that is in a construction process; a reference text determination unit, configured to determine, in a second protocol description text, a reference protocol description text having a similar transmission frame to the first protocol description text, using the at least one transmission frame as a text feature of the first protocol description text, wherein the second protocol description text is a constructed protocol description text of a second device, and the second device and the first device are different devices; The remaining content determination unit is used to determine the remaining content in the first protocol description text except the at least one sending frame according to the reference protocol description text.

9. An electronic device, comprising: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the protocol description text construction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the protocol description text construction method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method of processing data in internet protocol television receiver and internet protocol television receiver

    CN101540788A

  • Universal protocol adapting method and device

    CN102480462A