Development method, device, medium, product and equipment of application program
Patent Information
- Application Number
- CN202510543275.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2026-10-27
AI Technical Summary
[0012]根据本公开实施方式的应用程序开发方法、应用程序开发装置、计算机可读存储介质、计算机程序产品及电子设备,在应用程序开发过中,开发者可以使用同引擎调用范式编写跨引擎调用方法的代码,然后,在编译的过程中,通过对开发者编写的代码的抽象语法树进行修改,将修改后的抽象语法树转换为新的代码,根据转换后的新的代码继续进行编译,从而可以实现应用程序的跨引擎调用方法,如用户交互层跨引擎调用逻辑层的方法。一方面,本公开通过抽象语法树的修改,可以实现应用程序开发过程中同引擎调用方法和跨引擎调用方法的开发范式的统一,抹平二者之间的差异,开发者可以使用同引擎调用方法的范式编写跨引擎调用方法的代码,降低了应用程序开发的难度和学习成本,提高了应用程序的开发效率;另一方面,通过同引擎调用方法和跨引擎调用方法的开发范式的统一,可以基于前端开发范式实现大型应用程序混合分层技术栈的开发,避免了大型应用程序混合分层技术栈因为分层语言不一致,带来协同和开发成本高的问题;再一方面,在用户交互层和逻辑层通过本申请的方法进行方法调用,可使整个业务层(即用户交互层和逻辑层)均采用前端范式,天然具备动态性,显著提升了业务整体上线的比例和效率,以及降低了线上问题的修复周期。
Smart Images

Figure CN122985172A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a method for developing an application, an apparatus for developing an application, a computer-readable storage medium, a computer program product, and an electronic device. Background Technology
[0002] This section is intended to provide background or context for the embodiments of this disclosure set forth in the claims, and the description herein is not acknowledged as prior art simply because it is included in this section.
[0003] Currently, full-stack cross-platform development of applications can be achieved through existing cross-platform frameworks (such as Flutter and React Native), or it can be achieved based on hybrid stack technology that combines cross-platform and pure native technologies. For example, the application can be divided into a user interaction layer, a logic layer, and a platform layer. The user interaction layer can use cross-platform solutions such as Flutter and React Native. The logic layer has Kotlin Multiplatform and C++ cross-platform development solutions. The platform layer mainly uses platform-specific languages, with a small portion of the capabilities implemented using C or C++ for cross-platform solutions. Summary of the Invention
[0004] However, the first approach may not provide performance comparable to native applications when developing large applications. Certain platform-specific functions, performance optimizations, or complex customization requirements may not be easily implemented in a cross-platform framework, requiring additional work, resulting in low efficiency for cross-platform development of large applications. As for the second approach, it involves multiple technical languages. Due to the lack of uniformity in development languages, business logic becomes fragmented, increasing communication costs during development, reducing development efficiency, and lacking the ability to dynamically update.
[0005] Therefore, there is a great need for an application development methodology to reduce the difficulty of application development and improve its efficiency.
[0006] In this context, embodiments of the present invention are intended to provide an application development method, an application development apparatus, a computer-readable storage medium, a computer program product, and an electronic device.
[0007] According to a first aspect of the present disclosure, an application development method is provided, comprising: when it is determined that first code exists in the compiled code according to a preset identifier, converting the first code into a first abstract syntax tree, the first code including code for cross-engine calling methods of an application written using the same engine calling paradigm; adjusting a first node representing a module introduction description and a second node representing a method access path in the first abstract syntax tree, and generating a second abstract syntax tree based on the adjustment result; converting the second abstract syntax tree into second code, continuing to compile using the second code, and realizing the development of the application based on the compilation result.
[0008] According to a second aspect of the present disclosure, an application development apparatus is provided, comprising: a first abstract syntax tree (AST) generation module configured to convert the first code into a first abstract syntax tree when it is determined, based on a preset identifier, that the compiled code contains first code, wherein the first code includes code for cross-engine calling methods of an application written using the same engine calling paradigm; a second abstract syntax tree generation module configured to adjust a first node describing an identifier module and a second node representing a method access path in the first abstract syntax tree, and generate a second abstract syntax tree based on the adjustment result; and an application development module configured to convert the second abstract syntax tree into second code, continue compiling using the second code, and develop an application based on the compilation result.
[0009] According to a third aspect of this disclosure, a computer program product comprising instructions is provided that, when run on a computer, causes the computer to perform the steps of the application development method as described in the first aspect.
[0010] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the application development method as described in the first aspect of the above embodiments.
[0011] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the application development method as described in the first aspect of the above embodiments.
[0012] According to the application development method, application development apparatus, computer-readable storage medium, computer program product, and electronic device of the present disclosure, in the application development process, developers can use the same-engine calling paradigm to write code for cross-engine calling methods. Then, during the compilation process, by modifying the abstract syntax tree of the code written by the developer, the modified abstract syntax tree is converted into new code. Compilation continues based on the converted new code, thereby enabling cross-engine calling of application methods, such as cross-engine calling of logic layer methods from the user interaction layer. On the one hand, this disclosure, through modifications to the abstract syntax tree, unifies the development paradigms for both intra-engine and cross-engine method calls during application development, eliminating the differences between the two. Developers can use the intra-engine method call paradigm to write code for cross-engine method calls, reducing the difficulty and learning cost of application development and improving development efficiency. On the other hand, by unifying the development paradigms for intra-engine and cross-engine method calls, the development of hybrid layered technology stacks for large applications can be achieved based on the front-end development paradigm, avoiding the problems of high collaboration and development costs caused by inconsistent layered languages in large applications. Furthermore, by using the method of this application to call methods in the user interaction layer and logic layer, the entire business layer (i.e., the user interaction layer and logic layer) adopts the front-end paradigm, naturally possessing dynamism, significantly improving the overall business deployment rate and efficiency, and reducing the online problem repair cycle. Attached Figure Description
[0013] The above and other objects, features, and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated in the drawings by way of example and not limitation, wherein:
[0014] Figure 1 This diagram illustrates a flowchart of an application development method according to an exemplary embodiment of the present disclosure.
[0015] Figure 2 This diagram illustrates a layered architecture of an application according to an exemplary embodiment of the present disclosure;
[0016] Figure 3 A flowchart illustrating a method for adjusting a first abstract syntax tree according to an exemplary embodiment of the present disclosure is shown.
[0017] Figure 4 This illustration shows a flowchart of a method for replacing a second node with a third node according to an exemplary embodiment of the present disclosure;
[0018] Figure 5A schematic diagram illustrating a code conversion process according to an exemplary embodiment of the present disclosure is shown.
[0019] Figure 6 This diagram illustrates the structure of an application development apparatus according to an exemplary embodiment of the present disclosure.
[0020] Figure 7 A schematic diagram of the structure of an electronic device in an exemplary embodiment of this disclosure is shown.
[0021] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0022] The principles and spirit of the invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided to make the invention more thorough and complete, and to fully convey the scope of the invention to those skilled in the art.
[0023] Those skilled in the art will understand that embodiments of the present invention can be implemented as a system, apparatus, device, method, or computer program product. Therefore, the present invention can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0024] According to embodiments of the present invention, an application development method, an application development apparatus, a computer-readable storage medium, a computer program product, and an electronic device are provided.
[0025] In this document, any number of elements in the accompanying figures is for illustrative purposes and not for limitation, and any naming is for distinction only and has no limiting meaning.
[0026] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments. Invention Overview
[0028] The inventors of this disclosure have discovered that application development methods in related technologies suffer from high development costs and low development efficiency.
[0029] In view of the above, the basic idea of this disclosure is to provide an application development method, an application development device, a computer-readable storage medium, a computer program product, and an electronic device. In the application development process, developers can use the same-engine calling paradigm to write code for cross-engine calling methods. Then, during the compilation process, the abstract syntax tree of the code written by the developer is modified, and the modified abstract syntax tree is converted into new code. The compilation continues based on the converted new code, thereby enabling cross-engine calling of application methods, such as cross-engine calling of logic layer methods from the user interaction layer. On the one hand, this disclosure, through modifications to the abstract syntax tree, unifies the development paradigms for both intra-engine and cross-engine method calls during application development, eliminating the differences between the two. Developers can use the intra-engine method call paradigm to write code for cross-engine method calls, reducing the difficulty and learning cost of application development and improving development efficiency. On the other hand, by unifying the development paradigms for intra-engine and cross-engine method calls, the development of hybrid layered technology stacks for large applications can be achieved based on the front-end development paradigm, avoiding the problems of high collaboration and development costs caused by inconsistent layered languages in large applications. Furthermore, by using the method of this application to call methods in the user interaction layer and logic layer, the entire business layer (i.e., the user interaction layer and logic layer) adopts the front-end paradigm, naturally possessing dynamism, significantly improving the overall business deployment rate and efficiency, and reducing the online problem repair cycle.
[0030] After introducing the basic principles of the present invention, various non-limiting embodiments of the present invention will be described in detail below.
[0031] Application Scenarios Overview
[0032] It should be noted that the following application scenarios are shown only to facilitate understanding of the spirit and principles of the present invention, and the embodiments of the present invention are not limited in any way. On the contrary, the embodiments of the present invention can be applied to any applicable scenario.
[0033] In an exemplary application scenario, users can use the methods disclosed herein to achieve cross-platform development of applications. For example, when developing an application, users can use JavaScript to write methods for the user interaction layer and logic layer. Then, they can write code for cross-engine method calls between the user interaction layer and the logic layer, as well as code for same-engine method calls, using the same-engine call paradigm. When writing the code, for code that calls methods across engines, it can be pre-agreed to add a prefix before the function name. Thus, when compiling the code, code without the prefix will compile normally, while code with the prefix can be converted into a first abstract syntax tree. Then, the first node representing the module introduction description and the second node representing the method access path in the first abstract syntax tree are adjusted to generate a second abstract syntax tree. The second abstract syntax tree is then converted into the corresponding code, and the converted code is compiled. After compilation, the compilation result can be published to a preset network address. Then, applications on any platform can pull the compilation result from the preset network address and implement the functionality of the code corresponding to the compilation result, thereby achieving cross-platform development of the application.
[0034] Exemplary methods
[0035] Figure 1 This diagram illustrates a flowchart of an application development method according to an exemplary embodiment of the present disclosure, with reference to... Figure 1 The method includes:
[0036] Step S110: If it is determined that the compiled code contains first code according to the preset identifier, the first code is converted into a first abstract syntax tree. The first code includes the code of cross-engine calling methods of the application written in the same engine calling paradigm.
[0037] Step S120: Adjust the first node describing the representation module and the second node representing the access path of the representation method in the first abstract syntax tree, and generate a second abstract syntax tree based on the adjustment result;
[0038] Step S130: The second abstract syntax tree is converted into second code, and the second code is used to continue compilation. The application is developed based on the compilation result.
[0039] Below, we will first provide a detailed explanation of the specific implementation of "Step S110, in the case that the first code exists in the compiled code according to the preset identifier, convert the first code into a first abstract syntax tree".
[0040] In one exemplary implementation, it can be based on Figure 2 The layered architecture shown illustrates how application development is achieved. (Reference) Figure 2 In this disclosure, the application's development architecture can be divided into a user interaction layer 21, a logic layer 22, and a platform layer 23. The user interaction layer 21 is the UI (User Interface) layer, which can be understood as the user-facing interaction layer directly in the application. It is responsible for receiving user input data and visually presenting the processing results, enabling two-way communication between the user and the system through graphics, controls, and other elements. The logic layer 22 can be understood as the core processing layer of the application, responsible for executing business rules, data validation, and calculation logic. The platform layer 23 can be understood as the support layer that provides the application with a basic operating environment and general services, including middleware, databases, network communication, and other infrastructure. The platform layer smooths out underlying differences, providing a unified development interface for the application. It can also interface with different operating systems (such as Android, iOS, Windows, etc.) through standardized interfaces and adaptation technologies.
[0041] like Figure 2 As shown, taking a music application as an example, the user interaction layer 21 may include interactive pages or interactive controls such as the application's homepage, search, playback, and playlists; the logic layer 22 may include playback logic, membership logic, sharing logic, etc.; and the platform layer 23 may include related services that support networks, images, databases, files, etc., and may also call related service capabilities of the operating system, such as Bluetooth and NPU (Neural Processing Unit, a hardware chip specifically designed to accelerate neural network calculations).
[0042] In one exemplary embodiment of this disclosure, during cross-platform development, the user interaction layer can be based on the Real Native solution. Through technologies such as direct first-screen display, intelligent offline packages, package splitting, and dynamic import, different strategies are employed for different scenarios to achieve a full-scene experience comparable to pure native. The logic layer, by implementing high-performance and highly stable JS execution on the application client while simultaneously communicating and calling with the user interaction layer and system capabilities, achieves JS-based logic, thus achieving cross-platform functionality. The platform layer's basic library is implemented using C++ to achieve cross-platform capabilities.
[0043] Cross-platform compatibility refers to the ability of software, applications, or systems to run or be deployed on multiple different operating systems. This means that a single piece of code can run on multiple different operating systems without requiring separate development or adjustments for each system. React Native is an open-source framework for building cross-platform mobile applications. With React Native, developers can use JavaScript and React to create applications that work on different operating systems without writing native code for each operating system (or platform). React is an open-source JavaScript library focused on building user interfaces. JavaScript (i.e., JS mentioned above) is a lightweight, interpreted scripting language primarily used to enhance the interactivity and dynamism of web pages.
[0044] In one exemplary implementation, the methods of the application's user interaction layer and logic layer are implemented using JavaScript, while the platform layer is implemented using C++.
[0045] For example, when developing an application, users can write method code for the user interaction layer and the logic layer using JavaScript. When writing these methods, calls can be made within the same engine or across different engines. For instance, method 1 can call method 2. Methods 1 and 2 can both belong to the user interaction layer, or both to the logic layer, or method 1 can be in the user interaction layer and method 2 in the logic layer. In other words, methods 1 and 2 can belong to the same engine or different engines.
[0046] In other words, during application development, the UI layer can call methods within its own page (i.e., calls within its own engine), and it can also call methods in the logic layer across layers (i.e., cross-engine calls to logic layer methods). Cross-layer calls rely on native communication methods, hence the differences between calling methods within the same engine and across engines. This disclosure unifies the same-engine and cross-engine calling paradigms through subsequent processing. For developers, regardless of whether they need to make cross-engine or same-engine method calls, they can use the same-engine calling paradigm to write code. Then, by modifying the cross-engine calling code based on the same-engine calling paradigm using the method disclosed in this disclosure, new cross-engine calling code is automatically generated and compiled, reducing the development difficulty of the application and decreasing the learning curve for developers, thereby improving development efficiency.
[0047] In one exemplary implementation, the compiled code may be code to be compiled during the compilation phase, or it may include code to be compiled dynamically generated at runtime.
[0048] For example, once developers have written the relevant application code, if the relevant code involves cross-engine method calls, the methods disclosed herein can be used during the packaging and release phase of the relevant code to compile the code to be packaged and released, thereby automatically realizing cross-engine method calls during the application development process.
[0049] The application's code can include the initial version's code as well as code for feature updates. For example, after developers have written the initial application code and released the version, they may subsequently have new feature requirements or optimizations to existing features. Whether it's the initial application code or subsequent new feature code or old feature optimization code, the methods disclosed herein can be used to handle these needs. This way, during application development or iteration, it's possible to achieve "develop once, run on multiple platforms" as much as possible, significantly reducing the manpower investment costs of version iteration.
[0050] In one exemplary implementation, the compiled code includes first code, and the compiled code may also include third code, wherein the first code includes code for cross-engine calling methods of an application written using the same-engine calling paradigm, and the third code includes code for same-engine calling methods of an application written using the same-engine calling paradigm.
[0051] Since the code for same-engine calling methods in applications written in the same-engine calling paradigm does not require any processing and can directly implement the relevant functions, the second code in the code to be compiled can be directly compiled. However, the code for cross-engine calling methods written in the same-engine calling paradigm cannot directly implement the relevant functions. It needs to be processed and converted into the second code through the method disclosed in this paper before it can truly realize cross-engine method calls and thus implement the relevant functions of the code. Therefore, it is necessary to distinguish between the first and third codes in the compiled code to determine which part of the code needs to be converted.
[0052] In one exemplary implementation, if a preset identifier exists in the compiled code, the code segment containing the preset identifier is determined as the first code. In other words, the code segment containing the preset identifier in the compiled code can be determined as the first code.
[0053] For example, during application development, it can be pre-agreed to distinguish between the first and third lines of code written by the developer using preset identifiers. For instance, a preset string could be added before the code segment in the first line of code, such as before the function name, to identify that the code segment is the first line of code. Alternatively, a flag could be used to indicate whether a code segment is the first line of code; for example, a flag value of 1 indicates that the code segment is the first line of code, while a value of 0 or no flag indicates that it is not the first line of code.
[0054] In one exemplary implementation, the first code includes code that makes cross-engine method calls between the user interaction layer and the logic layer of an application written using the same engine calling paradigm.
[0055] For example, when developing an application, developers can use the same-engine call paradigm to write code for intra-engine or cross-engine calls between user-layer methods, as well as for intra-engine or cross-engine calls between logic-layer methods, and even for intra-engine or cross-engine calls between the user interaction layer and the logic layer. In other words, a single layer of an application may include multiple engines; therefore, methods within the same layer may belong to the same engine or different engines, and methods in different layers may be implemented using the same engine or different engines—meaning methods in different layers may belong to the same engine or different engines.
[0056] In application development, an engine can be understood as a module or framework in an application that undertakes core functions in a specific domain. Through high abstraction and encapsulation, it provides efficient and reusable underlying capabilities to support upper-level development.
[0057] In one exemplary implementation, the paradigm for calling methods within the same engine can be to import modules using ES6, and then perform method calls. This involves encapsulating the business method to be called into a module, and then calling the encapsulated method through a module-based call mechanism. ES6 (ECMAScript 6.0) is the standardized specification for the JavaScript language. ES6 improves code maintainability and development efficiency through new features such as modularity.
[0058] In one exemplary implementation, an abstract syntax tree is a tree-like abstract representation of the source code syntax structure, where each node corresponds to a syntax unit in the code (such as a variable declaration, function call, etc.).
[0059] For example, relevant transformation tools can be used to convert the first code into a first abstract syntax tree. As in this disclosure, a Babel plugin can be used to convert the first code into a first abstract syntax tree, then the relevant nodes in the first abstract syntax tree can be adjusted to obtain a second abstract syntax tree, and then the second abstract syntax tree can be converted into the second code.
[0060] The following is a detailed description of the specific implementation of step "S120, adjusting the first node of the representation module introduction description and the second node of the representation method access path in the first abstract syntax tree, and generating the second abstract syntax tree based on the adjustment result".
[0061] In one exemplary implementation, the first node can be understood as an ImportDeclaration node in the first abstract syntax tree, which represents a description of module import. ImportDeclaration is a node type in the abstract syntax tree (AST) that represents ES6 module import statements and describes the structural information of the import syntax in the code. The second node can be understood as a MemberExpression node in the first abstract syntax tree, which is a node type in the abstract syntax tree that represents object property access or method invocation.
[0062] For example, Figure 3 This diagram illustrates a flowchart of a method for adjusting a first abstract syntax tree according to an exemplary embodiment of this disclosure. (See also:) Figure 3 The method may include steps S310 to S320. Wherein:
[0063] In step S310, the module name and reference value in the first node of the first abstract syntax tree are modified.
[0064] For example, one exemplary implementation of step S310 may include: modifying the module name of the first node in the first abstract syntax tree to the name of a preset cross-engine call interface, and modifying the reference value of the first node in the first abstract syntax tree to a preset function name, wherein the function indicated by the preset function name is used for cross-engine communication through an agreed protocol.
[0065] For example, the first abstract syntax tree can be traversed, and the ImportDeclaration node encountered can be modified. The reference value of the node can be changed to the function name corresponding to the pre-generated function that communicates across engines through the agreed protocol, and the module name of the node can be changed to the name of the preset cross-engine call interface.
[0066] In step S320, the second node in the first abstract syntax tree is replaced with the third node representing a function call.
[0067] In one exemplary implementation, the third node can be understood as a CallExpression node, which can be understood as a node type in the abstract syntax tree that represents a function call.
[0068] For example, Figure 4 This diagram illustrates a flowchart of a method for replacing a second node with a third node according to an exemplary embodiment of this disclosure. (See also:) Figure 4 The method may include steps S410 to S420. Specifically: in step S410, the second node in the first abstract syntax tree is deleted; in step S420, a third node is added at the position of the second node.
[0069] In one exemplary implementation, the populated parameters of the third node include the method name exported by the calling module indicated by the second node and the callback function of the function indicated by the preset function name.
[0070] For example, you can traverse the first abstract syntax tree, delete the MemberExpression node encountered during the traversal, and then add a CallExpression node, i.e., the third node, at the position of the encountered MemberExpression node. The fill parameters of the third node include the method name exported by the calling module indicated by the second node and the callback function of the function indicated by the aforementioned preset function name.
[0071] After adjusting the first abstract syntax tree through the above steps S310 to S320, the second abstract syntax tree can be obtained.
[0072] The following is a detailed description of the specific implementation of "step S130, converting the second abstract syntax tree into second code, continuing to compile using the second code, and developing the application based on the compilation result".
[0073] For example, the second abstract syntax tree can be further converted into second code using Babel plugins, which will then participate in subsequent compilation to obtain the final compilation result. The application can then be developed based on the final compilation result.
[0074] Based on the method disclosed herein, application developers can use familiar intra-engine call paradigms to call services during the development process, and then automatically convert them into cross-engine calls through the method disclosed herein, thereby improving application development efficiency.
[0075] In one exemplary implementation, the compilation results can be published to a preset network address so that the application can obtain the compilation results from the preset network address during runtime and run the application based on the obtained compilation results.
[0076] For example, as mentioned above, the compiled code includes the application's initial code. This initial code can be compiled using the methods disclosed herein, packaged, and published to a preset network address. In this way, each client can download the application from the preset network address. As mentioned above, the compiled code also includes application feature update code. The compilation result includes the compilation result corresponding to the application feature update code. After publishing the compilation result to the preset network address, each application client can update the application according to the update prompt information during operation. If the update is confirmed, the compilation result of the feature update code can be obtained from the preset network address, and then the compilation result can be run in the application client to realize the application update.
[0077] For example, let's take the preset cross-engine call interface name as sdk, the pre-generated function for cross-engine communication via the agreed protocol as exec, and the first code written using the same-engine call paradigm as "import service from 'myService'; service.method();" as an example. Figure 5 This diagram illustrates a code conversion process according to an exemplary embodiment of the present disclosure.
[0078] refer to Figure 5 The first code is "import service from 'myService'";
[0079] The code `service.method();` is first parsed into a first abstract syntax tree (BST) 51 using a Babel plugin. Then, the Babel plugin modifies node 511 in the BST 51, changing it to node 521 and deleting node 512, replacing it with node 522, thus obtaining a second abstract syntax tree 52. Finally, Babel converts the second BST into the second code `import exec from 'sdk'; exec('service.method', () => {});`, thereby enabling cross-engine method calls.
[0080] Using the method disclosed herein, application developers can write code for both intra-engine and cross-engine method calls using the intra-engine calling paradigm. By automatically converting the code written by the developer into an abstract syntax tree, modifying the nodes of the abstract syntax tree to convert it into cross-engine method call syntax, and finally restoring the modified abstract syntax tree to cross-engine method call code, the syntax differences are eliminated.
[0081] Cross-engine calls are accomplished using a single-engine calling paradigm, resulting in a lower learning curve and faster onboarding for developers. Furthermore, this calling method has mature solutions for exception handling and parameter passing, facilitating future expansion. In addition, using a unified front-end development paradigm for large-scale application hybrid layered technology stacks avoids the high collaboration and development costs associated with inconsistent layering languages. It enables full cross-platform development of the UI, logic, and platform layers. When adding a new client (e.g., an application previously running on clients of OS1 and OS2, now needing to run on a client of OS3), there's no need to redevelop the UI and logic layers, allowing for low-cost deployment of new clients. Moreover, the entire business layer adopts a front-end paradigm, possessing inherent dynamism, significantly improving overall business deployment efficiency and reducing online issue repair cycles. Through the methods disclosed herein, both the business layer (i.e., the UI and logic layers) and the platform layer can be implemented using cross-platform solutions, achieving full-stack cross-platform application development.
[0082] Furthermore, it should be noted that the above figures are merely illustrative representations of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0083] Exemplary device
[0084] This disclosure also provides an application development apparatus through exemplary embodiments. (See reference...) Figure 6As shown, the application development apparatus 600 may include the following program modules: a first abstract syntax tree generation module 610, configured to convert the first code into a first abstract syntax tree when it is determined that the compiled code contains first code according to a preset identifier, wherein the first code includes code for cross-engine calling methods of an application written using the same engine calling paradigm; a second abstract syntax tree generation module 620, which adjusts the first node describing the identifier module and the second node representing the method access path in the first abstract syntax tree, and generates a second abstract syntax tree based on the adjustment result; and an application development module 630, configured to convert the second abstract syntax tree into second code, continue compilation using the second code, and realize the development of the application based on the compilation result.
[0085] In an optional implementation, the second abstract syntax tree generation module 620 may be specifically configured to: modify the module name and reference value in the first node of the first abstract syntax tree; and replace the second node in the first abstract syntax tree with a third node representing a function call.
[0086] In one optional implementation, modifying the module name and reference value in the first node of the first abstract syntax tree includes: modifying the module name of the first node in the first abstract syntax tree to the name of a preset cross-engine call interface, and modifying the reference value of the first node in the first abstract syntax tree to a preset function name, wherein the function indicated by the preset function name is used for cross-engine communication through an agreed protocol; replacing the second node in the first abstract syntax tree with a third node representing a function call includes: deleting the second node in the first abstract syntax tree; adding the third node at the position of the second node, wherein the filling parameters of the third node include the method name exported by the calling module indicated by the second node and the callback function of the function indicated by the preset function name.
[0087] In an optional implementation, the first abstract syntax tree generation module 610 may be specifically configured to: determine the code segment containing the preset identifier as the first code if a preset identifier exists in the compiled code.
[0088] In one alternative implementation, the compiled code also includes code for the same-engine invocation methods of the application written using the same-engine invocation paradigm.
[0089] In one alternative implementation, the first code includes code that enables cross-engine method calls between the user interaction layer and the logic layer of an application written using the same engine calling paradigm.
[0090] In one alternative implementation, the methods of the user interaction layer and the methods of the logic layer are implemented using the JavaScript language.
[0091] In an optional implementation, the device 600 may further include an update module, which may be configured to: publish the compilation results to a preset network address, so that the application can obtain the compilation results from the preset network address during operation and run the application based on the obtained compilation results.
[0092] The specific details of each part of the above-mentioned device have been described in detail in the corresponding method section of the above-mentioned implementation. For any undisclosed details, please refer to the implementation content of the method section above-mentioned implementation, and therefore will not be repeated here.
[0093] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0094] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0095] Exemplary storage media
[0096] The storage medium of an exemplary embodiment of the present invention will be described below.
[0097] In this exemplary embodiment, the above method can be implemented by a program product, such as a portable compact disc read-only memory (CD-ROM) containing program code, which can run on a device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0098] The program product may employ any combination of one or more readable media. A readable media may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0099] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0100] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RE, etc., or any suitable combination thereof.
[0101] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0102] Exemplary computer program product
[0103] Exemplary embodiments of this disclosure also provide a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the information management method described above.
[0104] In one embodiment, the computer program product can be a tangible product containing a computer program, such as a computer-readable storage medium storing the computer program. The readable storage medium can be a storage medium based on electrical, magnetic, optical, electromagnetic, infrared, or other signals, including but not limited to: random access memory (RAM), read-only memory (ROM), magnetic tape, floppy disk, flash memory, hard disk drive (HDD), solid-state drive (SSD), etc. For example, the computer program product can be implemented as a non-volatile storage medium storing the computer program, such as read-only memory, NAND flash memory, etc.
[0105] In one implementation, the computer program product can be an intangible product containing a computer program. For example, the computer program product can be implemented as a virtual digital product, such as an executable file, installation package, or other digital file storing the computer program.
[0106] Computer program code can be written in one or more programming languages. Examples of programming languages include C, Java, C++, and Python. Program code can execute entirely on the user's computing device, partially on the user's computing device, or as a standalone software package. It can also execute partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via an internet connection provided by a mobile network operator).
[0107] Computer programs can be carried or transmitted via signals such as electricity, magnetism, light, electromagnetic radiation, and infrared rays. Electronic devices can convert signals carrying computer programs into digital signals, thereby running the computer programs. When a computer program runs on an electronic device, its code is used to cause the electronic device to execute (more specifically, the processor of the electronic device to execute) the method steps of various exemplary embodiments of this disclosure. For example, the application development method described above can be executed, which includes the following steps: when it is determined that there is first code in the compiled code according to a preset identifier, the first code is converted into a first abstract syntax tree, the first code including code for cross-engine calling methods of the application written in the same engine calling paradigm; the first node representing the module introduction description and the second node representing the method access path in the first abstract syntax tree are adjusted, and a second abstract syntax tree is generated according to the adjustment result; the second abstract syntax tree is converted into second code, and compilation is continued through the second code, and the application development is realized according to the compilation result.
[0108] By executing the above method steps through a computer program, this disclosure, through modification of the abstract syntax tree, can unify the development paradigms of same-engine and cross-engine method calls during application development, eliminating the differences between the two. Developers can use the same-engine method call paradigm to write code for cross-engine method calls, reducing the difficulty and learning cost of application development and improving application development efficiency. On the other hand, by unifying the development paradigms of same-engine and cross-engine method calls, the development of large-scale application hybrid layered technology stacks can be realized based on the front-end development paradigm, avoiding the problems of high collaboration and development costs caused by inconsistent layered languages in large-scale application hybrid layered technology stacks. Furthermore, by using the method of this application to call methods in the user interaction layer and logic layer, the entire business layer (i.e., the user interaction layer and logic layer) can adopt the front-end paradigm, which naturally possesses dynamism, significantly improving the overall business launch rate and efficiency, and reducing the online problem repair cycle.
[0109] Exemplary electronic devices
[0110] refer to Figure 7 An electronic device according to exemplary embodiments of the present disclosure will be described. The electronic device may include a processor and a memory. The memory stores executable instructions of the processor, such as computer programs. The processor executes these executable instructions to perform the method steps of various exemplary embodiments of the present disclosure. Furthermore, the electronic device may also include a display for displaying a graphical user interface.
[0111] The following is for reference. Figure 7 The electronic device is illustrated by way of a general-purpose computing device. It should be understood that... Figure 7 The electronic device 700 shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0112] like Figure 7 As shown, the electronic device 700 may include: a processor 710, a memory 720, a bus 730, an I / O (input / output) interface 740, a network adapter 750, and a display 760.
[0113] The memory 720 may include volatile memory, such as RAM 721 and cache unit 722, and may also include non-volatile memory, such as ROM 723. The memory 720 may also include one or more program modules 724, including but not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. For example, program module 724 may include the modules described above.
[0114] The processor 710 may include one or more processing units, such as an AP (Application Processor), a modem processor, a GPU (Graphics Processing Unit), an ISP (Image Signal Processor), a controller, an encoder, a decoder, a DSP (Digital Signal Processor), a baseband processor, and / or an NPU (Neural-Network Processing Unit).
[0115] The processor 710 can be used to execute executable instructions stored in the memory 720, such as the application development method described above, which includes the following steps: if it is determined that there is first code in the compiled code according to a preset identifier, the first code is converted into a first abstract syntax tree, the first code including code for cross-engine calling methods of the application written in the same engine calling paradigm; the first node representing the module introduction description and the second node representing the method access path in the first abstract syntax tree are adjusted, and a second abstract syntax tree is generated according to the adjustment result; the second abstract syntax tree is converted into second code, and compilation is continued through the second code, and the application development is realized according to the compilation result.
[0116] Implementing the above method through computer programs has several advantages. First, by modifying the abstract syntax tree, this disclosure unifies the development paradigms for intra-engine and cross-engine method calls during application development, eliminating the differences between the two. Developers can use the intra-engine method call paradigm to write code for cross-engine method calls, reducing the difficulty and learning cost of application development and improving development efficiency. Second, by unifying the development paradigms for intra-engine and cross-engine method calls, the development of hybrid layered technology stacks for large applications can be achieved based on the front-end development paradigm, avoiding the problems of high collaboration and development costs caused by inconsistent layered languages in large applications. Third, by using the method of this application to call methods in the user interaction layer and logic layer, the entire business layer (i.e., the user interaction layer and logic layer) adopts the front-end paradigm, naturally possessing dynamism, significantly improving the overall business deployment ratio and efficiency, and reducing the online problem repair cycle.
[0117] Bus 730 is used to connect different components of electronic device 700 and may include a data bus, an address bus and a control bus.
[0118] Electronic device 700 can communicate with one or more external devices 800 (such as keyboard, mouse, external controller, etc.) through I / O interface 740.
[0119] Electronic device 700 can communicate with one or more networks via network adapter 750. For example, network adapter 750 can provide mobile communication solutions such as 3G / 4G / 5G, or wireless communication solutions such as wireless LAN, Bluetooth, and near-field communication. Network adapter 750 can communicate with other modules of electronic device 700 via bus 730.
[0120] Electronic device 700 can display a graphical user interface, such as displaying compilation results, through display 760.
[0121] although Figure 7 As not shown in the diagram, other hardware and / or software modules may also be configured in the electronic device 700, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0122] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0123] As can be seen from the above, the technical solutions disclosed herein can be implemented as methods, systems, computer program products, computer-readable storage media, electronic devices, etc. Those skilled in the art will understand that various aspects of this disclosure can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be referred to as "circuit," "module," or "device," respectively.
[0124] It should be understood that this disclosure is not limited to the specific methods, steps, or structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. Those skilled in the art will readily conceive of other embodiments based on the specific implementations provided in this disclosure. Therefore, the specific implementations provided in this disclosure are merely exemplary, and the scope and spirit of this disclosure are indicated by the claims, and should cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary technical means in the art not disclosed in this disclosure.
Claims
1. An application development method, characterized in that, include: If the compiler determines that there is first code in the compiled code based on a preset identifier, the first code is converted into a first abstract syntax tree. The first code includes code for cross-engine calling methods of an application written using the same engine calling paradigm. The first node describing the representation module and the second node representing the access path of the representation method in the first abstract syntax tree are adjusted, and a second abstract syntax tree is generated based on the adjustment result. The second abstract syntax tree is converted into second code, which is then used for further compilation. The application is developed based on the compilation results.
2. The method according to claim 1, characterized in that, The adjustment of the first node describing the representation module introduction and the second node of the representation method access path in the first abstract syntax tree includes: Modify the module name and reference value in the first node of the first abstract syntax tree; Replace the second node in the first abstract syntax tree with the third node representing a function call.
3. The method according to claim 2, characterized in that, Modifying the module name and reference value in the first node of the first abstract syntax tree includes: The module name of the first node in the first abstract syntax tree is modified to the name of a preset cross-engine call interface, and the reference value of the first node in the first abstract syntax tree is modified to a preset function name. The function indicated by the preset function name is used for cross-engine communication through an agreed protocol. The step of replacing the second node in the first abstract syntax tree with a third node representing a function call includes: Delete the second node in the first abstract syntax tree; A third node is added at the position of the second node, wherein the filling parameters of the third node include the method name exported by the calling module indicated by the second node and the callback function of the function indicated by the preset function name.
4. The method according to claim 1, characterized in that, The method further includes: If a preset identifier exists in the compiled code, the code segment containing the preset identifier is identified as the first code.
5. The method according to claim 1, characterized in that, The compiled code also includes code for same-engine invocation methods of applications written using the same-engine invocation paradigm.
6. The method according to claim 1, characterized in that, The first code includes code that enables cross-engine method calls between the user interaction layer and the logic layer of an application written using the same engine calling paradigm.
7. An application development apparatus, characterized in that, include: The first abstract syntax tree generation module is configured to convert the first code into a first abstract syntax tree when it is determined that the compiled code contains first code according to a preset identifier. The first code includes code for cross-engine calling methods of an application written in the same engine calling paradigm. The second abstract syntax tree generation module adjusts the first node describing the identification module and the second node representing the access path of the method in the first abstract syntax tree, and generates the second abstract syntax tree based on the adjustment result. The application development module is configured to convert the second abstract syntax tree into second code, continue compiling the second code, and develop the application based on the compilation results.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 6.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.
10. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the method as described in any one of claims 1 to 6.