CN111684766A - Updating communication protocol version numbers in distributed systems - Google Patents

Updating communication protocol version numbers in distributed systems Download PDF

Info

Publication number
CN111684766A
CN111684766A CN201980008482.6A CN201980008482A CN111684766A CN 111684766 A CN111684766 A CN 111684766A CN 201980008482 A CN201980008482 A CN 201980008482A CN 111684766 A CN111684766 A CN 111684766A
Authority
CN
China
Prior art keywords
communication protocol
information
data structure
syntax
text message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201980008482.6A
Other languages
Chinese (zh)
Inventor
曾健荣
王斌
周青松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SZ DJI Technology Co Ltd
Shenzhen Dajiang Innovations Technology Co Ltd
Original Assignee
SZ DJI Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SZ DJI Technology Co Ltd filed Critical SZ DJI Technology Co Ltd
Publication of CN111684766A publication Critical patent/CN111684766A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/18Protocol analysers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD

Abstract

The invention provides a method for updating a communication protocol version number of a distributed system, which comprises the following steps: generating respective syntax structure representations of the code version before modification and the code version after modification, which are respectively defined as a first syntax structure representation and a second syntax structure representation; acquiring respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation, and respectively defining the first communication protocol data structure and the second communication protocol data structure as a first communication data structure and a second communication data structure; generating a first and a second text message, respectively, based on all syntax information of the first and second communication data structures; calculating respective unique identifications of the first text message and the second text message, and respectively defining the unique identifications as a first unique identification and a second unique identification; the first and second unique identifiers are compared and the version number of the preset communication protocol is updated when the first and second unique identifiers are different. The method for updating the version number of the communication protocol in the distributed system greatly improves the reliability of the distributed system for discovering the change of the communication protocol and the efficiency for updating the version number of the communication protocol.

Description

Updating communication protocol version numbers in distributed systems
Technical Field
The present invention relates generally to the field of control techniques for distributed systems, and more particularly to updating a communication protocol version number in a distributed system.
Background
A distributed system is a software system built on a network and typically includes a plurality of modules that communicate with one another over the network using a communication protocol. In order to ensure the accuracy of communication, the communication protocol adopted by each module should be consistent.
In the existing distributed system, when a communication protocol is changed, the version of the communication protocol is updated manually, the protocol version number is carried in the communication protocol, and the version number is checked at a receiving side. Such a method has the following disadvantages: (1) easily omit: when the communication protocol changes, the communication protocol is not easily distinguished by eyes, for example: a certain communication protocol comprises multi-level data structure nesting, and when the data structure of a nesting layer changes, a maintainer easily omits the change; (2) the efficiency is low: when there are a large number of modules in a distributed system, it is very inefficient to update the communication protocol version manually.
Therefore, it is desirable to provide a scheme for automatically updating the version number of a communication protocol in a distributed system.
Disclosure of Invention
The present invention has been made to solve the above problems. According to an aspect of the present invention, there is provided a method for updating a communication protocol version number in a distributed system, where the distributed system includes a plurality of modules, and the modules communicate with each other through a preset communication protocol, the method including: generating respective grammar structure representations of the code version before modification and the code version after modification, and respectively defining the grammar structure representations as a first grammar structure representation and a second grammar structure representation; acquiring respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation, and defining the respective communication protocol data structures as a first communication data structure and a second communication data structure; generating a first text message based on all the syntax information of the first communication data structure and a second text message based on all the syntax information of the second communication data structure; calculating respective unique identifications of the first text message and the second text message, and respectively defining the unique identifications as a first unique identification and a second unique identification; and comparing the first unique identifier with the second unique identifier, and updating the version number of the preset communication protocol when the first unique identifier and the second unique identifier are different.
In an embodiment of the present invention, the communication protocol data structures in the pre-modification code version and the post-modification code version are generated based on a preset structure, and the preset structure conforms to a preset naming specification.
In one embodiment of the present invention, the obtaining the respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation comprises: analyzing the first syntactic structure representation and the second syntactic structure representation to search a data structure conforming to the preset naming specification; and acquiring the data type of the first member of the data structure which accords with the preset naming specification so as to obtain the communication protocol data structure.
In an embodiment of the present invention, the generating of the respective syntax structure representations of the pre-modification code version and the modified code version includes: and generating abstract syntax trees of the code version before modification and the code version after modification respectively.
In one embodiment of the present invention, the generating a first text message based on all syntax information of the first communication data structure and generating a second text message based on all syntax information of the second communication data structure comprises: all the syntax information of the first communication data structure is combined into a first character string, and all the syntax information of the second communication data structure is combined into a second character string.
In one embodiment of the invention, the all-syntax information includes self information and sub-member information of the communication data structure.
In an embodiment of the present invention, the self information includes domain name information, data structure type information, and occupancy size information.
In one embodiment of the present invention, the child member information includes child member name information, basic data type information, development information of structure/enumeration/association/definition type, and occupation size information.
In one embodiment of the present invention, the calculating the respective unique identifications of the first text message and the second text message includes: calculating respective message digest values for the first text message and the second text message.
In one embodiment of the invention, the method is implemented based on hook scripts of decentralized version control software.
According to another aspect of the present invention, an automatic driving system is provided, where the automatic driving system includes a plurality of modules, the modules communicate with each other through a preset communication protocol, and the automatic driving system updates the version number of the preset communication protocol by using any one of the above methods for updating the version number of the communication protocol in a distributed system.
According to yet another aspect of the present invention, a vehicle is provided, the vehicle comprising the above described autopilot system.
According to a further aspect of the invention, there is provided a drone comprising an autopilot system as described above.
According to another aspect of the present invention, a computing device is provided, where the computing device includes a plurality of modules, where the modules communicate with each other through a preset communication protocol, and the computing device updates the version number of the preset communication protocol by using any one of the above methods for updating the version number of the communication protocol in the distributed system.
According to another aspect of the present invention, there is provided a storage medium having stored thereon a computer program which, when executed, performs any of the above-described methods for updating a communication protocol version number for a distributed system.
The method for updating the version number of the communication protocol in the distributed system generates the grammar structure representation aiming at the code version before and after modification, acquires the communication protocol data structure from the generated grammar structure representation, determines whether the communication protocol changes or not by comparing the uniqueness identification of the communication protocol data structure, and automatically updates the version number of the communication protocol if the communication protocol changes, thereby greatly improving the reliability of the distributed system for finding the change of the communication protocol and the efficiency for updating the version number of the communication protocol, and effectively solving the problems of easy omission and low efficiency in a manual mode.
Drawings
Fig. 1 shows a schematic flow diagram of a method for a distributed system to update a communication protocol version number according to an embodiment of the invention;
FIG. 2 illustrates a more detailed flow diagram of a method of updating a communication protocol version number for a distributed system according to an embodiment of the present invention;
FIG. 3 illustrates a schematic block diagram of an exemplary computing device employing a method of updating a communication protocol version number for a distributed system in accordance with embodiments of the present invention;
FIG. 4 shows a schematic block diagram of an example autopilot system employing a method of updating a communication protocol version number for a distributed system in accordance with an embodiment of the present invention; and
fig. 5 shows a schematic block diagram of an exemplary drone employing a method of updating a communication protocol version number of a distributed system according to an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, exemplary embodiments according to the present invention will be described in detail below with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of embodiments of the invention and not all embodiments of the invention, with the understanding that the invention is not limited to the example embodiments described herein. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the invention described herein without inventive step, shall fall within the scope of protection of the invention.
In the following description, numerous specific details are set forth in order to provide a more thorough understanding of the present invention. It will be apparent, however, to one skilled in the art, that the present invention may be practiced without one or more of these specific details. In other instances, well-known features have not been described in order to avoid obscuring the invention.
It is to be understood that the present invention may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. As used herein, the term "and/or" includes any and all combinations of the associated listed items.
In order to provide a thorough understanding of the present invention, detailed steps and detailed structures will be set forth in the following description in order to explain the present invention. The following detailed description of the preferred embodiments of the invention, however, the invention is capable of other embodiments in addition to those detailed.
As described above, the current distributed system updates the communication protocol version manually, which is not only easy to miss the change of the communication protocol, but also inefficient. Based on this, the present invention provides a scheme for updating a communication protocol version number of a distributed system, and the following describes a scheme for updating a communication protocol version number of a distributed system according to an embodiment of the present invention with reference to the drawings.
Fig. 1 shows a schematic flow diagram of a method 100 for updating a communication protocol version number for a distributed system according to an embodiment of the invention. As shown in fig. 1, a method 100 for updating a communication protocol version number in a distributed system may include the steps of:
in step S110, respective syntax structure representations of the code version before modification and the code version after modification are generated, defined as a first syntax structure representation and a second syntax structure representation, respectively.
In an embodiment of the present invention, the method shown in fig. 1 may be used for a distributed system including a plurality of modules to automatically update a preset communication protocol version employed for communication between the modules. In general, the communication protocol may change when the code version is modified. Thus, it is possible to determine whether a change has occurred in the communication protocol by comparing the respective communication protocol data structures in the pre-modified code version and the modified code version. However, if the source code is directly analyzed to obtain the communication protocol data structure, the calculation amount is too large, and the accuracy is not high.
Based on this, in the embodiment of the present invention, in step S110, respective syntax structure representations, for example, abstract syntax structure representations, may be generated for the code version before modification and the code version after modification, respectively, so as to quickly acquire the communication protocol data structure in the code by analyzing the generated syntax structure representations. To distinguish from each other, the syntax structure representation generated for the code version before modification may be defined as a first syntax structure representation and the syntax structure representation generated for the code version after modification may be defined as a second syntax structure representation. Here, the first syntax structure representation and the second syntax structure representation are defined only for distinguishing each other, and have no other limitation.
Illustratively, the generating of the syntax structure representation of each of the pre-modified code version and the modified code version in step S110 may further include: an Abstract Syntax Tree (AST) is generated for each of the code version before modification and the code version after modification. That is, the syntax structure representations generated separately for the pre-modified and post-modified code versions may be abstract syntax trees. Wherein the abstract syntax tree generated for the code version before modification may be defined as a first abstract syntax tree and the abstract syntax tree generated for the code version before modification may be defined as a second abstract syntax tree. Here, the first abstract syntax tree and the second abstract syntax tree are defined only to distinguish each other, and there is no other limitation.
In computer science, an abstract syntax tree (or syntax tree for short) is an abstract representation of the syntax structure of a source code. It represents the syntactic structure of the programming language in the form of a tree, each node on the tree representing a structure in the source code. The communication protocol data structures of the code versions before and after modification are obtained based on the abstract syntax trees of the code versions before and after modification, so that the efficiency and the reliability are high.
In one example, a CastXML tool may be used to generate abstract syntax tree files for each of the code versions before and after modification. The CastXML tool can generate the structural organization relation of the input codes according to the grammar of C/C + +, and describe a grammar tree in an XML file format. In other examples, any other suitable method or tool may be employed to generate the abstract syntax tree file for each of the code versions before and after modification.
With continued reference to fig. 1, the subsequent steps of a method 100 for updating a communication protocol version number for a distributed system according to an embodiment of the present invention are described.
In step S120, the communication protocol data structures in the first syntax structure representation and the second syntax structure representation are obtained, and are defined as a first communication data structure and a second communication data structure, respectively.
Based on their respective syntax structure representations (e.g., abstract syntax trees) generated at step S110 for the code versions before and after modification, the respective communication protocol data structures in the code versions before and after modification can be obtained by parsing the generated abstract syntax tree file. In the embodiment of the present invention, in order to facilitate fast obtaining of the respective communication protocol data structures from the abstract syntax trees of the code versions before and after modification, a preset structure body conforming to a preset naming specification may be defined (for example, a macro is defined, and a prefix of the macro may be communication _ api), and the respective communication protocol data structures in the code versions before and after modification are all generated based on the preset structure body. In this way, the communication protocol data structure may be identified in advance, making it more efficient to find the communication protocol data type from the abstract syntax number.
Based on this, the obtaining of the respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation in step S120 may further include: analyzing the first syntactic structure representation and the second syntactic structure representation to search a data structure conforming to the preset naming specification; and acquiring the data type of the first member of the data structure which accords with the preset naming specification so as to obtain the communication protocol data structure. Specifically, the syntax structure representation files (for example, abstract syntax tree files) respectively generated for the code versions before and after modification in step S110 may be traversed, and a data structure conforming to the preset naming specification, for example, a structure with a prefix of communication _ api, may be searched from the syntax structure representation files, and then the data types of the first members of the structure may be acquired, that is, the communication protocol data structure in the syntax structure representation file may be obtained.
To distinguish from each other, a communication protocol data type acquired from the syntax structure representation corresponding to the code version before modification may be defined as a first communication protocol data structure (may be simply referred to as a first communication data structure), and a communication protocol data type acquired from the syntax structure representation corresponding to the code version after modification may be defined as a second communication protocol data structure (may be simply referred to as a second communication data structure). Here, the first communication data structure and the second communication data structure are defined only to distinguish each other, and there is no other limitation.
In step S130, a first text message is generated based on all the syntax information of the first communication data structure, and a second text message is generated based on all the syntax information of the second communication data structure.
Based on the respective communication protocol data structures in the code versions before and after modification acquired at step S120, unique identifiers of the respective communication protocol data structures in the code versions before and after modification may be generated for determining whether the communication protocol data structures before and after modification have changed based on the unique identifiers. In an embodiment of the present invention, a text message of a communication protocol data structure may be generated based on all syntax information of the communication protocol data structure, and a unique identification of the communication protocol data structure may be generated based on the text message.
Illustratively, the text message may be a character string generated based on all the syntax information of the communication protocol data structure, e.g., all the syntax information of the communication protocol data structure may be combined into a character string. Illustratively, all syntax information of the communication protocol data structure may include self information and sub-member information of the communication data structure. The self information may include domain name information (i.e., namespace name), data structure type (e.g., struct/union) information, and occupancy size information. The child member information may include child member name information, basic data type (e.g., int/char/float/long) information, development information of structure/enumeration/association/definition type (typedef), and occupancy size information.
For distinction, text information generated based on all syntax information of the communication protocol data type in the code version before modification may be defined as the first text information, and text information generated based on all syntax information of the communication protocol data type in the code version after modification may be defined as the second text information. Here, the first text information and the second text information are defined only to distinguish each other, and there is no other limitation.
In step S140, unique identifiers of the first text message and the second text message are calculated, and are respectively defined as a first unique identifier and a second unique identifier.
As previously described, in embodiments of the present invention, a text message of a communication protocol data structure may be generated based on all syntax information of the communication protocol data structure, and a unique identification of the communication protocol data structure may be generated based on the text message. Illustratively, the unique identifier may be a message digest value (e.g., an MD5 value) of the text message. That is, the message digest value of the first text message may be calculated as a unique identification of the communication protocol data type in the pre-modified code version, and the message digest value of the second text message may be calculated as a unique identification of the communication protocol data type in the modified code version.
For the purpose of distinction, the unique identification of the first text information may be defined as a first unique mark, and the unique identification of the second text information may be defined as a second unique mark. Here, the first unique identifier and the second unique identifier are defined only for distinguishing each other, and there is no other limitation.
In step S150, the first unique identifier and the second unique identifier are compared, and the version number of the preset communication protocol is updated when the first unique identifier and the second unique identifier are different.
Based on the unique identifications of the respective communication protocol data structures in the code versions before and after modification calculated in step S140, it is possible to determine whether the communication protocol before and after modification has changed by determining whether the unique identifications of the respective communication protocol data structures in the code versions before and after modification are the same. If the uniqueness identifications of the respective communication protocol data structures in the code versions before and after modification are the same, indicating that the communication protocols before and after modification are not changed; if the unique identifiers of the respective communication protocol data structures in the code versions before and after modification are different, which indicates that the communication protocols before and after modification are changed, the version number of the communication protocol (such as the preset communication protocol used for communication between the modules of the distributed system) corresponding to the compared communication protocol data structure may be updated, for example, the version number of the communication protocol may be incremented by 1. Thus, the method for updating the version number of the communication protocol in the distributed system according to the embodiment of the invention is realized.
In an embodiment of the present invention, the method for updating the communication protocol version number in the distributed system may be implemented based on a hook script of distributed version control software (GIT). Specifically, the developer submits the code using GIT commit, the GIT client automatically triggers GIT post-commit script, in the post-commit script, the above steps S110 to S150 may be implemented, and when the unique identifiers of the respective communication protocol data structures in the code versions before and after submission are different, the version number of the corresponding communication protocol may be updated, and the code versions are additionally submitted using GIT commit-amend.
Based on the above description, the method for updating the version number of the communication protocol in the distributed system according to the embodiment of the present invention generates the syntax structure representation for the code version before and after modification, obtains the communication protocol data structure from the generated syntax structure representation, and determines whether the communication protocol changes by comparing the unique identifier of the communication protocol data structure, if so, the version number of the communication protocol is automatically updated, thereby greatly improving the reliability of the distributed system for finding the change of the communication protocol and the efficiency of updating the version number of the communication protocol, and effectively solving the problems of easy omission and low efficiency in a manual mode.
Fig. 2 shows a more detailed flowchart of a method for updating a communication protocol version number of a distributed system according to an embodiment of the present invention. As shown in fig. 2, a method for updating a version number of a communication protocol in a distributed system according to an embodiment of the present invention may include the following steps:
first, in step S1, using the GIT commit submitting code, a commit node a (i.e., a code version) is generated and the GIT client automatically triggers the GIT post-commit hook script.
In which GIT is a distributed version control software, originally authored by linus torvalds, released in GPL in 2005. The GIT can support various hook scripts and is triggered by partial GIT commands to complete user-defined automatic operation.
The 5 steps after the step S1 are equally divided into two branches, namely, the left branch is executed for the code version corresponding to the commit node a, and the right branch is executed for the code version before the commit node a. To distinguish between the two, the left branch of these 5 steps is labeled S2A through S6A, and the right branch is labeled S2B through S6B. It should be understood that the execution order of the left and right branches of each of the 5 steps may not be sequential.
In step S2A, a C/C + + abstract syntax tree of the code version corresponding to the commit node a is generated. At step S2B, a C/C + + abstract syntax tree of the code version before commit node a is generated.
In computer science, an Abstract Syntax Tree (AST), or simply Syntax Tree (Syntax Tree), is an Abstract representation of the Syntax structure of source code. It represents the syntactic structure of the programming language in the form of a tree, each node on the tree representing a structure in the source code. A common implementation tool is CastXML, which can generate the structural organization relation of input codes according to the grammar of C/C + +, and describe a grammar tree in an XML file format. After the syntax tree file is generated using the CastXML tool, the file may be parsed to obtain a fully expanded string of the communication protocol data structure, which is used to calculate the MD5 value, indicating that the communication protocol version number needs to be updated when the MD5 value changes, as will be described below.
At step S3A, the syntax tree is parsed for all data structures beginning with communication _ api. At step S3B, the syntax tree is parsed for all data structures beginning with communication _ api.
In step S4A, the data type of the first member of these data structures is obtained, i.e., all communication protocol data structures are obtained. In step S4B, the data type of the first member of these data structures is obtained, i.e., all communication protocol data structures are obtained.
And in the post-commit script, generating abstract syntax trees before and after submission, and finding out a communication protocol data structure according to the predefined identification of the communication protocol data structure. Wherein the communication protocol data structure may be identified by: first, a macro is defined that declares a communication protocol: # define COMM _ API _ EXPORT (type) structcomunication _ API # # type { type a; }; the COMM _ API _ execute declaration is then used at the definition of the communication protocol data structure. Based on this, an abstract syntax tree can be generated by using CastXML (or other tools), the structure body in the syntax tree is filtered, and when the name conforms to the beginning of communication _ api, the first member type is obtained, namely, the communication protocol data structure.
In step S5A, the syntax tree is parsed, and the complete data structure of the data protocol is expanded to generate a character string. In step S5B, the syntax tree is parsed, and the complete data structure of the data protocol is expanded to generate a character string.
In step S6A, digest information of the character string is calculated. In step S6B, digest information of the character string is calculated.
In the abstract syntax tree, all information of the communication data structure, including domain name information, basic data type, user-defined type expansion, type data length information, etc., are searched and combined into a character string, and the MD5 value of the character string is calculated as the unique identifier of the communication data structure. MD5(Message-Digest Algorithm) is a widely used cryptographic hash function that generates a 128-bit (16-byte) hash value (hash value) that represents data Digest information.
In step S7, the MD5 values of all communication data structures before and after commit are compared, and if there is a change, the version number of the corresponding communication data structure is updated in step S8 (i.e., the version number of the communication protocol in which MD5 has changed is incremented by 1), and the updated version number is additionally committed to commit a in step S9 with git commit — amend. In step S10, the post-commit hook script ends. For the communication data structure with unchanged MD5 value, the version number of the corresponding communication protocol does not need to be updated, and the flow directly proceeds to step S10.
More specific operations of the method for updating the version number of the communication protocol by the distributed system according to the embodiment of the present invention are described above with reference to fig. 2. Based on the above description, the method for updating the version number of the communication protocol in the distributed system according to the embodiment of the present invention has an automatic identification method of the data structure of the communication protocol: that is, based on the macro declaration and the abstract syntax tree, the data structures describing the communication protocol may be automatically identified using scripts. In addition, the method for updating the version number of the communication protocol in the distributed system according to the embodiment of the invention can identify the change of the data structure: that is, based on the abstract syntax tree, all syntax information (including data structure member names, type expansion, memory occupation size, and the like) of a certain data structure is obtained, a character string is generated, and the summary information MD5 is calculated, which indicates that the data structure is changed if MD5 is changed.
Generally, the method for updating the version number of the communication protocol in the distributed system according to the embodiment of the invention can realize the function of automatically updating and submitting the version number of the communication protocol through the post-commit and pre-push hook scripts of the GIT, only a macro statement is used as the communication protocol at the definition position of the communication data structure, and the subsequent updating of all the version numbers is completed by the hook scripts of the GIT. The method for automatically updating the communication protocol version based on the GIT can avoid the problems of low labor cost, low efficiency and high error probability caused by manual maintenance, and can be applied to the field of communication protocol consistency guarantee of an interprocess communication system. An interprocess communication system refers to a communication system between software running on a computer (or embedded device). The interprocess communication protocol refers to a communication information structure negotiated among different processes and definition thereof, and communication links can be various: such as network port, USB, serial port, etc. The interprocess communication system comprises a plurality of different program installation packages, and the communication protocol among the programs needs to keep consistency, thereby ensuring that the communication content can be correctly transmitted and responded. Therefore, the method for updating the version number of the communication protocol by the distributed system according to the embodiment of the invention can be applied to the application (such as a robot system) which needs a large amount of interprocess communication, greatly improve the maintenance efficiency of the communication protocol and ensure the correctness of the communication.
The method for updating the version number of the communication protocol in the distributed system according to the embodiment of the invention is exemplarily described above. For example, the method for updating the version number of the communication protocol in the distributed system according to the embodiment of the present invention may be implemented in the distributed system, or may be implemented in any device, apparatus, or system having a memory and a processor. In addition, the method for updating the version number of the communication protocol in the distributed system according to the embodiment of the invention can also be implemented in any interprocess communication system.
According to another aspect of the present invention, there is provided a computing device including a plurality of modules, the modules communicating with each other through a preset communication protocol, the computing device updating the version number of the preset communication protocol by using the method for updating the version number of the communication protocol in the distributed system described above with reference to fig. 1 and 2. A computing device employing a method of updating a communication protocol version number for a distributed system according to an embodiment of the present invention is described below in conjunction with fig. 3. Fig. 3 illustrates a schematic block diagram of an exemplary computing device 300 employing a method for updating a communication protocol version number for a distributed system in accordance with an embodiment of the present invention.
As shown in fig. 3, computing device 300 includes a plurality of components (or referred to as modules), each including one or more processors 302, one or more memory devices 304, input devices 306, and output devices 308, interconnected by a bus system 310 and/or other form of connection mechanism (not shown). It should be noted that the components and configuration of computing device 300 shown in FIG. 3 are exemplary only, and not limiting, and that the computing device may have other components and configurations as desired.
The processor 302 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the computing device 300 to perform desired functions.
The storage 304 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by processor 302 to implement the functionality of updating a communication protocol version number in the embodiments of the invention described above (implemented by the processor) and/or other desired functionality. Various applications and various data, such as various data used and/or generated by the applications, may also be stored in the computer-readable storage medium.
The input device 306 may be a device used by a user to input instructions and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.
The output device 308 may output various information (e.g., images or sounds) to an external (e.g., user), and may include one or more of a display, a speaker, and the like.
The above components of the computing device 300 may communicate with each other through a preset communication protocol, and the version number of the preset communication protocol is automatically updated by using the aforementioned method for updating the version number of the communication protocol in the distributed system according to the embodiment of the present invention.
Exemplary computing device 300, which may employ the method of updating a communication protocol version number for a distributed system according to embodiments of the present invention, may illustratively be implemented as a terminal, such as a smartphone, tablet, or any electronic device having computing capabilities.
According to a further aspect of the present invention, there is provided a storage medium on which program instructions are stored, which program instructions, when executed by a computer or a processor, are adapted to perform the respective steps of the method of updating a communication protocol version number for a distributed system of an embodiment of the present invention. The storage medium may include, for example, a memory card of a smart phone, a storage component of a tablet computer, a hard disk of a personal computer, a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a portable compact disc read only memory (CD-ROM), a USB memory, or any combination of the above storage media. The computer-readable storage medium may be any combination of one or more computer-readable storage media.
According to still another aspect of the present invention, there is provided an autopilot system including a plurality of modules communicating with each other through a preset communication protocol, the autopilot system updating the version number of the preset communication protocol by using the method of updating the version number of the communication protocol in a distributed system described above with reference to fig. 1 and 2. An example autopilot system employing a method for updating a communication protocol version number for a distributed system in accordance with an embodiment of the present invention is described below in conjunction with fig. 4. Fig. 4 shows a schematic block diagram of an example autopilot system 400 that employs a method of updating a communication protocol version number for a distributed system in accordance with an embodiment of the present invention.
As shown in fig. 4, the autopilot system 400 includes a vehicle position identification module 410, a vehicle state identification module 420, an external environment identification module 430, a travel plan generation module 440, and a vehicle control module 450. Wherein the vehicle location identification module 410 is configured to identify a location of the vehicle on the map. The vehicle state identification module 420 is configured to identify a vehicle state of the vehicle. The external environment identification module 430 is configured to identify an external environment of the vehicle. The travel plan generation module 440 is configured to generate a travel plan including a control target value of the automatic driving control of the vehicle based on the vehicle position identified by the vehicle position identification module 410, the vehicle state identified by the vehicle state identification module 420, and the external environment identified by the external environment identification module 430. The vehicle control module 450 is configured to send an instruction to a brake of the vehicle based on the control target value of the travel plan generated by the travel plan generation module 440, thereby executing the automated driving control.
As shown in fig. 4, the autopilot system 400 includes a plurality of modules, respectively, a vehicle position identification module 410, a vehicle state identification module 420, an external environment identification module 430, a travel plan generation module 440, and a vehicle control module 450. The vehicle position identification module 410, the vehicle state identification module 420 and the external environment identification module 430 all need to communicate with the driving plan generation module 440 (i.e. transmit their identification results to the driving plan generation module 440), the driving plan generation module 440 needs to communicate with the vehicle control module 450 (i.e. transmit its generated driving plan to the vehicle control module 450), therefore, all these communications between these modules need to adopt a certain communication protocol, and the communication protocols between these modules must be consistent to ensure the correct implementation of the communications. Based on this, the autopilot system 400 can detect whether the communication protocol between its modules has changed (has remained consistent) by updating the version number of the communication protocol according to the distributed system described above with reference to fig. 1 and 2, and if so, automatically update to correctly maintain communication, thereby ensuring reliable and safe autopilot.
The following describes in detail a process in which the autopilot system 400 detects the consistency of the communication protocols among the modules of the vehicle position identification module 410, the vehicle state identification module 420, the external environment identification module 430, the travel plan generation module 440, and the vehicle control module 450 by using the method of updating the communication protocol version numbers according to the distributed system described above with reference to fig. 1 and 2, and updates the communication protocol version numbers when a change in the communication protocols is detected.
First, as described above, the vehicle position identification module 410, the vehicle state identification module 420, and the external environment identification module 430 each need to communicate with the travel plan generation module 440 (i.e., transfer their identification results to the travel plan generation module 440), the travel plan generation module 440 needs to communicate with the vehicle control module 450 (i.e., transfer its generated travel plan to the vehicle control module 450), and the vehicle position identification module 410, the vehicle state identification module 420, the external environment identification module 430, and the vehicle control module 450 may communicate with the travel plan generation module 440 using the same communication protocol, respectively. Therefore, it is necessary to determine whether or not the communication protocol data structures in the codes implementing the vehicle position identification module 410, the vehicle state identification module 420, the external environment identification module 430, the travel plan generation module 440, and the vehicle control module 450 are changed in the modification of their respective code versions.
For distinction, a code implementing the vehicle position recognition module 410 is defined as a vehicle position recognition code, a code implementing the vehicle state recognition module 420 is defined as a vehicle state recognition code, a code implementing the external environment recognition module 430 is defined as an external environment recognition code, a code implementing the travel plan generation module 440 is defined as a travel plan generation code, and a code implementing the vehicle control module 450 is defined as a vehicle control code. In these codes, the same structure body conforming to the preset naming specification is used to define the communication protocol data structure (for example, the aforementioned data structure beginning with communication _ api). Based on this, it is possible to detect whether a change occurs in the communication protocol data structure thereof after implementing the modification of the code version of each of the aforementioned five modules.
For example, for a code version of the vehicle state identification code, the respective syntax structure representations (e.g., abstract syntax trees) of the code version and a code version before the code version may be generated based on the hook script of the distributed version control software, which are respectively defined as a first syntax structure representation and a second syntax structure representation; then, acquiring respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation (for example, analyzing the first syntax structure representation and the second syntax structure representation to search for a data structure conforming to the preset naming specification, and then acquiring a data type of a first member of the data structure conforming to the preset naming specification to obtain the communication protocol data structure), which are respectively defined as a first communication data structure and a second communication data structure; then generating a first text message based on all the syntax information of the first communication data structure and a second text message based on all the syntax information of the second communication data structure (e.g., combining all the syntax information of the first communication data structure into a first string and combining all the syntax information of the second communication data structure into a second string); then calculating respective unique identifications of the first text message and the second text message (for example, calculating respective MD5 values of the first text message and the second text message), which are respectively defined as a first unique identification and a second unique identification; finally, the first unique identifier and the second unique identifier are compared, and the version number of the first communication protocol is updated when the first unique identifier and the second unique identifier are different. That is, for a code version of the vehicle state identification code, if the MD5 values of the character strings combined by all the information of the respective communication protocol data structures of the code version are not equal compared with the code version before the code version, it indicates that the communication protocol data structure is changed compared with the code version before the code version, and the communication protocol version number corresponding to the communication protocol data structure should be modified (e.g., the version number is incremented by 1). If the MD5 value of the string combined by all the information of their respective communication protocol data structures is equal when the code version is compared with the code version before the code version, it indicates that the communication protocol data structure is unchanged when the code version is compared with the code version before the code version, and the communication protocol version number corresponding to the communication protocol data structure does not need to be modified.
Similarly, for the vehicle state identification code, the external environment identification code, the travel plan generation code, and the vehicle control code, it is possible to adopt the method described above to detect whether a change has occurred in the communication protocol data structure therein, and to automatically update the communication protocol version number when the change has occurred.
The automatic driving system and the automatic updating method of the communication protocol version number between the modules thereof according to the embodiment of the present invention are exemplarily described above, and it should be understood that the automatic driving system shown in fig. 4 is merely exemplary, the automatic driving system may further include any other required modules not shown, and the communication protocol between the modules may also be updated by the method of updating the communication protocol version number by using the distributed system according to the embodiment of the present invention.
According to still another aspect of the present invention, there is also provided a vehicle, where the vehicle may include the above-mentioned autopilot system, and the autopilot system of the vehicle may update the communication protocol used for communication between the modules thereof according to the method for updating the version number of the communication protocol by the distributed system according to the embodiment of the present invention, and a person skilled in the art may understand the method for updating the communication protocol by combining the foregoing description, and details are not described here for brevity.
According to yet another aspect of the present invention, there is also provided a drone, which may include a flight control system including a plurality of modules communicating with each other through a preset communication protocol, the drone updating the version number of the preset communication protocol using the method of updating the version number of the communication protocol of the distributed system described above with reference to fig. 1 and 2. An example drone employing a method of updating a communication protocol version number for a distributed system according to an embodiment of the invention is described below in conjunction with fig. 5. Fig. 5 shows a schematic block diagram of an exemplary drone 500 that employs a method of updating a communication protocol version number for a distributed system according to an embodiment of the present invention.
As shown in fig. 5, the drone 500 includes a flight control system including an instruction signal receiving module 510, a sensor data processing module 520, and a control amount calculating module 530. The command signal receiving module 510 is configured to receive a command from a remote controller (not shown) of the drone 500 and a sensor signal from a sensor, transmit the received sensor signal to the sensor data processing module 520, and transmit the received command from the remote controller to the control amount calculating module 530. The sensor data processing module 520 is configured to process and calculate the sensor signal to obtain position and orientation information of the drone 500, and transmit the position and orientation information obtained by processing to the control quantity calculating module 530. The control amount calculation module 530 is configured to calculate a control amount of a corresponding controller based on an instruction of the remote controller and the position and orientation information, and output the control amount to a driving mechanism.
As described above, the drone 500 includes a flight control system including a plurality of modules, respectively, a command signal receiving module 510, a sensor data processing module 520, and a control amount calculating module 530. The command signal receiving module 510, the sensor data processing module 520, and the control amount calculating module 530 all need to communicate with each other. Therefore, a certain communication protocol is required for the communication between the modules, and the communication protocol between the modules must be consistent to ensure the correct implementation of the communication. Based on this, the drone 500 may adopt the method of updating the version number of the communication protocol according to the distributed system described above with reference to fig. 1 and fig. 2 to detect whether the communication protocol between the modules of its flight control system changes (keeps consistent), and if so, automatically update to correctly keep communication, thereby realizing correct and safe operation of the drone.
The following describes in detail a process in which the drone 500 detects consistency of the communication protocol among the modules of the instruction signal receiving module 510, the sensor data processing module 520, and the control amount calculating module 530 by using the method of updating the communication protocol version number according to the distributed system described above with reference to fig. 1 and 2, and updates the communication protocol version number when detecting a change in the communication protocol.
First, as described above, the command signal receiving module 510, the sensor data processing module 520, and the control amount calculating module 530 all need to communicate with each other. Therefore, it is necessary to determine whether or not the communication protocol data structure in the code implementing the instruction signal receiving module 510, the sensor data processing module 520, and the control amount calculating module 530 is changed in the modification of the respective code versions thereof.
For distinction, a code implementing the instruction signal receiving module 510 is defined as an instruction signal receiving code, a code implementing the sensor data processing module 520 is defined as a sensor data processing code, and a code implementing the control amount calculating module 530 is defined as a control amount calculating code. In these codes, the same structure body conforming to the preset naming specification is used to define the communication protocol data structure (for example, the aforementioned data structure beginning with communication _ api). Based on this, it can be detected whether the communication protocol data structure changes after the modification of the code version of each of the aforementioned three modules is implemented.
For example, for a code version of the instruction signal receiving code, the respective syntax structure representations (e.g. abstract syntax trees) of the code version and the code version before the code version can be generated based on the hook script of the distributed version control software, which are respectively defined as a first syntax structure representation and a second syntax structure representation; then, acquiring respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation (for example, analyzing the first syntax structure representation and the second syntax structure representation to search for a data structure conforming to the preset naming specification, and then acquiring a data type of a first member of the data structure conforming to the preset naming specification to obtain the communication protocol data structure), which are respectively defined as a first communication data structure and a second communication data structure; then generating a first text message based on all the syntax information of the first communication data structure and a second text message based on all the syntax information of the second communication data structure (e.g., combining all the syntax information of the first communication data structure into a first string and combining all the syntax information of the second communication data structure into a second string); then calculating respective unique identifications of the first text message and the second text message (for example, calculating respective MD5 values of the first text message and the second text message), which are respectively defined as a first unique identification and a second unique identification; finally, the first unique identifier and the second unique identifier are compared, and the version number of the first communication protocol is updated when the first unique identifier and the second unique identifier are different. That is, for a code version of the instruction signal receiving code, if the MD5 values of the character strings combined by all the information of the respective communication protocol data structures of the code version are not equal compared with the code version before the code version, it indicates that the communication protocol data structure is changed compared with the code version before the code version, and the communication protocol version number corresponding to the communication protocol data structure should be modified (for example, the version number is incremented by 1). If the MD5 value of the string combined by all the information of their respective communication protocol data structures is equal when the code version is compared with the code version before the code version, it indicates that the communication protocol data structure is unchanged when the code version is compared with the code version before the code version, and the communication protocol version number corresponding to the communication protocol data structure does not need to be modified.
Similarly, for both the sensor data processing code and the control amount calculation code, the above-described method may be employed to detect whether a change has occurred in the communication protocol data structure therein, and the above-described method may be employed to automatically update the communication protocol version number when the change has occurred.
The above describes the automatic updating method of the communication protocol version number between modules of the unmanned aerial vehicle and the flight control system thereof according to the embodiment of the present invention by way of example, it should be understood that the unmanned aerial vehicle and the flight control system thereof shown in fig. 5 are only exemplary, the unmanned aerial vehicle and the flight control system thereof may further include any other required modules that are not shown, and the communication protocol between these modules may also be updated by adopting the method of updating the communication protocol version number by using the distributed system according to the embodiment of the present invention.
The application scenario of the method for updating the version number of the communication protocol in the distributed system according to the embodiment of the invention is exemplarily described above. Based on the above description, the method for updating the version number of the communication protocol by the distributed system and the device or system using the method generate the syntax structure representation for the code versions before and after modification, acquire the communication protocol data structure from the generated syntax structure representation, determine whether the communication protocol changes by comparing the unique identifier of the communication protocol data structure, and automatically update the version number of the communication protocol if the communication protocol changes, thereby greatly improving the reliability of the distributed system for finding the change of the communication protocol and the efficiency for updating the version number of the communication protocol, and effectively solving the problems of easy omission and low efficiency in a manual mode.
Although the illustrative embodiments have been described herein with reference to the accompanying drawings, it is to be understood that the foregoing illustrative embodiments are merely exemplary and are not intended to limit the scope of the invention thereto. Various changes and modifications may be effected therein by one of ordinary skill in the pertinent art without departing from the scope or spirit of the present invention. All such changes and modifications are intended to be included within the scope of the present invention as set forth in the appended claims.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one logical functional division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another device, or some features may be omitted, or not executed.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the method of the present invention should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
It will be understood by those skilled in the art that all of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where such features are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some of the modules according to embodiments of the present invention. The present invention may also be embodied as apparatus programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The above description is only for the specific embodiment of the present invention or the description thereof, and the protection scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and the changes or substitutions should be covered within the protection scope of the present invention. The protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (33)

1. A method for updating a communication protocol version number in a distributed system, wherein the distributed system comprises a plurality of modules, and the modules communicate with each other through a preset communication protocol, and the method comprises the following steps:
generating respective grammar structure representations of the code version before modification and the code version after modification, and respectively defining the grammar structure representations as a first grammar structure representation and a second grammar structure representation;
acquiring respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation, and defining the respective communication protocol data structures as a first communication data structure and a second communication data structure;
generating a first text message based on all the syntax information of the first communication data structure and a second text message based on all the syntax information of the second communication data structure;
calculating respective unique identifications of the first text message and the second text message, and respectively defining the unique identifications as a first unique identification and a second unique identification; and
and comparing the first unique identification with the second unique identification, and updating the version number of the preset communication protocol when the first unique identification and the second unique identification are different.
2. The method according to claim 1, wherein the respective communication protocol data structures in the pre-modification code version and the post-modification code version are generated based on a preset structure, and the preset structure conforms to a preset naming specification.
3. The method of claim 2, wherein obtaining the respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation comprises:
analyzing the first syntactic structure representation and the second syntactic structure representation to search a data structure conforming to the preset naming specification; and
and acquiring the data type of the first member of the data structure which accords with the preset naming specification to obtain the communication protocol data structure.
4. The method of claim 1, wherein generating the respective syntactic structure representations of the pre-modified code version and the modified code version comprises:
and generating abstract syntax trees of the code version before modification and the code version after modification respectively.
5. The method of claim 1, wherein generating a first text message based on all syntax information of the first communication data structure and generating a second text message based on all syntax information of the second communication data structure comprises:
all the syntax information of the first communication data structure is combined into a first character string, and all the syntax information of the second communication data structure is combined into a second character string.
6. The method of claim 5, wherein the all syntax information includes self information and sub-member information of the communication data structure.
7. The method according to claim 6, wherein the self information includes domain name information, data structure type information, and occupancy size information.
8. The method of claim 6, wherein the child member information comprises child member name information, basic data type information, development information and occupancy size information for a structure/enumeration/association/definition type.
9. The method of claim 1, wherein said calculating a unique identifier for each of said first text message and said second text message comprises:
calculating respective message digest values for the first text message and the second text message.
10. Method according to any of claims 1-9, characterized in that the method is implemented based on hook scripts of decentralized version control software.
11. An autopilot system comprising a plurality of modules communicating via a predetermined communication protocol, wherein the autopilot system updates the version number of the predetermined communication protocol by a method of updating the version number of the communication protocol by a distributed system according to any one of claims 1 to 10.
12. A vehicle, characterized in that the vehicle comprises an autonomous driving system comprising a plurality of modules communicating among themselves through a preset communication protocol, the version number of which is updated by a method comprising the steps of:
generating respective grammar structure representations of the code version before modification and the code version after modification, and respectively defining the grammar structure representations as a first grammar structure representation and a second grammar structure representation;
acquiring respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation, and defining the respective communication protocol data structures as a first communication data structure and a second communication data structure;
generating a first text message based on all the syntax information of the first communication data structure and a second text message based on all the syntax information of the second communication data structure;
calculating respective unique identifications of the first text message and the second text message, and respectively defining the unique identifications as a first unique identification and a second unique identification; and
and comparing the first unique identification with the second unique identification, and updating the version number of the preset communication protocol when the first unique identification and the second unique identification are different.
13. The vehicle of claim 12, wherein the respective communication protocol data structures in the pre-modification code version and the post-modification code version are each generated based on a preset structure that conforms to a preset naming convention.
14. The vehicle of claim 13, wherein said obtaining the respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation comprises:
analyzing the first syntactic structure representation and the second syntactic structure representation to search a data structure conforming to the preset naming specification; and
and acquiring the data type of the first member of the data structure which accords with the preset naming specification to obtain the communication protocol data structure.
15. The vehicle of claim 12, wherein generating the respective syntactic structure representations of the pre-modified code version and the modified code version comprises:
and generating abstract syntax trees of the code version before modification and the code version after modification respectively.
16. The vehicle of claim 12, wherein generating a first text message based on all grammar information for the first communication data structure and generating a second text message based on all grammar information for the second communication data structure comprises:
all the syntax information of the first communication data structure is combined into a first character string, and all the syntax information of the second communication data structure is combined into a second character string.
17. The vehicle of claim 16, wherein the all-grammar information includes self information and sub-member information of a communication data structure.
18. The vehicle according to claim 17, characterized in that the own information includes domain name information, data structure type information, and occupancy size information.
19. The vehicle of claim 17, wherein the child member information comprises child member name information, basic data type information, deployment information and occupancy size information for a structure/enumeration/association/definition type.
20. The vehicle of claim 12, wherein said calculating a unique identification for each of said first text message and said second text message comprises:
calculating respective message digest values for the first text message and the second text message.
21. Vehicle according to any of claims 12-20, characterized in that the method is implemented based on hook scripts of decentralized version control software.
22. A drone, characterized in that it comprises a flight control system comprising a plurality of modules communicating among them through a preset communication protocol, the version number of which is updated by a method comprising the steps of:
generating respective grammar structure representations of the code version before modification and the code version after modification, and respectively defining the grammar structure representations as a first grammar structure representation and a second grammar structure representation;
acquiring respective communication protocol data structures in the first syntax structure representation and the second syntax structure representation, and defining the respective communication protocol data structures as a first communication data structure and a second communication data structure;
generating a first text message based on all the syntax information of the first communication data structure and a second text message based on all the syntax information of the second communication data structure;
calculating respective unique identifications of the first text message and the second text message, and respectively defining the unique identifications as a first unique identification and a second unique identification; and
and comparing the first unique identification with the second unique identification, and updating the version number of the preset communication protocol when the first unique identification and the second unique identification are different.
23. The drone of claim 22, wherein the respective communication protocol data structures in the pre-modification code version and the post-modification code version are each generated based on a preset structure that conforms to a preset naming convention.
24. The drone of claim 23, wherein the obtaining the respective communication protocol data structures in the first and second syntax structure representations comprises:
analyzing the first syntactic structure representation and the second syntactic structure representation to search a data structure conforming to the preset naming specification; and
and acquiring the data type of the first member of the data structure which accords with the preset naming specification to obtain the communication protocol data structure.
25. The drone of claim 22, wherein generating the respective syntactic structure representations of the pre-modified code version and the modified code version comprises:
and generating abstract syntax trees of the code version before modification and the code version after modification respectively.
26. The drone of claim 22, wherein generating a first text message based on all the syntax information of the first communication data structure and generating a second text message based on all the syntax information of the second communication data structure comprises:
all the syntax information of the first communication data structure is combined into a first character string, and all the syntax information of the second communication data structure is combined into a second character string.
27. The drone of claim 26, wherein the all syntax information includes self information and sub-member information of the communication data structure.
28. The drone of claim 27, wherein the self information comprises domain name information, data structure type information, and occupancy size information.
29. The drone of claim 27, wherein the child member information includes child member name information, basic data type information, development information and occupancy size information for structure/enumeration/association/definition types.
30. The drone of claim 22, wherein the calculating the unique identification of each of the first text message and the second text message comprises:
calculating respective message digest values for the first text message and the second text message.
31. A drone according to any of claims 22-30, characterized in that the method is implemented based on hook scripts of decentralized version control software.
32. A computing device, characterized in that the computing device comprises a plurality of modules, the modules communicate with each other through a preset communication protocol, and the computing device updates the version number of the preset communication protocol by adopting the method for updating the version number of the communication protocol in the distributed system according to any one of claims 1 to 10.
33. A storage medium having stored thereon a computer program which, when executed, performs a method of updating a communication protocol version number for a distributed system according to any of claims 1-10.
CN201980008482.6A 2019-05-23 2019-05-23 Updating communication protocol version numbers in distributed systems Pending CN111684766A (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/088172 WO2020232707A1 (en) 2019-05-23 2019-05-23 Update of communication protocol version number in distributed system

Publications (1)

Publication Number Publication Date
CN111684766A true CN111684766A (en) 2020-09-18

Family

ID=72451453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980008482.6A Pending CN111684766A (en) 2019-05-23 2019-05-23 Updating communication protocol version numbers in distributed systems

Country Status (2)

Country Link
CN (1) CN111684766A (en)
WO (1) WO2020232707A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799677A (en) * 2021-02-05 2021-05-14 北京字节跳动网络技术有限公司 Hook method, device, equipment and storage medium for compilation period
CN113868231A (en) * 2021-12-03 2021-12-31 南昌龙旗信息技术有限公司 Data structure updating method and device
CN114064041A (en) * 2021-11-18 2022-02-18 宁波波导易联电子有限公司 Method and system for automatically generating car control codes for car control matrix file through Android system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113568876B (en) * 2021-08-04 2024-03-26 江苏爱玛车业科技有限公司 Method and device for automatically generating DBC file

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1246186A (en) * 1996-12-12 2000-03-01 量子网络私人有限公司 A distributed operating system
CN1668010A (en) * 2004-03-12 2005-09-14 微软公司 Tag-based schema for distributing update metadata in an update distribution system
US20090077165A1 (en) * 2007-09-14 2009-03-19 Rhodes Bradley J Workflow Manager For A Distributed System
US20150112955A1 (en) * 2013-10-21 2015-04-23 International Business Machines Corporation Mechanism for communication in a distributed database
CN106254305A (en) * 2015-06-05 2016-12-21 索尼公司 Distributed allowance list for safety updatability

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101018231B (en) * 2007-02-07 2010-05-26 重庆重邮信科通信技术有限公司 A detection method for self-adapted protocol version
EP2439904B1 (en) * 2008-06-07 2014-01-15 Coherent Logix Incorporated Transmitting and receiving control information for use with multimedia streams
CN102377821B (en) * 2011-10-17 2014-02-19 邦讯技术股份有限公司 Intelligent version updating method and device for network terminal equipment
US9262152B1 (en) * 2015-01-22 2016-02-16 Bank Of America Corporation Modular system including management and deployment of software updates and revisions
CN108429764B (en) * 2018-05-28 2021-03-30 烽火通信科技股份有限公司 Data transmission and analysis method based on private protocol

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1246186A (en) * 1996-12-12 2000-03-01 量子网络私人有限公司 A distributed operating system
CN1668010A (en) * 2004-03-12 2005-09-14 微软公司 Tag-based schema for distributing update metadata in an update distribution system
US20090077165A1 (en) * 2007-09-14 2009-03-19 Rhodes Bradley J Workflow Manager For A Distributed System
US20150112955A1 (en) * 2013-10-21 2015-04-23 International Business Machines Corporation Mechanism for communication in a distributed database
CN106254305A (en) * 2015-06-05 2016-12-21 索尼公司 Distributed allowance list for safety updatability

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112799677A (en) * 2021-02-05 2021-05-14 北京字节跳动网络技术有限公司 Hook method, device, equipment and storage medium for compilation period
CN112799677B (en) * 2021-02-05 2023-09-12 北京字节跳动网络技术有限公司 Method, device, equipment and storage medium for hook of compiling period
CN114064041A (en) * 2021-11-18 2022-02-18 宁波波导易联电子有限公司 Method and system for automatically generating car control codes for car control matrix file through Android system
CN114064041B (en) * 2021-11-18 2022-08-02 宁波波导易联电子有限公司 Method and system for generating car control codes for car control matrix file through Android system
CN113868231A (en) * 2021-12-03 2021-12-31 南昌龙旗信息技术有限公司 Data structure updating method and device
CN113868231B (en) * 2021-12-03 2022-03-18 南昌龙旗信息技术有限公司 Data structure updating method and device

Also Published As

Publication number Publication date
WO2020232707A1 (en) 2020-11-26

Similar Documents

Publication Publication Date Title
CN111684766A (en) Updating communication protocol version numbers in distributed systems
US8887135B2 (en) Generating test cases for functional testing of a software application
US10489591B2 (en) Detection system and method thereof
CN107545181B (en) Program operating method, terminal, and computer-readable storage medium
CN106815031B (en) Kernel module loading method and device
KR101337874B1 (en) System and method for detecting malwares in a file based on genetic map of the file
US20170052884A1 (en) Generic test automation for restful web services applications
CN107766130B (en) Method and device for migrating virtual machine to container
CN112416327A (en) Project construction method and device, computer equipment and storage medium
US20170351510A1 (en) Method for recognizing application type
CN107643893B (en) Program detection method and device
CN112486629A (en) Micro-service state detection method and device, electronic equipment and storage medium
US20130339787A1 (en) Systematic failure remediation
CN109614325B (en) Method and device for determining control attribute, electronic equipment and storage medium
US20180025162A1 (en) Application program analysis apparatus and method
CN111144839A (en) Project construction method, continuous integration system and terminal equipment
JP2022091685A (en) Generation of programming language corpus
US9760470B2 (en) Device, method, and program analysis of new source code to be added to execution program to check for bug
CN110457085B (en) File processing method and device, terminal equipment and computer readable medium
US8589734B2 (en) Verifying correctness of processor transactions
CN111367890A (en) Data migration method and device, computer equipment and readable storage medium
CN110990346A (en) File data processing method, device, equipment and storage medium based on block chain
KR20210130694A (en) Universal runtime verification system between source language and language converted through transpiler
US9965344B2 (en) Method and apparatus for transmitting data in a robot operating system
CN108196975B (en) Data verification method and device based on multiple checksums and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200918

WD01 Invention patent application deemed withdrawn after publication