Intelligent driving interface management method and device, computer equipment and storage medium
Through automatic inspection mechanism and pre-configured inspection policies, automatic inspection and merge the interface code of the intelligent driving system, the problem of poor interface scalability and compatibility is solved, the system's real-time and reliability are improved, and maintenance costs are reduced.
Patent Information
- Application Number
- CN202510085085.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-05-13
AI Technical Summary
The poor interface scalability and compatibility of intelligent driving systems lead to low data transmission efficiency, poor real-time performance, and increases maintenance costs.
Adopt automatic detection mechanism and pre-configured inspection strategies, including file specification checks, interface backward compatibility checks, compilation checks and topic alignment checks, automated checks and merging interface codes, ensuring interface consistency and reliability, and replacing JSON with Protobuf serialization protocol to reduce data redundancy.
It improves the inspection efficiency and code quality of the interface, ensures the consistency and reliability of the interface, enhances the reliability and stability of the intelligent driving system, and reduces maintenance costs.
Smart Images

Figure CN119988224A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent driving technology, and in particular to a management method, device, computer equipment and storage medium for an intelligent driving interface. Background Art
[0002] In intelligent driving technology, interface management is the key to achieving efficient and stable data transmission between modules. In related technologies, it mainly relies on the text-based JavaScript Object Notation (JSON) serialization protocol. Since the JSON text format has the problems of high data redundancy and low transmission efficiency, it affects the real-time performance of the intelligent driving system. At the same time, when the interface is upgraded and expanded, it is often necessary to make major adjustments to the original data format, which makes it difficult to ensure the backward compatibility of the intelligent driving system and increases the maintenance cost. Summary of the invention
[0003] The purpose of the present invention is to provide a management method for an intelligent driving interface to solve the technical problems of poor interface scalability and compatibility in intelligent driving scenarios in the prior art.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0005] A method for managing an intelligent driving interface, comprising:
[0006] Obtaining an interface code merge request, wherein the interface code merge request includes an interface code file to be merged;
[0007] In response to the interface code merging request, a network callback function is called to trigger the automatic detection mechanism to take effect;
[0008] Based on the automatic detection mechanism, obtaining a plurality of pre-configured inspection strategies and an execution order of the inspection strategies;
[0009] The checking strategies are called in sequence according to the execution order to check the interface code files. If the interface code files pass the check, the interface code files are merged and the merged interface code files are released.
[0010] According to the above technical means, multiple inspection strategies and the execution order of the inspection strategies can be pre-configured based on the automatic detection mechanism, and when requesting the interface code merge, the network callback function is called to trigger the automatic detection mechanism, and the interface code file is automatically checked to achieve automated inspection and construction, reducing manual intervention, improving the inspection efficiency of the interface, ensuring the consistency and reliability of the interface, and further increasing the reliability and stability of the intelligent driving system. Moreover, when merging the interface code, there is no need to change the original data format, ensuring the backward compatibility of the interface during upgrades and expansions, and reducing maintenance costs.
[0011] Furthermore, the method further comprises:
[0012] Acquire key boot parameters of the compilation environment, and create an initial configuration file based on the key boot parameters;
[0013] Obtaining the compiled code required for the initial configuration file from a code library, and adding the compiled code to the initial configuration file to obtain a target configuration file;
[0014] A compilation environment is built based on the target configuration file, and multiple inspection strategies and the execution order of the inspection strategies are configured in the compilation environment, wherein the inspection strategies include: a file specification inspection strategy, an interface backward compatibility inspection strategy, a compilation inspection strategy, and a theme alignment inspection strategy.
[0015] According to the above technical means, the Protocol Buffers (Protobuf) serialization protocol can be used instead of JSON, which reduces data redundancy and the amount of data transmitted, thereby improving the real-time performance of the intelligent driving system. By executing the file specification check strategy, interface backward compatibility check strategy, compilation check strategy and theme alignment check strategy, the quality of the compilation process and the quality of the final interface code can be ensured, making the intelligent driving system more reliable and stable.
[0016] Further, when the inspection strategy is a file specification inspection strategy, the step of calling the inspection strategies in sequence according to the execution order to inspect the interface code file includes:
[0017] Reading an interface definition file from the interface code file, and obtaining file semantic parameters of the interface definition file;
[0018] Checking the semantic parameters of the file based on the check items in the file specification check strategy;
[0019] If the file semantic parameters meet the preset conditions corresponding to the inspection items, it is determined that the interface code file passes the file specification inspection.
[0020] According to the above technical means, the inspection efficiency can be improved and the errors and omissions of manual inspection can be reduced. By checking the file semantic parameters and making the file semantic parameters meet the preset conditions corresponding to the inspection items, the interface definition file can be easily identified and managed, and the correct file naming helps to improve the development efficiency and facilitate developers to quickly find the required interface definition files.
[0021] Further, when the checking strategy is an interface backward compatibility checking strategy, calling the checking strategies in sequence according to the execution order to check the interface code files includes:
[0022] Obtain the historical version file of the proto interface, and obtain the current version file of the proto interface from the interface code file;
[0023] Check each variable in the current version file according to the interface backward compatibility check strategy to confirm whether there is a situation where the variable name is the same as that in the historical version file but the format is changed, and whether there is an operation to modify the variable name already existing in the historical version file;
[0024] If no variable name or format has been modified, check whether there are new variables in the current version file;
[0025] If there are new variables in the current version file, check whether the naming of the new variables complies with the specification and whether there is a conflict with the variables in the historical version file;
[0026] If it is checked that the naming of the newly added variables complies with the specification and does not conflict with the variables of the historical version files, it is determined that the current version file of the proto interface in the interface code file passes the interface backward compatibility check.
[0027] According to the above technical means, backward compatibility of the interface can be achieved, ensuring that the current version file is compatible with the proto interface in the interface code file, which is convenient for the iteration and upgrade of the intelligent driving system. Moreover, by extending the field function, the interface can be gradually upgraded without causing too much impact on the existing intelligent driving system. Through the interface backward compatibility check, potential incompatibility issues can be discovered before the interface is upgraded, providing timely warnings for developers, allowing developers to make adjustments and repairs before releasing the new version to avoid problems in actual use.
[0028] Further, when the inspection strategy is a compilation inspection strategy, calling the inspection strategies in sequence according to the execution order to inspect the interface code files includes:
[0029] Compile the interface code file using the first platform version interface dynamic library to obtain a first compilation result;
[0030] If the first compilation result does not report an error, compile the interface code file using the second platform version interface dynamic library to obtain a second compilation result;
[0031] If the second compilation result does not report an error, it is determined that the interface code file passes the compilation check.
[0032] According to the above technical means, potential errors can be discovered and repaired in time, unpredictable problems can be avoided during operation, and the stability and reliability of the intelligent driving system can be improved. By compiling the interface code files on different platforms, it can be ensured that the interface code files can work normally on different platforms and meet the operation requirements in a multi-platform environment.
[0033] Further, when the checking strategy is a subject alignment checking strategy, calling the checking strategies in sequence according to the execution order to check the interface code files includes:
[0034] Obtain the subscribed topics and published topics of all modules from the interface code file;
[0035] Exclude the whitelist of subscribed topics, check whether the subscribed topics outside the whitelist have corresponding publishers, and whether the published topics have subscribers, and obtain the check results;
[0036] Determine whether the interface code file passes the subject alignment check according to the check result.
[0037] According to the above-mentioned technical means, inconsistencies in themes can be discovered in a timely manner, and corresponding measures can be taken to make adjustments to ensure the consistency of themes, thereby improving the overall performance and stability of the intelligent driving system.
[0038] Furthermore, the method further comprises:
[0039] If the interface code file fails the check, obtaining error information causing the interface code file to fail;
[0040] Query the solution corresponding to the error message;
[0041] The error message and the solution are sent to the requester corresponding to the interface code merge request.
[0042] According to the above-mentioned technical means, when the interface code file check fails, the requester can quickly locate the interface code where the error message appears, and query the corresponding solution based on the error message, so that the requester can quickly correct the errors in the interface code file, thereby improving development efficiency and code quality.
[0043] A management device for an intelligent driving interface, comprising:
[0044] A first acquisition module, configured to acquire an interface code merge request, wherein the interface code merge request includes an interface code file to be merged;
[0045] A trigger module, used to respond to the interface code merge request and call the network callback function to trigger the automatic detection mechanism to take effect;
[0046] A second acquisition module, used to acquire a plurality of pre-configured inspection strategies and an execution order of the inspection strategies based on the automatic detection mechanism;
[0047] The checking module is used to call the checking strategies in sequence according to the execution order to check the interface code files. If the interface code files pass the check, the interface code files are merged and the merged interface code files are released.
[0048] A computer device comprises: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the above method by executing the computer instructions.
[0049] A computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable a computer to execute the above method.
[0050] The technical solution provided by the present invention has the following advantages:
[0051] (1) According to the above technical means, the present invention can pre-configure multiple inspection strategies and the execution order of the inspection strategies based on the automatic detection mechanism, and when requesting the interface code merge, call the network callback function to trigger the automatic detection mechanism, automatically check the interface code file, so as to realize automatic inspection and construction, reduce manual intervention, improve the inspection efficiency of the interface, ensure the consistency and reliability of the interface, and further increase the reliability and stability of the intelligent driving system. Moreover, when merging the interface code, there is no need to change the original data format, which ensures the backward compatibility of the interface during upgrade and expansion, and reduces the maintenance cost.
[0052] (2) According to the above technical means, the present invention can use the Protobuf serialization protocol instead of JSON, which reduces data redundancy and the amount of transmitted data, thereby improving the real-time performance of the intelligent driving system. By executing the file specification check strategy, the interface backward compatibility check strategy, the compilation check strategy, and the theme alignment check strategy, the quality of the compilation process and the quality of the final interface code can be ensured, making the intelligent driving system more reliable and stable.
[0053] (3) According to the above technical means, the present invention can improve the inspection efficiency and reduce the errors and omissions of manual inspection. By checking the file semantic parameters and making the file semantic parameters meet the preset conditions corresponding to the inspection items, the interface definition file can be easily identified and managed, and the correct file naming helps to improve the development efficiency and facilitate developers to quickly find the required interface definition files.
[0054] (4) According to the above technical means, the present invention can achieve backward compatibility of the interface, ensuring that the current version file is compatible with the proto interface in the interface code file, which is convenient for the iteration and upgrade of the intelligent driving system. Moreover, by extending the field function, the interface can be gradually upgraded without causing too much impact on the existing intelligent driving system. Through the interface backward compatibility check, potential incompatibility issues can be discovered before the interface is upgraded, providing timely warnings for developers, allowing developers to make adjustments and repairs before releasing the new version to avoid problems in actual use.
[0055] (5) According to the above technical means, the present invention can timely discover and repair potential errors, avoid unpredictable problems during operation, and improve the stability and reliability of the intelligent driving system. By compiling the interface code files on different platforms, it can be ensured that the interface code files can work normally on different platforms and meet the operation requirements in a multi-platform environment.
[0056] (6) According to the above technical means, the present invention can timely discover the inconsistency of the theme and take corresponding measures to make adjustments to ensure the consistency of the theme, thereby improving the overall performance and stability of the intelligent driving system.
[0057] (7) According to the above technical means, when the interface code file fails the check, the present invention can enable the requester to quickly locate the interface code where the error message appears, and based on the corresponding solution based on the error message query, the requester can quickly correct the error in the interface code file, thereby improving development efficiency and code quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 A schematic diagram of a flow chart of a method for managing an intelligent driving interface provided by an embodiment of the present invention;
[0060] Figure 2 A schematic flow chart of a method for managing an intelligent driving interface provided by another embodiment of the present invention;
[0061] Figure 3 A schematic flow chart of a method for managing an intelligent driving interface provided by another embodiment of the present invention;
[0062] Figure 4 A schematic flow chart of a method for managing an intelligent driving interface provided by another embodiment of the present invention;
[0063] Figure 5 A schematic flow chart of a method for managing an intelligent driving interface provided by another embodiment of the present invention;
[0064] Figure 6 A schematic flow chart of a method for managing an intelligent driving interface provided by another embodiment of the present invention;
[0065] Figure 7 A schematic flow chart of a method for managing an intelligent driving interface provided by another embodiment of the present invention;
[0066] Figure 8 A schematic diagram of the structure of a management device for an intelligent driving interface provided by an embodiment of the present invention;
[0067] Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0068] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.
[0069] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0070] like Figure 1 As shown, this embodiment proposes a management method for an intelligent driving interface, comprising the following steps:
[0071] Step S100: Obtain an interface code merge request, wherein the interface code merge request includes an interface code file to be merged.
[0072] In step S100, when multiple developers develop or modify different parts of the interface code, they need to integrate the codes they have processed together, and then an interface code merge request is initiated. The interface code merge request includes the interface code file to be merged, and the interface code file includes various code changes made by the developers, such as newly added interface functions, optimization or repair of existing interfaces, etc.
[0073] Step S200, responding to the interface code merge request, calling the network callback function to trigger the automatic detection mechanism to take effect.
[0074] In step S200, upon receiving the interface code merge request, the intelligent driving system needs to respond and trigger the automatic detection mechanism by calling the network callback function. For example, a notification can be sent to Jenkins (an open source automation service platform) through a webhook to trigger the automatic detection mechanism, which then automatically performs a comprehensive and systematic check on the interface code requested to be merged, avoiding the introduction of problematic code into the main code base, thereby affecting the stability and functionality of the entire intelligent driving system.
[0075] Step S300: Based on the automatic detection mechanism, obtain multiple pre-configured inspection strategies and the execution order of the inspection strategies.
[0076] In step S300, since Jenkins has continuous integration capabilities, it can realize automated inspection and construction, which can effectively improve development efficiency and the continuous and efficient operation of the intelligent driving system. Based on Jenkins 2.426.3 version, multiple inspection strategies and the execution order of the inspection strategies can be pre-configured; through the pre-configured multiple inspection strategies and the execution order of the inspection strategies, it is possible to realize automated inspection of the interface code, improve development efficiency, and reduce human errors. Among them, the version of Jenkins is not limited to the use of Jenkins 2.426.3 version, but can also be other Jenkins versions that can realize automated inspection and construction. There is no specific limitation here, and you can choose according to your actual usage needs.
[0077] Step S400: Invoke the check strategies in order to check the interface code files. If the interface code files pass the check, merge the interface code files and publish the merged interface code files.
[0078] In step S400, each inspection strategy is called in turn to check the interface code file in a predetermined execution order. Each inspection strategy will perform corresponding detection operations on the interface code file according to its own settings and functions, and output the inspection results. If after a series of inspections, the interface code file successfully passes the inspection of all inspection strategies, it means that the interface code file requested to be merged meets the requirements of the intelligent driving system in all aspects. At this time, the interface code file requested to be merged can be merged; and after the merger is completed, the merged interface code file is released so that other developers can carry out subsequent development work based on the latest interface code, and promote the sustainable development of the entire intelligent driving system.
[0079] In this embodiment, multiple inspection strategies and the execution order of the inspection strategies are pre-configured based on the automatic detection mechanism, and when requesting the interface code merge, the network callback function is called to trigger the automatic detection mechanism, and the interface code file is automatically checked to achieve automated inspection and construction, reducing manual intervention, improving the inspection efficiency of the interface, ensuring the consistency and reliability of the interface, and further increasing the reliability and stability of the intelligent driving system. Moreover, when merging the interface code, there is no need to change the original data format, ensuring the backward compatibility of the interface during upgrades and expansions, and reducing maintenance costs.
[0080] like Figure 2 As shown, in one embodiment, the method further includes the following steps:
[0081] Step S500: obtaining key boot parameters of the compilation environment, and creating an initial configuration file based on the key boot parameters;
[0082] Step S600: Obtain the compiled code required for the initial configuration file from the code library, and add the compiled code to the initial configuration file to obtain the target configuration file;
[0083] Step S700, build a compilation environment based on the target configuration file, and configure multiple inspection strategies and the execution order of the inspection strategies in the compilation environment, wherein the inspection strategies include: file specification inspection strategy, interface backward compatibility inspection strategy, compilation inspection strategy and theme alignment inspection strategy.
[0084] In this embodiment, the key boot parameters of the compilation environment are first obtained, including the source branch, the destination branch, and the corresponding merge request ID (MRID) and other key boot parameters; then an initial configuration file is created according to the key boot parameters, and the format of the initial configuration file can be a protocol buffer. Using the protocol buffer (Protobuf) serialization protocol instead of JSON effectively reduces data redundancy and reduces the amount of transmitted data, thereby improving the real-time performance of the intelligent driving system.
[0085] After further obtaining the compilation code required for the initial configuration file from the code base, the obtained compilation code is added to the initial configuration file to further enrich and refine the content of the initial configuration file to make it the target configuration file. In the target configuration file, in addition to the key boot parameters set, the source file path to be compiled, the header file path, the execution order of the compilation script, and other information are clearly listed. Then, according to the contents described in the target configuration file, each component of the compilation environment is set one by one. For example, install the specified version of the compiler, configure the correct source file and header file path, set the execution order of the compilation script, etc.
[0086] Finally, configure the file specification check strategy, interface backward compatibility check strategy, compilation check strategy, and theme alignment check strategy in the compilation environment, and set the execution order of the check strategy. For example, the file specification check strategy may be executed first to ensure that the basic specifications of the interface code file meet the requirements, so that in subsequent inspections, operations can be performed based on more standardized files, reducing the inspection difficulties caused by problems such as confusing file formats; then the compilation check strategy is carried out to eliminate compilation problems, and then the interface backward compatibility check strategy and theme alignment check strategy are carried out to comprehensively ensure the quality of the interface code from different levels. By executing the file specification check strategy, interface backward compatibility check strategy, compilation check strategy, and theme alignment check strategy, the quality of the compilation process and the final interface code can be ensured, making the intelligent driving system more reliable and stable.
[0087] like Figure 3 As shown, in one embodiment, when the inspection strategy is a file specification inspection strategy, step S400 further includes the following steps:
[0088] Step S401: read an interface definition file from an interface code file, and obtain file semantic parameters of the interface definition file;
[0089] Step S402: Check the file semantic parameters based on the check items in the file specification check strategy;
[0090] Step S403: If the file semantic parameters meet the preset conditions corresponding to the inspection items, it is determined that the interface code file passes the file specification inspection.
[0091] In this embodiment, when the inspection strategy is a file specification inspection strategy, a Python (programming language) script is written, and the interface definition file is read from the interface code file using the Python script, and the file semantic parameters of the interface definition file are further obtained, including file name, message name, variable name, comment and other information. Then, the file name naming, message name naming, variable name naming, comment format, etc. are checked according to the inspection items in the file specification inspection strategy in the industry; if the file semantic parameters meet the preset conditions corresponding to the inspection items, it is determined that the interface code file passes the file specification inspection and meets the inspection items in the file specification inspection strategy in the industry. The file semantic parameter inspection is not limited to the above-mentioned inspections, but also includes a series of inspections such as macro naming inspection, enumeration naming inspection, and checking whether to add package (package) declarators, so as to more comprehensively ensure the correctness of the data format. Among them, protoc-gen-lint, Buf and other inspection tools can be used to check whether the file semantic parameters meet the preset conditions corresponding to the inspection items.
[0092] like Figure 4 As shown, in one embodiment, when the inspection strategy is an interface backward compatibility inspection strategy, step S400 further includes the following steps:
[0093] Step S404: Obtain the historical version file of the proto interface, and obtain the current version file of the proto interface from the interface code file;
[0094] Step S405: Check each variable in the current version file according to the interface backward compatibility check strategy to confirm whether there is a situation where the variable name is the same as that in the historical version file but the format is changed, and confirm whether there is an operation to modify the variable name already existing in the historical version file;
[0095] Step S406: If no variable name or format has been modified, check whether there is a new variable in the current version file;
[0096] Step S407: If there are new variables in the current version file, check whether the naming of the new variables complies with the specification and whether there is a conflict with the variables in the historical version file;
[0097] Step S408: If the naming of the newly added variables is checked to be in compliance with the specification and does not conflict with the variables of the historical version files, it is determined that the current version file of the proto interface in the interface code file passes the interface backward compatibility check.
[0098] In this embodiment, the Proto interface, whose full name is Protocol Buffers interface, is an interface form involved in a language-neutral, platform-neutral, and extensible mechanism for serializing structured data. When upgrading the interface version, obtain the historical version file of the proto interface, and obtain the current version file of the proto interface from the interface code file; the current version file uses the extended field function of Protobuf to add variables, so that developers can add new fields to the proto interface without destroying the historical version file. Then use the inspection tool to check each variable in the current version file according to the interface backward compatibility inspection strategy to confirm whether there is a situation where the variable name is the same as that in the historical version file but the format has changed, and confirm whether there is an operation to modify the variable name that already exists in the historical version file. To ensure that the historical version file can operate normally when interacting with the current version file. Among them, the inspection tools include gRPC-Gateway (gRPC-Gateway is a tool for converting gRPC services into RESTful APIs. It is mainly used to verify the compatibility and correctness between gRPC services and REST interfaces), Buf (Buf is a tool focused on Protocol Buffers (protobuf), mainly used to manage and check proto file-related content), etc.
[0099] After confirming that there are no modified variable names or formats, it is necessary to check whether there are new variables in the current version file; and after checking that there are new variables in the current version file, further check whether the naming of the new variables complies with the specifications and whether there are conflicts with the variables in the historical version file. Naming that complies with the specifications helps improve the readability and maintainability of the code, while avoiding errors in the intelligent driving system when processing data. When checking that the naming of the new variables complies with the specifications and does not conflict with the variables in the historical version file, and that there are no modified variable names or formats, it can be determined that the current version file of the proto interface in the interface code file passes the interface backward compatibility check. This ensures that there will be no problems caused by interface incompatibility when the historical version file interacts with the current version file.
[0100] Furthermore, when the interface version is upgraded, only variables are allowed to be added, and variable names and formats are not allowed to be modified. Newly added variables can provide support for new functions or requirements without affecting the use of existing variables by the proto interface. For example, if the proto interface relies on a specific variable for data processing, the name or format of this variable cannot be modified in the current version file, otherwise the proto interface may fail to recognize the variable or data parsing errors may occur when using it.
[0101] The embodiment of the present invention can achieve backward compatibility of the interface, ensuring that the current version file is compatible with the proto interface in the interface code file, which is convenient for the iteration and upgrade of the intelligent driving system. Moreover, by extending the field function, the interface can be gradually upgraded without causing too much impact on the existing intelligent driving system. Through the interface backward compatibility check, potential incompatibility issues can be discovered before the interface is upgraded, providing timely warnings for developers, allowing developers to make adjustments and repairs before releasing the new version to avoid problems in actual use.
[0102] like Figure 5 As shown, in one embodiment, when the inspection strategy is a compilation inspection strategy, step S400 further includes the following steps:
[0103] Step S409: compile the interface code file using the first platform version interface dynamic library to obtain a first compilation result;
[0104] Step S410: If the first compilation result does not report an error, compile the interface code file using the second platform version interface dynamic library to obtain a second compilation result;
[0105] Step S411: If the second compilation result does not report an error, it is determined that the interface code file passes the compilation check.
[0106] In this embodiment, the first platform can be X86 (X86 is usually a complex instruction set computer (CISC) architecture, the full name is "Intel 8086" microprocessor architecture and its subsequent compatible architecture), and the second platform can be ORIN (ORIN is a system-on-chip platform for autonomous driving and other fields. The full name is NVIDIA DRIVE Orin). When the inspection strategy is a compilation inspection strategy, first, install the X86 and ORIN platform compilation tools to ensure that the interface code can be effectively compiled. Then compile and generate the X86 version interface dynamic library through Protobuf3.20.1 version, and use the X86 version interface dynamic library to compile the interface code file to obtain the first compilation result, including detecting whether there are syntax errors, type mismatches, undefined variables or functions, etc. in the interface code file. If the first compilation result does not report an error, then compile and generate the ORIN version interface dynamic library through Protobuf3.20.1 version, and use the ORIN version interface dynamic library to compile the interface code file again to obtain the second compilation result, and detect whether there are the above errors in the interface code. If the second compilation result also does not report an error, it is determined that the interface code file passes the compilation check. By compiling and checking the interface code files, potential errors can be discovered and fixed in a timely manner, unpredictable problems can be avoided during operation, and the stability and reliability of the intelligent driving system can be improved. By using Protobuf for compilation, it can be ensured that the serialization and deserialization processes of the interface data meet the specifications and that efficient data transmission can be performed between different modules. By compiling and checking on different platforms, it can be ensured that the interface can work properly on different platforms and meet the operation requirements in a multi-platform environment.
[0107] like Figure 6 As shown, in one embodiment, when the inspection strategy is a subject alignment inspection strategy, step S400 further includes the following steps:
[0108] Step S412: Obtain the subscribed topics and published topics of all modules from the interface code file;
[0109] Step S413: exclude the whitelist of subscribed topics, check whether the subscribed topics outside the whitelist have corresponding publishers, and whether the published topics have subscribers, and obtain the check result;
[0110] Step S414: Determine whether the interface code file passes the subject alignment check based on the check result.
[0111] In this embodiment, when the check strategy is the topic alignment check strategy, the subscribed topics and published topics of all modules are crawled from the interface code file through the Python script to fully understand the use of topics in the intelligent driving system. After excluding the subscribed topic whitelist, for each subscribed topic, the published topic list is traversed to check whether there is a publisher matching it. If the subscribed topic has no corresponding publisher, the inconsistency is recorded, which may specifically include the name of the subscribed topic, the module to which it belongs, and other information. Then the same operation is performed on the published topic to check whether each published topic has a corresponding subscriber. If it is found that the published topic has no subscriber, the relevant information is also recorded and the inspection result is obtained. If it is found that the subscribed topic has no corresponding publisher or the published topic has no corresponding subscriber during the traversal process, any of these two situations can be determined to have failed the topic alignment check. After excluding the subscribed topic whitelist, by checking whether the subscribed topic outside the whitelist has a corresponding publisher and whether the published topic has a subscriber, the inconsistency of the topic can be discovered in time, and corresponding measures can be taken to adjust it to ensure the consistency of the topic, thereby improving the overall performance and stability of the intelligent driving system.
[0112] like Figure 7 As shown, in one embodiment, the method further includes the following steps:
[0113] Step 4010: If the interface code file fails to pass the check, the error information causing the interface code file to fail is obtained;
[0114] Step 4020, query the solution corresponding to the error information;
[0115] Step 4030: Send error information and solutions to the requester corresponding to the interface code merge request.
[0116] In this embodiment, when the interface code file is checked according to various pre-set inspection strategies, if the interface code file fails to meet all inspection requirements, it will be determined that the inspection fails. And obtain the error information that caused the interface code file to fail. For example, in the file specification check, it is found that the naming of the interface code file does not comply with the prescribed naming rules, or the annotations are incomplete and inaccurate; in the compilation check, syntax errors, link errors, etc. occur, resulting in the inability to compile normally; in the interface backward compatibility check, it may be found that the new version interface is incompatible with the old version interface, affecting the normal use of the interface by the existing module; in the topic alignment check, there are inconsistencies in the topics used by the parties involved in the communication, which may cause problems such as message loss or misrepresentation. Then, a targeted query solution is performed based on the specific error information obtained; and the error information and solution are sent to the requester corresponding to the interface code merge request, helping the requester to more efficiently find the error information in the interface code and modify the interface code file in time, thereby improving development efficiency and code quality.
[0117] like Figure 8 As shown, an embodiment of the present invention further provides a management device for an intelligent driving interface, including:
[0118] A first acquisition module 100 is used to acquire an interface code merge request, wherein the interface code merge request includes an interface code file to be merged;
[0119] The trigger module 200 is used to respond to the interface code merge request and call the network callback function to trigger the automatic detection mechanism to take effect;
[0120] A second acquisition module 300 is used to acquire a plurality of pre-configured inspection strategies and an execution order of the inspection strategies based on an automatic detection mechanism;
[0121] The checking module 400 is used to call the checking strategies in order of execution to check the interface code files. If the interface code files pass the check, the interface code files are merged and the merged interface code files are released.
[0122] In one embodiment, it also includes:
[0123] A third acquisition module is used to acquire key boot parameters of the compilation environment and create an initial configuration file based on the key boot parameters;
[0124] Add a module to obtain the compiled code required for the initial configuration file from the code library, and add the compiled code to the initial configuration file to obtain the target configuration file;
[0125] The configuration module is used to build a compilation environment based on the target configuration file, and configure multiple inspection strategies and the execution order of the inspection strategies in the compilation environment. The inspection strategies include: file specification inspection strategy, interface backward compatibility inspection strategy, compilation inspection strategy and theme alignment inspection strategy.
[0126] In one embodiment, the inspection module 400 includes:
[0127] A reading unit, used for reading an interface definition file from an interface code file and obtaining file semantic parameters of the interface definition file;
[0128] A first checking unit, configured to check the semantic parameters of the file based on the checking items in the file specification checking strategy;
[0129] The determination unit is used to determine whether the interface code file passes the file specification check if the file semantic parameters meet the preset conditions corresponding to the check items.
[0130] In one embodiment, the inspection module 400 further includes:
[0131] The first acquisition unit is used to acquire the historical version file of the proto interface and to acquire the current version file of the proto interface from the interface code file;
[0132] The second checking unit is used to check each variable in the current version file according to the interface backward compatibility checking strategy to confirm whether there is a situation where the variable name is the same as that in the historical version file but the format is changed, and to confirm whether there is an operation to modify the variable name already existing in the historical version file;
[0133] The third checking unit is used to check whether there are new variables in the current version file if there is no variable name or the format is modified;
[0134] The fourth checking unit is used to check whether the naming of the newly added variables complies with the specification and whether there is a conflict with the variables of the historical version file if there are newly added variables in the current version file;
[0135] The second determining unit is used to determine whether the current version file of the proto interface in the interface code file passes the interface backward compatibility check if it is checked that the naming of the newly added variable complies with the specification and does not conflict with the variables of the historical version file.
[0136] In one embodiment, the inspection module 400 further includes:
[0137] A first compiling unit, used to compile the interface code file using the first platform version interface dynamic library to obtain a first compiling result;
[0138] A second compilation unit is used to compile the interface code file using the second platform version interface dynamic library to obtain a second compilation result if the first compilation result does not report an error;
[0139] The third determining unit is configured to determine that the interface code file passes the compilation check if the second compilation result does not report an error.
[0140] In one embodiment, the inspection module 400 further includes:
[0141] The second acquisition unit is used to acquire the subscribed topics and published topics of all modules from the interface code file;
[0142] A fifth checking unit is used to exclude the whitelist of subscribed topics, check whether the subscribed topics outside the whitelist have corresponding publishers, and whether the published topics have subscribers, and obtain the checking result;
[0143] The fourth determining unit is used to determine whether the interface code file passes the subject alignment check according to the check result.
[0144] In one embodiment, it also includes:
[0145] The fourth acquisition module is used to obtain error information causing the interface code file to fail if the interface code file fails to pass the check;
[0146] Query module, used to query the solution corresponding to the error information;
[0147] The sending module is used to send error information and solutions to the requester corresponding to the interface code merge request.
[0148] Fig. 9 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0149] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0150] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0151] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of a computer device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0152] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0153] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0154] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0155] The above embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Any equivalent substitution or change made by a person skilled in the art based on the present invention is within the protection scope of the present invention.
Claims
1. A management method for an intelligent driving interface, characterized in that: include: Obtaining an interface code merge request, wherein the interface code merge request includes an interface code file to be merged; In response to the interface code merging request, a network callback function is called to trigger the automatic detection mechanism to take effect; Based on the automatic detection mechanism, obtaining a plurality of pre-configured inspection strategies and an execution order of the inspection strategies; The checking strategies are called in sequence according to the execution order to check the interface code files. If the interface code files pass the check, the interface code files are merged and the merged interface code files are released.
2. The management method according to claim 1, characterized in that: The method further comprises: Acquire key boot parameters of the compilation environment, and create an initial configuration file based on the key boot parameters; Obtaining the compiled code required for the initial configuration file from a code library, and adding the compiled code to the initial configuration file to obtain a target configuration file; A compilation environment is built based on the target configuration file, and multiple inspection strategies and the execution order of the inspection strategies are configured in the compilation environment, wherein the inspection strategies include: a file specification inspection strategy, an interface backward compatibility inspection strategy, a compilation inspection strategy, and a theme alignment inspection strategy.
3. The management method according to claim 2, characterized in that: When the inspection strategy is a file specification inspection strategy, calling the inspection strategies in sequence according to the execution order to inspect the interface code file includes: Reading an interface definition file from the interface code file, and obtaining file semantic parameters of the interface definition file; Checking the semantic parameters of the file based on the check items in the file specification check strategy; If the file semantic parameters meet the preset conditions corresponding to the inspection items, it is determined that the interface code file passes the file specification inspection.
4. The management method according to claim 2, characterized in that: When the checking strategy is an interface backward compatibility checking strategy, calling the checking strategies in sequence according to the execution order to check the interface code files includes: Obtain the historical version file of the proto interface, and obtain the current version file of the proto interface from the interface code file; Check each variable in the current version file according to the interface backward compatibility check strategy to confirm whether there is a situation where the variable name is the same as that in the historical version file but the format is changed, and whether there is an operation to modify the variable name already existing in the historical version file; If no variable name or format has been modified, check whether there are new variables in the current version file; If there are new variables in the current version file, check whether the naming of the new variables complies with the specification and whether there is a conflict with the variables in the historical version file; If it is checked that the naming of the newly added variables complies with the specification and does not conflict with the variables of the historical version files, it is determined that the current version file of the proto interface in the interface code file passes the interface backward compatibility check.
5. The management method according to claim 2, characterized in that: When the inspection strategy is a compilation inspection strategy, calling the inspection strategies in sequence according to the execution order to inspect the interface code files includes: Compiling the interface code file using the first platform version interface dynamic library to obtain a first compilation result; If the first compilation result does not report an error, compile the interface code file using the second platform version interface dynamic library to obtain a second compilation result; If the second compilation result does not report an error, it is determined that the interface code file passes the compilation check.
6. The management method according to claim 2, characterized in that: When the checking strategy is a subject alignment checking strategy, calling the checking strategies in sequence according to the execution order to check the interface code files includes: Obtain the subscribed topics and published topics of all modules from the interface code file; Exclude the whitelist of subscribed topics, check whether the subscribed topics outside the whitelist have corresponding publishers, and whether the published topics have subscribers, and obtain the check results; Determine whether the interface code file passes the subject alignment check according to the check result.
7. The management method according to claim 1, characterized in that: The method further comprises: If the interface code file fails the check, obtaining error information causing the interface code file to fail; Query the solution corresponding to the error message; The error message and the solution are sent to the requester corresponding to the interface code merge request.
8. A management device for an intelligent driving interface, characterized in that: include: A first acquisition module, configured to acquire an interface code merge request, wherein the interface code merge request includes an interface code file to be merged; A trigger module, used to respond to the interface code merge request and call the network callback function to trigger the automatic detection mechanism to take effect; A second acquisition module, used to acquire a plurality of pre-configured inspection strategies and an execution order of the inspection strategies based on the automatic detection mechanism; The checking module is used to call the checking strategies in sequence according to the execution order to check the interface code files. If the interface code files pass the check, the interface code files are merged and the merged interface code files are released.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.