Software resource compilation method and corresponding device, equipment and medium

By responding to compilation instructions in software development to obtain the channel identification and package and compile the resources of the target module and its dependent modules, the problem of resource redundancy and update in software development is solved, and customized software project packaging and compilation and file resource update are realized.

CN112764756BActive Publication Date: 2024-09-17GUANGZHOU HUADUO NETWORK TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110055839.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-15
Publication Date
2024-09-17
Estimated Expiration
2041-01-15

AI Technical Summary

Technical Problem

Existing software development applications cannot customize, package and compile software projects according to development needs, resulting in redundant source code products and the inability to update file resources with the same name in new software projects.

Method used

Obtain the channel identifier by responding to the compilation instructions, determine the target module and its dependent modules, package the compiled code and file resources, and when the target module and the dependent module have files with the same name, replace the file of the dependent module with the file of the target module as the only option. Generate customized source code products.

Benefits of technology

It realizes customized packaging and compilation based on development needs, reduces redundant resources in source code products, and ensures that file resources in new software projects can be updated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112764756B
    Figure CN112764756B
Patent Text Reader

Abstract

The present application discloses a software resource compilation method and its corresponding device, equipment, and medium, wherein the control method comprises the following steps: in response to the compilation instruction of the software development project, obtaining a channel identification corresponding to the compilation instruction; determining the target module corresponding to the channel identification and the dependent module to be referenced in its function; packaging and compiling the code resources of the target module and the file resources referenced by it, wherein, for the file resources, when the target module and the dependent module have the same-name object, the file resources of the target module are used as the only option to replace the same-name object of the dependent module; outputting the packaged and compiled source code product, wherein the source code product comprises a code file corresponding to the code resource of the target module and a resource file corresponding to its file resource. The present application constructs a software project packaging and compilation function, and at the same time provides a multi-channel development mode for the development team, which helps to improve the development efficiency of the software project.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer software development, and in particular to a software resource compilation method, device and corresponding electronic equipment and non-volatile storage medium. Background Art

[0002] With the development of the Internet, the number of Internet users is also increasing day by day, and major Internet companies are also developing various types of applications to meet the needs of Internet users. Nowadays, Internet companies' software projects generally use existing software development applications to develop software development projects that meet corresponding needs, in order to save development time and development costs and improve the development efficiency of software projects.

[0003] However, the source code products of the same software development project packaged and compiled by current software development applications cannot be packaged and compiled by different channels, resulting in that each development team cannot customize the packaged and compiled source code products to meet their development needs.

[0004] Secondly, the source code product that developers package and compile for their development needs based on the software development application will include non-essential development resources such as code resources and image resources for other development needs, which will make the code resources and file resources contained in the source code product redundant.

[0005] Furthermore, when developers develop a new software project based on an old software project, in the source code product obtained by packaging and compiling the new project, there may be file resources with the same name as the old software project in the new software project, which makes it impossible to package and compile the file resources in the new software development project, resulting in the inability to update the file resources of the new project.

[0006] In view of the various problems that affect software development in existing technologies, it is necessary to explore some effective solutions. Summary of the invention

[0007] One of the purposes of the present application is to solve at least one of the above problems and to provide a software resource compilation method and its corresponding device, electronic device, and non-volatile storage medium.

[0008] In order to meet the various objectives of this application, this application adopts the following technical solutions:

[0009] A software resource compilation method provided for one of the purposes of this application comprises the following steps:

[0010] In response to a compilation instruction of a software development project, obtaining a channel identifier corresponding to the compilation instruction;

[0011] Determine the target module corresponding to the channel identifier and the dependent modules that need to be referenced in its function;

[0012] Package and compile the code resources of the target module and the file resources referenced by it. For file resources, when the target module and the dependent module have objects with the same name, the file resources of the target module are used as the only option to replace the objects with the same name in the dependent module.

[0013] Output the packaged compiled source code product, which includes code files corresponding to the code resources of the target module and resource files corresponding to its file resources.

[0014] In a further embodiment, in response to a compilation instruction of a software development project, in the step of obtaining a channel identifier corresponding to the compilation instruction, the software development project corresponds to multiple organization modules, each channel identifier is related to at least one of the organization modules, wherein the organization module corresponding to the channel identifier corresponding to the compilation instruction is the target module.

[0015] In a further embodiment, in the step of packaging and compiling the code resources of the target module and the file resources referenced by it, for the code resources, when the target module has annotation information related to the interface call, the corresponding interface call information is obtained according to the annotation information.

[0016] In a further embodiment, for code resources, when the target module has annotation information related to the interface call, the step of obtaining corresponding interface call information according to the annotation information includes:

[0017] Identify the annotation information related to the implementation class in the target module;

[0018] According to the annotation information, query the relationship conversion service for the interface call information corresponding to the annotation information, wherein the interface call information is used to request the relationship conversion service to call the corresponding implementation class for it;

[0019] The interface call information is packaged and compiled as code resources.

[0020] In a further embodiment, for file resources, when the target module and the dependent module have objects with the same name, the step of replacing the objects with the same name of the dependent module with the file resources of the target module as the only option includes:

[0021] Parse the code resources of the target module and determine the file names of the file resources that depend on the dependent module;

[0022] Based on the file name, check whether there is a file resource with the same name in the local resource library associated with the target module;

[0023] When a file resource with the same name exists, it is used to replace the corresponding file resource of the dependent module.

[0024] In a further embodiment, the code resources of the target module and the file resources referenced by the code resources are packaged and compiled, and the file resources are picture resources, audio resources or video resources.

[0025] In a further embodiment, in the step of outputting the packaged compiled source code product, the source code product is packaged into an Android installation package or an SDK package.

[0026] A software resource compilation device provided for one of the purposes of the present application includes:

[0027] An instruction response unit, used to respond to a compilation instruction of a software development project and obtain a channel identifier corresponding to the compilation instruction;

[0028] A module determination unit, used to determine a target module corresponding to the channel identifier and a dependent module that needs to be referenced in its function;

[0029] A resource packaging unit, used for packaging and compiling the code resources of the target module and the file resources referenced by it, wherein, for file resources, when the target module and the dependent module have objects with the same name, the file resources of the target module are used as the only option to replace the objects with the same name in the dependent module;

[0030] The product output unit is used to output the packaged compiled source code product, wherein the source code product includes a code file corresponding to the code resource of the target module and a resource file corresponding to its file resource.

[0031] In some embodiments, the resource packaging unit includes:

[0032] An annotation recognition unit is used to identify annotation information related to the implementation class in the target module;

[0033] An information calling unit, used to query the relationship conversion service for interface calling information corresponding to the annotation information according to the annotation information, wherein the interface calling information is used to request the relationship conversion service to call a corresponding implementation class for it;

[0034] The code packaging unit is used to package and compile the interface call information as a code resource.

[0035] In a further embodiment, the resource packaging unit further comprises:

[0036] A file name determination unit, used for parsing the code resources of the target module and determining the file name of the file resource that depends on the dependent module;

[0037] A same-name query unit, used to query whether there is a file resource with the same name in the local resource library associated with the target module according to the file name;

[0038] The file replacement unit is used to replace the corresponding file resource of the dependent module with the file resource with the same name when there is a file resource with the same name.

[0039] An electronic device provided to meet one of the purposes of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the software resource compilation method described in the present application.

[0040] A non-volatile storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the software resource compilation method in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the method are executed.

[0041] Compared with the prior art, the advantages of this application are as follows:

[0042] First, this application provides a differentiated packaging and compilation service for software projects developed based on software development applications by constructing a channel-customized software development project packaging and compilation function. The channel identifier corresponding to the compilation instruction is obtained by responding to the compilation instruction, and the target module associated with the channel identifier and the dependent template functionally referenced by the target module are determined, and the code resources of the target module and the dependent template and the referenced file resources are packaged and compiled to generate and output the source code product customized by the compilation instruction. The software development project packaging and compilation service implemented by this execution logic can be used by developers to customize the packaging and compilation of source code products containing the code resources and file resources required by them according to functional requirements, and to carry out targeted packaging and compilation, so that the various types of resources contained in the source code product are the resources required for the functions it implements, and prevent resource redundancy in the source code product generated by the packaging and compilation.

[0043] Secondly, the packaging and compilation function constructed by this application can provide developers with a service for updating file resources with the same name. During the packaging and compilation process, if there are file resources with the same name in the target module and the dependent template, the file resources in the target module will be used as the only option to replace the file resources with the same name in the dependent target to update the file resources and improve the development efficiency of developers. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0045] Figure 1 A schematic diagram of the packaging, compiling and executing logic architecture of the software resource compiling method of the present application;

[0046] Figure 2A flowchart of a typical embodiment of the software resource compilation method of the present application;

[0047] Figure 3 A flowchart of a specific process of packaging and compiling code resources in the software resource compilation method of the present application;

[0048] Figure 4 A flowchart of a specific process of packaging and compiling file resources in the software resource compilation method of the present application;

[0049] Figure 5 A principle block diagram of a typical embodiment of the software resource compilation device of the present application;

[0050] Figure 6 This is a basic structural block diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION

[0051] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.

[0052] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0053] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.

[0054] It will be understood by those skilled in the art that the "client", "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of two-way communication on a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication system), which can combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant, personal digital assistant), which may include a radio frequency receiver, pager, Internet / intranet access, web browser, notepad, calendar and / or GPS (Global Positioning System, global positioning system) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with and / or including a radio frequency receiver. The "client", "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or suitable for and / or configured to run locally, and / or in a distributed form, at any other location on the earth and / or in space. The "client", "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, for example, a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.

[0055] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.

[0056] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.

[0057] See also Figure 1 The execution logic of the relevant technical solution of this application is constructed according to the architecture shown in the figure, and the role and function of each part are revealed as follows:

[0058] The software development project 80 referred to in this application includes multiple organization modules 81, each of which includes code resources and corresponding file resources for implementing corresponding functions, so that the software development project 80 constructs related services through the corresponding functions implemented by each of the organization modules 81 contained therein.

[0059] The target module 82 referred to in this application is specified by the compilation instructions generated by the software development project. According to the channel identifier contained in the compilation instructions, the target module 82 and the dependent modules 83 that the target module 82 needs to reference functionally are determined from the various organizational modules 81 included in the software development project 80.

[0060] The source code product 84 referred to in this application is generated by packaging and compiling the code resources and file resources of the target module 82 determined by the channel identifier and the code resources and file resources required by the dependent module 83 that the target module 82 needs to reference functionally.

[0061] The software development project 80 referred to in this application is generally a project file developed by a development device through a software development application. As mentioned above, the multiple organization modules 81 included in the software development project 80 are composed of corresponding development code resources and development file resources.

[0062] The functional reference of the target module 82 to the dependent module 83 may include one or more situations, such as interface calls at the process level in the running state, and references to code resources during the packaging and compilation stage.

[0063] The development device of the present application is equipped with relevant operating systems, such as Window, Mac, Linux, IOS, HMS (Hongmeng), Android and other operating systems that provide equivalent functions. With the support of such operating systems, applications adaptively developed for these operating systems can also run normally in the terminal devices. It is with the help of the operation of these applications that the terminal devices can realize human-computer interaction, remote interaction, and various indirect interactions with other terminals through remote servers.

[0064] The application referred to in this application generally means an application running on an electronic device such as a server or terminal device. These applications implement the relevant technical solutions of this application in a programming manner. Their program codes can be stored in a non-volatile storage medium recognizable by a computer in the form of computer executable instructions, and can be loaded into the memory by the central processing unit for execution. The relevant devices of this application are constructed by the operation of the application on the computer.

[0065] The code resources referred to in this application are used to describe source code data for implementation and development, which are written in a high-level computer language, such as Python, Java, C++, etc. Logically, they can form multiple branch processes with the help of transition statements such as if and case, and can be executed through execution statements, such as calling a method function through execution statements.

[0066] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality to each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.

[0067] See also Figure 2 , a software resource compilation method of the present application, in its typical embodiment, comprises the following steps:

[0068] Step S11, in response to the compilation instruction of the software development project, obtaining a channel identifier corresponding to the compilation instruction:

[0069] The software development project generates the compilation instruction by triggering a corresponding compilation event, so as to obtain the channel identifier corresponding to the compilation instruction by responding to the compilation instruction.

[0070] The compilation event refers to an event executed by the developer by touching a control that is used to trigger the generation of corresponding compilation instructions. The control is displayed in the graphical user interface of the software development project, and a navigation bar for displaying the software development project is provided in the graphical user interface so that the developer can display the various modules included in the software development project in the navigation bar to determine the corresponding module, and generate the corresponding compilation instructions for the module determined by the control that generates compilation instructions.

[0071] The channel identifier is used to determine the target module specified by the compilation instruction to which the channel identifier belongs and the dependent module functionally referenced by the target module. For the specific implementation of the channel identifier, please refer to the subsequent steps, which will not be discussed here.

[0072] It can be understood that the channel identifier is associated with one or more corresponding modules in the software development project, and the association relationship between the channel identifier and the module can be set by the developer according to his own development process / plan, so as to determine through the channel identifier that one or more modules included in the software development project pointed to by the compilation instruction are the target module and the dependent module.

[0073] In one embodiment, the software development project includes multiple organization modules for implementing corresponding functions and services, and each channel identifier is associated with at least one organization module, wherein the organization module corresponding to the channel identifier is the target module, and the dependent module that the target module needs to reference functionally can be determined through the channel identifier.

[0074] Step S12, determining the target module corresponding to the channel identifier and the dependent modules that need to be referenced in terms of its functions:

[0075] After the channel identifier corresponding to the compile instruction is obtained by responding to the compile instruction, the module associated with the channel identifier is determined as the target module and the dependent module required to be referenced by the function implemented by the target module.

[0076] The target module is a module included in the software development project, and correspondingly, the dependent module is also a module included in the software development project. One or more modules included in the software development project are determined to be the target module through the channel identifier, and one or more dependent modules that the target module needs to reference in the functions it implements are determined from the modules included in the software development project, so as to package and compile the code resources and file resources of the target module for resource integration.

[0077] In one embodiment, the target module pointed to by the channel identifier and the dependent module that the target module needs to reference functionally are determined from the multiple organization modules included in the software development project according to the channel identifier, so that the code resources and file resources of the target module and the corresponding code resources and file resources in the dependent modules required by the target module are packaged and compiled, and the resources required for the compilation instructions are packaged and compiled. Regarding the packaging and compilation process, please refer to the subsequent steps and will not be elaborated on here.

[0078] Step S13, package and compile the code resources of the target module and the file resources referenced by it, wherein, for file resources, when the target module and the dependent module have objects with the same name, the file resources of the target module are used as the only option to replace the objects with the same name in the dependent module:

[0079] After determining the target module and the dependent module from the software development project according to the channel identifier, the code resources of the target module and the file resources referenced by it are packaged and compiled, and the code resources and file resources required for the functions of the target module in the dependent module are also packaged and compiled into the same source code product.

[0080] In the execution process of packaged compilation, when the target module and the dependent module have objects (file resources) with the same name, the file resources of the target module will be used as the only option to replace the objects (file resources) with the same name of the dependent module, so that the file resources contained in the source code product generated by packaged compilation of the target module and the dependent module are based on the file resources pointed to by the target module, and the functions implemented by the target module are compiled.

[0081] In the execution process of packaged compilation, when the code resources in the target module reference the implementation class of the dependent module through the corresponding interface class to implement the corresponding function, the code resources of the corresponding dependent module will be packaged and compiled according to the interface class of the code resources in the target module, so that the functions in the target module can be realized in the source code product generated by packaged compilation.

[0082] In one embodiment, during the execution of packaging and compiling the code resources of the target module, when the target module has annotation information related to interface calls, corresponding interface call information is obtained based on the annotation information, and the implementation class provided by the interface call information is packaged and compiled into the code resources of the target module.

[0083] The annotation information existing in the code resources in the target module is used to call the interface call information set in the relationship conversion service. Each interface call information in the relationship conversion service is provided with the annotation information associated with it, so that the module in the software development project calls the corresponding interface call information by writing the annotation information, and implements the function written by the implementation class associated with the interface call information through the interface call information called by it.

[0084] For further examples, see Figure 3 When the target module has annotation information related to the interface call, the specific implementation steps for obtaining the corresponding interface call information according to the annotation information and packaging and compiling are as follows:

[0085] Step S131, identifying annotation information related to the implementation class in the target module:

[0086] The target module corresponding to the channel identifier is determined through the channel identifier, and the code resources contained in the target module are traversed to identify the annotation information related to the implementation class in the target module.

[0087] In one embodiment, the annotation information may be a Java annotation, which is a grammatical metadata that can be added to a Java source code. Classes, methods, variables, parameters, and packages in a Java source code may be annotated, and may be used to associate information metadata with program elements. The target module obtains corresponding interface call information through the annotation information, and calls the corresponding implementation class through the interface call information to implement the corresponding function.

[0088] In another embodiment, the annotation information refers to annotations implemented in existing high-level languages, such as the aforementioned Java annotations, and is further enriched and implemented with high-level languages ​​to form an annotation system with more complete and easy-to-use functions, as long as it can be recognized by this method and realize the corresponding functions.

[0089] Step S132: query the relationship conversion service for the interface call information corresponding to the annotation information according to the annotation information, wherein the interface call information is used to request the relationship conversion service to call the corresponding implementation class for it:

[0090] When the annotation information is identified as existing in the target module, the relationship conversion service will be queried for the interface call information corresponding to the annotation information according to one or more of the annotation information, and the relationship conversion service will be requested to package and compile the implementation class corresponding to the interface call information.

[0091] In one embodiment, the relationship conversion service is based on the differentiated annotation framework technology developed by Android Annotation Process. It extracts the interface class and uses the annotation capability provided by the framework on the implementation class to realize a service of differentiated selection of the target implementation class during construction. It is capable of removing code resources from non-target channels in the dimension of class bytecode, and has the automatic management capability of the unit code set SourceSet in the organization module. The relationship conversion service will be provided with multiple interface call information, and each interface call information is provided with the annotation information associated therewith, so that the target module can write the annotation information and call the corresponding implementation class of the interface call information associated with the annotation information to realize the corresponding function.

[0092] Step S133: package and compile the interface call information as a code resource:

[0093] After the interface call information associated with the annotation information is acquired through the annotation information existing in the target panel, the code resources of the interface call information are packaged and compiled into the code resources belonging to the target module.

[0094] By constructing the relationship conversion service, a modular development service is provided, so that the code resources of other templates included in the software development project are not invaded during the packaging and compilation of the corresponding target module through the compilation instructions, so that the source code products generated by the packaging and compilation are more targeted, and the code resources unique to different templates are not coupled.

[0095] In one embodiment, see Figure 4 When the target module and the dependent module have objects with the same name, the specific steps performed by the package compilation using the file resources of the target module as the only option to replace the objects with the same name in the dependent module are as follows:

[0096] Step S131', parse the code resources of the target module, and determine the file name of the file resource that depends on the dependent module:

[0097] The code resources in the target module are parsed to determine the file name of the file resource of the dependent template on which the target module depends.

[0098] Step S132', query the local resource library associated with the target module based on the file name to see whether there is a file resource with the same name:

[0099] According to the file name of the file resource in the dependent target on which the target module depends, it is queried whether there is a file resource with the same name as the file name in the local resource library associated with the target module.

[0100] The local resource library stores the file resources required by the target module to implement corresponding functions, which may include other resources such as image resources, audio resources, video resources or XML file resources, and each of the file resources has an existing association with the code resources in the target module, so that the code resources can implement corresponding functions by referencing the file resources stored in the local resource library.

[0101] Step S133': when there is a file resource with the same name, the corresponding file resource of the dependent module is replaced with the file resource with the same name:

[0102] When it is found that there are file resources with the same name as the file resources of the dependent template in the file resources of the target module, the file resources of the target module will replace the file resources with the same name in the dependent target for packaging and compilation, so as to ensure that the file resources in the target module are the only option, so that the source code product generated by the packaging and compilation can realize the functions realized by the target module.

[0103] Step S14: output the packaged compiled source code product, which includes code files corresponding to the code resources of the target module and resource files corresponding to its file resources:

[0104] The code resources of the target module and the file resources referenced by the target module are packaged and compiled to generate the source code product including the code files corresponding to the code resources of the target module and the resource files corresponding to the file resources, and the source code product is output to feedback the compilation instruction.

[0105] In one embodiment, the source code product may be a development kit (SDK) or an application installation package packaged and compiled according to the target module, which implements corresponding functions and services based on the code resources written by the target module and the file resources referenced by it.

[0106] In one embodiment, the source code product generated by packaging and compiling may be an Android installation package (APK), so that a device can install the application built by the target module through the installation package.

[0107] Furthermore, by functionalizing each step in the method disclosed in the above embodiments, a software resource compilation device of the present application can be constructed. Figure 5In a typical embodiment, the device includes: an instruction response unit 11, a module determination unit 12, a resource packaging unit 13 and a product output unit 14. The instruction response unit 11 is used to respond to the compilation instruction of the software development project and obtain the channel identifier corresponding to the compilation instruction; the module determination unit 12 is used to determine the target module corresponding to the channel identifier and the dependent module that needs to be referenced in its function; the resource packaging unit 13 is used to package and compile the code resources of the target module and the file resources referenced by it, wherein, for the file resources, when the target module and the dependent module have the same-name object, the file resources of the target module are used as the only option to replace the same-name object of the dependent module; the product output unit 14 is used to output the source code product after packaging and compilation, and the source code product includes the code file corresponding to the code resource of the target module and the resource file corresponding to its file resource.

[0108] In one embodiment, the resource packaging unit 13 includes: an annotation identification unit, which is used to identify annotation information related to the implementation class in the target module; an information calling unit, which is used to query the relationship conversion service for interface calling information corresponding to the annotation information based on the annotation information, and the interface calling information is used to request the relationship conversion service to call the corresponding implementation class for it; a code packaging unit, which is used to package and compile the interface calling information as a code resource.

[0109] In another embodiment, the resource packaging unit 13 further includes: a file name determination unit, which is used to parse the code resources of the target module and determine the file name of the file resource that depends on the dependent module; a same-name query unit, which is used to query whether there is a file resource with the same name in the local resource library associated with the target module based on the file name; and a file replacement unit, which is used to replace the corresponding file resource of the dependent module with the file resource with the same name when there is a file resource with the same name.

[0110] In order to solve the above technical problems, the embodiment of the present application also provides a computer device for running a computer program implemented according to the software resource compilation method. Figure 6 , Figure 6 This is a basic structural block diagram of the computer device in this embodiment.

[0111] like Figure 6As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected via a system bus. Among them, the non-volatile storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor can implement a software resource compilation method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute a software resource compilation method. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0112] In this embodiment, the processor is used to execute the specific functions of each module / submodule of the software resource compilation device of the present invention, and the memory stores the program code and various data required to execute the above modules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the software resource compilation device, and the server can call the program code and data of the server to execute the functions of all submodules.

[0113] The present application also provides a non-volatile storage medium, wherein the software resource compilation method is written into a computer program and stored in the storage medium in the form of computer-readable instructions. When the computer-readable instructions are executed by one or more processors, it means that the program is run in the computer, thereby enabling one or more processors to execute the steps of the software resource compilation method of any of the above-mentioned embodiments.

[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0115] In summary, this application constructs a software development project packaging and compilation function, which is convenient for developers to package and compile the source code products required for development, and at the same time provides developers with multi-channel software development functions, which helps to improve the development efficiency of software projects.

[0116] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0117] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.

[0118] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A software resource compilation method, It is characterized in that The steps include: In response to a compilation instruction of a software development project, obtaining a channel identifier corresponding to the compilation instruction; Determine, from various organizational modules included in the software development project, a target module corresponding to the channel identifier and a dependent module that the target module needs to reference in terms of function; Package and compile the code resources of the target module and the file resources referenced by the target module, wherein, for the file resources, when the target module and the dependent module have objects with the same name, the file resources of the target module are used as the only option to replace the objects with the same name of the dependent module, and when the annotation information in the target module indicates that the code resources of the target module reference the implementation class of the dependent module through the corresponding interface class to implement the corresponding function, the implementation class code resources of the corresponding dependent module are packaged and compiled according to the interface class in the code resources in the target module; Output the packaged compiled source code product, the source code product includes a code file corresponding to the code resources of the target module and a resource file corresponding to the file resources of the target module.

2. The method according to claim 1, It is characterized in that In the step of obtaining a channel identifier corresponding to the compilation instruction in response to the compilation instruction of the software development project, the software development project corresponds to multiple organization modules, each channel identifier is related to at least one of the organization modules, wherein the organization module corresponding to the channel identifier corresponding to the compilation instruction is the target module.

3. The method according to claim 1, It is characterized in that For code resources, when the annotation information in the target module indicates that the code resources of the target module reference the implementation class of the dependent module through the corresponding interface class to implement the corresponding function, the step of packaging and compiling the implementation class code resources of the corresponding dependent module according to the interface class in the code resources in the target module includes: Identify the annotation information related to the implementation class in the target module; According to the annotation information, query the relationship conversion service for the interface call information corresponding to the annotation information, wherein the interface call information is used to request the relationship conversion service to call the corresponding implementation class for it; The interface call information is packaged and compiled as code resources.

4. The method according to claim 1, It is characterized in that For file resources, when the target module and the dependent module have objects with the same name, the steps of replacing the objects with the same name in the dependent module with the file resource of the target module as the only option include: Parse the code resources of the target module and determine the file names of the file resources that depend on the dependent module; Based on the file name, check whether there is a file resource with the same name in the local resource library associated with the target module; When a file resource with the same name exists, it is used to replace the corresponding file resource of the dependent module.

5. The method according to claim 1, It is characterized in that The code resources of the target module and the file resources referenced by it are packaged and compiled, and the file resources are picture resources, audio resources or video resources.

6. The method according to claim 1, It is characterized in that In the step of outputting the packaged compiled source code product, the source code product is packaged into an Android installation package or an SDK package.

7. A software resource compilation device, It is characterized in that It includes: An instruction response unit, used to respond to a compilation instruction of a software development project and obtain a channel identifier corresponding to the compilation instruction; A module determination unit, used to determine, from various organizational modules included in the software development project, a target module corresponding to the channel identifier and a dependent module that the target module needs to reference in terms of function; A resource packaging unit, used for packaging and compiling the code resources of the target module and the file resources referenced by the target module, wherein, for the file resources, when the target module and the dependent module have objects with the same name, the file resources of the target module are used as the only option to replace the objects with the same name of the dependent module, and when the annotation information in the target module indicates that the code resources of the target module reference the implementation class of the dependent module through the corresponding interface class to realize the corresponding function, the implementation class code resources of the corresponding dependent module are packaged and compiled according to the interface class in the code resources in the target module; The product output unit is used to output the packaged compiled source code product, wherein the source code product includes a code file corresponding to the code resources of the target module and a resource file corresponding to the file resources of the target module.

8. An electronic device comprising a central processing unit and a memory, It is characterized in that The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 6.

9. A non-volatile storage medium, It is characterized in that It stores a computer program implemented according to the method described in any one of claims 1 to 6 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.