Method and device for generating module program for service architecture

By analyzing the declaration file, obtaining key variables and inserting program templates, and generating module programs, it solves the problem that a large amount of handwritten code is required for the development of SOA architecture module programs, and achieves the effect of shortening the development cycle and reducing the amount of code.

CN115098183BActive Publication Date: 2025-02-18JILUO TECH (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210654023.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-09
Publication Date
2025-02-18
Estimated Expiration
2042-06-09

AI Technical Summary

Technical Problem

In the prior art, the development of SOA architecture module programs requires a large amount of repetitive handwritten code, resulting in a long development cycle.

Method used

Generate module programs by parsing preconfigured declaration files, obtaining key variables, and inserting them into the corresponding reserved location in the pre-designed program template.

Benefits of technology

This greatly reduces the amount of module program development code, shortens the development cycle, and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098183B_ABST
    Figure CN115098183B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for generating a module program for a service-oriented architecture, and relates to the field of computer technology. The method comprises: parsing a pre-configured first declaration file corresponding to the module program, obtaining key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in common program segments of different module programs; and inserting the key variables into corresponding reserved positions in a pre-designed program template to generate the module program. The method greatly reduces the amount of module program development code and shortens the development cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for generating module programs oriented to a service architecture. Background Art

[0002] Service-oriented architecture (SOA) is a software architecture. SOA architecture is also a very suitable architecture for autonomous driving systems. The most direct factors are:

[0003] 1. In the autonomous driving system, the perception and fusion of multiple sensors, the planning and decision-making of complex and changing scenarios, and the control execution with high real-time requirements involve a large number of calculations of different types, which need to be decomposed into different service subsystems and evolve independently;

[0004] 2. The "publish-subscribe" communication model can effectively reduce the coincidence of communication between services.

[0005] The above two factors correspond exactly to the two architectural constraints of the "client-server" style and the "event / message-based publish-subscribe" style in the SOA architectural style. The core problem solved by these two architectural styles is how to decompose complex systems into multiple software components and integrate them in a low-coupling manner. From this perspective, the entire autonomous driving system is integrated based on the Data Distribution Service (DDS) middleware of the SOA architectural style. Different services are decomposed into corresponding module programs, that is, one service corresponds to one module program, which only receives messages, processes messages and sends results. However, the development of module programs requires a large amount of repetitive handwritten code, resulting in a long development cycle. Summary of the invention

[0006] The present invention provides a method and device for generating a module program oriented to a service architecture, which is used to solve the problem in the prior art that the development of module programs in an SOA architecture requires a large amount of repetitive handwritten codes and has a long development cycle.

[0007] The present invention provides a module program generation method for a service-oriented architecture, comprising:

[0008] Parsing a pre-configured first declaration file corresponding to the module program, obtaining key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in a common program segment of different module programs;

[0009] The key variables are inserted into corresponding reserved positions in a pre-designed program template to generate a module program.

[0010] According to the service-oriented architecture module program generation method provided by the present invention, the key variables are inserted into corresponding reserved positions in a pre-designed program template to generate a module program, including:

[0011] Searching for a placeholder corresponding to the key variable in the program template according to the keyword, each of the reserved positions being provided with the placeholder;

[0012] The key variable is used to replace the placeholder until all the placeholders are replaced;

[0013] An instruction to rename the program template is received, and the module program is generated after renaming.

[0014] According to the service-oriented architecture module program generation method provided by the present invention, before parsing a pre-configured first declaration file corresponding to the module program and obtaining key variables of keywords declared in the first declaration file, the method further includes:

[0015] Parsing a pre-configured second declaration file, and obtaining startup configuration information and connection relationships corresponding to each module program declared in the second declaration file;

[0016] Generate a startup configuration file for the corresponding module program according to the startup configuration information;

[0017] Generate a theme file of the corresponding module program according to the connection relationship, wherein the theme file includes: a theme key and a theme value of the connection relationship, and the key variables in the first declaration file include: the theme key and the theme key type,

[0018] Among them, the startup configuration file is used to be called by the system process to start the module program in the startup configuration file. The program template is provided with a reading function for reading the corresponding theme file when the module program starts. The reading function is used to read the theme value corresponding to the theme key in the theme file, so that the module program creates an instance of the connection relationship according to the theme value and the theme key type.

[0019] According to the service-oriented architecture module program generation method provided by the present invention, the keywords in the first declaration file also include: an optional item indicating whether the subject value in the connection relationship is optional, a judgment function is provided in the program template, and the judgment function is used to judge whether the module program starts normally when the subject value is not read when the module program starts according to the actual value of the key variable of the optional item, if the actual value of the key variable is true, the program module starts normally, and if the actual value of the key variable is false, the program module cannot be started.

[0020] According to the service architecture-oriented module program generation method provided by the present invention, the judgment function is also used to start an error report when it is determined that the module program fails to read the theme value and cannot be started normally, and prompt the theme key corresponding to the default theme value.

[0021] According to the service-oriented architecture module program generation method provided by the present invention, the key variables in the first declaration file also include: the transmission data type of the connection relationship.

[0022] The present invention also provides a module program generation device for a service-oriented architecture, comprising:

[0023] A first declaration file parsing unit, configured to parse a pre-configured first declaration file corresponding to a module program, and obtain key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in a common program segment of different module programs;

[0024] The module program generating unit is used to insert the key variables into the corresponding reserved positions in the pre-designed program template to generate the module program.

[0025] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements any of the above-described module program generation methods for a service-oriented architecture.

[0026] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method for generating a module program for a service-oriented architecture as described in any one of the above is implemented.

[0027] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the method for generating a module program for a service-oriented architecture as described above is implemented.

[0028] The method and device for generating a module program for a service architecture provided by the present invention parses a pre-configured first declaration file corresponding to the module program, obtains the keywords declared in the first declaration file, and the key variables represent the unique fields in the common program segments of different module programs; inserts the key variables into the corresponding reserved positions in the pre-designed program template to generate the module program. In this way, when developing a module program, the developer only needs to configure the first declaration file, and then automatically generate the module program. Subsequently, only the core algorithm part of the module program needs to be developed, which greatly reduces the amount of module program development code and shortens the development cycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 It is a flow chart of the module program generation method for service-oriented architecture provided by the present invention;

[0031] Figure 2 It is a schematic diagram of the structure of a module program generating device for a service-oriented architecture provided by the present invention;

[0032] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0034] The module program generation method for service-oriented architecture provided by the embodiment of the present invention is as follows: Figure 1 As shown, including:

[0035] Step S110, parse the pre-configured first declaration file corresponding to the module program, obtain the key variables of the keywords declared in the first declaration file, the key variables represent the unique fields in the common program segments of different module programs, that is, the different fields in the common program segments. In this embodiment, the first declaration file is designed in the YAML (Yet Another Markup Language) declarative programming mode. Specifically, in actual use, the first declaration file is named: base yaml file. The base yaml file provides developers with specific configurable keywords. Developers configure the specific values ​​corresponding to the keywords, that is, key variables. These keywords can be detected grammatically so that the key variables can be parsed from the base yaml file. The configurable keywords in the base yaml file include the unique fields in the common program segments of the SOA architecture module programs. Taking the autonomous driving system as an example, the keywords specifically include: scheduled tasks, diagnosis, measurement and connection relationship (i.e. io) data segments, etc.

[0036] Step S120, insert the key variables into the corresponding reserved positions in the pre-designed program template to generate a module program. The program template is a template for the module program, and the program template is provided with a common program segment for all module programs in the system (such as: autonomous driving system). Taking the C++ program as an example, the program template includes two C++ program templates: a header file program template and a source file program template. The key variables corresponding to the keywords in different first declaration files are different. Inserting different key variables into the program template will generate different module programs. It should be noted that the module program generated here is not a fully functional module program, but only uses YAML declarative configuration programming to generate the common program segments in the module program, which reduces the amount of code for developers. Developers continue to develop on the basis of the generated module program, for example: inheriting the module program to implement their own core business-related algorithms.

[0037] The module program generation method for service architecture provided in this embodiment parses the pre-configured first declaration file corresponding to the module program, obtains the value corresponding to the keyword declared in the first declaration file, and the key variable represents the unique field in the common program segment of different module programs; inserts the value corresponding to the key variable into the corresponding reserved position in the pre-designed program template to generate the module program. In this way, when developing the module program, the developer only needs to configure the first declaration file, and then automatically generate the module program. Subsequently, only the core algorithm part of the module program needs to be developed, which greatly reduces the amount of module program development code and shortens the development cycle.

[0038] In this embodiment, step S120 includes:

[0039] The placeholder corresponding to the key variable is searched in the program template according to the keyword, and each reserved position is provided with the placeholder. Specifically, the placeholder can be in the following form "### keyword###", as long as the symbol in the placeholder is not a symbol with special meaning in the program language. By setting the placeholder in the reserved position, it is convenient to quickly find the position to replace the keyword according to the keyword.

[0040] Use the key variable to replace the placeholder, and use the key variable to replace "###keyword###" until all placeholders are replaced.

[0041] An instruction to rename the program template is received, and the module program is generated after renaming. For a C++ program, the suffix of the program template of the header file is changed to .h, and the suffix of the program template of the source file is changed to .cc.

[0042] In this embodiment, before step S110, the following steps are also included:

[0043] Parse the pre-configured second declaration file to obtain the startup configuration information and connection relationship corresponding to each module program declared in the second declaration file. Similar to the first declaration file, the second declaration file is designed using the YAML declarative programming method. Specifically, in actual use, the second declaration file can be named: startup yaml file. The startup yaml file can be used by developers to configure the startup configuration information and connection relationship of each module program when it is started. The connection relationship is the publish-subscribe relationship and client-server relationship in the SOA architecture. The startup yaml file is configured with the startup configuration information and corresponding connection relationship of all module programs in the entire system. The startup configuration information includes basic information such as the module program name (or ID).

[0044] A startup configuration file of the corresponding module program is generated according to the startup configuration information. Of course, the startup configuration file also includes the name (or ID) of the module program and the basic information required for startup.

[0045] A subject file of the corresponding module program is generated according to the connection relationship. Each module program corresponds to a subject file. The subject file includes: a subject key and a subject value of the connection relationship. The key variables include: the subject key and the subject key type. That is, the key variable of the keyword of the connection relationship in the first declaration file is consistent with the subject key. The subject key type indicates which of the publisher, subscriber, client or server each connection relationship of the module program belongs to.

[0046] The startup configuration file is used to be called by the system process (such as the management process of the autonomous driving system) to start the module program in the startup configuration file. Specifically, the system process obtains the module program name and the basic information required for startup from the startup configuration file, and starts the module program according to the basic information. The program template is provided with a reading function for reading the corresponding theme file when the module program starts. Since the program template is provided with the reading function, the module program generated after step S120 also includes the reading function. The reading function is used to read the theme value corresponding to the theme key in the theme file, so that the module program creates an instance of a connection relationship according to the theme value and the theme key type. Instances of connection relationships include: publish-subscribe relationship instances and client-server relationship instances.

[0047] Since the startup sequence of each module program in a system (such as an autonomous driving system) has a certain logical association, the startup configuration information of all module programs is configured in the startup yaml file to facilitate unified configuration by developers. In addition, in a system, the overall topological relationship of the publish-subscribe (many-to-many relationship) relationship is relatively complex, and the connection relationship is uniformly configured in the second declaration file. If the publish-subscribe relationship or the client-server relationship is changed, there is no need to manually change the code, only uniform modifications in the second declaration file are required. For example: If you want to add a subscription relationship, you can add the corresponding topic key-value pair (i.e., topic key and topic value) in the startup yaml file, and add a name relationship data segment in the module base yaml file. After re-executing steps S110 and S120, the module program will be regenerated.

[0048] In this embodiment, the keywords in the first declaration file also include: an optional item indicating whether the subject value in the connection relationship is optional, and a judgment function is provided in the program template, and the judgment function is used to judge whether the module program starts normally when the subject value is not read when the module program starts according to the actual value of the key variable of the optional item. If the actual value of the key variable is true, the program module starts normally, and if the actual value of the key variable is false, the program module cannot start. Specifically, if the actual value of the key variable of the optional item is True, the default subject value of the key-value pair of the connection relationship in the second declaration file is allowed, and the module program may not create an instance of the connection relationship corresponding to the default subject value after startup, and it does not affect the startup of the module program; if the actual value of the key variable of the optional item is False, the default subject value is not allowed, and if there is a default subject value in the subject file, the module program cannot start. Since the option of whether the subject value in the connection relationship is optional is configured, when you want to remove a connection relationship, you can remove the subject key-value pair in the startup yaml file, provided that the actual value of the key variable of the corresponding optional option in the module base yaml file is True. At this time, you only need to re-parse the startup yaml file, that is, execute S110, and there is no need to regenerate the module program, which facilitates the maintenance of the module program.

[0049] Furthermore, the judgment function is also used to start an error report when it is determined that the module program cannot be started normally because the module program does not read the theme value, and prompt the theme key corresponding to the default theme value, so that when the startup fails, the developer can quickly locate the error point and configure the default theme value in the second declaration file in time.

[0050] In this embodiment, the key variables in the first declaration file also include: the transmission data type of the connection relationship. When changing the transmission data type of the publish-subscribe or client-server relationship, it is only necessary to change the key variable corresponding to the transmission data type keyword of the connection relationship in the baseyaml file of the module program, and re-execute step S120, then the module program will be regenerated without changing the code.

[0051] In a specific application, the module program generation method for the service-oriented architecture can be implemented using the SDK (Software Development Kit) framework. The following two tables give partial contents of the second declaration file (startup yaml file) and the first declaration file (base yaml file), where the first declaration file only shows the keywords of the connection relationship (i.e., io) data segment.

[0052] Table 1 Startup YAML file

[0053]

[0054] Table 2 base yaml file

[0055]

[0056] Table 1 shows the startup configuration information and connection relationship of the module program mobileye, where the content above connection is the startup configuration information, which is used to generate the startup configuration file corresponding to the module, processor means starting the module program in the main processor 1, args means the relevant parameters of the main processor 1, param is the basic information when the module program is started, and the basic information comes from the mobileye_config.yaml file.

[0057] The following content is the connection relationship used to generate the theme file corresponding to the module program. The module program includes four pairs of connection relationships:

[0058] localization_result:localization_result1;

[0059] perception_result:perception_result1;

[0060] relative_motion_result:relative_motion_result1;

[0061] smart_camera_front_result:smart_camera_front_result1.

[0062] Each set of connection relationships consists of a key-value pair (key: topic key, value: topic value), localization_result represents the topic key, and localization_result1 represents the topic value.

[0063] The mobileye module program has four pairs of connection relationships. It is currently impossible to distinguish which of these four pairs of connection relationships are publish-subscribe relationships and which are client-server relationships. You need to go to the base yaml file of the specific module program (distinguished by the io:type field) to distinguish them.

[0064] Table 2 lists some keywords in the io data segment of the base yaml file.

[0065] Keyword name: is the keyword for starting the connection relationship topic key in the yaml file, and the corresponding key variable is: topic key, for example: topic key localization_result. The mobileye module program can obtain the topic value corresponding to the topic key from the topic file based on the key variable localization_result of the name keyword.

[0066] Keyword type: a keyword indicating the type of connection relationship configured in the startup yaml file. The corresponding key variables include: publisher (publishing instance type), subscriber (subscription instance type), client (client instance type), and service (server instance type).

[0067] Keyword schema: Keywords for the type of data transferred between publish-subscribe and client-server relationships. The corresponding key variable is: transfer data type.

[0068] Keyword optional: A keyword that starts the optional option of whether the subject value of the connection relationship in the YAML file is optional. The corresponding key variable is True or False.

[0069] The module program generation device for service-oriented architecture provided by the present invention is described below. The module program generation device for service-oriented architecture described below and the module program generation method for service-oriented architecture described above can be referenced to each other.

[0070] like Figure 2 As shown, the module program generation device for service-oriented architecture provided by the present invention includes:

[0071] The first declaration file parsing unit 210 is used to parse a pre-configured first declaration file corresponding to a module program, and obtain key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in a common program segment of different module programs.

[0072] The module program generating unit 220 is used to insert the key variables into corresponding reserved positions in the pre-designed program template to generate a module program.

[0073] The module program generation device for service architecture provided in this embodiment parses the pre-configured first declaration file corresponding to the module program, obtains the value corresponding to the keyword declared in the first declaration file, and the key variable represents the unique field in the common program segment of different module programs; inserts the value corresponding to the key variable into the corresponding reserved position in the pre-designed program template to generate the module program. In this way, when developing a module program, the developer only needs to configure the first declaration file, and then automatically generate the module program. Later, only the core algorithm part of the module program needs to be developed, which greatly reduces the amount of module program development code and shortens the development cycle.

[0074] Optionally, the module program generating unit 220 includes:

[0075] The placeholder search unit is used to search for a placeholder corresponding to the key variable in the program template according to the keyword, and each of the reserved positions is provided with the placeholder.

[0076] The placeholder replacement unit is used to replace the placeholder with the key variable until all the placeholders are replaced.

[0077] The renaming instruction receiving unit is used to receive an instruction to rename the program template and generate the module program after renaming.

[0078] Optionally, the module program generating device for service-oriented architecture further includes:

[0079] The second declaration file parsing unit is used to parse a pre-configured second declaration file to obtain startup configuration information and connection relationships corresponding to each module program declared in the second declaration file.

[0080] The startup configuration file generating unit is used to generate a startup configuration file of the corresponding module program according to the startup configuration information.

[0081] The subject file generation unit is used to generate a subject file of the corresponding module program according to the connection relationship. The subject file includes: the subject key and subject value of the connection relationship. The key variables in the first declaration file include: the subject key and subject key type.

[0082] Among them, the startup configuration file is used to be called by the system process to start the module program in the startup configuration file. The program template is provided with a reading function for reading the corresponding theme file when the module program starts. The reading function is used to read the theme value corresponding to the theme key in the theme file, so that the module program creates an instance of the connection relationship according to the theme value and the theme key type.

[0083] Optionally, the keywords in the first declaration file also include: an optional item indicating whether the subject value in the connection relationship is optional, and a judgment function is provided in the program template. The judgment function is used to judge whether the module program starts normally when the subject value is not read when the module program starts according to the actual value of the key variable of the optional item. If the actual value of the key variable is true, the program module starts normally; if the actual value of the key variable is false, the program module cannot start.

[0084] Optionally, the judgment function is also used to start an error report and prompt the theme key corresponding to the default theme value when it is judged that the module program cannot be started normally because the theme value is not read.

[0085] Optionally, the key variables in the first declaration file also include: the transmission data type of the connection relationship.

[0086] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the module program generation method for the service-oriented architecture, and the method includes:

[0087] A pre-configured first declaration file corresponding to the module program is parsed to obtain key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in common program segments of different module programs.

[0088] The key variables are inserted into corresponding reserved positions in a pre-designed program template to generate a module program.

[0089] The module program generation device for service architecture provided by the present invention parses the pre-configured first declaration file corresponding to the module program, obtains the keywords declared in the first declaration file, and the keywords represent the unique fields in the common program segments of different module programs; inserts the keywords into the corresponding reserved positions in the pre-designed program template to generate the module program. In this way, when developing the module program, the developer only needs to configure the first declaration file, and then automatically generate the module program. Subsequently, only the core algorithm part of the module program needs to be developed, which greatly reduces the amount of module program development code and shortens the development cycle.

[0090] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0091] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the module program generation method for a service-oriented architecture provided by the above methods, the method comprising:

[0092] A pre-configured first declaration file corresponding to the module program is parsed to obtain key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in common program segments of different module programs.

[0093] The key variables are inserted into corresponding reserved positions in a pre-designed program template to generate a module program.

[0094] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating a module program for a service-oriented architecture provided by the above methods is implemented, and the method comprises:

[0095] A pre-configured first declaration file corresponding to the module program is parsed to obtain key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in common program segments of different module programs.

[0096] The key variables are inserted into corresponding reserved positions in a pre-designed program template to generate a module program.

[0097] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0098] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A module program generation method for a service-oriented architecture, characterized in that: include: Parsing a pre-configured first declaration file corresponding to the module program, obtaining key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in a common program segment of different module programs; Inserting the key variables into corresponding reserved positions in a pre-designed program template to generate a module program; Wherein, before parsing the pre-configured first declaration file corresponding to the module program and obtaining the key variables of the keywords declared in the first declaration file, the method further includes: Parsing a pre-configured second declaration file, and obtaining startup configuration information and connection relationships corresponding to each module program declared in the second declaration file; Generate a startup configuration file for the corresponding module program according to the startup configuration information; Generate a theme file of the corresponding module program according to the connection relationship, wherein the theme file includes: a theme key and a theme value of the connection relationship, and the key variables in the first declaration file include: the theme key and the theme key type, Among them, the startup configuration file is used to be called by the system process to start the module program in the startup configuration file. The program template is provided with a reading function for reading the corresponding theme file when the module program starts. The reading function is used to read the theme value corresponding to the theme key in the theme file, so that the module program creates an instance of the connection relationship according to the theme value and the theme key type.

2. The method for generating a module program for a service-oriented architecture according to claim 1, characterized in that: Insert the key variables into the corresponding reserved positions in the pre-designed program template to generate a module program, including: Searching for a placeholder corresponding to the key variable in the program template according to the keyword, each of the reserved positions being provided with the placeholder; The key variable is used to replace the placeholder until all the placeholders are replaced; An instruction to rename the program template is received, and the module program is generated after renaming.

3. The method for generating a module program for a service-oriented architecture according to claim 1, characterized in that: The keywords in the first declaration file also include: an optional item indicating whether the subject value in the connection relationship is optional, a judgment function is provided in the program template, and the judgment function is used to judge whether the module program starts normally when the subject value is not read when the module program starts according to the actual value of the key variable of the optional item. If the actual value of the key variable is true, the program module starts normally, and if the actual value of the key variable is false, the program module cannot be started.

4. The method for generating a module program for a service-oriented architecture according to claim 3, characterized in that: The judgment function is also used to start an error report and prompt the theme key corresponding to the default theme value when it is judged that the module program cannot be started normally because the theme value is not read.

5. The method for generating a module program for a service-oriented architecture according to claim 1, characterized in that: The key variables in the first declaration file also include: the transmission data type of the connection relationship.

6. A module program generation device for service-oriented architecture, characterized in that: include: A first declaration file parsing unit, configured to parse a pre-configured first declaration file corresponding to a module program, and obtain key variables of keywords declared in the first declaration file, wherein the key variables represent unique fields in a common program segment of different module programs; A module program generating unit, used for inserting the key variables into corresponding reserved positions in a pre-designed program template to generate a module program; Wherein, the device further comprises: A second declaration file parsing unit, configured to parse a pre-configured second declaration file, and obtain startup configuration information and connection relationships corresponding to each module program declared in the second declaration file; A startup configuration file generating unit, used to generate a startup configuration file of a corresponding module program according to the startup configuration information; A subject file generating unit, used for generating a subject file of a corresponding module program according to the connection relationship, wherein the subject file includes: a subject key and a subject value of the connection relationship, and the key variables in the first declaration file include: the subject key and the subject key type; Among them, the startup configuration file is used to be called by the system process to start the module program in the startup configuration file. The program template is provided with a reading function for reading the corresponding theme file when the module program starts. The reading function is used to read the theme value corresponding to the theme key in the theme file, so that the module program creates an instance of the connection relationship according to the theme value and the theme key type.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for generating a module program for a service-oriented architecture as claimed in any one of claims 1 to 5 is implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a module program for a service-oriented architecture as claimed in any one of claims 1 to 5 is implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for generating a module program for a service-oriented architecture as claimed in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Dynamic generation of target files from template files and tracking of the processing of target files

    US7320007B1