Interface calling method, device, equipment and storage medium

By obtaining and encapsulating functional interface information for mini-game development and generating interface encapsulation code, the problem of inconsistent interface calls in different programming languages ​​is solved and development efficiency and stability are improved.

CN118331660BActive Publication Date: 2024-10-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410758609.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-10-08
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

In the development of small games, due to the inconsistent interface calling methods between different programming languages, developers need to spend a lot of time and energy on interface conversion, which increases the development workload, easily introduces errors, and affects development efficiency and stability.

Method used

By obtaining the interface information of the functional interface used for mini-game development, determining the corresponding interface encapsulation template, and generating the interface encapsulation code, the functional interface of the first programming language is automatically encapsulated into a form that can be called in the second programming language environment. , Reduce manual writing and maintenance of code.

Benefits of technology

It improves the efficiency of interface packaging, reduces the development workload, improves the efficiency and accuracy of mini-game development, and thereby improves the stability of mini-games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118331660B_ABST
    Figure CN118331660B_ABST
Patent Text Reader

Abstract

The present application relates to an interface calling method, device, computer equipment, storage medium and computer program product. The method can be applied to the field of cloud technology, and the method includes: obtaining interface information of a functional interface in a first programming language used for mini-game development; determining an interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template includes a template code for encapsulating the functional interface in a second programming language; generating an interface encapsulation code based on the interface information and the interface encapsulation template; calling the interface encapsulation code when developing a target game function of a mini-game based on the second programming language; the interface encapsulation code is used to implement the target game function. The use of this method can improve the development efficiency of mini-games.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an interface calling method, device, equipment and storage medium. Background Art

[0002] API (Application Programming Interface) is a set of rules, protocols, and tools that define the interactions between software components. It provides a method that allows different software components to communicate and interact without direct access to source code or programs.

[0003] When developing target game functions of a mini-game through a mini-game development application, if there are existing function interfaces that can implement these target game functions, the development of the target game functions can be quickly completed by calling these existing function interfaces. However, these existing function interfaces are often developed based on specific programming languages, and the programming language used by the mini-game development application may be inconsistent with the programming language used by these existing function interfaces. This inconsistency in programming languages ​​has caused great trouble to developers, requiring developers to spend a lot of time and energy to understand and convert interface calling methods between different programming languages, thereby reducing development efficiency.

[0004] Existing solutions usually require developers to manually write a large amount of code to encapsulate interface calls between different programming languages. This not only increases the development workload, but also easily introduces errors and inconsistencies, affecting the development efficiency and accuracy of mini-games, and further affecting the stability of the developed mini-games. Summary of the invention

[0005] Based on this, it is necessary to provide an interface calling method, device, equipment and storage medium that can improve development efficiency in response to the above technical problems.

[0006] In a first aspect, the present application provides an interface calling method. The method comprises:

[0007] Obtaining interface information of a functional interface in a first programming language used for mini-game development;

[0008] Determine an interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template includes a template code encapsulating the functional interface using a second programming language;

[0009] Generate an interface encapsulation code based on the interface information and the interface encapsulation template;

[0010] When developing a target game function of a mini-game based on the second programming language, the interface encapsulation code is called; the interface encapsulation code is used to implement the target game function.

[0011] In a second aspect, the present application also provides an interface calling device. The device comprises:

[0012] An interface information acquisition module, used to acquire interface information of a functional interface in a first programming language used for mini-game development;

[0013] An interface encapsulation template determining module, configured to determine an interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template comprising a template code encapsulating the functional interface in a second programming language;

[0014] An interface encapsulation code generation module, used to generate an interface encapsulation code based on the interface information and the interface encapsulation template;

[0015] The interface calling module is used to call the interface encapsulation code when developing a target game function of the mini-game based on the second programming language; the interface encapsulation code is used to implement the target game function.

[0016] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0017] Obtaining interface information of a functional interface in a first programming language used for mini-game development;

[0018] Determine an interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template includes a template code encapsulating the functional interface using a second programming language;

[0019] Generate an interface encapsulation code based on the interface information and the interface encapsulation template;

[0020] When developing a target game function of a mini-game based on the second programming language, the interface encapsulation code is called; the interface encapsulation code is used to implement the target game function.

[0021] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0022] Obtaining interface information of a functional interface in a first programming language used for mini-game development;

[0023] Determine an interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template includes a template code encapsulating the functional interface using a second programming language;

[0024] Generate an interface encapsulation code based on the interface information and the interface encapsulation template;

[0025] When developing a target game function of a mini-game based on the second programming language, the interface encapsulation code is called; the interface encapsulation code is used to implement the target game function.

[0026] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0027] Obtaining interface information of a functional interface in a first programming language used for mini-game development;

[0028] Determine an interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template includes a template code encapsulating the functional interface using a second programming language;

[0029] Generate an interface encapsulation code based on the interface information and the interface encapsulation template;

[0030] When developing a target game function of a mini-game based on the second programming language, the interface encapsulation code is called; the interface encapsulation code is used to implement the target game function.

[0031] The above-mentioned interface calling method, apparatus, computer equipment, storage medium and computer program product, after obtaining interface information of a functional interface in a first programming language used for mini-game development, determine an interface encapsulation template corresponding to the functional interface according to the obtained interface information, wherein the interface encapsulation template includes a template code for encapsulating the functional interface in a second programming language, and automatically generates interface encapsulation code of the functional interface based on the interface information and the interface encapsulation template, thereby realizing automatic encapsulation of the functional interface in the first programming language into a form that can be called in the second programming language environment, thereby improving the encapsulation efficiency of the functional interface in the first programming language, and when developing the target game function of the mini-game based on the second programming language, the interface encapsulation code can be directly called based on the development requirements, thereby reducing the workload of manual code writing and maintenance, improving the development efficiency and accuracy of the mini-game development, and thereby improving the stability of the developed mini-game. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 An application environment diagram of an interface calling method in an embodiment;

[0033] Figure 2 A schematic diagram of a flow chart of an interface calling method in an embodiment;

[0034] Figure 3 A schematic diagram of a code implementation for extracting interface information in an embodiment;

[0035] Figure 4 A schematic diagram of code implementation for extracting interface information in another embodiment;

[0036] Figure 5 A schematic diagram of code implementation of interface classification in one embodiment;

[0037] Figure 6 A schematic diagram of code implementation of interface classification in another embodiment;

[0038] Figure 7 A schematic diagram of a code implementation of template rendering in an embodiment;

[0039] Figure 8 A schematic diagram of a code implementation of template rendering in another embodiment;

[0040] Fig. 9 A schematic diagram of an interface encapsulation code in an embodiment;

[0041] Fig.10 A schematic diagram of a flow chart of an interface calling method in another embodiment;

[0042] Fig.11 A schematic diagram of a flow chart of an interface calling method in another embodiment;

[0043] Fig.12 A schematic diagram of a flow chart of an interface calling method in another embodiment;

[0044] Fig.13 A structural block diagram of an interface calling device in an embodiment;

[0045] Fig.14 is an internal structure diagram of a computer device in one embodiment;

[0046] Fig.15 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0048] The interface calling method provided in the embodiment of the present application can be applied to the field of cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize data calculation, storage, processing, and sharing.

[0049] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0050] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.

[0051] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.

[0052] The interface calling method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. The interface calling method can be executed by the terminal 102 or the server 104 alone, or by the terminal 102 and the server 104 in collaboration. In some embodiments, the interface calling method is executed by the terminal 102, and the terminal 102 obtains the interface information of the functional interface used for the development of the mini-game and in the first programming language; determines the interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template includes a template code for encapsulating the functional interface using the second programming language; generates an interface encapsulation code based on the interface information and the interface encapsulation template; when the target game function of the mini-game is developed based on the second programming language, the interface encapsulation code is called; the interface encapsulation code is used to implement the target game function.

[0053] The terminals may be, but are not limited to, various desktop computers, laptops, smart phones, tablet computers, IoT devices, portable wearable devices, and network devices. IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Network devices may be routers, switches, firewalls, load balancers, network storage, network adapters, etc.

[0054] The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal and the server may be directly or indirectly connected via wired or wireless communications, which is not limited in this application.

[0055] In one embodiment, Figure 2 As shown, an interface calling method is provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps:

[0056] S202, obtaining interface information of a functional interface in a first programming language used for mini-game development.

[0057] Among them, mini-games refer to lightweight game applications with simple operations, short game time and low hardware requirements. They can run independently on the terminal or be embedded as sub-applications in other applications. The other applications are the parent applications of the mini-games. The parent application is a software platform that can contain or run one or more other independent applications (called sub-applications). In software development and application deployment, the parent application provides the sub-applications with a unified framework for operating environment, data exchange interface and user interaction. For example, in the embodiment of the present application, the parent application where the mini-game is located can be a social media platform or an instant messaging application.

[0058] Mini-game development refers to the process of designing and making lightweight game applications, specifically including the entire process of designing, coding, testing and publishing for mini-games. It is understandable that mini-game development depends on mini-game development applications, which provide the necessary tools and functions to support game development. Mini-game development applications can specifically be game development engines. Game development engines are a software framework used for game design, development and publishing. They provide a set of pre-written functions and tools to help developers create and run games, whether they are 2D, 3D, single-player games or multiplayer online games. Game development engines usually include graphics renderers, physics engines, audio processors, script support, animation tools, etc., enabling developers to develop games more efficiently without having to write all the underlying code from scratch. Game development engines can specifically be at least one of Unity, Cocos2d, Unreal Engine and Godot. It is understandable that different game development engines usually support specific programming languages ​​or provide their own scripting languages, which are used to implement game logic, design interfaces, and control various interactions of games. For example, the programming languages ​​supported by Unity are C#, the programming languages ​​supported by Cocos2d are C++, JavaScript, Lua, etc., and Unreal The programming language supported by Engine is C++, and the programming language supported by Godot is GDScript.

[0059] A functional interface is an application layer programming interface (API) with a certain function. It is composed of a set of predefined functions, commands or protocols, which enable different software applications to interact with each other or access specified functions and resources. The functional interface can be an interface provided by other applications other than the mini-game development application. Other applications refer to independent applications that are not directly involved in the development of mini-games. The functional interface enables the mini-game development application to use the services provided by other applications when developing mini-games. These services are exposed in the form of functional interfaces of other applications. The programming language used by other applications is the first programming language, and the programming language used by the mini-game development application is the second programming language. The first programming language and the second programming language are different programming languages.

[0060] Other applications can be game development applications that are different from mini-game development applications. For example, when using Unity to develop a mini-game, it is necessary to integrate certain specific tools or libraries in Cocos2d to implement the development of a certain game function. In this case, this game function can be implemented by calling the API provided by Cocos2d, thereby utilizing the strengths of Cocos2d, such as more optimized 2D game processing capabilities, without leaving the Unity environment. These APIs provided by Cocos2d are the corresponding functional interfaces. Other applications can also be non-game development applications that are different from mini-game development applications. For example, the mini-game being developed needs to integrate social media functions that allow players to share achievements or invite friends to join the game. In this case, when developing the mini-game, these functions can be implemented by calling the APIs provided by social applications. These APIs provided by social applications are the corresponding functional interfaces.

[0061] Interface information is information used to describe or define an interface, which may include attribute information and function information to ensure that developers can correctly understand and use the interface. Attribute information refers to the detailed description of data fields or variables defined in the interface, which may include name, type, default value, description, access rights and other information. Function information refers to the detailed description of methods or functions defined in the interface. These methods are the behavioral part of the interface and are used to perform specific operations. Function information may include function name, hyperparameters, return type, description, exceptions and other information.

[0062] Specifically, the computer device can obtain an interface definition document for a functional interface provided by a developer of the functional interface used for mini-game development and in the first programming language, parse the interface definition document, obtain a parsing result, and extract interface information of the functional interface from the parsing result.

[0063] Among them, the developers of functional interfaces usually refer to individuals, teams or organizations responsible for designing, implementing, maintaining and providing application programming interfaces (APIs). These developers can be various types of entities, including commercial companies, open source communities, government agencies or independent software developers. They provide APIs to allow other software developers and systems to access specific functions or data.

[0064] The interface definition document of a functional interface describes the various interfaces that can be called in a software system, including the interface's operations, parameters, return data, and possible error messages. It can be an online API document, a developer manual, or an automatically generated interface description file.

[0065] S204, determining an interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template includes a template code that encapsulates the functional interface in a second programming language.

[0066] Among them, the interface encapsulation template is a set of predefined code structures, that is, it creates an abstract layer so that a functional interface written in a programming language can be conveniently called by another programming language. The interface encapsulation template in the embodiment of the present application includes a template code that uses a second programming language to encapsulate a functional interface implemented based on a first programming language. The second programming language is the programming language used for mini-game development applications, and the first programming language is the programming language used by other applications.

[0067] Specifically, after obtaining the interface information of the functional interface, the computer device may analyze the interface information of any functional interface to obtain an analysis result, and determine the interface encapsulation template corresponding to the functional interface according to the analysis result.

[0068] S206, generating an interface encapsulation code based on the interface information and the interface encapsulation template.

[0069] Specifically, for any functional interface, after determining the interface encapsulation template corresponding to the functional interface, the interface information of the functional interface and the interface encapsulation template can be input into the template engine, and the interface information can be passed to the obtained interface encapsulation template through the template engine. For example, according to the definition of the interface encapsulation template, the interface information can be appropriately filled into the placeholder of the template to generate the final interface encapsulation code.

[0070] Among them, a template engine is a software tool or library used to combine data and a preset format (i.e., a template) to generate text output. This output is usually code, a web page, or other text files. The template engine can be set as needed, including EJS (Embedded JavaScript), Jinja2, Handlebars.js Mustache, etc. For example, when the first programming language is C# and the second programming language is JavaScript, the template engine used can be EJS. EJS allows developers to embed JavaScript code into template files, and then generate dynamic content by processing these templates.

[0071] S208, when developing a target game function of a mini-game based on the second programming language, calling the interface encapsulation code; the interface encapsulation code is used to implement the target game function.

[0072] Among them, game functions are the elements and interactive mechanisms that constitute the game experience of the mini-game, which can specifically include the game rules, operation methods, goals, storylines, characters, visual arts, sound effects, and interfaces for interacting with players. The design and implementation of game functions are crucial to ensuring player participation, enjoyment, and the overall appeal of the game. The target game function is the specific game function that is currently being developed.

[0073] It is understandable that after obtaining the interface encapsulation code of each functional interface, the computer device can use the interface encapsulation code of these functional interfaces to develop mini-games. Calling the interface encapsulation code may refer to embedding the interface encapsulation code into the game logic code, that is, combining the functions that can be implemented by the interface encapsulation code with other parts of the game to implement the corresponding game functions. For example, the user login function of the mini-game allows login using a social account. Assuming that the interface encapsulation code of the user information interface of the social application already exists, the interface encapsulation code of the user information interface of the social application can be directly embedded in the logic code related to the login function of the mini-game.

[0074] Calling interface encapsulation code can also refer to executing interface encapsulation code. For example, when using Unity to develop a game function for a small game, it is necessary to integrate certain specific tools or libraries in Cocos2d (such as animation system, particle effects) to implement the development of this game function. Assuming that the interface encapsulation code of these specific tools or libraries already exists, the corresponding interface encapsulation code can be directly executed.

[0075] Specifically, during the process of developing a mini-game through a mini-game development application, when a target game function of the mini-game is developed based on a second programming language, a target function interface based on a first programming language that needs to be called by the target game function can be determined, and the interface encapsulation code corresponding to the target function interface can be called.

[0076] The above-mentioned interface calling method, after obtaining the interface information of the functional interface in the first programming language used for mini-game development, determines the interface encapsulation template corresponding to the functional interface according to the obtained interface information, wherein the interface encapsulation template includes a template code for encapsulating the functional interface in the second programming language, and automatically generates the interface encapsulation code of the functional interface based on the interface information and the interface encapsulation template, thereby realizing the automatic encapsulation of the functional interface of the first programming language into a form that can be called in the second programming language environment, thereby improving the encapsulation efficiency of the functional interface of the first programming language, and when the target game function of the mini-game is developed based on the second programming language, the interface encapsulation code can be directly called based on the development requirements, thereby reducing the workload of manual code writing and maintenance, improving the development efficiency and accuracy of the mini-game development, and thereby improving the stability of the developed mini-game.

[0077] In one embodiment, the process of a computer device obtaining interface information of a functional interface for mini-game development in a first programming language includes the following steps: obtaining an interface definition document of a functional interface for mini-game development in a first programming language; traversing the nodes of an abstract syntax tree corresponding to the interface definition document to obtain a target node in the abstract syntax tree that belongs to a preset node type; and determining the interface information of the functional interface based on the node information of the target node.

[0078] Among them, the interface definition document of the functional interface describes the various interfaces that can be called in a software system, including the interface's operations, parameters, return data, and possible error messages. It can be an online API document, a developer manual, or an automatically generated interface description file.

[0079] Abstract Syntax Tree (AST) is a tree representation of the grammatical structure of the source code. AST extracts the grammatical structure in the source code and presents it in the form of a tree. Each node represents a structure in the program code.

[0080] It can be understood that each functional interface in the interface definition document corresponds to multiple nodes in the abstract syntax tree. For a certain functional interface, each of the multiple nodes corresponding to it is used to describe part of the information of the functional interface. According to the different node types to which each node belongs, the information of the functional interface described by each node is also different. The node types include attribute signature type, index signature declaration type, method signature type, function type, interface declaration type, type alias declaration type and other types. Among them, attribute signature type, index signature declaration type, method signature type, function type, interface declaration type, type alias declaration type are preset node types, and the nodes belonging to these preset node types in the abstract syntax tree are all target nodes.

[0081] Node information refers to the data stored on the corresponding node. These data describe the specific details of the program structure or code fragment represented by the node. The content of node information depends on the node type of the node, and usually includes information such as name, data type, parameters, and return type.

[0082] Specifically, the computer device can obtain the interface definition documents of the functional interfaces of other required applications and that can be used for mini-game development from the open source library, and parse the obtained interface definition documents to obtain the abstract syntax tree corresponding to the interface definition document, and traverse the nodes of the abstract syntax tree. For any traversed node, the node type of the node is determined. When the node type belongs to a preset node type, the node is determined as the target node, and the node information corresponding to the node is obtained until the traversal of all nodes in the abstract syntax tree is completed, and the interface information of each corresponding functional interface is determined according to the node information of each traversed target node.

[0083] In the above embodiment, the computer device obtains an interface definition document of a functional interface in a first programming language used for mini-game development, traverses nodes in an abstract syntax tree corresponding to the interface definition document, obtains a target node in the abstract syntax tree that belongs to a preset node type, and determines the interface information of the functional interface based on the node information of the target node. This automated extraction of interface information reduces the need for manual participation, thereby significantly improving the efficiency and accuracy of interface information extraction. Moreover, when the functional interface in the first programming language used for mini-game development is updated, the relevant interface information can be quickly updated by automatically re-traversing the AST. The use of the AST traversal method can easily adapt to changes in the code structure, thereby reducing dimensionality costs.

[0084] In one embodiment, the above method also includes a process of obtaining an abstract syntax tree corresponding to the interface definition document, which process includes the following steps: calling the compiler's create program function to create a program instance; the source file corresponding to the program instance includes the interface definition document; and extracting the abstract syntax tree corresponding to the interface definition document from the program instance.

[0085] The compiler is used to read high-level language program codes, parse and process these codes, and then generate low-level codes that can be executed by computer hardware, such as machine code or instruction sets related to a specific hardware architecture. In the embodiment of the present application, if the interface definition document is written in TypeScript, a TypeScript compiler can be used.

[0086] Specifically, after obtaining the interface definition document of the functional interface, the computer device calls the program creation function of the compiler based on the first programming language to create a program instance through the program creation function, and loads the source file corresponding to the program instance, wherein the loaded source file includes the interface definition document of the functional interface, and then parses the interface definition document to obtain the abstract syntax tree corresponding to the interface definition document.

[0087] For example, call the createProgram function of the TypeScript compiler to create a TypeScript program instance, which is responsible for parsing and analyzing the source code file, and call the getSourceFiles method to obtain the AST of all source files of the program, thereby obtaining the AST of the interface definition document.

[0088] In the above embodiment, the computer device creates a program instance by calling the create program function of the compiler, wherein the source file corresponding to the program instance includes an interface definition document; an abstract syntax tree corresponding to the interface definition document is extracted from the program instance. In this way, the abstract syntax tree is automatically created, the efficiency of abstract syntax tree construction is improved, and the interface information can be quickly and accurately extracted based on the abstract syntax tree in the future.

[0089] In one embodiment, the process of a computer device determining the interface information of a functional interface based on the node information of a target node includes the following steps: calling an information extraction function corresponding to the target node to extract the interface information in a source format from the node information; performing structured processing on the interface information in the source format to obtain a data file containing the interface information in a preset format; the process of a computer device determining the interface packaging template corresponding to the functional interface based on the interface information includes the following steps: determining the interface packaging template corresponding to the functional interface based on the interface information obtained by parsing the data file.

[0090] Among them, the information extraction function refers to a function or method used to extract the required information from the target node. It can be understood that the node type of the target node is different, and the corresponding information extraction function is also different. For example, the node type of target node 1 and target node 2 belongs to node type 1, and the corresponding information extraction function is information extraction function 1. The node type of target node 3 and target node 4 belongs to node type 2, and the corresponding information extraction function is information extraction function 2.

[0091] The source format usually refers to the original organization and storage of data or files, without any processing or conversion. The source format of AST usually directly corresponds to the grammatical rules of the programming language. For example, when processing the AST of TypeScript or JavaScript, each node type such as FunctionDeclaration, VariableDeclaration or InterfaceDeclaration is directly mapped to the grammatical structure of the language.

[0092] Structuring refers to the process of converting data or information from one format or state into a structured form for easy storage, management, query and analysis.

[0093] A preset format refers to a pre-set data or file format that specifies how data should be organized, represented, and stored in order to comply with specific standards, requirements, or system interface specifications. For example, a preset format can be JSON format, XML format, etc. JSON (JavaScript Object Notation) is a lightweight data exchange format.

[0094] Specifically, after determining the target node, the computer device calls an information extraction function that matches the node type to which the target node belongs for any target node, so as to extract the interface information in the source format from the node information of the target node, and performs structured processing on the extracted interface information according to the format requirements of the preset format to obtain the interface information in the preset format. After processing the node information of all target nodes and obtaining all the interface information in the preset format, all the obtained interface information in the preset format is exported to obtain a data file containing the interface information in the preset format. After that, the batch encapsulation of the functional interfaces can be directly implemented based on the data file of the interface information in the preset format. Specifically, the data file of the interface information in the preset format can be loaded, and the file content of the data file of the interface information in the preset format can be parsed to obtain the interface information of each functional interface, and based on the parsed interface information of each functional interface, the interface encapsulation template corresponding to each functional interface is determined.

[0095] In one embodiment, the preset format is JSON format, and the data file of the interface information in the preset format obtained is the data file of the interface information in JSON format. After that, the file content of the data file of the interface information in JSON format can be parsed to obtain the interface information of each functional interface, and based on the parsed interface information of each functional interface, the interface encapsulation template corresponding to each functional interface is determined. Storing the interface information in a data file in JSON format can simplify the data processing, transmission and integration process. The JSON file can be used by different systems and applications as a configuration file or a medium for data exchange, which is convenient for cross-platform and cross-language application integration. Storing the interface information in a data file in JSON format not only improves the accessibility and operability of the data, but also facilitates the realization of automated processing, document generation and cross-system integration. This method improves development efficiency and enhances the modularity and maintainability of the application.

[0096] In the above embodiment, the computer device extracts the interface information in the source format from the node information by calling the information extraction function corresponding to the target node; performs structured processing on the interface information in the source format to obtain a data file containing the interface information in a preset format; determines the interface encapsulation template corresponding to the functional interface based on the interface information obtained by parsing the data file, and processes the node information in the abstract syntax tree (AST) by automatically calling the information extraction function, thereby reducing the need for manual reading and parsing of the code and improving the efficiency and accuracy of the interface information extraction; after the interface information in the source format is structured, the format of the generated data file is unified and clear, which is easy for subsequent processing and analysis, and the problems caused by inconsistent formats or parsing errors are reduced. The generated interface information data file in the preset format is easy to manage and use, and the interface information of multiple functional interfaces is stored in the same data file, which avoids the maintenance of multiple files, making the maintenance and updating of the interface information more convenient and efficient. The encapsulation template of each functional interface is automatically determined by parsing the unified data file during encapsulation, and the code can be generated in batches, thereby improving the development efficiency.

[0097] In one embodiment, the process in which a computer device calls an information extraction function corresponding to a target node to extract interface information in a source format from the node information includes the following steps: determining the node type to which the target node belongs; determining the information extraction function corresponding to the node type; and calling the information extraction function to extract interface information of a functional interface from the node information of the target node.

[0098] Among them, the node types include attribute signature type, index signature declaration type, method signature type, function type, interface declaration type, and type alias declaration type. It can be understood that each node type corresponds to a corresponding information extraction function.

[0099] Specifically, for any target node, the computer device determines the node type to which the target node belongs. If the target node is an attribute signature type, the information extraction function corresponding to the attribute signature type is called to extract the interface information related to the attribute of the corresponding functional interface from the node information of the target node; if the target node is an index signature declaration type, the information extraction function corresponding to the index signature declaration type is called to extract the interface information of the index of the corresponding functional interface from the node information of the target node; if the target node is a method signature type, the information extraction function corresponding to the method signature type is called to extract the interface information of the corresponding functional interface from the node information of the target node. interface information related to the method of the corresponding functional interface; if the target node is a function type, the information extraction function corresponding to the function type is called to extract interface information related to the function of the corresponding functional interface from the node information of the target node; if the target node is an interface declaration type, the information extraction function corresponding to the interface declaration type is called to extract interface information related to the interface name of the corresponding functional interface from the node information of the target node; if the target node is a type alias declaration type, the information extraction function corresponding to the type alias declaration type is called to extract interface information related to the name of the alias of the corresponding functional interface from the node information of the target node.

[0100] Among them, the interface information related to the properties of the functional interface may specifically include the name of the property, data type and optional access modifiers (such as public, private) and other information; the interface information related to the index of the functional interface may specifically include the type of index and the type of return value and other information; the interface information related to the method of the functional interface may specifically include the name of the method, parameter list (including the name and type of each parameter), return type and other information; the interface information related to the function of the functional interface may specifically include the name of the function, parameters, return type, implementation details and other information; the interface information related to the interface name of the functional interface may specifically include the interface name and information of all members (methods, properties, etc.) defined by it; the interface information related to the name of the alias may specifically include information such as the name of the alias and the actual type it points to.

[0101] like Figure 3As shown, for each node, first check whether it is a property signature node (PropertySignature). If it is a property signature node, execute the corresponding processing logic to extract the corresponding interface information; if it is not a property signature node, check whether it is an index signature declaration node. If it is an index signature declaration node, execute the corresponding processing logic to extract the corresponding interface information; if it is not an index signature declaration node, check whether it is a signature node (MethodSignature), a method declaration node (MethodDeclaration) or a function declaration node (FunctionDeclaration). If it is, execute the corresponding processing logic to extract the corresponding interface information; if it is not a signature node (MethodSignature), a method declaration node (MethodDeclaration) or For any type of function declaration node, check whether it is a function type node (FunctionType). If so, execute the corresponding processing logic to extract the corresponding interface information; if it is not a function type node (FunctionType), check whether it is an interface declaration node (InterfaceDeclaration). If so, execute the corresponding processing logic to extract the corresponding interface information; if it is not an interface declaration node (InterfaceDeclaration), check whether it is a type alias declaration node (TypeAliasDeclaration). If so, execute the corresponding processing logic to extract the corresponding interface information; if it is not a type alias declaration node (TypeAliasDeclaration), it means that the node type of the node is not the above preset node type, that is, the node is not a target node.

[0102] For example, when the node is an attribute signature node, execute Figure 4 The processing logic shown is used to extract the corresponding interface information, such as Figure 4 As shown, when a node is detected as an attribute signature node, the getTypeName method is called to extract its type, name, comment and other information, and perform some specific processing operations, such as determining the array type, processing the comment content, etc. Finally, an object containing this information is returned for subsequent processing or code generation. This processing method helps to automatically parse TypeScript code and generate corresponding documents or codes.

[0103] In the above embodiment, the computer device ensures that accurate and relevant information is extracted from each node by identifying the node type and calling the corresponding information extraction function, thereby avoiding unnecessary data processing and potential information omissions; the automated node identification and information extraction process reduces reliance on manual operations and significantly improves processing speed and efficiency; and if the interface definition or structure changes, only the corresponding information extraction function needs to be adjusted without changing the entire analysis process, which makes the maintenance and update process more flexible and simple.

[0104] In one embodiment, the interface information includes function information, and the process of a computer device determining an interface encapsulation template corresponding to a functional interface based on the interface information includes the following steps: determining a function type corresponding to the functional interface based on the function information; and selecting a candidate interface encapsulation template that matches the function type from candidate interface encapsulation templates as the interface encapsulation template corresponding to the functional interface.

[0105] The function information refers to information related to methods or functions in the interface information, and specifically may be information associated with a method signature type node or a function type node in the interface information.

[0106] The function type is used to describe the function signature of the functional interface, that is, the return type and parameters of the function. That is, the function type defines how the function corresponding to the functional interface is called, what parameters it accepts, and what results it returns. Function types specifically include asynchronous function types that include Promise callbacks, synchronous function types that include listener event callbacks, synchronous function types with no return values, synchronous function types that return common data types, and synchronous function types that return objects. Functions that belong to the asynchronous function type that includes Promise callbacks perform asynchronous operations and return a Promise object, which represents the completion or failure of a certain moment in the future; functions that belong to the synchronous function type that includes listener event callbacks do not generate new The thread or stops execution to wait for any operation, but sets event listeners to respond to future events, such as user input or file reading; functions belonging to the synchronous function type with no return value perform some operations but do not return any value (that is, return undefined). This type of function is usually used to execute commands or modify certain states without feedback information; functions belonging to the synchronous function type that returns common data types perform calculations or process data and return results of basic data types, such as string, number, boolean, etc.; functions belonging to the synchronous function type that returns objects return an object after processing its logic. This object may contain multiple values ​​or complex data structures and is suitable for when the function needs to return multiple data items.

[0107] It can be understood that in the embodiment of the present application, a corresponding interface encapsulation template is pre-configured for each function type. For example, the interface encapsulation template configured for the asynchronous function type containing Promise callbacks may include error handling, state management, and asynchronous result processing; the interface encapsulation template configured for the synchronous function type containing listening event callbacks may include registration and unbinding of event listeners, and event-triggered response logic; the interface encapsulation template configured for the synchronous function type with no return value may include logic for performing a series of operations without returning results; the interface encapsulation template configured for the function type returning common data types may include processing logic for return types of basic data types (such as integers, strings, etc.); the interface encapsulation template configured for the function type that synchronously returns objects may include creating and returning complex objects or data structures, which may include error handling and data validation.

[0108] Specifically, for the extracted interface information of any functional interface, the function type determination function is called to extract the method-related information corresponding to the method signature type node from the interface information, and to extract the function-related information from the interface information, so as to obtain the function information corresponding to the functional interface, and determine the function type corresponding to the functional interface based on the extracted function information, and select a candidate interface encapsulation template that matches the function type of the functional interface from the candidate interface encapsulation templates as the interface encapsulation template corresponding to the functional interface.

[0109] In the above embodiment, the computer device determines the function type corresponding to the functional interface based on the function information in the interface information of the functional interface; from the candidate interface encapsulation templates, a candidate interface encapsulation template that matches the function type is selected as the interface encapsulation template corresponding to the functional interface, and the function type is automatically determined according to the function information such as parameter type, return type, function description, etc., and then the adapted template is automatically selected from the predefined template library, which greatly improves the development speed, reduces the time for manual selection and adjustment of templates, and thereby improves the efficiency of generating encapsulation code.

[0110] In one embodiment, the above-mentioned interface calling method also includes the following steps: obtaining a function list corresponding to the function type; calling the information adding function corresponding to the function type to add the interface information of the functional interface to the function list; the process of the computer device generating an interface encapsulation code based on the interface information and the interface encapsulation template also includes the following steps: when the function list includes interface information of at least two functional interfaces, the interface encapsulation template is respectively rendered based on the interface information of at least two functional interfaces to obtain at least two interface encapsulation codes.

[0111] The function list is used to store the interface information of the functional interface, and specifically can store the function information of the functional interface. It can be understood that each function type corresponds to a corresponding function list.

[0112] The information adding function is a function used to add interface information to the function list. It can be understood that the information adding functions corresponding to different function types are different.

[0113] Template rendering refers to dynamically filling data into a predefined template to generate text output, and the text data can specifically be code.

[0114] Specifically, for the interface information of any extracted functional interface, after the function type of the functional interface is determined based on the interface information of the functional interface, the function type can be obtained to obtain a function list corresponding to the function type, and the information adding function corresponding to the function type can be called to add the interface information of the functional interface to the function list, wherein, when the function type is a function type that asynchronously includes a Promise callback, the first function list and the first information adding function corresponding to the function type that asynchronously includes a Promise callback are obtained, and the first information adding function is called to add the interface information of the functional interface to the first function list; when the function type is a function type that synchronously includes a listening event callback, the second function list and the second information adding function corresponding to the function type that synchronously includes a listening event callback are obtained, and the second information adding function is called to add the interface information of the functional interface to the second function list; when the function type is a synchronous function type with no return value, the third function list and the third information adding function corresponding to the synchronous function type with no return value are obtained, and Call the third information adding function to add the interface information of the functional interface to the third function list; when the function type is a function type that synchronously returns a common data type, obtain the fourth function list and the fourth information adding function corresponding to the function type that synchronously returns the common data type, and call the fourth information adding function to add the interface information of the functional interface to the fourth function list; when the function type is a function type that synchronously returns an object, obtain the fifth function list and the fifth information adding function corresponding to the function type that synchronously returns the object, and call the fifth information adding function to add the interface information of the functional interface to the fifth function list. After completing the addition of the interface information of all functional interfaces, obtain the function list with the corresponding information added under each function type. For any function list with the corresponding information added, when the function list contains the interface information of at least two functional interfaces, the interface encapsulation template corresponding to the function type can be template rendered based on the interface information of each functional interface, thereby obtaining the interface encapsulation code corresponding to each functional interface.

[0115] For example, Figure 5As shown, for any functional interface, the function information of the functional interface checks whether the return type of the function contains "Promisify". If the return type contains "Promisify", the handleOneWayCallbackFunction method is called to process the function; check whether the function name starts with "on". If the function name starts with "on", the handleOnEventFunction method is called to process the function; check whether the function name does not start with "off" and the return type is VoidKeyword. If the condition is met, the handleReturnVoidFunction method is called to process the function; check whether the function name ends with "Sync". If the function name ends with "Sync", the handleSyncFunction method is called to process the function; check whether the function name is in the specialApi.classFuns array. If the function name is in the array, the handleClassFunction method is called to process the function.

[0116] Take the processing of functions of function types that synchronously return common data types as an example to illustrate, such as Figure 6 As shown in the figure, the main function of the code shown in the figure is to process the synchronous function and extract its detailed information and store it in an object. Specifically, it performs the following operations: 1. Create an info object: extract the name, comment, parameters and return type of the function and store this information in the info object; 2. Traverse the parameter type: check whether the type of each parameter needs to be processed, if so, add it to the modelList and process its subclasses; 3. Check the return type: check whether the return type needs to be processed, if so, add it to the modelList and process its subclasses; 4. Add to syncFunList: add the info object containing the function detailed information to the syncFunList. Through these operations, the code can effectively parse and process the synchronous function nodes and prepare this information for subsequent use, such as generating corresponding code or documents.

[0117] It is understandable that each function type has a corresponding template file. Take C# public function as an example, Figure 7As shown in the figure, the main function of the code shown in the figure is to use the EJS template engine to render the template file according to the provided data object, and write the rendered content to the specified file. The specific steps are as follows: 1. Prepare data: provide a data object containing a list of different types of functions for rendering the template; 2. Render template: call the ejs.renderFile method to render the template file and generate string content; 3. Process rendering results: check whether there are errors in the rendering process and process the generated string content; 4. Write to file: write the generated string content to the specified file path. In this way, the interface encapsulation code corresponding to each functional interface in the function list corresponding to each function type can be automatically generated to improve development efficiency and reduce manual errors. Among them, in the data preparation stage, the following function lists need to be prepared: 1. oneWayCallbackFunList: callback function list of Promise; 2. onEventList: callback function list of event listeners without return value; 3. oneWayNoCallbackFunList: function list that returns void; 4. onEventNeedReturnList: callback function list of event listeners with return value; 5. syncFunList: synchronization function list; 6. class function list.

[0118] Taking the interface encapsulation template corresponding to the synchronous function type with no return value as an example, the template rendering process is explained. Figure 8 As shown in the figure, the main function of the code shown in the figure is to use the EJS template engine to dynamically insert the content of the template file in the C# file. The specific steps include: 1. Define the EJS template: the template file defines the structure and style of the generated code; 2. Prepare data: the data passed to the template includes different types of function lists and type mapping data; 3. Render the template: use the EJS template engine to render the template file and generate a C# class definition containing all methods and properties. In this way, the interface encapsulation code corresponding to each functional interface in the function list corresponding to each function type can be automatically generated, which improves development efficiency and reduces manual errors.

[0119] In the above embodiment, the computer device obtains a function list corresponding to the function type; calls the information adding function corresponding to the function type to add the interface information of the functional interface to the function list; by systematically adding the interface information of the functional interface to the function list, these functional interfaces can be centrally managed and operated to improve processing efficiency. For example, when the function list includes interface information of at least two functional interfaces, it can process the information of multiple functional interfaces at the same time, and automatically render and generate code for each functional interface, which significantly improves the processing speed, especially when processing a large number of interfaces. The automated template rendering avoids the repetitive labor of manually writing encapsulation code for each interface, thereby improving the encapsulation efficiency of the functional interface; and, using the same template to generate encapsulation code for functional interfaces of the same function type ensures the consistency of style and structure of all generated codes, which is conducive to subsequent maintenance and expansion of the code base.

[0120] In one embodiment, the interface encapsulation template includes template content based on a first programming language, template content based on a second programming language, and a bridging template content. The process by which a computer device generates an interface encapsulation code for an interface based on interface information and the interface encapsulation template includes the following steps: generating a first code file based on the interface information and the template content of the first programming language; generating a second code file based on the interface information and the template content of the second programming language; generating a third code file based on the interface information and the bridging template content; and integrating the first code file, the second code file, and the third code file to obtain the interface encapsulation code for the functional interface.

[0121] Among them, the template content based on the first programming language refers to the template content designed for the first programming language, which is used to generate the code of the first programming language, and may specifically include the syntax structure, control flow, data type definition, etc. that are unique to the first programming language. The template content based on the second programming language refers to the template content designed for the second programming language, which is used to generate the code of the second programming language, and may specifically include the syntax structure, control flow, data type definition, etc. that are unique to the second programming language. The bridge template content refers to a code template specially designed to connect or coordinate the interaction of different programming languages. The template content is used to generate the middle-layer code, and the generated code acts as a "bridge".

[0122] Specifically, for any functional interface, after the computer device obtains the interface encapsulation template corresponding to the functional interface, it can perform template rendering on the interface encapsulation template through the interface information. Specifically, the interface information can be adaptively filled into the template content based on the first programming language, the template content based on the second programming language and the bridge content of the interface encapsulation template, thereby generating a first code file, a second code file and a third code file, and integrating the first code file, the second code file and the third code file to obtain the interface encapsulation code of the functional interface.

[0123] In the above embodiment, the computer device can be configured according to development requirements with an interface encapsulation template including template content based on a first programming language, template content based on a second programming language, and a bridging template content, so that interface encapsulation code that meets the requirements can be quickly and automatically generated based on the interface information and the interface encapsulation code, thereby reducing the workload of manual code writing and maintenance and improving the efficiency and accuracy of encapsulation of functional interfaces.

[0124] In one embodiment, the first code file contains public function information defined based on the first programming language, the public function information includes the declaration and annotation of the public function, request parameters, return type, implementation logic and callback information, and external function declaration information for the functional interface; the second code file includes the implementation logic, request parameters and return type of the functional interface; the third code file includes bridging information for bridging the public functions and the functional interface.

[0125] Among them, the declaration and comments of public functions: these are the definitions of common functions, including the function description, parameters, return value, etc. The comments are used to explain the purpose, boundary conditions, dependencies, etc. of the function; the request parameters of the public function list in detail the input parameters required by the function, including type and purpose; the return type of the public function indicates the data type returned after the function is executed, and clarifies the output of the function; the implementation logic and callback information of the public function refers to the specific function implementation code, which may include calls to other systems or services, and callback logic when processing asynchronous operations; the external function declaration information for the functional interface is used to declare the external function of the functional interface to ensure correct parsing during linking.

[0126] The implementation logic of the functional interface is the logic of specifically implementing the public functions defined in the first code file. The request parameters and return types of the functional interface correspond to the definitions in the first code file, ensuring that the implementation logic receives and returns the correct data types.

[0127] The third code file includes bridging information for bridging public functions and functional interfaces, including necessary data conversion, interface call mapping, and protocol adaptation code, to ensure that the implementations in the first code file and the second code file can work seamlessly between different programming environments or platforms.

[0128] Fig. 9 The interface encapsulation code of a functional interface in an embodiment is shown. This C# code is used to call an external JavaScript function in a Unity project. Specifically, this code defines a class, uses the DLLImport attribute to introduce functions from JavaScript, and provides corresponding C# methods. The design of this class allows calling JavaScript functions in a Unity project while processing different types of parameters.

[0129] In the above embodiment, the code is divided into three main files: a first code file, a second code file and a third code file. The three files respectively process the public function information based on the first programming language, the implementation logic of the functional interface, and the bridging logic. Each file assumes specific functions and responsibilities, making the system structure clearer and the logic clearer.

[0130] In one embodiment, the functional interface of the first programming language includes the functional interface of the parent application. When the computer device develops the target game function of the mini-game based on the second programming language, the process of calling the interface encapsulation code includes the following steps: in the development environment provided by the mini-game development application, when the target game function of the mini-game is developed based on the second programming language, the interface encapsulation code of the functional interface of the parent application is embedded in the logic code for implementing the target game function.

[0131] Among them, the developed mini-game is a sub-application of the parent application, and the parent application provides a unified framework for the operating environment, data exchange interface and user interaction for the sub-application. For example, in the embodiment of the present application, the parent application where the mini-game is located can be a social media platform or an instant messaging application.

[0132] Specifically, after the computer device obtains the interface information of the functional interface of the parent application in the first programming language, it determines the interface encapsulation template corresponding to the functional interface based on the interface information, and generates the interface encapsulation code based on the interface information and the interface encapsulation template. After obtaining the interface encapsulation code of the functional interface of the parent application, the computer device can, in the development environment provided by the mini-game development application, when developing the target game function of the mini-game based on the second programming language, embed the interface encapsulation code of the functional interface of the parent application required to implement the target function into the logic code for implementing the target game function. After the required interface encapsulation code of the functional interface of the parent application is respectively embedded in the logic code for implementing different target game functions, a mini-game quick adaptation plug-in suitable for the mini-game and the parent application can be generated. The mini-game quick adaptation plug-in is a tool for quickly adapting the mini-game to the parent application. The mini-game can be quickly adapted to the parent application later through the mini-game quick adaptation plug-in.

[0133] In the above embodiment, the computer device encapsulates the functional interface of the parent application to obtain an interface encapsulation code. In the development environment provided by the mini-game development application, when the target game function of the mini-game is developed based on the second programming language, the interface encapsulation code of the functional interface of the parent application is embedded in the logic code for implementing the target game function. In this way, the mini-game can effectively utilize the mature functions of the parent application, improve development efficiency, and reduce development costs.

[0134] In one embodiment, the above interface calling method further includes the following steps: in the process of running the mini-game through the parent application, when an interface calling request for the functional interface of the parent application triggered by the mini-game is received, the interface encapsulation code is executed.

[0135] Specifically, after the computer device completes the development of a mini-game that integrates the functional interface of the parent application, during the process of running the mini-game through the parent application, when an interface call request triggered by the mini-game is received, it is determined whether the interface call request is an interface call request for the functional interface of the parent application. If so, the interface encapsulation code of the functional interface pointed to by the interface call request is executed through the mini-game quick adaptation plug-in to obtain the execution result, and the execution result is returned to the mini-game.

[0136] In the above embodiment, when the computer device receives an interface call request for the functional interface of the parent application triggered by the mini-game while running the mini-game through the parent application, the interface encapsulation code is executed, so that the mini-game can utilize the resources and functions that have been developed and optimized in the parent application without the need for repeated development, thus saving development time and cost. By calling the interface of the parent application, the mini-game can expand its functional scope and provide richer interaction modes.

[0137] In one embodiment, the functional interface of the first programming language includes the functional interfaces of other game development applications. When the computer device develops the target game function of a mini-game based on the second programming language, the process of calling the interface encapsulation code includes the following steps: in the development environment provided by the mini-game development application, when the game character of the mini-game is developed based on the second programming language, an interface call request for the functional interface of other game development applications is received; and the interface encapsulation code is executed according to the interface call request to obtain the game character image.

[0138] Specifically, after the computer device obtains the interface information of the functional interface of other game development applications, it determines the interface encapsulation template corresponding to the functional interface based on the interface information, and generates the interface encapsulation code based on the interface information and the interface encapsulation template. When the functional interface is a functional interface for creating a game character, after the computer device obtains the interface encapsulation code of the functional interface of other game development applications and used for creating a game character, it can receive the interface call request for the functional interface of other game development applications and used for creating a game character in the development environment provided by the mini-game development application when developing a game character for a mini-game based on the second programming language, and execute the interface encapsulation code of the functional interface used for creating a game character according to the interface call request to obtain a game character image.

[0139] It can be understood that the functional interfaces of the first programming language include functional interfaces of other game development applications. In addition to the functional interfaces for creating game characters, the functional interfaces of other game development applications may also have various other functional interfaces. The computer device may also encapsulate these functional interfaces to obtain corresponding interface encapsulation codes. In the development environment provided by the mini-game development application, when completing the relevant development tasks of the mini-game development based on the second programming language, it receives interface call requests for functional interfaces of other game development applications that are used to implement corresponding development tasks, and executes the interface encapsulation code of the corresponding functional interface according to the interface call request to complete the corresponding development tasks.

[0140] In the above embodiment, the computer device encapsulates the functional interfaces of other game development applications to obtain interface encapsulation code. In the development environment provided by the mini-game development application, when the relevant development tasks of the mini-game development are completed based on the second programming language, the interface encapsulation code is directly executed, so that the development process of the mini-game can utilize the existing functions in other game development applications, thereby improving development efficiency.

[0141] In one embodiment, Fig.10 As shown, an interface calling method is also provided, which is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps:

[0142] S1002, obtaining an interface definition document of a functional interface in a first programming language used for mini-game development.

[0143] S1004, calling a create program function of the compiler to create a program instance; the source file corresponding to the program instance includes an interface definition document; and extracting an abstract syntax tree corresponding to the interface definition document from the program instance.

[0144] S1006: perform node traversal on the abstract syntax tree corresponding to the interface definition document to obtain a target node of a preset node type in the abstract syntax tree.

[0145] S1008, determining the node type to which the target node belongs; determining the information extraction function corresponding to the node type; and calling the information extraction function to extract interface information of the functional interface from the node information of the target node.

[0146] S1010, performing structured processing on the interface information in the source format to obtain a data file containing the interface information in a preset format.

[0147] S1012, determining a function type corresponding to the functional interface based on the function information in the interface information obtained by parsing the data file.

[0148] S1014, selecting a candidate interface encapsulation template that matches the function type from the candidate interface encapsulation templates as the interface encapsulation template corresponding to the functional interface; the interface encapsulation template includes a template code that encapsulates the functional interface in a second programming language.

[0149] S1016, obtaining a function list corresponding to the function type; calling an information adding function corresponding to the function type to add the interface information of the functional interface to the function list.

[0150] S1018: When the function list includes interface information of at least two functional interfaces, template rendering is performed on the interface encapsulation templates based on the interface information of the at least two functional interfaces to obtain at least two interface encapsulation codes.

[0151] S1020, when developing a target game function of a mini-game based on the second programming language, calling an interface encapsulation code; the interface encapsulation code is used to implement the target game function.

[0152] In one embodiment, the functional interface of the first programming language includes the functional interface of the parent application. When the computer device develops the target game function of the mini-game based on the second programming language, the process of calling the interface encapsulation code includes the following steps: in the development environment provided by the mini-game development application, when the target game function of the mini-game is developed based on the second programming language, the interface encapsulation code of the functional interface of the parent application is embedded in the logic code for implementing the target game function; wherein, the developed mini-game is a sub-application of the parent application.

[0153] In one embodiment, when a computer device receives an interface call request for a functional interface of a parent application triggered by the mini-game while running the mini-game through the parent application, the computer device executes the interface encapsulation code.

[0154] In one embodiment, the functional interface of the first programming language includes the functional interfaces of other game development applications. When the computer device develops the target game function of a mini-game based on the second programming language, the process of calling the interface encapsulation code includes the following steps: in the development environment provided by the mini-game development application, when the game character of the mini-game is developed based on the second programming language, an interface call request for the functional interface of other game development applications is received; and the interface encapsulation code is executed according to the interface call request to obtain the game character image.

[0155] The present application also provides an application scenario, which can be a development scenario of a mini-game quick adaptation plug-in, wherein the mini-game quick adaptation plug-in is a tool for quickly adapting a mini-game to a social application. The social application can be, for example, a WX application, and the mini-game development application for developing mini-games can be specifically Unity. The functional interface provided by the WX application is JSAPI developed based on TypeScript, and the programming language supported by Unity is C#. The application scenario can specifically apply the above-mentioned interface calling method, refer to Fig.11 As shown in the flowchart, the process of developing a quick adaptation plug-in for a mini-game may include the following steps:

[0156] 1. The basic library is updated.

[0157] After completing the construction of the mini-game basic library, the WX application will update and synchronize the API type definition file of the WX application and used for mini-game development to the open source library. The corresponding storage location of the open source library is https: / / github.com / wechat-miniprogram / minigame-api-typings / . The API type definition file contains all public APIs.

[0158] 2. Obtaining API type definition files

[0159] When you need to develop a quick adaptation plug-in for a small game suitable for a WX application, you can obtain the API type definition file of the WX application and used for small game development from the open source library.

[0160] 3. API type definition file parsing

[0161] Use the TypeScript API to create a program instance (create Program) and get the source file (get SourceFiles), parse the API type definition file, and generate an abstract syntax tree (AST).

[0162] 4. Extract interface information

[0163] Traverse all AST nodes, filter out all target nodes that meet the preset node types, extract interface information from the node information of the target nodes, and convert the extracted interface information into API Schema JSON format.

[0164] 5. Classification processing interface

[0165] The function type of each API is determined according to the interface information of each API. The function types include the following types: asynchronous functions including Promise callbacks, synchronous functions including listener event callbacks, synchronous functions without return values, synchronous functions returning common data types, and synchronous functions returning objects.

[0166] 6. Rendering template generation code

[0167] Use the EJS template engine to render the template and generate the corresponding interface encapsulation code based on the classified interface information.

[0168] 7. Encapsulation interface code call

[0169] Calling the WX application JS API and callback in Unity can specifically include the following steps:

[0170] (1) C# WX Classes: Generated C# classes that contain the corresponding WX API methods;

[0171] (2) C# WX Methods: Generated C# methods that call JavaScript functions in JsLib through the P / Invoke mechanism;

[0172] (3) JsLib: contains JavaScript code that actually calls the JS API of the WX application;

[0173] (4) JS API Callback Response: WX applies the callback response of the JS API and passes the result back to the C# code in Unity through the message transmission (SendMessage) mechanism;

[0174] (5) C# WX Callback: C# method that handles the callback and processes the results passed back from JavaScript.

[0175] The above process uses automation tools and template engines to achieve automatic generation and integration of TypeScript interface definition files into C# and JavaScript codes. The specific steps include obtaining and parsing interface definition files, extracting and classifying interface information, generating codes by template rendering, and calling and processing callbacks in Unity. Through this series of steps, the API of WX applications can be quickly generated and encapsulated so that it can be seamlessly called and used in Unity. After the generation of interface encapsulation codes corresponding to the JS API of all WX applications is completed in step 6, refer to Fig.12, the generated interface encapsulation code can be written into the specified file to obtain the mini-game quick adaptation plug-in. Subsequently, the mini-game can be quickly adapted to the WX application based on the mini-game quick adaptation plug-in, that is, the call and callback processing can be implemented in Unity.

[0176] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0177] Based on the same inventive concept, the embodiment of the present application also provides an interface calling device for implementing the interface calling method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more interface calling device embodiments provided below can refer to the limitations on the interface calling method above, and will not be repeated here.

[0178] In one embodiment, Fig.13 As shown, an interface calling device is provided, including: an interface information acquisition module 1302, an interface encapsulation template determination module 1304, an interface encapsulation code generation module 1306 and an interface calling module 1308, wherein:

[0179] The interface information acquisition module 1302 is used to acquire interface information of a functional interface in a first programming language used for mini-game development;

[0180] The interface encapsulation template determining module 1304 is used to determine the interface encapsulation template corresponding to the functional interface based on the interface information; the interface encapsulation template includes a template code that encapsulates the functional interface using the second programming language;

[0181] An interface encapsulation code generating module 1306, configured to generate an interface encapsulation code based on the interface information and the interface encapsulation template;

[0182] The interface calling module 1308 is used to call the interface encapsulation code when developing the target game function of the mini-game based on the second programming language; the interface encapsulation code is used to implement the target game function.

[0183] In the above embodiment, after obtaining interface information of a functional interface in a first programming language used for mini-game development, an interface encapsulation template corresponding to the functional interface is determined according to the obtained interface information, wherein the interface encapsulation template includes a template code for encapsulating the functional interface in a second programming language, and based on the interface information and the interface encapsulation template, an interface encapsulation code of the functional interface is automatically generated, thereby automatically encapsulating the functional interface of the first programming language into a form that can be called in the second programming language environment, thereby improving the encapsulation efficiency of the functional interface of the first programming language, and when developing the target game function of the mini-game based on the second programming language, the interface encapsulation code can be directly called based on development requirements, thereby reducing the workload of manual code writing and maintenance, improving the development efficiency and accuracy of the mini-game development, and thereby improving the stability of the developed mini-game.

[0184] In one embodiment, the interface information acquisition module 1302 is also used to: obtain an interface definition document of a functional interface used for mini-game development and in a first programming language; traverse the nodes of an abstract syntax tree corresponding to the interface definition document to obtain a target node of a preset node type in the abstract syntax tree; and determine the interface information of the functional interface based on the node information of the target node.

[0185] In one embodiment, the interface information acquisition module 1302 is further used to: call the compiler's create program function to create a program instance; the source file corresponding to the program instance includes an interface definition document; and extract an abstract syntax tree corresponding to the interface definition document from the program instance.

[0186] In one embodiment, the interface information acquisition module 1302 is also used to: call the information extraction function corresponding to the target node to extract the interface information in the source format from the node information; perform structured processing on the interface information in the source format to obtain a data file containing the interface information in a preset format; the interface encapsulation template determination module 1304 is also used to: determine the interface encapsulation template corresponding to the functional interface based on the interface information obtained by parsing the data file.

[0187] In one embodiment, the interface information acquisition module 1302 is further used to: determine the node type to which the target node belongs; determine the information extraction function corresponding to the node type; and call the information extraction function to extract the interface information of the functional interface from the node information of the target node.

[0188] In one embodiment, the interface information includes function information; the interface encapsulation template determination module 1304 is also used to: determine the function type corresponding to the functional interface based on the function information; and select a candidate interface encapsulation template that matches the function type from the candidate interface encapsulation templates as the interface encapsulation template corresponding to the functional interface.

[0189] In one embodiment, the interface encapsulation template determination module 1304 is also used to: obtain a function list corresponding to the function type; call the information addition function corresponding to the function type to add the interface information of the functional interface to the function list; the interface encapsulation code generation module 1306 is also used to: when the function list includes interface information of at least two functional interfaces, template rendering of the interface encapsulation template is performed based on the interface information of at least two functional interfaces to obtain at least two interface encapsulation codes.

[0190] In one embodiment, the interface encapsulation template includes template content based on a first programming language, template content based on a second programming language, and a bridging template content. The interface encapsulation code generation module 1306 is also used to: generate a first code file based on interface information and the template content of the first programming language; generate a second code file based on the interface information and the template content of the second programming language; generate a third code file based on the interface information and the bridging template content; integrate the first code file, the second code file, and the third code file to obtain the interface encapsulation code of the functional interface.

[0191] In one embodiment, the first code file contains public function information defined based on the first programming language, the public function information includes the declaration and annotation of the public function, request parameters, return type, implementation logic and callback information, and external function declaration information for the functional interface; the second code file includes the implementation logic, request parameters and return type of the functional interface; the third code file includes bridging information for bridging the public functions and the functional interface.

[0192] In one embodiment, the functional interface of the first programming language includes the functional interface of the parent application, and the interface calling module 1308 is also used for: in the development environment provided by the mini-game development application, when developing the target game function of the mini-game based on the second programming language, embedding the interface encapsulation code of the functional interface of the parent application into the logic code for implementing the target game function; wherein the developed mini-game is a sub-application of the parent application.

[0193] In one embodiment, the interface calling module 1308 is further used to: in the process of running the mini-game through the parent application, when an interface calling request for the functional interface of the parent application triggered by the mini-game is received, execute the interface encapsulation code.

[0194] In one embodiment, the functional interface of the first programming language includes the functional interface of other game development applications, and the interface calling module 1308 is also used to: in the development environment provided by the mini-game development application, when developing a game character of a mini-game based on the second programming language, receive an interface calling request for the functional interface of other game development applications; execute the interface encapsulation code according to the interface calling request to obtain the game character image.

[0195] Each module in the above interface calling device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0196] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.14 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store functional interface data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an interface calling method is implemented.

[0197] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.15As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an interface calling method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0198] Those skilled in the art will understand that Fig.14 or Fig.15 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.

[0199] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0200] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0201] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0202] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0203] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0204] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0205] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An interface calling method, characterized in that: The method comprises: Obtaining interface information of a functional interface in a first programming language used for mini-game development; Calling a function type determination function to extract method-related information corresponding to a method signature type node from the interface information, extracting function-related information from the interface information, and obtaining function information including the method-related information and the function-related information; Determine the function type corresponding to the functional interface based on the function information; Obtain a function list corresponding to the function type; call an information adding function corresponding to the function type to add the interface information of the functional interface to the function list; From the candidate interface encapsulation templates, a candidate interface encapsulation template matching the function type is selected as the interface encapsulation template corresponding to the functional interface; the interface encapsulation template comprises template content based on the first programming language, template content based on the second programming language and bridge template content; the candidate interface encapsulation template is pre-configured for different function types; When the function list includes interface information of at least two functional interfaces, at least two first code files are generated based on the interface information of at least two functional interfaces and the template content of the first programming language; at least two second code files are generated based on the interface information of at least two functional interfaces and the template content of the second programming language; at least two third code files are generated based on the interface information of at least two functional interfaces and the bridging template content; the first code file, the second code file and the third code file are respectively integrated to obtain at least two interface encapsulation codes; the first code file contains public function information defined based on the first programming language, and the public function information includes declaration and annotation of the public function, request parameters, return type, implementation logic and callback information, and external function declaration information for the functional interface; the second code file includes the implementation logic, request parameters and return type of the functional interface; the third code file includes bridging information bridging the public function and the functional interface; When developing a target game function of a mini-game based on the second programming language, the interface encapsulation code is called; the interface encapsulation code is used to implement the target game function.

2. The method according to claim 1, characterized in that The step of obtaining interface information of a functional interface in a first programming language used for mini-game development includes: Obtaining an interface definition document of a functional interface in a first programming language for mini-game development; Performing node traversal on an abstract syntax tree corresponding to the interface definition document to obtain a target node of a preset node type in the abstract syntax tree; The interface information of the functional interface is determined according to the node information of the target node.

3. The method according to claim 2, characterized in that The method further comprises: Calling a compiler's create program function to create a program instance; a source file corresponding to the program instance includes the interface definition document; An abstract syntax tree corresponding to the interface definition document is extracted from the program instance.

4. The method according to claim 2, characterized in that: The determining the interface information of the functional interface according to the node information of the target node includes: Calling the information extraction function corresponding to the target node to extract the interface information in the source format from the node information; Structuring the interface information in the source format to obtain a data file containing the interface information in a preset format; The calling function type determination function to extract method-related information corresponding to the method signature type node from the interface information, extracting function-related information from the interface information, and obtaining function information including the method-related information and the function-related information, includes: Parse the data file to obtain the interface information, call a function type determination function to extract method-related information corresponding to a method signature type node from the interface information, extract function-related information from the interface information, and obtain function information including the method-related information and the function-related information.

5. The method according to claim 4, characterized in that The calling of the information extraction function corresponding to the target node to extract the interface information in the source format from the node information includes: Determine the node type to which the target node belongs; Determine an information extraction function corresponding to the node type; The information extraction function is called to extract the interface information of the functional interface from the node information of the target node.

6. The method according to any one of claims 1 to 5, characterized in that The functional interface of the first programming language includes the functional interface of the parent application, and when the target game function of the mini-game is developed based on the second programming language, the interface encapsulation code is called, including: In the development environment provided by the mini-game development application, when developing a target game function of the mini-game based on the second programming language, embedding the interface encapsulation code of the functional interface of the parent application into the logic code for implementing the target game function; Among them, the developed mini-game is a sub-application of the parent application.

7. The method according to claim 6, characterized in that The method further comprises: In the process of running the mini-game through the parent application, when an interface call request for the functional interface of the parent application triggered by the mini-game is received, the interface encapsulation code is executed.

8. The method according to any one of claims 1 to 5, characterized in that The functional interface of the first programming language includes the functional interface of other game development applications, and when developing the target game function of the mini-game based on the second programming language, calling the interface encapsulation code includes: In the development environment provided by the mini-game development application, when developing a game character of the mini-game based on the second programming language, receiving an interface call request for a functional interface of the other game development application; The interface encapsulation code is executed according to the interface call request to obtain a game character image.

9. An interface calling device, characterized in that: The device comprises: An interface information acquisition module, used to acquire interface information of a functional interface in a first programming language used for mini-game development; An interface encapsulation template determination module is used to call a function type determination function to extract method-related information corresponding to a method signature type node from the interface information, extract function-related information from the interface information, and obtain function information containing the method-related information and the function-related information; determine the function type corresponding to the functional interface based on the function information; obtain a function list corresponding to the function type; call an information addition function corresponding to the function type to add the interface information of the functional interface to the function list; select a candidate interface encapsulation template matching the function type from candidate interface encapsulation templates as the interface encapsulation template corresponding to the functional interface; the interface encapsulation template contains template content based on the first programming language, template content based on the second programming language, and bridge template content; the candidate interface encapsulation template is pre-configured for different function types; An interface encapsulation code generation module is used to generate at least two first code files based on the interface information of at least two functional interfaces and the template content of the first programming language when the function list includes interface information of at least two functional interfaces; generate at least two second code files based on the interface information of at least two functional interfaces and the template content of the second programming language; generate at least two third code files based on the interface information of at least two functional interfaces and the bridging template content; integrate the first code file, the second code file and the third code file respectively to obtain at least two interface encapsulation codes; the first code file contains public function information defined based on the first programming language, and the public function information includes declaration and annotation of the public function, request parameters, return type, implementation logic and callback information, and external function declaration information for the functional interface; the second code file includes the implementation logic, request parameters and return type of the functional interface; the third code file includes bridging information bridging the public function and the functional interface; The interface calling module is used to call the interface encapsulation code when developing a target game function of the mini-game based on the second programming language; the interface encapsulation code is used to implement the target game function.

10. The device according to claim 9, characterized in that The interface information acquisition module is also used for: Obtaining an interface definition document of a functional interface in a first programming language for mini-game development; Performing node traversal on an abstract syntax tree corresponding to the interface definition document to obtain a target node of a preset node type in the abstract syntax tree; The interface information of the functional interface is determined according to the node information of the target node.

11. The device according to claim 10, characterized in that The interface information acquisition module is also used for: Calling a compiler's create program function to create a program instance; a source file corresponding to the program instance includes the interface definition document; An abstract syntax tree corresponding to the interface definition document is extracted from the program instance.

12. The device according to claim 10, characterized in that The interface information acquisition module is also used for: Calling the information extraction function corresponding to the target node to extract the interface information in the source format from the node information; Structuring the interface information in the source format to obtain a data file containing the interface information in a preset format; The interface encapsulation template determination module is also used for: Parse the data file to obtain the interface information, call a function type determination function to extract method-related information corresponding to a method signature type node from the interface information, extract function-related information from the interface information, and obtain function information including the method-related information and the function-related information.

13. The device according to claim 12, characterized in that The interface information acquisition module is also used for: Determine the node type to which the target node belongs; Determine an information extraction function corresponding to the node type; The information extraction function is called to extract the interface information of the functional interface from the node information of the target node.

14. The device according to any one of claims 9 to 13, characterized in that The functional interface of the first programming language includes a functional interface of a parent application, and the interface calling module is further used for: In the development environment provided by the mini-game development application, when developing a target game function of the mini-game based on the second programming language, embedding the interface encapsulation code of the functional interface of the parent application into the logic code for implementing the target game function; Among them, the developed mini-game is a sub-application of the parent application.

15. The device according to claim 14, characterized in that The interface calling module is also used for: In the process of running the mini-game through the parent application, when an interface call request for the functional interface of the parent application triggered by the mini-game is received, the interface encapsulation code is executed.

16. The device according to any one of claims 9 to 13, characterized in that The functional interface of the first programming language includes functional interfaces of other game development applications, and the interface calling module is further used for: In the development environment provided by the mini-game development application, when developing a game character of the mini-game based on the second programming language, receiving an interface call request for a functional interface of the other game development application; The interface encapsulation code is executed according to the interface call request to obtain a game character image.

17. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.