Code download methods, devices, equipment and media

By combining an SOA service code generation system with a cross-compilation toolchain, the stability and adaptability of the communication protocol framework code in the vehicle software development process were achieved, solving the problems of compilation failure and poor platform compatibility, and improving R&D efficiency and confidence in code modification.

CN116319747BActive Publication Date: 2025-11-14CHONGQING CHANGAN TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202310171027.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2025-11-14
Estimated Expiration
2043-02-27

AI Technical Summary

Technical Problem

In the existing technology, during the vehicle software development process, the generation of communication protocol framework code has problems such as compilation failure, poor platform compatibility, and no guarantee of the impact of code changes. This results in long troubleshooting time and high repair costs, which has a serious impact, especially when problems are found after the actual vehicle is in use.

Method used

An SOA service code generation system is adopted, which performs basic compilation of the source code through a cross-compilation toolchain, verifies the communication function based on the code communication verification mechanism, caches the source code of normal communication, verifies code changes online in real time, and provides continuous integration and assurance mechanisms.

Benefits of technology

It improved the stability and adaptability of code generation, reduced labor costs, shortened the R&D cycle, reduced the cost of impact assessment caused by code changes, and increased iteration frequency and business expansion capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319747B_ABST
    Figure CN116319747B_ABST
Patent Text Reader

Abstract

This application provides a code download method, apparatus, device, and medium. The method includes: the SOA service code generation system generating source code based on application metadata and received code download instructions; performing basic compilation of the source code using a cross-compilation toolchain; verifying the communication function of the source code after basic compilation based on a code communication verification mechanism; and caching the source code with normal communication function as code to be downloaded in response to the code download instructions. This application directly performs online cross-compilation on source code generated on a cloud server and uses a communication verification mechanism to verify the communication function of the source code, ensuring that the downloaded source code is stable and reliable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computers, and more specifically, to a method, apparatus, device, and medium for downloading code. Background Technology

[0002] Currently, mainstream new energy vehicle-side services provide preset services and paid services to vehicle users based on SOA architecture. Communication between vehicle-side services generally uses a stable communication protocol. The resulting code, besides business logic, largely consists of code handling the communication protocol. To allow development teams to focus more on business logic code, an SOA service code generation system allows teams to define their own metadata, including applications, services, methods, and data types. Development teams can download the vehicle-side code, which encapsulates the communication protocol framework. Based on this code, teams can then develop their business logic, complete the main development processes such as development, testing, and system testing, and finally verify the code in a real vehicle.

[0003] Vehicle software development is mainly divided into different R&D teams based on hardware. Under the same hardware, different R&D teams are further subdivided according to different platforms. Automotive software is closely related to hardware, and the platforms are numerous and complex. The transition from traditional CAN signal to SOA architecture (DDS communication protocol) is a large leap. Due to insufficient experience accumulation, the problem chain is long and the hierarchy is unclear, resulting in long time consumption for troubleshooting and localization, and waste of resources.

[0004] To support the rapid transformation of automakers, the framework code for service communication must be stable and efficient, with stability being the primary metric. The generated framework code may present the following risks:

[0005] First, the generated code cannot be compiled using basic methods, or the code can only be compiled on a single platform and cannot be compiled on multiple platforms simultaneously.

[0006] Secondly, the code may have been modified by the code provider over time. Without an effective guarantee mechanism, if it is only discovered that the code cannot communicate normally in the later stages of development, the feedback will be severely delayed, the repair cost will be high, and the development progress will be delayed. Especially for problems that are only exposed after being put into actual vehicles, the impact will be immeasurable. Summary of the Invention

[0007] This invention provides a code download method, apparatus, device, and medium, which solves at least the following technical problems:

[0008] First, in the existing technology, when downloading the communication protocol framework code from the server to the terminal, a basic verification is still required. The operation to complete the basic verification is done manually, that is, it relies on manual labor.

[0009] Secondly, the communication protocol framework code located on the server may be modified by the provider over time. There is a lack of effective protection mechanisms in the existing technology. If it is only discovered that the code cannot communicate normally in the later stages of development, the feedback will be severely delayed, the repair cost will be high, and the development progress will be delayed. In particular, the impact of problems that are only exposed after the vehicle is put into actual use is immeasurable.

[0010] In a first aspect, this application provides a code download method applied to a first server, wherein the first server is equipped with an SOA service code generation system, the method comprising:

[0011] The SOA service code generation system generates source code based on application metadata and received code download instructions.

[0012] The source code was compiled using a cross-compilation toolchain.

[0013] The communication functionality of the source code, after basic compilation, is verified based on the code communication verification mechanism.

[0014] The source code, with its cached communication function functioning correctly, is used as code to be downloaded in response to the code download instruction.

[0015] In one embodiment of this application, the source code is fundamentally compiled using a cross-compilation toolchain, including:

[0016] Identify the current compilation platform used to compile the source code;

[0017] Based on the current compilation platform, the cross-compilation toolchain corresponding to the current compilation platform is searched and invoked from the database;

[0018] Compile the source code using the cross-compilation toolchain described above;

[0019] If the source code fails to compile, the compilation process will continue in a loop until it succeeds.

[0020] In one embodiment of this application, if the source code fails to compile, it is compiled repeatedly until it succeeds, including:

[0021] The SOA service code generation system also includes a recording component. If the source code fails to compile, the error information generated during the compilation process is sent to the recording component for processing, and a compilation failure notification is sent to the source code provider.

[0022] Obtain updated source code from the source code provider, wherein the updated source code is obtained by modifying the source code that failed to compile according to the compilation failure notification;

[0023] Continue compiling the updated source code provided by the source code provider, and issue a compilation success notification when the compilation is successful;

[0024] The communication function of the source code that has completed basic compilation is verified based on the code communication verification mechanism, including: triggering the code communication verification mechanism based on the compilation success notification to determine whether the source code is communicating normally.

[0025] In one embodiment of this application, verifying the communication function of the source code after basic compilation based on a code communication verification mechanism includes:

[0026] The SOA service code generation system also includes test code;

[0027] The test code is triggered to retrieve test cases from the test case management platform on the second server;

[0028] Combine the source code and the test cases into a project directory;

[0029] The project directory is compiled, and an executable file is generated after successful compilation. The executable file includes a client executable file and a server executable file.

[0030] The test code is used to test whether the client executable and the server executable can communicate normally.

[0031] In one embodiment of this application, testing whether the client executable and the server executable can communicate normally based on the test code includes:

[0032] The communication processes and results generated during the verification of the source code after basic compilation are persisted, generating intermediate files.

[0033] The intermediate file is parsed to obtain the communication process and communication result, and the communication process and communication result are notified to the SOA service code generation system through a callback interface.

[0034] In one embodiment of this application, obtaining test cases from a test case management platform on a second server includes:

[0035] The SOA service code generation system determines whether the test case exists in the first server.

[0036] If the test case exists, determine whether the version of the test case in the first server is higher than the test case in the test case management platform on the second server;

[0037] If the version of the test case in the first server is higher than the version of the test case management platform on the second server, then the test case in the first server is retrieved.

[0038] If the version of the test case in the first server is lower than the version of the test case management platform on the second server, then the test case from the test case management platform on the second server is retrieved.

[0039] In one embodiment of this application, if the test case does not exist, the test case from the test case management platform on the second server is obtained;

[0040] The test cases obtained from the test case management platform on the second server are cached in the first server.

[0041] In one embodiment of this application, the source code includes a remote procedure call method and an event method. Both the remote procedure call method and the event method contain several data types, namely, basic data types, structures, variable-length data, fixed-length arrays, enumerations, and multi-level structures.

[0042] In one embodiment of this application, prior to performing basic compilation of the source code using a cross-compilation toolchain, a compilation environment is configured, the configuration environment including:

[0043] When the detected compilation workload is less than the first threshold, compilation is performed within the SOA service code generation system.

[0044] If it is detected that the SOA service code generation system is deployed in the form of a Docker container, and the corresponding image of the Docker container does not contain the first compiler, then a pre-made new image containing the first compiler is obtained and the compilation environment is configured.

[0045] If it is detected that the SOA service code generation system is deployed in the form of a virtual machine container and the virtual machine does not contain a second compiler, then the download of the second compiler and configuration of the compilation environment will be triggered directly.

[0046] If the SOA service code generation system is found to be deployed in Windows and the Windows system does not report containing a third compiler, then the third compiler is obtained using MinGW to configure the compilation environment.

[0047] In one embodiment of this application, the method further includes a continuous integration server, which is used to configure a compilation environment to complete cross-compilation when the compilation workload exceeds the first threshold.

[0048] In a second aspect, this application also provides a code downloading apparatus, comprising:

[0049] The generation module is used by the SOA service code generation system to generate source code based on application metadata and received code download instructions;

[0050] A compilation module is used to perform basic compilation of the source code using a cross-compilation toolchain;

[0051] The verification module verifies the communication functionality of the source code after basic compilation based on the code communication verification mechanism.

[0052] A caching module is used to cache the source code that is in normal communication function as code to be downloaded in response to the code download instruction.

[0053] In a third aspect, this application also provides an electronic device, including a processor, a memory, and a communication bus;

[0054] The communication bus is used to connect the processor and the memory;

[0055] The processor is used to execute the computer program stored in the memory to implement the code download method described in any of the above embodiments.

[0056] In a fourth aspect, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being used to cause a computer to execute the code downloading method as described in any of the above embodiments.

[0057] The beneficial effects of this application are as follows: This application proposes a code download method, apparatus, device, and medium. The method is applied to a first server, and the first server is equipped with an SOA service code generation system. In this method, the SOA service code generation system generates source code based on application metadata and received code download instructions; performs basic compilation of the source code using a cross-compilation toolchain; verifies the communication function of the compiled source code based on a code communication verification mechanism; and caches the source code with normal communication function as code to be downloaded in response to the code download instructions. This application generates communication protocol framework code immediately upon receiving the code download instructions, and then performs basic verification of the communication protocol framework code, improving verification efficiency, reducing manpower costs, and thus providing upfront feedback, accelerating the response time, and thereby speeding up the entire R&D process. As the communication protocol framework code evolves and the provider modifies it, this application provides a safeguard mechanism to prevent issues such as the downloaded communication protocol framework code failing to communicate properly from being discovered only in the later stages of development. After modifications to the communication protocol framework code, this application provides real-time, uninterrupted online verification of the impact on existing services, significantly reducing the cost of assessing service impact, increasing confidence in modifications to the communication protocol framework code, increasing iteration frequency, and providing strong support for business expansion. Attached Figure Description

[0058] Figure 1 This is a schematic diagram of a code downloading method provided in one embodiment of this application;

[0059] Figure 2 This is a flowchart of a code download method provided in one embodiment of this application;

[0060] Figure 3 This is a flowchart of a method for basic compilation of source code using a cross-compilation toolchain, provided in one embodiment of this application.

[0061] Figure 4 This is a flowchart of a method for compiling source code from failure to successful compilation, provided in one embodiment of this application.

[0062] Figure 5 This is a schematic diagram illustrating the notification of code downloaders or code maintainers based on whether compilation was successful, provided in one embodiment of this application.

[0063] Figure 6 This is one of the flowcharts of a method for verifying the communication function of source code that has completed basic compilation based on a code communication verification mechanism provided in one embodiment of this application;

[0064] Figure 7This is the second flowchart of a method for verifying the communication function of source code that has completed basic compilation based on a code communication verification mechanism provided in one embodiment of this application;

[0065] Figure 8 This is a flowchart of a method for processing communication process and communication result provided in one embodiment of this application;

[0066] Figure 9 This is one of the flowcharts of a method for obtaining test cases provided in one embodiment of this application;

[0067] Figure 10 This is a second flowchart of a method for obtaining test cases provided in one embodiment of this application;

[0068] Figure 11 This is a flowchart of a compilation environment configuration method provided in one embodiment of this application;

[0069] Figure 12 This is one of the schematic diagrams illustrating the implementation environment of a code downloading method provided in one embodiment of this application;

[0070] Figure 13 This is the second schematic diagram of the implementation environment of a code downloading method provided in one embodiment of this application;

[0071] Figure 14 This is a framework diagram of a code downloading device provided in one embodiment of this application;

[0072] Figure 15 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0073] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0074] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this application. Therefore, the drawings only show the components related to this application and are not drawn according to the actual number, shape and size of the components. In actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be very complex.

[0075] Numerous details are explored in the following description to provide a more thorough explanation of embodiments of this application. However, it will be apparent to those skilled in the art that embodiments of this application may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in figure form to avoid obscuring embodiments of this application.

[0076] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0077] First, it's important to clarify that SOA, as a service-oriented architecture, is a design philosophy and methodology. In SOA, services are the core abstraction and the most fundamental unit of system description. Each service component has independent functionality and can be reused; the interfaces between service components follow a unified standard, allowing them to access each other, be composed, and extend. Business processes are combinations and extensions of service components with state and service scheduling strategies. Through SOA architecture, OEMs can integrate and plan business functions across different operating systems and hardware platforms (controllers), enabling rapid iteration and reorganization of functions to meet the flexible and ever-changing business needs under the trend of intelligent connectivity.

[0078] Currently, mainstream new energy vehicle-side services are based on SOA architecture, providing preset services and paid services to vehicle users. Communication between vehicle-side services generally uses a stable communication protocol, and the resulting code, besides business logic, primarily handles the communication protocol. To allow development teams to focus more on business logic code, an SOA service code generation system allows teams to define their own metadata, including applications, services, methods, and data types. Teams can download the vehicle-side code, which encapsulates the communication protocol framework, eliminating the need for them to concern themselves with the underlying communication details—it's ready to use out of the box. The vehicle-side service source code is primarily written in C or C++. Development teams use this code for business logic development, completing the main development processes such as development, testing, and system testing, before finally verifying it in a real vehicle. Vehicle software development is mainly divided into different development teams based on hardware, and even within the same hardware, different development teams are further subdivided based on different platforms, such as QNX and Android within an EDC (Electronic Development Center). Automotive software is closely integrated with hardware, and the platforms are numerous and complex. The transition from traditional CAN signals to SOA architecture (DDS communication protocol) is a significant leap. Due to insufficient experience, the problem chain is long and the hierarchy is unclear, resulting in time-consuming troubleshooting and resource waste.

[0079] To support the rapid transformation of automakers, the communication protocol framework code for service communications must be stable and efficient, with stability being the primary objective. The main problems with the generated communication protocol framework code include basic compilation failures, incompatibility with different platforms, and a lack of safeguards against changes to the communication protocol framework code. Changes to the communication protocol framework code lack effective safeguards, often resulting in problems only being discovered after development, leading to significant delays in feedback, high repair costs, and delays in development schedules. The impact is particularly immeasurable when problems are only exposed in a specific production vehicle. Therefore, improving the accuracy of the generated communication protocol framework code is essential and should be done as early as possible.

[0080] Please see Figure 1 This is a schematic diagram of a code downloading method provided in one embodiment of this application.

[0081] like Figure 1 As shown, the written code, besides business logic code, primarily consists of communication protocol framework code that handles communication protocols. The business logic code directly implements user needs; for example, if a user needs to query certain data, the code that directly queries the database and returns the result is the business logic code. In contrast, there is non-business logic code, also called auxiliary business logic code, which exists independently of the business logic. For example, when a user queries certain data, the code that handles potential garbled Chinese characters in the input may not be directly included in the user's objective, but can be applied to other business scenarios. This code for handling garbled Chinese characters is non-business logic code.

[0082] The communication protocol framework code is the code that handles the communication protocol. The vehicle-side R&D team directly downloads the required communication protocol framework code from the server. In this embodiment, the server refers to a cloud server. The code downloader on the terminal needs to send a code download command to the cloud server. The terminal can be a PC, mobile phone, tablet, etc. The terminal communicates with the cloud server via HTTP. HTTP is the abbreviation for Hypertext Transfer Protocol. HTTP is a simple request-response write, which usually runs on top of TCP. It specifies what kind of messages the terminal may send to the cloud server and what kind of response it may receive. The headers of the request and response messages are sent in ASCII format, while the message content has a MIME-like format. This simple model was a major contributor to the early success of the web because it made development and deployment very straightforward.

[0083] In this embodiment, the cloud server mentioned above is named the first cloud server to distinguish it from other cloud servers in this code download method. As will be discussed later, there will also be a second cloud server and a third cloud server.

[0084] It should be noted that the first cloud server also deploys an SOA service code generation system. The SOA service code generation system allows the R&D team to define metadata such as applications, services, methods, and data types. The R&D team can download the source code and encapsulate the communication protocol framework code in the source code. The R&D team does not need to care about the underlying communication details and can use it out of the box.

[0085] After receiving the code download instruction, the SOA service code generation system performs step S101, which generates the code. After generating the source code, step S102 is executed to compile the generated source code online. If the compilation succeeds, step S103 is executed on the compiled source code. Alternatively, step S103 can be omitted depending on the requirements, but this would not guarantee the safety of modified source code. Then, step S104 is executed to respond to the code download instruction, returning the generated source code to the vehicle-side R&D team via HTTP. The generated source code is persistently cached in the persistent layer.

[0086] Please see Figure 2 This is a flowchart of a code download method provided in one embodiment of this application.

[0087] like Figure 2 As shown, the methods for downloading the code include:

[0088] Step S201: The SOA service code generation system generates source code based on application metadata and received code download instructions;

[0089] Meta-information is information about information, used to describe the structure, semantics, purpose, and usage of information. Reflection refers to the ability to access, inspect, and modify its own state or behavior at runtime. Reflection utilizes meta-information to provide an efficient way to manage, control, and use complex information. Through the reflection mechanism from meta-information to information, information itself can be used in a simpler, more flexible, and more automated way. Meta-information and meta-information modeling can be used in the description and use of software system architecture. A code download instruction is a piece of code, that is, the code that the vehicle-side R&D team tells the first cloud server to perform a specific operation through the terminal's computer. The commands that a computer program sends to the computer processor are instructions. The lowest level instruction is a string of 0s and 1s, indicating that an entity operation should be run. Depending on the instruction type, a specific storage area is called a register, which contains data that can be used to retrieve instructions or data storage locations. A code download instruction usually consists of two parts: the opcode and the address code.

[0090] The SOA service code generation system calculates the type of code to be generated based on application metadata and the received code download instruction. Upon receiving the code download instruction, the system determines its validity. If valid, it executes the corresponding operation to generate initial source code. However, this initial source code is not guaranteed to be error-free. If invalid, the system refuses to execute the operation and alerts the vehicle-side development team, requesting authorization before sending the download instruction again. The source code encapsulates a communication protocol framework, allowing the development team to use it out of the box without needing to concern themselves with the underlying communication details. It's important to note that the functionality of the initial source code is uncertain, which is precisely the problem this application aims to solve: ensuring basic compilation and normal communication capabilities, and verifying the communication functionality of the source code. Furthermore, improvements have been made to the acquisition of test cases, increasing the efficiency of test case retrieval.

[0091] Step S202: Perform basic compilation of the source code using a cross-compilation toolchain;

[0092] Cross-compilation is the process of generating executable code for one platform from code written on another. For example, we write C51 code on Windows, compile it into an executable file, and then run it on a C51 system, not just on Windows. Compilation means generating executable code for one platform. Cross-compilation means that C51 cross-compilation occurs on Keil (an integrated development environment), and the runtime environment is C51. Why cross-compile? Because the necessary compilers are not allowed or cannot be installed on the platform. In this embodiment, it's to increase the universality of the source code, ensuring that the downloaded communication protocol framework code can be compiled into executable files on multiple platforms.

[0093] Based on enterprise customization requirements, this embodiment currently implements cross-compilation for the following platforms:

[0094] Platform: EDC ANDRIOD, using the android-ndk-r23-linux cross-compilation toolchain to complete basic compilation work;

[0095] Platform: Nvidia Orin LINUX, with basic compilation completed using the prebuilts / orinx / aarch64-glibc-stable-2020.08-1 cross-compilation toolchain.

[0096] Platform: Xavier Linux, using the gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu cross-compilation toolchain to complete the basic compilation work.

[0097] Platform: Qualcomm TBOX, using the ql-ag551qcn-le20-gcc820-v1-toolchain cross-compilation toolchain to complete the basic compilation work.

[0098] Platform: EDC_QNX, using the QNX700 operating system to complete the basic compilation work.

[0099] Platform: Remote control, using the ql-ag550qcn-le20-gcc820-v1-toolchain / 571 cross-compilation chain tool to complete the basic compilation work.

[0100] Platform: Windows system (for testing purposes), basic compilation was performed using x86_64—8.1.0—release—win32—sjlj—rt_v6—rev0 (mingw).

[0101] Platform: Ubuntu / Industrial PC / Linux PC (for development purposes), using gcc / g++ GNU 7.5.0 compiler to complete basic compilation.

[0102] S203. Verify the communication function of the source code after basic compilation based on the code communication verification mechanism;

[0103] The most important aspect of this step is to ensure that the generated source code can communicate normally. This requires continuously maintaining a test service on the SOA service code generation system. This service (i.e., the source code) contains RPC methods and event methods. Each method has multiple data types, including common data types such as basic data types, structs, variable-length arrays, fixed-length data, enumerations, multi-level structs, and arrays containing multi-level structs.

[0104] In this step, the source code that completes the basic compilation is not the executable file, but rather refers to verifying the source code, not the executable file. Similar to S202, this verification ensures the communication functionality of the source code is normal. The communication protocol framework code iterates over time, and changes to this framework code may impact existing services. Therefore, online verification allows for real-time, uninterrupted verification, effectively assessing the impact on services, greatly increasing confidence in code modification, increasing iteration frequency, and providing strong support for business expansion.

[0105] S204. The source code with normal cache communication function is used as the code to be downloaded in response to the code download instruction.

[0106] The cache is divided into local cache, distributed cache and multi-level cache. Based on whether the cache and the application belong to the same process, the cache is divided into local cache and distributed cache.

[0107] Local caching refers to storing data in the same memory space as the application process, where data reading and writing are both completed within the same process. The advantage of local caching is fast read speed, but it cannot handle large data volumes. Local caching does not require remote network requests to operate on memory space, resulting in no additional performance overhead and thus fast read speeds. However, because local caching occupies the application process's memory space, such as the JVM memory space of a Java process, it cannot handle large data volumes.

[0108] The distributed cache is an independently deployed service process, and it is not deployed on the same server as the application. Therefore, read and write operations of the distributed cache need to be completed through remote network requests, and distributed caching is mainly used in application cluster deployment environments. The advantages of distributed caching include: support for large-scale data storage; as an independently deployed process, it has its own memory space and does not occupy the memory space of the application process; it also supports horizontally scalable cluster deployment, thus enabling large-scale data storage; data is not lost when the application restarts; centralized data storage ensures data consistency; and data read / write separation provides high performance and high availability.

[0109] In this embodiment, local caching can be selected when the amount of data is small. Of course, distributed caching is also an option, depending on the specific requirements.

[0110] Please see Figure 3 This is a flowchart of a method for basic compilation of source code using a cross-compilation toolchain, provided in one embodiment of this application.

[0111] like Figure 3 As shown, the methods for performing basic compilation of source code using a cross-compilation toolchain include:

[0112] S301. Identify the current compilation platform used to compile the source code. By identifying the relevant parameters of the current compilation platform, determine what platform it is. S302. Based on the current compilation platform, search the database and call the cross-compilation toolchain corresponding to the current compilation platform. For example, if the platform is identified as EDCANDRIOD, complete the basic compilation work using the android-ndk-r23-linux cross-compilation toolchain. If the platform is identified as Nvidia Orin LINUX, complete the basic compilation work using the prebuilts / orinx / aarch64-glibc-stable-2020.08-1 cross-compilation toolchain.

[0113] S302. Based on the current compilation platform, search the database and call the cross-compilation toolchain corresponding to the current compilation platform. S303. Compile the source code using the cross-compilation toolchain. S304. If the source code fails to compile, repeat the compilation process until it succeeds. Compilation is the process of translating a high-level language into assembly language or machine language; simply put, it's translating what the high-level language programmer says into language the machine can understand. High-level languages ​​cannot be directly executed on a machine because machines can only understand 0s and 1s. However, it's unlikely that we would directly write assembly language and machine language, so a bridge is built to connect high-level language programmers and the machine.

[0114] Please see Figure 4 This is a flowchart of a method for compiling source code from failure to successful compilation, provided in one embodiment of this application.

[0115] like Figure 4 As shown, if the source code fails to compile, it will be compiled repeatedly until it succeeds, including:

[0116] S401. The SOA service code generation system also includes a recording component. If the source code fails to compile, the error information generated during the compilation process is sent to the recording component for processing, and a compilation failure notification is sent to the source code provider.

[0117] This embodiment uses C language compilation, which generally consists of four stages: preprocessing, assembly, compilation, and linking. Preprocessing involves handling pseudo-instructions and special symbols in the source program; assembly refers to the process of translating assembly language code into machine language, generating an object file with the extension .o. Compilation refers to converting the source program into binary code that the computer can execute. Linking refers to locating the absolute addresses of code segments in each object file, generating an executable file specific to the platform.

[0118] Error messages generated during compilation are explained according to each stage. During the preprocessing stage, an error message "No corresponding file or directory" may appear. This error occurs because the compiler cannot find the required file in its search path; the file may have been specified on the command line or declared in relevant statements. An "Illegal preprocessor directive" error may also occur, indicating that the preprocessor encountered an unrecognized # command. During the compilation stage, an error message "Variable not declared" may appear. During the linking stage, an error message "File not recognized: file format not recognized" may appear. During the runtime stage, an error message "Error loading shared library, cannot open shared object file: file or directory does not exist" may appear.

[0119] Compilation failure notifications will be sent to the source code provider, and these notifications can be linked to specific error reasons, allowing the source code provider to be promptly informed of the errors. These notifications can be sent to the source code provider (i.e., the code maintainer) via WeChat Work, SOA service code generation system reminders, and corporate email.

[0120] S402. Obtain the updated source code from the source code provider, wherein the updated source code is obtained by modifying the source code that failed to compile according to the compilation failure notification;

[0121] For example, during the compilation phase, the following errors may occur: error: conflicting types for 'Alex', which means "an exception exists for the variable 'Alex'", and the reason for the error is that "other data types may have been declared for 'Alex' previously"; error: too many types in declaration, which means "too many types are defined in the declaration", and the reason for the error is "missing logical operators, relational operators, or similar symbols"; additionally, warning: comparison between pointer and integer, which means "warning: comparing pointers and integer values ​​may be fine, this warning is usually given by strstr functions such as 'if (strstr(line, "word") != NULL)' which return a pointer or null value".

[0122] As mentioned above, compilation failure notifications do not only occur during the compilation stage, but may also occur during the preprocessing stage, the linking stage, or the runtime stage, depending on the specific circumstances.

[0123] S403. Continue compiling the updated source code provided by the source code provider, and issue a compilation success notification when the compilation is successful;

[0124] The source code provider and code maintainer may be the same team; this only discusses the general case. In most cases, the source code provider and code maintainer are the same team. The updated source code provided by the source code provider may have issues and may require several rounds of compilation and modification to ensure that the updated source code meets requirements.

[0125] The step of verifying the source code that has completed basic compilation based on the code communication verification mechanism to determine whether the source code is communicating normally includes: triggering the code communication verification mechanism based on the compilation success notification to determine whether the source code is communicating normally.

[0126] Please see Figure 5 This is a schematic diagram illustrating the notification of code downloaders or code maintainers based on whether compilation was successful, provided in one embodiment of this application.

[0127] First, step S501 is executed to receive the feedback / compile callback. Then, step S502 is executed to determine whether compilation was successful. If compilation is successful, the code downloader is notified; if compilation fails, the code maintainer is notified via WeChat Work, the SOA service code generation system, and an enterprise email. This essentially provides a failure alert mechanism. Considering the long compilation time, an asynchronous notification mechanism is used in the architecture to obtain alert information. The SOA service code generation system provides a callback interface, feedback / compile, which can provide compilation information through a call similar to the following.

[0128] POST http: / / feedback / compile: {

[0129] "Request Body": "{\"reqId\": 12345, \"result\": \"ok\", \"resultStatus\": 0, \"resultMsg\": \"\"}"

[0130] }

[0131] After receiving the callback signal, the SOA service code generation system notifies the code downloader of the compilation results via multiple platforms (webpage, WeChat Work, email, etc.), and notifies the code generator of compilation failure information via multiple platforms (webpage, WeChat Work, email, etc.), achieving real-time feedback, accelerating the notification process, and improving response speed. It should be noted that the code generator is also the code maintainer.

[0132] Please see Figure 6 This is one of the flowcharts of a method for verifying the communication function of source code that has completed basic compilation based on a code communication verification mechanism provided in one embodiment of this application.

[0133] like Figure 6 As shown, the communication functionality of the source code that has completed basic compilation, verified based on the code communication verification mechanism, includes:

[0134] S601. The SOA service code generation system also includes test code; S602. Trigger the test code to obtain test cases from the test case management platform on the second server. The second server is a second cloud server, and the second cloud server and the first cloud server are independent cloud servers; S603. Combine the source code and the test cases into a project directory; S604. Compile the project directory. After successful compilation, an executable file is generated, including a client executable file and a server executable file; S605. Test whether the client executable file and the server executable file can communicate normally based on the test code. The code communication verification mechanism mainly solves whether the generated code can communicate normally. It requires continuous maintenance of a test service on the SOA service code generation system. This service (i.e., the RPC method and event method mentioned above) has multiple data types for each method, including basic data types, structures, variable-length data, fixed-length arrays, enumerations, and multi-level structures. The data includes common data types such as multi-level structures. RPC, short for Remote Procedure Call, is similar to a three-tier client / server architecture. Third-party client programs call SAP's internal standard or custom functions through an interface, process the returned data, and then display or print it. Local procedure calls, on the other hand, directly call local methods to complete business logic. Remote procedure calls, however, are used when a business function cannot be directly invoked and requires a third party to implement the business rules. RPC does not concern itself with specific implementation rules, and users do not need to understand the specific protocol; whoever makes the call implements the code. Downloading application code triggers the download of test service code and retrieves the latest test cases from the test case management platform. The source code and test cases are combined into a project directory, which is compiled in an x86-Linux environment. At this stage, platform differences are irrelevant. After successful compilation, executable files for both communicating parties (client and server) are generated. Scripts are used to execute the client and server respectively. The communication process and results between the client and server are persisted to a local file for log auditing and process tracing. The local file is parsed, and the verification results and process are sent to the SOA service code generation system via a callback interface channel. Completing communication verification allows code providers to immediately understand whether their code has been compromised, facilitating the maintenance of a stable code structure and saving significant manpower. For code users, timely notifications of the code's stability status help them avoid using problematic code and prevent unnecessary development costs.

[0135] Please see Figure 7 This is the second flowchart of a method for verifying the communication function of source code that has completed basic compilation based on a code communication verification mechanism, provided in one embodiment of this application.

[0136] like Figure 7 As shown, the source code to be downloaded in this application includes RPC methods and EVENT methods. Remote procedure call methods and event methods are all components of the source code. Both remote procedure call methods and event methods include basic data types, structures, data, etc. After the SOA service code generation system receives the code download instruction, it executes step S701 to generate test service code, which is the source code; executes step S702 to remotely obtain the test case set; executes step S703 to assemble the source code and test case set into a project directory; then executes step S704 to compile the project directory using X86-Linux; executes step S705 to execute the Client and server respectively; executes step S706 to save the process log and results as text during the execution of the client executable file and the server executable file; executes step S707 to parse the text notification data to the SOA service code generation system.

[0137] Please see Figure 8 This is a flowchart of a method for processing communication processes and results provided in one embodiment of this application.

[0138] like Figure 8 As shown, the method for processing the communication process and communication results includes: S801, persisting the communication process and communication results generated during the verification of the source code after basic compilation, and generating an intermediate file; S802, parsing the intermediate file to obtain the communication process and communication results, and notifying the SOA service code generation system of the communication process and communication results through a callback interface.

[0139] The generated source code and test cases are combined into a project directory, which is then compiled in an x86-Linux environment. At this stage, platform differences are irrelevant. After successful compilation, executable files for both the client and server are generated. These executables are executed via scripts. The communication process and results between the client and server executables are persisted to a local file for logging, auditing, and process tracing. The local file is parsed, and the verification results and process are notified to the SOA service code generation system via a callback interface. After communication verification is complete, the code provider (or maintainer) can immediately identify any code corruption, facilitating the maintenance of a stable code structure and saving significant manpower. Downloaders receive timely notifications of the code's stability status, avoiding the use of problematic code and preventing unnecessary development costs.

[0140] Please see Figure 9 This is one of the flowcharts for a method of obtaining test cases provided in one embodiment of this application.

[0141] like Figure 9 As shown, the method for obtaining test cases includes: S901, determining whether the test case exists in the first server based on the SOA service code generation system; S902, if the test case exists, determining whether the version of the test case in the first server is higher than the test case in the test case management platform on the second server; S903, if the version of the test case in the first server is higher than the test case in the test case management platform on the second server, obtaining the test case in the first server; S904, if the version of the test case in the first server is lower than the test case in the test case management platform on the second server, obtaining the test case in the test case management platform on the second server. If the test case does not exist, obtaining the test case in the test case management platform on the second server; caching the obtained test case in the test case management platform on the second server in the first cloud server. Test case management needs to be flexible and configurable, supporting dynamic addition, modification, and deletion, and introducing version traceability. For system and data security, the system and test cases are isolated. Therefore, the SOA service code generation system obtains test cases by pulling them. As the business develops, the number of test cases and the frequency of verification will gradually increase. If test cases are pulled every time verification is performed, it can be predicted that performance degradation will occur in the later stages. This leads to the idea of ​​local caching of test cases to solve this problem.

[0142] The steps for obtaining test cases include: First, querying the local test cases. If they exist, extracting the local version; if the local version lags behind the remote version, retrieving the remote version. If they do not exist, directly retrieving the remote test cases. Second, retrieving the remote test cases. There are multiple methods for this, and the appropriate method can be chosen based on the scenario. The key is to decouple business logic and data, improving scalability and security. Third, caching locally reduces the I / O consumption of remote calls. Remote calls involve long protocol stacks, incurring overhead. With a large number of verifications and increased verification frequency, this can cause latency and potentially become a bottleneck. Recording versions facilitates tracking and comparison to ensure the latest version exists remotely, simplifying management.

[0143] Please see Figure 10 This is a second flowchart of a method for obtaining test cases provided in one embodiment of this application.

[0144] like Figure 10 As shown, the method for obtaining test cases also includes: S1001, obtaining the latest message digest code from the remote server; S1002, determining whether the message digest code exists locally; if it exists, proceed to the next step, S1003, combining the latest local test case set and code to form a project directory; S1004, compiling the project directory and executing it; if it does not exist, proceed to the next step, S1005, saving the latest message digest code locally; S1006, pulling the latest test cases (latest test case set) based on the message digest code and saving it; then, execute S1003 again. Test cases need to be obtained from another server. The development process defaults to obtaining the latest test cases, but there may be parallel development across multiple product lines, requiring a multi-version coexistence mechanism. The coexistence of multiple versions leads to the concept of a version baseline, which allows test cases to be rolled back to a specified version for comparison during multi-version execution. Since test cases need to be retrieved from another server, repeatedly retrieving duplicate content while the baseline remains unchanged for a long time would cause unnecessary I / O consumption and is not very meaningful. Therefore, a message digest code is used to determine the unique identifier of the file. Before the first call, the SOA service code generation system (code generation end) retrieves and saves the latest message digest code value from the other server, and then uses this value to retrieve the latest test cases. Subsequent verifications find that the remote server (i.e., the other server) is the latest, so the local test cases can be used directly, reducing file transfer overhead and optimizing overall verification time.

[0145] Please see Figure 11 This is a flowchart of a compilation environment configuration method provided in one embodiment of this application.

[0146] like Figure 11As shown, the method for configuring the compilation environment includes: S1101, when the detected compilation workload is less than a first threshold, performing compilation within the SOA service code generation system; S1102, if the SOA service code generation system is identified as being deployed in the form of a Docker container, and the corresponding image of the Docker container does not contain a first compiler, then obtaining a pre-made new image containing the first compiler to configure the compilation environment; S1103, if the SOA service code generation system is identified as being deployed in the form of a virtual machine container, and the virtual machine does not contain a second compiler, then directly triggering the download of the second compiler to configure the compilation environment; S1104, if the SOA service code generation system is identified as being deployed in the form of Windows, and the Windows does not contain a third compiler, then obtaining the third compiler using MinGW to configure the compilation environment. When the compilation workload exceeds the first threshold, the compilation environment is configured using the continuous integration server to complete cross-compilation. In cases of low workload, this saves server resources and facilitates rapid iteration; the compilation server can be shared with the SOA service code generation system application server. If the SOA service code generation system is deployed using Docker containers and the existing image does not include the GCC compiler, a new image containing the GCC compiler should be created based on the existing image. If the SOA service code generation system is deployed using virtual machine containers and the virtual machine does not include the GCC compiler, root privileges are required to download the GCC compiler. If the SOA service code generation system is deployed in a Windows environment and the Windows environment does not include the GCC compiler, MinGW (Minimalist GNU for Windows) is needed to install the GCC compiler. With high business volume, application and compilation need to be decoupled for easier future expansion. Using CI-like tools for online compilation will increase operational complexity. The CI server (Continuous Integration Server) should be equipped with multi-platform cross-compilation toolchains, such as ql-ag550qcn-le20-gcc820-v1-toolchain / 571 and android-ndk-r23-linux.

[0147] Please see Figure 12 This is a schematic diagram of one implementation environment for a code download method provided in one embodiment of this application.

[0148] like Figure 12As shown, the vehicle-side R&D team 1204 communicates with the first cloud server 1201 via HTTP link 1205. The first cloud server 1201 has an SOA service code generation system installed. After the vehicle-side R&D team 1204 sends a code download command to the first cloud server 1201, the first cloud server 1201 responds to the command and generates the source code. The generated source code is cross-compiled on the continuous integration server 1203, meaning the cross-compilation server and the SOA service code generation system server are not shared. Test cases are obtained from the second cloud server 1202.

[0149] Please see Figure 13 This is a second schematic diagram of the implementation environment of a code downloading method provided in one embodiment of this application.

[0150] like Figure 13 As shown, the vehicle-side R&D team 1303 communicates with the first cloud server 1301 via HTTP link 1304. The first cloud server 1301 obtains test cases from the second cloud server 1302, but the compilation still takes place on the first cloud server 1301. In cases with a small workload, in order to save server resources and facilitate rapid iteration, the server where the compilation and SOA service code generation system are located shares the first cloud server 1301.

[0151] Please see Figure 14 This is a framework diagram of a code downloading device provided in one embodiment of this application.

[0152] like Figure 14 As shown, this embodiment provides a code downloading device 1400, which includes:

[0153] The generation module 1401 is used by the SOA service code generation system to generate source code based on application metadata and received code download instructions;

[0154] Compilation module 1402 is used to perform basic compilation of the source code using a cross-compilation toolchain;

[0155] Verification module 1403 verifies the communication function of the source code that has completed basic compilation based on the code communication verification mechanism;

[0156] The caching module 1404 is used to cache the source code that is in normal communication function as code to be downloaded in response to the code download instruction.

[0157] In one embodiment, the compilation module 1402 is configured to: identify the current compilation platform used to compile the source code; search for and call the cross-compilation toolchain corresponding to the current compilation platform from the database based on the current compilation platform; compile the source code using the cross-compilation toolchain; and if the source code fails to compile, compile it in a loop until it succeeds.

[0158] In one embodiment, if the source code fails to compile, the compilation is repeated until it succeeds. The SOA service code generation system further includes a recording component. If the source code fails to compile, error information generated during the compilation process is sent to the recording component for processing, and a compilation failure notification is sent to the source code provider. The updated source code from the source code provider is obtained, wherein the failed source code is modified according to the compilation failure notification to obtain the updated source code. The updated source code from the source code provider is then compiled again, and a compilation success notification is issued when compilation succeeds.

[0159] In one embodiment, the verification module 1403 is configured to trigger a code communication verification mechanism based on the successful compilation notification to determine whether the source code is communicating normally.

[0160] In one embodiment, the verification module 1403 is further configured to: the SOA service code generation system further includes test code; trigger the test code to obtain test cases from the test case management platform on the second server; combine the source code and the test cases into a project directory; compile the project directory, and generate an executable file after successful compilation, wherein the executable file includes a client executable file and a server executable file; and test whether the client executable file and the server executable file can communicate normally based on the test code.

[0161] In one embodiment, testing whether the client executable and the server executable can communicate normally based on the test code is configured to: persist the communication process and communication results generated during the verification of the source code after basic compilation, and generate an intermediate file; parse the intermediate file to obtain the communication process and communication results, and notify the SOA service code generation system of the communication process and communication results through a callback interface.

[0162] In one embodiment, obtaining test cases from a test case management platform on a second server is configured as follows: Based on the SOA service code generation system, determine whether the test cases exist in the first server; if the test cases exist, determine whether the version of the test cases in the first server is higher than the version of the test cases in the test case management platform on the second server; if the version of the test cases in the first server is higher than the version of the test cases in the test case management platform on the second server, obtain the test cases in the first server; if the version of the test cases in the first server is lower than the version of the test cases in the test case management platform on the second server, obtain the test cases in the test case management platform on the second server. If the test cases do not exist, obtain the test cases in the test case management platform on the second server; cache the obtained test cases in the test case management platform on the second server in the first cloud server.

[0163] The source code in the code download device includes remote procedure call methods and event methods. Both remote procedure call methods and event methods contain several data types, namely basic data types, structures, variable-length data, fixed-length arrays, enumerations, and multi-level structures.

[0164] The compilation module 1402 is preceded by a compilation environment configuration module, configured as follows: when the detected compilation workload is less than a first threshold, compilation is performed within the SOA service code generation system; if the SOA service code generation system is identified as being deployed as a Docker container, and the corresponding image of the Docker container does not contain a first compiler, a pre-made new image containing the first compiler is obtained to configure the compilation environment; if the SOA service code generation system is identified as being deployed as a virtual machine container, and the virtual machine does not contain a second compiler, the second compiler is directly downloaded to configure the compilation environment; if the SOA service code generation system is identified as being deployed as a Windows system, and the Windows system does not contain a third compiler, the third compiler is obtained using MinGW to configure the compilation environment. When the compilation workload exceeds the first threshold, the compilation environment is configured using the continuous integration server to complete cross-compilation.

[0165] In this embodiment, the code download and reload essentially involves setting up multiple modules to execute the methods described in the above embodiments. The specific functions and technical effects can be referred to in the above method embodiments, and will not be repeated here.

[0166] Please see Figure 15 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application.

[0167] like Figure 15 As shown, this application embodiment also provides an electronic device 1500, including a processor 1501, a memory 1502 and a communication bus 1503;

[0168] Communication bus 1503 is used to connect processor 1501 and memory 1502;

[0169] The processor 1501 is used to execute a computer program stored in the memory 1502 to implement one or more methods as described in Embodiment 1 above.

[0170] This application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being used to cause a computer to perform any of the methods described in Embodiment 1 above.

[0171] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions included in Embodiment 1 of this application.

[0172] It should be noted that the computer-readable medium described in this disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or device. In this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution device, apparatus, or apparatus. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0173] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0174] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0175] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of methods and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using dedicated hardware-based means to perform the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0176] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.

Claims

1. A code download method, characterized in that, The method, applied to a first server and having an SOA service code generation system deployed on it, includes: The SOA service code generation system generates source code based on application metadata and received code download instructions. The source code is communication protocol framework code. The source code was compiled using a cross-compilation toolchain. The communication function of the source code that has completed basic compilation is verified based on the code communication verification mechanism. The source code that has completed basic compilation is the verification source code. The source code with normal cache communication function is used as code to be downloaded in response to the code download instruction; The communication functionality of the source code, after basic compilation, is verified based on a code communication verification mechanism, including: The SOA service code generation system also includes test code; The test code is triggered to retrieve test cases from the test case management platform on the second server; Combine the source code and the test cases into a project directory; The project directory is compiled, and an executable file is generated after successful compilation. The executable file includes a client executable file and a server executable file. The test code is used to test whether the client executable and the server executable can communicate normally.

2. The method according to claim 1, characterized in that, The source code is fundamentally compiled using a cross-compilation toolchain, including: Identify the current compilation platform used to compile the source code; Based on the current compilation platform, the cross-compilation toolchain corresponding to the current compilation platform is searched and invoked from the database; Compile the source code using the cross-compilation toolchain described above; If the source code fails to compile, the compilation process will continue in a loop until it succeeds.

3. The method according to claim 2, characterized in that, If the source code fails to compile, the compilation process continues in a loop until it succeeds, including: The SOA service code generation system also includes a recording component. If the source code fails to compile, the error information generated during the compilation process is sent to the recording component for processing, and a compilation failure notification is sent to the source code provider. Obtain updated source code from the source code provider, wherein the updated source code is obtained by modifying the source code that failed to compile according to the compilation failure notification; Continue compiling the updated source code provided by the source code provider, and issue a compilation success notification when the compilation is successful; The communication function of the source code that has completed basic compilation is verified based on the code communication verification mechanism, including: triggering the code communication verification mechanism based on the compilation success notification to determine whether the source code is communicating normally.

4. The method according to claim 1, characterized in that, Based on the test code, test whether the client executable file and the server executable file can communicate normally, including: The communication processes and results generated during the verification of the source code after basic compilation are persisted, generating intermediate files. The intermediate file is parsed to obtain the communication process and communication result, and the communication process and communication result are notified to the SOA service code generation system through a callback interface.

5. The method according to claim 1, characterized in that, Retrieve test cases from the test case management platform on the second server, including: The SOA service code generation system determines whether the test case exists in the first server. If the test case exists, determine whether the version of the test case in the first server is higher than the test case in the test case management platform on the second server; If the version of the test case in the first server is higher than the version of the test case management platform on the second server, then the test case in the first server is retrieved. If the version of the test case in the first server is lower than the version of the test case management platform on the second server, then the test case from the test case management platform on the second server is retrieved.

6. The method according to claim 5, characterized in that, If the test case does not exist, then obtain the test case from the test case management platform on the second server; The test cases obtained from the test case management platform on the second server are cached in the first server.

7. The method according to any one of claims 1 to 6, characterized in that, The source code includes remote procedure call methods and event methods. Both remote procedure call methods and event methods contain several data types, namely basic data types, structures, variable-length data, fixed-length arrays, enumerations, and multi-level structures.

8. The method according to claim 1, characterized in that, Before performing basic compilation of the source code using a cross-compilation toolchain, the compilation environment must be configured, including: When the detected compilation workload is less than the first threshold, compilation is performed within the SOA service code generation system. If it is detected that the SOA service code generation system is deployed in the form of a Docker container, and the corresponding image of the Docker container does not contain the first compiler, then a pre-made new image containing the first compiler is obtained and the compilation environment is configured. If it is detected that the SOA service code generation system is deployed in the form of a virtual machine container and the virtual machine does not contain a second compiler, then the download of the second compiler and configuration of the compilation environment will be triggered directly. If the SOA service code generation system is found to be deployed in Windows and the Windows system does not report containing a third compiler, then the third compiler is obtained using MinGW to configure the compilation environment.

9. The method according to claim 8, characterized in that, The method also includes a continuous integration server. When the compilation workload exceeds the first threshold, the continuous integration server is used to configure the compilation environment to complete cross-compilation.

10. A code downloading device, characterized in that, include: The generation module is used by the SOA service code generation system to generate source code based on application metadata and received code download instructions. The source code is communication protocol framework code. A compilation module is used to perform basic compilation of the source code using a cross-compilation toolchain; The verification module verifies the communication function of the source code that has completed basic compilation based on the code communication verification mechanism. The source code that has completed basic compilation is the verification source code. The communication functionality of the source code, after basic compilation, is verified based on a code communication verification mechanism. This includes: the SOA service code generation system further includes test code; triggering the test code to obtain test cases from a test case management platform on a second server; combining the source code and the test cases into a project directory; compiling the project directory, and generating an executable file upon successful compilation, wherein the executable file includes a client executable file and a server executable file; and testing whether the client executable file and the server executable file can communicate normally based on the test code. A caching module is used to cache the source code that is in normal communication function as code to be downloaded in response to the code download instruction.

11. An electronic device, characterized in that, Includes processor, memory, and communication bus; The communication bus is used to connect the processor and the memory; The processor is used to execute a computer program stored in the memory to implement the method of any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, It stores a computer program thereon, the computer program being used to cause the computer to perform the method as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Distributed automatic construction method and system

    CN105550001A

  • Software source code processing method and device as well as electronic equipment

    CN105630569A

  • Cross compiling tool chain construction method and device, electronic equipment and storage medium

    CN113849181A

  • Test method and device, electronic equipment and storage medium

    CN115114164A