Method, device and equipment for calling target native function and computer storage medium

By configuring the transmission protocol and network view container in the native application, the problem of Flutter applications being unable to call native functions during dynamic updates is solved, and Flutter Web is able to call native functions, supporting complete dynamic updates and cross-platform development.

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

Patent Information

Application Number
CN202310426833.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-12
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

Flutter applications cannot fully implement full platform function updates during dynamic updates, especially the inability to call the native functions of the Android operating system, resulting in incomplete support for dynamic updates.

Method used

By configuring the preset transmission protocol in the native application, cross-platform communication is achieved between the first module and the second module. The second module uses the method channel provided by the network view container to call the native functions of the native platform to ensure that Flutter Web can be called normally. Native functionality.

Benefits of technology

It realizes Flutter Web's normal calling of native functions, supports the integrity of dynamic updates, reduces development costs and time, and improves application development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796313A_ABST
    Figure CN118796313A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, in particular to a method, device and equipment for calling a target native function and a computer storage medium. The method specifically comprises the steps that a first module in a native application responds to a calling operation triggered for a target native function embedded in a native platform, corresponding calling information is obtained, and the calling information at least comprises a calling interface identifier corresponding to the target native function obtained from configuration information; on the basis of a preset transmission protocol, calling information is sent to the second module, so that the second module obtains a corresponding calling interface address on the basis of the calling interface identifier, and the target native function is called on the basis of the calling interface address to obtain a corresponding calling response; wherein the transmission protocol is used for constraining a transmission mode about function calling and response between the first module and the second module; and receiving a calling response from the second module based on the transmission protocol, and obtaining a calling result of the target native function based on the calling response.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the continuous development and popularization of network technology, applications, as one of the products of network technology, have been widely used in various fields. In order to meet the ever-increasing needs of application users for application upgrades, developers need to increase the speed of application development and iteration, and cross-platform application development methods and dynamic update methods have gradually become the focus of technology development.

[0003] At present, the main way to develop cross-platform applications is to develop applications through a cross-platform application development framework. As one of the cross-platform development frameworks, the Flutter development framework (hereinafter referred to as Flutter) has obvious advantages: first, it supports the development of applications for all platforms, and a set of code bases can support mobile operating systems, personal computer (PC) operating systems, web pages (Web) and embedded platforms, etc.; second, Flutter's self-drawn user interface (UI) engine and the way it is compiled into native code make it possible for the system to have high performance during runtime.

[0004] Dynamic update refers to directly updating a function in the application without going through the software version update review of the app store. This update method has the advantages of being lightweight, invisible, and fast. However, when this dynamic update method is applied to applications that include Flutter modules, there is a problem that it is impossible to fully implement full platform function updates.

[0005] The following will take a native application running on the Android operating system and containing a module developed by Flutter as an example to illustrate the above problem.

[0006] Before the application is updated, since the code corresponding to the Flutter module is directly included in the program code of the application, when the operation of the Flutter module involves calling the native functions of the Android operating system (such as camera, Bluetooth, dialing, etc.), the call to the native function can be completed directly through the method channel provided by Flutter, thereby smoothly realizing the normal operation of the Flutter module.

[0007] When some functions in the Flutter module need to be dynamically updated, the general approach is to compile the business code to be updated into the Flutter Web interface to provide the corresponding display interface and updated functions of the Flutter module. However, Flutter Web cannot call the native functions of the operating system. As a result, when the operation of the business code to be updated involves calling the native functions of the Android operating system, Flutter Web will not be able to successfully implement the call, and the Flutter module will not be able to achieve dynamic updates in the above way. Therefore, Flutter applications do not fully support dynamic updates.

[0008] In order to ensure that applications containing Flutter modules fully support dynamic updates, how to implement normal calls of native functions by Flutter Web is an urgent problem to be solved. Summary of the invention

[0009] The present application provides a method, apparatus, device and computer storage medium for calling a target native function, so as to realize the normal calling of the native function by Flutter Web.

[0010] In a first aspect, an embodiment of the present application provides a method for calling a target native function, which is applied to a first module in a native application on a native platform, the first module is developed based on a development framework page Flutter Web code, and the native application also includes a second module, and the method includes:

[0011] In response to a call operation triggered for a target native function embedded in the native platform, corresponding call information is obtained, wherein the call information at least includes: a call interface identifier corresponding to the target native function obtained from the configuration information;

[0012] Based on a preset transmission protocol, the calling information is sent to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response; wherein the transmission protocol is used to constrain the transmission method of function calling and response between the first module and the second module;

[0013] Based on the transmission protocol, a call response is received from the second module, and based on the call response, a call result of the target native function is obtained.

[0014] In a possible implementation, the call information further includes: call parameters corresponding to the target native function obtained based on the call operation;

[0015] Then, the calling information is sent to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response, including:

[0016] The calling information is sent to the second module, so that the second module calls the target native function based on the calling interface address and the calling parameters to process the calling parameters and obtain a corresponding calling response.

[0017] In a possible implementation, sending the call information to the second module so that the second module obtains the corresponding call interface address based on the call interface identifier, and calls the target native function based on the call interface address to obtain the corresponding call response, including:

[0018] Generate a call operation identifier corresponding to the call operation, and associate the call operation identifier with the call information;

[0019] Sending the calling operation identifier and the calling information associated with the calling operation identifier to the second module, so that the second module calls the target native function, obtains the corresponding calling response, and performs association processing on the calling operation identifier and the calling response;

[0020] Then receive the call response, including:

[0021] Based on the call operation identifier, a call response associated with the call operation identifier is received.

[0022] In a possible implementation, the second module includes a network view container, and the operating environment provided by the network view container is developed based on the Flutter code;

[0023] Then, the calling information is sent to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response, including:

[0024] Sending call information to the network view container in the second module, so that the network view container obtains the call interface address based on the call interface identifier, and calls the target native function based on the call interface address and the method channel provided by the network view container to obtain a corresponding call response;

[0025] Then receive a call response from the second module, including:

[0026] A call response is received from the web view container in the second module.

[0027] In a possible implementation, sending the calling information to the network view container in the second module so that the network view container obtains the calling interface address based on the calling interface identifier includes:

[0028] Sending the calling information to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier and the preset calling interface index; wherein,

[0029] The calling interface index is obtained by the network view container based on the annotation of the native functions on the native platform in the Flutter code of the native application.

[0030] In a second aspect, an embodiment of the present application provides a method for calling a target native function, which is applied to a second module in a native application on a native platform, where the second module is developed based on native code, and the native application includes a method developed based on FlutterWeb code, and the method further includes:

[0031] Based on a preset transmission protocol, receiving call information from the first module, the call information is obtained by the first module in response to a call operation triggered for a target native function embedded in the native platform, and the call information at least includes: a call interface identifier corresponding to the target native function obtained from the configuration information; the transmission protocol is used to constrain the transmission method of the function call and response between the first module and the second module;

[0032] Obtaining a corresponding calling interface address based on the calling interface identifier, and calling a target native function based on the calling interface address to obtain a corresponding calling response;

[0033] Based on the transmission protocol, a call response is returned to the first module, so that the first module obtains a call result of the target native function based on the call response.

[0034] In a possible implementation, the call information further includes: call parameters corresponding to the target native function obtained based on the call operation;

[0035] Based on the calling interface address, the target native function is called to obtain the corresponding call response, including:

[0036] Based on the calling interface address and calling parameters, the target native function is called to process the calling parameters and obtain a corresponding calling response.

[0037] In a possible implementation, receiving a calling interface identifier corresponding to a target native function includes:

[0038] receiving a call operation identifier and a call interface identifier associated with the call operation identifier; wherein the call operation identifier corresponds to the call operation;

[0039] Then call the target native function and get the corresponding call response, including:

[0040] Call the target native function, obtain the corresponding call response, and associate the call operation identifier with the call response;

[0041] Then a call response is returned to the first module, including:

[0042] A call response associated with the call operation identifier is returned to the first module.

[0043] In a possible implementation, the second module includes a network view container, and the operating environment provided by the network view container is developed based on the Flutter code;

[0044] Based on the calling interface address, the target native function is called to obtain the corresponding call response, including:

[0045] Based on the calling interface address and the method channel provided by the network view container, call the target native function and obtain the corresponding call response;

[0046] Then a call response is returned to the first module, including:

[0047] The calling network view container returns a calling response to the first module.

[0048] In a possible implementation, obtaining a corresponding calling interface address based on the calling interface identifier includes:

[0049] Based on the calling interface identifier and the preset calling interface index, obtaining the calling interface address;

[0050] The calling interface index is obtained by the network view container based on the annotation of the native function on the native platform in the Flutter code of the native application.

[0051] In a third aspect, an embodiment of the present application provides a device for calling a target native function, which is applied to a first module in a native application on a native platform, wherein the first module is developed based on a development framework page Flutter Web code, and the native application also includes a second module. The device includes:

[0052] A first processing unit is configured to obtain corresponding call information in response to a call operation triggered for a target native function embedded in a native platform, wherein the call information at least includes: a call interface identifier corresponding to the target native function obtained from the configuration information;

[0053] A first sending unit is used to send call information to the second module based on a preset transmission protocol, so that the second module obtains a corresponding call interface address based on the call interface identifier, and calls a target native function based on the call interface address to obtain a corresponding call response; wherein the transmission protocol is used to constrain the transmission method of function calls and responses between the first module and the second module;

[0054] The first receiving unit is used to receive a call response from the second module based on a transmission protocol, and obtain a call result of the target native function based on the call response.

[0055] In a possible implementation, the call information further includes: call parameters corresponding to the target native function obtained based on the call operation;

[0056] The first sending unit is used to send the calling information to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response, which is specifically used for:

[0057] The calling information is sent to the second module, so that the second module calls the target native function based on the calling interface address and the calling parameters to process the calling parameters and obtain a corresponding calling response.

[0058] In a possible implementation, the first sending unit is used to send the call information to the second module, so that the second module obtains the corresponding call interface address based on the call interface identifier, and calls the target native function based on the call interface address to obtain the corresponding call response, specifically used to:

[0059] Generate a call operation identifier corresponding to the call operation, and associate the call operation identifier with the call information;

[0060] Sending the calling operation identifier and the calling information associated with the calling operation identifier to the second module, so that the second module calls the target native function, obtains the corresponding calling response, and performs association processing on the calling operation identifier and the calling response;

[0061] When the first receiving unit is used to receive the call response, it is specifically used to:

[0062] Based on the call operation identifier, a call response associated with the call operation identifier is received.

[0063] In a possible implementation, the second module includes a network view container, and the operating environment provided by the network view container is developed based on the Flutter code;

[0064] The first sending unit is used to send the calling information to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response, which is specifically used for:

[0065] Sending call information to the network view container in the second module, so that the network view container obtains the call interface address based on the call interface identifier, and calls the target native function based on the call interface address and the method channel provided by the network view container to obtain a corresponding call response;

[0066] When the first receiving unit is used to receive the call response from the second module, it is specifically used to:

[0067] A call response is received from the web view container in the second module.

[0068] In a possible implementation manner, the first sending unit is used to send the calling information to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier, specifically for:

[0069] Sending the calling information to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier and the preset calling interface index; wherein,

[0070] The calling interface index is obtained by the network view container based on the annotation of the native functions on the native platform in the Flutter code of the native application.

[0071] In a fourth aspect, an embodiment of the present application provides a device for calling a target native function, which is applied to a second module in a native application on a native platform, wherein the second module is developed based on native code, and the native application includes a device developed based on FlutterWeb code, and the device includes:

[0072] A second receiving unit is used to receive call information from the first module based on a preset transmission protocol, where the call information is obtained by the first module in response to a call operation triggered for a target native function embedded in the native platform, and the call information at least includes: a call interface identifier corresponding to the target native function obtained from the configuration information; the transmission protocol is used to constrain the transmission method of the function call and response between the first module and the second module;

[0073] A second processing unit is used to obtain a corresponding calling interface address based on the calling interface identifier, and based on the calling interface address, call the target native function to obtain a corresponding calling response;

[0074] The second sending unit is used to return a call response to the first module based on the transmission protocol, so that the first module obtains a call result of the target native function based on the call response.

[0075] In a possible implementation, the call information further includes: call parameters corresponding to the target native function obtained based on the call operation;

[0076] The second processing unit is used to call the target native function based on the calling interface address and obtain the corresponding calling response, specifically to:

[0077] Based on the calling interface address and calling parameters, the target native function is called to process the calling parameters and obtain a corresponding calling response.

[0078] In a possible implementation manner, when the second receiving unit is used to receive the calling interface identifier corresponding to the target native function, it is specifically used to:

[0079] receiving a call operation identifier and a call interface identifier associated with the call operation identifier; wherein the call operation identifier corresponds to the call operation;

[0080] The second processing unit is used to call the target native function, and when obtaining the corresponding call response, it is specifically used to:

[0081] Call the target native function, obtain the corresponding call response, and associate the call operation identifier with the call response;

[0082] When the second sending unit is used to return the call response to the first module, it is specifically used to:

[0083] A call response associated with the call operation identifier is returned to the first module.

[0084] In a possible implementation, the second module includes a network view container, and the operating environment provided by the network view container is developed based on the Flutter code;

[0085] The second processing unit is used to call the target native function based on the calling interface address and obtain the corresponding calling response, specifically to:

[0086] Based on the calling interface address and the method channel provided by the network view container, call the target native function and obtain the corresponding call response;

[0087] When the second sending unit is used to return the call response to the first module, it is specifically used to:

[0088] The calling network view container returns a calling response to the first module.

[0089] In a possible implementation manner, when the second processing unit is used to obtain the corresponding calling interface address based on the calling interface identifier, it is specifically used to:

[0090] Based on the calling interface identifier and the preset calling interface index, obtaining the calling interface address;

[0091] The calling interface index is obtained by the network view container based on the annotation of the native function on the native platform in the Flutter code of the native application.

[0092] In a fifth aspect, an embodiment of the present application provides a device for calling a target native function, comprising: a memory and a processor, wherein the memory is used to store computer instructions; and the processor is used to execute computer instructions to implement the steps of the method for calling a target native function provided in an embodiment of the present application.

[0093] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed by a processor, the steps of the method for calling the target native function provided in the embodiment of the present application are implemented.

[0094] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; when the processor of an electronic device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, so that the electronic device executes the steps of the method for calling the target native function provided in the embodiment of the present application.

[0095] The beneficial effects of this application are as follows:

[0096] An embodiment of the present application provides a method, apparatus, device and storage medium for calling a target native function. The method uses a preset transmission protocol to implement communication between a first module and a second module in a native application running on a native platform. Then, the second module can call the native function embedded in the native platform based on the substitute information from the first module, and return the obtained call response to the first module, thereby implementing the first module's call to the native function.

[0097] In this application, the communication between the first module and the second module is achieved through a preset transmission protocol, which not only ensures the feasibility of cross-platform communication between the Flutter web end and the native end, but also allows developers to agree on a customized transmission protocol according to development requirements, which is highly flexible and scalable.

[0098] Moreover, when the second module implements the process of calling the target native function, it calls the network view container developed based on the Flutter code, and uses the method channel provided by the network view container to implement the call to the native function embedded in the native platform. In this way, combined with the cross-platform advantage of Flutter, developers only need to use Flutter code to develop the network view container once to ensure that the network view container can run in native applications on various native platforms, which greatly reduces the manpower and time costs of developing applications and effectively improves the development efficiency of applications.

[0099] In addition, when the second module determines the calling interface address corresponding to the calling interface identifier, it can search for the corresponding calling interface address from the preset calling interface index, and the calling interface index is obtained by the network view container based on the annotation of the native function on the native platform in the Flutter code of the native application. In this way, developers only need to add annotations to the native functions in the code corresponding to the Flutter module when developing native applications. The subsequent native application can generate the calling interface index corresponding to all native functions in the native application based on the annotation by automatic scanning. When making subsequent interface calls, the corresponding calling interface address can be directly obtained by using the index, which satisfies the Flutter module's calling requirements for native functions at one time.

[0100] In the solution provided by the present application, the business code to be updated can be compiled into a Flutter Web function provided by Flutter officially, and run directly in the native application in the form of a Web, and then the call of the native function by Flutter Web is implemented through the method of calling the target native function provided by the present application. In this way, this solution does not need to parse the abstract syntax tree corresponding to the business code to be updated, there is no problem of incomplete support for Flutter syntax, and there is no problem of incompatibility between the Flutter development framework version and the existing native application after the upgrade, and the feasibility of the solution is high.

[0101] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0102] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0103] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0104] Figure 2 A schematic diagram of a framework for communication between Flutter and a native platform provided in an embodiment of the present application;

[0105] Figure 3 A schematic diagram of a dynamic update of a Flutter module provided in an embodiment of the present application;

[0106] Figure 4 A schematic diagram of an architecture for calling a target native function provided in an embodiment of the present application;

[0107] Figure 5 A flowchart of a method for calling a target native function provided in an embodiment of the present application;

[0108] Figure 6 A schematic diagram of the structure of a JSBridge provided in an embodiment of the present application;

[0109] Fig. 7A A flowchart of a method for transmitting information provided in an embodiment of the present application;

[0110] Figure 7B A schematic diagram of a method for transmitting information provided in an embodiment of the present application;

[0111] Figure 8 A flowchart of another method for transmitting information provided in an embodiment of the present application;

[0112] Fig. 9 A flowchart of another method for calling a target native function provided in an embodiment of the present application;

[0113] Fig.10 A flowchart of a method for a second module to respond to call information provided in an embodiment of the present application;

[0114] Fig.11A A flowchart of a method for calling a target native function through a network view container provided in an embodiment of the present application;

[0115] Fig. 11BA schematic diagram of calling a target native function through a network view container provided in an embodiment of the present application;

[0116] Fig. 12A A flowchart of a method for calling a target native function provided in an embodiment of the present application;

[0117] Fig. 12B A schematic diagram of a framework for calling a target native function provided in an embodiment of the present application;

[0118] Fig.13 A flowchart of a method for marking transmission information provided in an embodiment of the present application;

[0119] Fig.14 A schematic diagram of a calling process provided for an embodiment of the present application;

[0120] Fig.15 A response flow diagram provided for an embodiment of the present application;

[0121] Fig.16 A schematic diagram of the structure of a device for calling a target native function provided in an embodiment of the present application;

[0122] Fig.17 A schematic diagram of the structure of another device for calling a target native function provided in an embodiment of the present application;

[0123] Fig.18 A schematic diagram of a hardware structure of an electronic device provided in an embodiment of the present application;

[0124] Fig.19 A schematic diagram of the hardware composition structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0125] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0126] It should be understood that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order. In the description of the embodiments of the present application, "plurality" refers to two or more.

[0127] To facilitate understanding of the technical solutions provided in the embodiments of the present application, some key terms used in the embodiments of the present application are explained here:

[0128] Native application: An application developed based on the operating environment (machine language and operating system) of the terminal device. For example, when the terminal device uses the Android operating system, its corresponding native application is an application developed using the Android corresponding Java code. The application can run directly on the Android operating system and use the hardware functions of the terminal device.

[0129] Native platform: The native platform is the operating environment provided by the operating system of each terminal device. Native applications can run directly on the native platform.

[0130] Container: A container is a standardized software unit that packages code and all its dependencies so that applications can run quickly and reliably from one computing environment to another. Applicable to applications based on various operating systems, containerized programs will always run the same regardless of the infrastructure. The container isolates the program from other environments and ensures that it can run uniformly.

[0131] Transmission protocol: It is the rule for data conversion. When the code is running, it needs to receive and send data. The protocol data packet specifies the data conversion format, such as data length, base conversion, and equivalence. The communication protocol can be customized. For example, the communication protocol corresponding to the IO interface is responsible for data format conversion, and the communication protocol corresponding to the process interface is responsible for data processing, namely floating-point operation rules.

[0132] Hybrid development: that is, the hybrid development of the front-end and the client. The application developed with this technology is a semi-native program, a mobile application that uses native programming technology to build the App shell, and the content inside the shell is provided by Web technology. It has both the "advantages of Native App's good interactive experience" and the "advantages of Web App's cross-platform development."

[0133] Abstract Syntax Tree (AST): In computer science, an abstract syntax tree can be referred to as a syntax tree. It is an abstract representation of the syntax structure of the source code. It represents the syntax structure of the programming language in a tree-like form, and each node on the tree represents a structure in the source code. It is called "abstract" because the abstract syntax tree does not represent every detail of the real syntax. For example, nested parentheses are implied in the tree structure and are not presented in the form of nodes; and conditional jump statements such as if-condition-then can be represented using nodes with two branches.

[0134] The following is a brief introduction to the design concept of the embodiment of the present application:

[0135] As network technology becomes increasingly popular, applications, as one of the products of network technology, have been increasingly used in various fields, and the needs of application users (hereinafter referred to as users) for applications are constantly being updated and iterated. In order to meet the numerous and rapidly iterating upgrade requirements, developers need to increase the speed of application development gene iteration. Therefore, more and more developers have turned their attention to cross-platform application development methods, supplemented by dynamically updated function iteration methods, to achieve the goal of developing multiple terminals at once and rapidly iterating application functions.

[0136] However, the solution of developing cross-platform applications using the Flutter development framework, which is popular among developers, has the problem of being unable to fully implement full-platform functional updates in terms of dynamic updates.

[0137] For example, for an application running on the Android operating system, assuming that it includes a functional module developed by Flutter (referred to as Flutter module), when it comes to the need to dynamically update the Flutter module, the code to be updated is generally compiled into a Flutter Web interface to provide the corresponding display interface of the Flutter module and the updated functions.

[0138] However, Flutter Web cannot call native functions of the operating system. As a result, when the operation of the business code to be updated involves calling native functions of the Android operating system, Flutter Web will not be able to successfully implement the call, and the Flutter module will not be able to achieve dynamic updates in the above way. Therefore, Flutter applications do not fully support dynamic updates.

[0139] In order to ensure that applications containing Flutter modules fully support dynamic updates, how to implement normal calls of native functions by Flutter Web is an urgent problem to be solved.

[0140] In view of this, the embodiments of the present application provide a method, apparatus, device and computer storage medium for calling a target native function, by configuring a preset transmission protocol between a first module developed based on Flutter Web code and a second module in a native application, to ensure that the call information from the first module to the native function embedded in the native platform can be accurately transmitted to the second module. Specifically, the first module first responds to the call operation triggered for the target native function embedded in the native platform, and obtains the corresponding call information, which at least includes the call interface identifier corresponding to the target native function obtained from the configuration information corresponding to the first module; then, the first module can send the call information to the second module based on the preset transmission protocol. In this way, through a pre-agreed transmission protocol, the first module and the second module can realize cross-platform (web page and native platform) communication between the two modules.

[0141] The second module can receive the above-mentioned call information through the network view container developed based on the Flutter code, and obtain the corresponding call interface address based on the call interface identifier in the call information and the preset call interface index, and call the target native function based on the call interface address and the method channel provided in the network view container to obtain the corresponding call response. In this way, the network view container developed based on Flutter can take advantage of Flutter's own cross-platform advantages, run on native platforms with different operating systems, and use method channels to implement calls to native functions in the native platform, ensuring that developers only need to develop one set of code and apply it to applications on multiple platforms, effectively reducing development costs and improving application development efficiency.

[0142] After the second module obtains the corresponding call response, it can send the call response to the first module, and after the first module receives the call response corresponding to the target native function, it can obtain the call result of the target native function based on the call response. In this way, through the transmission protocol between the first module and the second module, the first module and the second module realize the transmission of information about function calls and responses, and the second module determines the called interface address through the received call interface identifier, calls the target native function, and returns the call response to the first module, finally realizing the first module's call to the target native function.

[0143] The following briefly introduces the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In the specific implementation process, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0144] See also Figure 1 , is a schematic diagram of an application scenario provided in an embodiment of the present application. The application scenario includes multiple terminal devices 101 and a server 102. The number of terminal devices 101 can be one or more, and the number of servers 102 can also be one or more. The present application does not specifically limit the number of terminal devices 101 and servers 102.

[0145] In an optional implementation, the terminal device 101 and the server 102 may be directly or indirectly connected in communication through one or more networks 103. The network 103 may be a wired network or a wireless network, for example, a mobile cellular network, or a wireless fidelity (Wireless-Fidelity, WIFI) network, or other possible networks, which are not limited in the embodiment of the present invention.

[0146] In the embodiment of the present application, the terminal device 101 includes but is not limited to mobile phones, tablet computers, laptops, desktop computers, e-book readers, intelligent voice interaction devices, smart home appliances, car terminals and other devices; various clients can be installed on the terminal device, which can be an application (such as social software, game software, etc.) or a mini-program, etc., and the client can be an independently running Flutter application or a native application that includes a Flutter module.

[0147] Server 102 is a backend server corresponding to the client, providing services to the client. Server 102 can 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, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0148] It should be noted that in the solution provided in the embodiment of the present application, the terminal device 101, as the executor of the solution, can implement the operation steps corresponding to the first module and the second module through different threads, or can also implement the operation steps corresponding to the first module and the second module through the same thread, and the present application does not impose any restrictions.

[0149] The following describes the method of calling the target native function provided by the exemplary embodiment of the present application in combination with the application scenario described above according to the accompanying drawings. It should be noted that the above application scenario is only shown to facilitate the understanding of the spirit and principles of the present application, and the implementation method of the present application is not limited in this respect.

[0150] In the process of developing applications, most developers strive to develop only one set of application code to adapt to various operating systems. Using the Flutter development framework to develop applications can achieve this goal to a great extent. It should be noted that a complete Flutter application actually includes two parts: native code and Flutter code. This is because Flutter itself is just a UI system, and it cannot provide some native capabilities, such as using Bluetooth, camera, GPS, etc. Therefore, to call these capabilities in the Flutter application, it is necessary to communicate with the native platform. Flutter uses its unique platform channel (Platform Channel) to realize the communication between Flutter and the native platform, and the platform channel can be used in both Android Java code and Objective C code on iOS.

[0151] For example, the following will take an application containing Flutter code running on an Android system as an example to illustrate the above method of communicating with the native platform. Figure 2 , is a schematic diagram of a communication architecture between Flutter and a native platform provided in an embodiment of the present application. Figure 2 In the architecture shown, the Flutter module in the application sends messages to the native application where the Flutter module is located through the platform channel. The native application receives messages from the Flutter module by following the platform channel. Then the native application can call the application programming interface (API) of the native platform and return the response to the native application. Then the native application returns the response to the Flutter module in the native application through the platform channel.

[0152] However, for native applications that include Flutter modules, there is a big problem with the dynamic update of Flutter modules.

[0153] First, let's explain how to implement dynamic updates for Flutter modules. For a native application that includes a Flutter module, when a function in the Flutter module needs to be updated quickly, if you want to skip the time-consuming review process of the app store, you need to update the function through dynamic updates. The Flutter development framework supports this update method by compiling the Flutter business code to be updated corresponding to the old function of the native application into Flutter Web, so that it runs in the browser provided by the native platform or the lightweight browser embedded in the native application. Through the corresponding page of the compiled Flutter Web, the old function of the Flutter module in the native application is overwritten, thereby updating the old function.

[0154] The following will take the update of the login account function in a target application as an example to illustrate the dynamic update of the Flutter module. Figure 3 , is a schematic diagram of a dynamic update of a Flutter module provided in an embodiment of the present application. Figure 3 As shown, before dynamic updates are performed, when users use the functions corresponding to the Flutter module in the target application, the corresponding operation interface will be displayed in the interface of the target application. When the developer dynamically updates the login account module developed based on the Flutter code included in the target application, the target application will detect the update instruction from the server when it starts. Therefore, when the user uses the login account function, the target application will compile the business code to be updated into the form of Flutter Web, so that the updated login account function corresponding to the business code will overwrite the original login interface in the form of a web page, so that the user can use the updated login account function without feeling it.

[0155] However, in this way, if the old function of the Flutter module in the native application does not involve calling the native function, the old function can be dynamically updated smoothly. But once the old function involves calling the native function, since Flutter Web cannot call the native function on the native platform, the corresponding page of Flutter Web can only play the role of displaying the pattern, and cannot further implement the various in-depth functions contained in the page. Take the update of the above-mentioned login account function as an example to illustrate this problem. In the case Figure 3In the updated web page shown, in addition to the account and password login method, it also includes the login method below through a third-party account. This function requires calling another application through the native platform and obtaining the corresponding login information from the application before the third-party account login function can be realized. However, since the current dynamically updated login page is actually the web page corresponding to Flutter Web, it is impossible to call the native function of launching another application on the native platform. Therefore, the login function through a third-party account in the web page cannot be used, and the corresponding option for this function is only an image display.

[0156] Based on the above problem, the present application embodiment provides a solution that enables Flutter Web to call the target native function in the native platform. Figure 4 , is a schematic diagram of an architecture for calling a target native function provided by an embodiment of the present application. Figure 4 In the architecture shown, the native application includes a first module and a second module (the part of the native application other than the first module) developed based on the Flutter Web code, which runs on the native platform and can realize two-way communication with the native platform; wherein the native platform may include platforms corresponding to various operating systems, and these operating systems may include various different systems, for example, Android system or iOS system in mobile operating system, or Windows system or Linux system in PC operating system, or operating system for embedded system, etc., which is not limited in this application.

[0157] In the solution for calling native functions provided in the embodiment of the present application, interaction and cooperation between the first module and the second module are required to implement the calling of the target native function.

[0158] Hereinafter, the methods for implementing calling the target native function on the first module side and the second module side will be described respectively.

[0159] See also Figure 5 , is a flow chart of a method for calling a target native function provided by an embodiment of the present application. The method is applied to the first module in the native application, by executing Figure 5 The method steps shown implement the application of the target native function. Specifically, the execution steps of the method are as follows:

[0160] Step S501: in response to a call operation triggered for a target native function embedded in a native platform, corresponding call information is obtained, where the call information at least includes: a call interface identifier corresponding to the target native function obtained from configuration information.

[0161] The calling operation for the target native function may come from the user directly clicking on a function option in the operation page corresponding to the first module when using the first module, or may come from the calling operation automatically triggered by the first module when implementing a certain function, and this application does not limit this. For example, there is a Bluetooth option switch in a certain operation page corresponding to the first module. When the user clicks the Bluetooth option switch, the calling operation is triggered for the target native function (turning on Bluetooth) on the native platform.

[0162] In the configuration information corresponding to the first module, several calling interface identifiers corresponding to each native function that the first module needs to call will be pre-configured. In this way, when the first module receives a calling operation for the target native function, it can obtain the calling interface identifier corresponding to the target native function from its configuration information, thereby providing an information basis for subsequent calls to the target native function.

[0163] Step S502: Based on a preset transmission protocol, the above-mentioned calling information is sent to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain a corresponding calling response.

[0164] The transmission protocol is used to constrain the transmission mode of function calls and responses between the first module and the second module. The transmission protocol can be specifically set according to the needs of developers, and the data form of the transmission can also be determined based on the needs, such as a string.

[0165] In a possible embodiment, the transmission of the call information and the response between the first module and the second module can be implemented by setting a communication bridge (Java Script Bridge, JSBridge). Specifically, the specific implementation of this embodiment is as follows:

[0166] See also Figure 6 , which is a structural diagram of JSBridge provided in an embodiment of the present application. It should be noted that JSBridge usually communicates through a protocol to realize a mechanism for two-way communication between the native end and the Web end. In the process of JSBridge realizing two-way communication, the key point is that through JSBridge, the Web end can call the interface corresponding to the code of the native end. Similarly, the native end can also call the interface corresponding to the code of the Web end through JSBridge to realize two-way calling and communication between each other.

[0167] In the embodiments of the present application, Figure 6As shown, the way to set up JSBridge is: encapsulate the native interface corresponding to the second module (i.e., the native end) into a Flutter development code (dart) interface that can be recognized and called by the first module, encapsulate the dart interface of the first module into a native interface, and configure the corresponding transmission protocol. In this way, the second module can receive information from the first module through the native interface obtained after encapsulation; the first module can also receive information from the second module through the dart interface obtained after encapsulation, thereby realizing cross-platform communication between the first module corresponding to the Flutter Web end and the second module corresponding to the native end.

[0168] After the first module sends the call information to the second module, the second module can determine the corresponding call interface address based on the call interface identifier in the call information, and call the corresponding target native function on the native platform according to the call interface address, thereby obtaining the corresponding call response.

[0169] Step S503: Based on the transmission protocol, a call response is received from the second module, and based on the call response, a call result of the target native function is obtained.

[0170] After the first module receives the call response from the second module, it can obtain the call result of the target native function according to the content in the call response. Furthermore, the first module can also display the corresponding result to the user in the operation page corresponding to the first module based on the call result. For example, assuming that the instruction to call the target native function triggered by the user in the operation page corresponding to the first module is to turn on Bluetooth, then after the first module completes the two-way communication with the second module, the first module can display the image corresponding to the Bluetooth on mode in the operation page according to the call response returned by the second module, thereby completing the response to the instruction triggered by the user.

[0171] In the solution provided in the embodiment of the present application, cross-platform communication between the first module and the second module is realized through a preset transmission protocol, which solves the first problem of Flutter Web calling the target native function, that is, the communication between the Web end and the native end in the application. In this way, the first module can use the transmission protocol to send call information to the second module, and receive a returned call response from the second module, thereby realizing the call to the target native function, and further realizing full support for dynamic updates of Flutter modules.

[0172] In a possible embodiment, the call information obtained by the first module in response to the call operation for the target native function may also include: call parameters corresponding to the target native function determined based on the call operation. These call parameters may be the input parameters required when calling the target native function, or the parameters that need to be processed when calling the target native function. In this way, when calling the target native function, the first module will simultaneously transmit the call interface identifier and the call parameters to the second module, so that the second module can obtain the corresponding call interface address according to the call interface identifier, and can also call the target native function to process the corresponding call parameters, thereby obtaining the corresponding call response, in response to the call information from the first module.

[0173] The present application also provides a possible implementation method, that is, when the first module and the second module perform bidirectional transmission of call information and call response, the call information and the call response are marked at the same time to ensure that each call can obtain a correct response.

[0174] Specifically, when executing step S502, the above requirement for marking the call may be implemented by executing the following steps.

[0175] See also Fig. 7A , is a flow chart of a method for transmitting information provided in an embodiment of the present application, and the specific steps of the method are as follows:

[0176] Step S701: Generate a call operation identifier corresponding to the call operation, and associate the call operation identifier with the call information.

[0177] The calling operation is the calling operation for the target native function responded by the first module. At this time, before transmitting the calling information to the second module, the first module can generate a corresponding calling operation identifier for the calling operation, thereby uniquely identifying the calling operation.

[0178] Exemplarily, the generated call operation identifier may be implemented in the form of a digital identity document (ID) or other string identifiers, which is not limited in this application.

[0179] After generating the corresponding call operation identifier, the first module can associate the call operation identifier with the previously acquired call information. After obtaining the associated call information, the first module can perform the following operations:

[0180] Step S702: Send the calling operation identifier and the calling information associated with the calling operation identifier to the second module, so that the second module calls the target native function, obtains the corresponding calling response, and performs association processing on the calling operation identifier and the calling response.

[0181] After the above steps S701 and S702, the first module can complete the method of marking the calling operation when transmitting the calling information to the second module in one direction.

[0182] See also Figure 7B , is a schematic diagram of a method for transmitting information provided in an embodiment of the present application. Figure 7B As shown, Flutter Web (corresponding to Fig. 7A When the first module in the program sends a call message to the second module, it needs to go through JSbridge agreed upon in the preset transmission protocol. At this time, JSbridge will generate an ID corresponding to this call and bind the ID to the call information. In this way, the second module can receive the call information corresponding to the call operation.

[0183] After the second module completes the operations related to the calling operation identifier, the first module still needs to implement the following steps:

[0184] Step S703: Based on the calling operation identifier, receiving a subsequent calling response associated with the calling operation identifier.

[0185] After the second module returns a call response regarding the target native function to the first module, the first module can receive the call response associated with the call operation identifier based on the call operation identifier generated by itself, so as to ensure that the first module can accurately obtain the call response corresponding to the above-mentioned call operation from several possible responses.

[0186] In an embodiment of the present application, by using the above-mentioned method of generating a call operation tag for the call operation, both the call information and the call response are associated with the call operation identifier, which can ensure that the call operation can obtain an accurate call response among several possible responses, thereby improving the accuracy of the call target native function of the present solution and the feasibility of the present solution. Based on such a tagging method, in the process of implementing information transmission, the embodiment of the present application can adopt both a synchronous transmission method and an asynchronous transmission method, thereby improving the applicability and flexibility of the present solution while ensuring that the first module can correctly match the call and response of the response among several call operations and responses.

[0187] The present application also provides a possible implementation manner, that is, the second module includes a network view container, and the operating environment provided by the network view container is developed based on Flutter code.

[0188] Under this premise, when the first module executes step S502 and step S503, it can be implemented by performing the following operations:

[0189] See also Figure 8, is a flow chart of another method for transmitting information provided in an embodiment of the present application, and its specific operation steps are as follows:

[0190] Step S801: sending calling information to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address and the method channel provided by the network view container to obtain a corresponding calling response.

[0191] When the second module includes a network view container, when the first module sends information to the second module, it will directly send the corresponding call information to the network view container of the second module. Among them, the network view container is a container developed based on Flutter code. In this way, the cross-platform characteristics of Flutter are utilized, so that developers only need to develop once through Flutter code. After obtaining the corresponding network view container, the network view container can be embedded in the native application corresponding to different operating systems to achieve the effect of calling native functions. This greatly improves the development efficiency of applications and reduces the manpower and time costs required to develop applications.

[0192] Step S802: receiving a call response from the network view container in the second module.

[0193] Correspondingly, when the first module sends the call information directly to the network view container, it naturally receives the call response from the network view container of the second module.

[0194] In a possible implementation, when the first module sends the calling information to the network view container in the second module so that the network view container obtains the calling interface address based on the calling interface identifier, the following operations are specifically performed:

[0195] The calling information is sent to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier and the preset calling interface index.

[0196] The calling interface index is obtained by the network view container based on the annotation of the native function on the native platform in the Flutter code of the native application.

[0197] In the process of developing native applications, when developers use Flutter code to develop corresponding modules, they can annotate the native functions that may be called in the module with corresponding annotations. In this way, when the native application is running, it can automatically scan the various annotations in the Flutter code, and based on the annotations corresponding to each native function, generate an interface address index corresponding to the native function that will be called by the Flutter module in the entire native application (its existence form can be different, such as a map or a table, text, etc., which is not limited in this application), so that the second module in the subsequent native application can implement the call to the native function. Furthermore, when there is a new called native function in the updated function corresponding to the Flutter module that needs to be dynamically updated, the second module in the native application can also obtain the calling interface address corresponding to the native function according to the annotation of the new native function in the business code to be updated, and save it in the pre-generated interface address index for use in subsequent calls.

[0198] The above introduces the specific process of how to implement the calling target native function provided in the embodiment of the present application from the first module side, and the corresponding contribution of the second module side to the calling target native function is explained in the following content.

[0199] See also Fig. 9 , is a flow chart of another method for calling a target native function provided by an embodiment of the present application. The method is applied to the second module by executing Fig. 9 The method steps shown implement the application of the target native function. Specifically, the execution steps of the method are as follows:

[0200] Step S901: Based on a preset transmission protocol, receiving calling information from a first module.

[0201] Among them, the call information is obtained by the first module in response to the call operation triggered by the target native function embedded in the native platform. The specific process is not repeated here. The call information at least includes the call interface identifier corresponding to the target native function obtained by the first module from the configuration information. The transmission protocol is the above-mentioned protocol used to constrain the transmission method of function calls and responses between the first module and the second module.

[0202] Step S902: Obtain a corresponding calling interface address based on the calling interface identifier, and based on the calling interface address, call the target native function to obtain a corresponding calling response.

[0203] After receiving the call information from the first module, the second module will respond to the call information, obtain the corresponding call interface address according to the call interface identifier in the call information, and further call the target native function to obtain the corresponding call response.

[0204] In a possible embodiment, the call information from the first module also includes the call parameters corresponding to the target native function obtained by the first module based on the call operation. Then, when the second module executes step S902, it needs to specifically perform the following steps to achieve a response to the call information:

[0205] Based on the calling interface address and calling parameters, the target native function is called to process the calling parameters and obtain a corresponding calling response.

[0206] Specifically, after the second module obtains the corresponding calling interface address based on the calling interface identifier in the calling information, the second module can find the corresponding target native function based on the calling interface address; then, the second module inputs the calling parameters obtained from the calling information into the function corresponding to the target native function, so that the target native function processes the calling parameters to obtain a corresponding calling response.

[0207] The following will take the function of logging in with a third-party account in the login account interface mentioned above as an example to illustrate the above operation. When a user uses a third-party account to log in, the first module needs to call the third-party application and obtain the third-party account information corresponding to the user. At this time, the first module not only needs to provide the calling interface identifier corresponding to the native function of starting the third-party application, but also needs to provide the corresponding calling parameters, such as the user name or other related content of the request authorization. Therefore, the calling information includes the calling interface identifier and the related calling parameters.

[0208] After receiving the call information, the second module first determines the correct target native function and its corresponding calling interface based on the calling interface identifier, and then needs to input the calling parameters into the calling interface so that the functional function (or program, etc.) corresponding to the calling interface can process the calling parameters to obtain the third-party account information or token required by the user, so that the user can use the third-party account to log in to this application.

[0209] In this embodiment, the content included in the call information is expanded, so that this solution can not only achieve the effect of simply calling the native function, but also achieve the effect of calling the native function for further operation, thereby improving the applicability of this solution.

[0210] After obtaining the call response to the call operation through the above methods, the second module can also perform the following steps:

[0211] Step S903: Based on the transmission protocol, a call response is returned to the first module, so that the first module obtains a call result of the target native function based on the call response.

[0212] For this transmission protocol, since it stipulates the mutual communication between the first module and the second module, therefore, in the method of calling the target native function applied on the second module side, its construction method and content are the same as those described in the above-mentioned method of calling the target native function applied on the first module side. For details, please refer to the above description and will not be repeated here.

[0213] In a possible implementation, in order to ensure that an accurate call response matching the call operation can be obtained, the first module associates the call information with the call operation identifier of the call operation when transmitting the call information. Thus, after receiving such call information, the response operation that the second module needs to perform is as follows:

[0214] See also Fig.10 , is a flow chart of a method for a second module to respond to call information provided in an embodiment of the present application, and the specific steps of the method are as follows:

[0215] Step S1001: receiving a calling operation identifier and a calling interface identifier associated with the calling operation identifier; wherein the calling operation identifier corresponds to the calling operation.

[0216] At this time, after receiving the call operation identifier, the second module needs to save the call operation identifier for subsequent processing of the call response.

[0217] Step S1002: calling the target native function, obtaining a corresponding call response, and performing association processing on the call operation identifier and the call response.

[0218] After the second module completes calling the target native function and obtains the corresponding call response, the second module can use the call operation identifier it saves to associate the call operation identifier with the call response, thereby ensuring that the first module can obtain the correct call response.

[0219] Step S1003: Return a call response associated with the call operation identifier to the first module.

[0220] Through the above process, the second module can complete the response to the associated call information, so as to ensure that even if the first module receives multiple call responses at the same time, it can correctly distinguish the call operations corresponding to different responses. In this way, the applicability and reliability of the implementation of this solution are improved.

[0221] In another possible implementation, the second module includes a network view container, and the operating environment provided by the network view container is developed based on the Flutter code. Specifically, the network view container can adopt hybrid technology, create a shell by the flutter code, and fill the interior with a small browser kernel provided by the native application. In this implementation, the network view container is specifically used to handle the two-way communication between the second module and the first module, and the second module's call operation on the target native function in response to the call information from the first module. Among them, the specific implementation method of the network view container to complete the above tasks is as follows:

[0222] See also Fig.11A , is a flow chart of a method for calling a target native function through a network view container provided by an embodiment of the present application. In this method, the second module needs to complete the following operation steps:

[0223] Step S1101: Based on the calling interface address and the method channel provided by the network view container, the target native function is called to obtain a corresponding calling response.

[0224] See also Fig. 11B , which is a schematic diagram of calling a target native function through a network view container provided by an embodiment of the present application, such as Fig. 11B As shown, when the second module calls the target native function, it can call the target native function through the method channel provided by the network view container.

[0225] Step S1102: calling the network view container, and returning the obtained calling response to the first module.

[0226] Through the above two steps, the second module can use the network view container to achieve the purpose of calling the native function and communicating with the first module. The specific implementation form of the network view container, which plays an important role in this, will be introduced in the following content.

[0227] Exemplarily, the network view container mentioned above can be a network view (Webview) container, which is similar to a general browser and is used to run compiled web pages. Specifically, for the first module developed based on Flutter Web code provided in the embodiment of the present application, the Webview container can include a page component Flutter Webview for displaying page content and a communication component Webview Bridge for communicating with the first module and the native platform.

[0228] In this way, the web page generated by the code of the first module during execution can be displayed in the Flutter Webview component in the Webview container. When the web page triggers a call operation for the native application, the web page can send call information to the Webview Bridge component in the Webview container through a preset transmission protocol and receive the call response returned by it.

[0229] Moreover, the web view container is developed based on Flutter code, which means that the second module can use the method channel provided by Flutter to call the native functions in the native platform. Flutter is a cross-platform development framework, which means that with this feature, developers can only write code once to obtain a Webview container that can be applied to the native applications corresponding to each platform, which effectively improves the development efficiency of the application and avoids the ineffective waste of developers' energy.

[0230] In a possible implementation, through the network view container, the second module may also determine the calling interface address in the following manner: obtaining the calling interface address based on the calling interface identifier and a preset calling interface index.

[0231] The calling interface index is obtained by the network view container based on the annotation of the native function on the native platform in the Flutter code of the native application.

[0232] Specifically, the method of obtaining the calling interface index is the same as the embodiment in the first module side, which will not be repeated here, and only an API for Flutter to obtain data from native is used to illustrate. In the description of the API in the Flutter code, the first line is a comment, specifically:

[0233] @JSBridgeFunc(prefix: "YDFMemoryCzchePlatform.instance", type: 'memory.get')

[0234] In this way, when the code corresponding to the API is compiled, a Map will be automatically generated according to the above annotations and injected into the network view container for use when calling the target native function.

[0235] After obtaining the calling interface index, the network view container can save the calling interface index so that when the target native function needs to be called later, the corresponding calling interface address can be obtained according to the calling interface index.

[0236] The above introduces the specific implementation methods of the present solution from the first module side and the second module side respectively. In order to clarify the specific interaction operations between the first module side and the second module side, the following will take the interaction between the first module and the second module as the context, combined with the various possible implementation methods provided by the present application, to introduce the specific implementation steps of the method for calling the target native function provided by the embodiment of the present application.

[0237] See also Fig. 12A , is a flow chart of a method for calling a target native function provided by an embodiment of the present application, and the specific implementation steps of the method are as follows:

[0238] Step S1201: The first module obtains corresponding calling information in response to a calling operation triggered for a target native function embedded in the native platform, and the calling information includes at least: a calling interface identifier corresponding to the target native function obtained from the configuration information and a calling parameter corresponding to the target native function determined based on the calling operation.

[0239] Step S1202: The first module sends the above-mentioned calling information to the second module based on a preset transmission protocol; correspondingly, the second module receives the calling information from the first module based on the same transmission protocol.

[0240] Step S1203: The second module obtains the corresponding calling interface address based on the calling interface identifier and the preset calling interface index.

[0241] Step S1204: the second module calls the target native function based on the calling interface address and the calling parameters to process the calling parameters and obtain a corresponding calling response.

[0242] Step S1205: the second module sends a call response to the first module based on the transmission protocol; correspondingly, the first module receives the call response from the second module based on the same transmission protocol.

[0243] Step S1206: The first module obtains a call result of the target native function based on the received call response.

[0244] It should be noted that the specific implementation methods corresponding to the above steps S1201-S1206 can be found in the previous text and will not be repeated here.

[0245] In order to facilitate the understanding of the structural relationship between the various modules in the above method, the following will be combined Fig. 12B An example is given to illustrate the above method.

[0246] See also Fig. 12B , is a schematic diagram of a framework for calling a target native function provided by an embodiment of the present application. Fig. 12BIn the architecture shown, a native application runs on the native platform, which includes the Flutter Web client (corresponding to Fig. 12A The first module in) and the native end (corresponding to Fig. 12A The second module in the ); When the Flutter Web end is triggered to call the target native function, the Flutter Web end will send a call message to the Webview Bridge component in the Webview container included in the native end based on the preset transmission protocol (corresponding to Fig. 12B In process 1), the Webview Bridge component can obtain the call information through the native interface in JSBridge (corresponding to Fig. 12B Based on the calling information, the native function (Native function) in the native platform is called (corresponding to Fig. 12B After the native function completes the call, it will return the corresponding call response to the Webview Bridge component (corresponding to Fig. 12B In process 4), the Webview Bridge component returns the call response to the Flutter Web end (corresponding to Fig. 12B In process 5), the Flutter Web client can obtain the call response through the Dart interface in JSBridge (corresponding to Fig. 12B Process 6) in the above code completes the call of the native function from the Flutter Web end.

[0247] Through the above method, the first module calls the native function. However, when the first module needs to call multiple native functions in a short period of time, the above operation process is likely to cause a mismatch between the call and the response. Based on this, the embodiment of the present application also provides a method for marking transmission information. Fig.13 , is a flow chart of a method for marking transmission information provided in an embodiment of the present application. Specifically, the method steps are as follows:

[0248] Step S1301: After obtaining the call information corresponding to the call operation, the first module generates a call operation identifier corresponding to the call operation.

[0249] Step S1302: The first module associates the calling operation identifier with the calling information to obtain associated calling information.

[0250] Step S1303: the first module sends the call operation identifier and the associated call information to the second module based on the transmission protocol; correspondingly, the second module receives the call operation identifier and the associated call information.

[0251] At this point, the second module can continue to perform the operations in the above steps S1203-S1204, and after the execution is completed, continue to perform the following operations:

[0252] Step S1304: the second module performs association processing on the call operation identifier and the call response to obtain an associated call response.

[0253] Step S1305: the second module returns the associated call response to the first module; correspondingly, the first module receives the associated call response corresponding to the call operation identifier based on the call operation identifier.

[0254] Through the above method, the first module and the second module ensure that each call and response sent and returned can be correctly matched. Further, the effect of synchronous or asynchronous message sending can be achieved, which improves the applicability and flexibility of this solution.

[0255] For example, in combination with the above Fig. 12A and Fig.13 The corresponding method, the calling process and the response process provided in the embodiment of the present application can be respectively referred to Fig.14 and Fig.15 .

[0256] See also Fig.14 , is a schematic diagram of a calling process provided by an embodiment of the present application. Fig.14 As shown, FlutterWeb sends a call to JSbridge. At this time, the first module generates an ID for this call to receive a response; JSbridge sends the call carrying the ID to the Webview container, and the Webview container sends the call to the Webview Bridge component it includes. The Webview Bridge component saves the ID carried by the call, and determines the native function to be called through the API Map corresponding to the native function, and sends a call to it.

[0257] See also Fig.15 , is a schematic diagram of a response flow provided in an embodiment of the present application. Fig.15As shown, the native function sends a response to the Webview Bridge component, the Webview Bridge component associates the previously saved ID with the response, and then sends the associated response to the webview container, which feeds the response back to Flutter Web through JSbridge, so that Flutter Web completes the call to the native function.

[0258] Based on the same inventive concept, the present application embodiment also provides a device for calling a target native function, see Fig.16 , which is a structural diagram of a device for calling a target native function provided in an embodiment of the present application. The device can be the above-mentioned terminal or a chip or integrated circuit therein, etc. The device includes a module / unit / technical means for executing the method executed by the terminal in the above-mentioned method embodiment.

[0259] Exemplarily, the device 1600 is applied to a first module in a native application on a native platform, and includes:

[0260] The first processing unit 1601 is configured to obtain corresponding call information in response to a call operation triggered for a target native function embedded in the native platform, wherein the call information at least includes: a call interface identifier corresponding to the target native function obtained from the configuration information;

[0261] The first sending unit 1602 sends the calling information to the second module based on the preset transmission protocol, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response; wherein the transmission protocol is used to constrain the transmission method of the function call and response between the first module and the second module;

[0262] The first receiving unit 1603 receives a call response from the second module based on the transmission protocol, and obtains a call result of the target native function based on the call response.

[0263] In a possible implementation, the call information further includes: call parameters corresponding to the target native function obtained based on the call operation;

[0264] The first sending unit 1602 is used to send the calling information to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response, which is specifically used for:

[0265] The calling information is sent to the second module, so that the second module calls the target native function based on the calling interface address and the calling parameters to process the calling parameters and obtain a corresponding calling response.

[0266] In a possible implementation, the first sending unit 1602 is used to send the calling information to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response, specifically for:

[0267] Generate a call operation identifier corresponding to the call operation, and associate the call operation identifier with the call information;

[0268] Sending the calling operation identifier and the calling information associated with the calling operation identifier to the second module, so that the second module calls the target native function, obtains the corresponding calling response, and performs association processing on the calling operation identifier and the calling response;

[0269] When the first receiving unit 1603 is used to receive the call response, it is specifically used to:

[0270] Based on the call operation identifier, a call response associated with the call operation identifier is received.

[0271] In a possible implementation, the second module includes a network view container, and the operating environment provided by the network view container is developed based on the Flutter code;

[0272] The first sending unit 1602 is used to send the calling information to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain the corresponding calling response, which is specifically used for:

[0273] Sending call information to the network view container in the second module, so that the network view container obtains the call interface address based on the call interface identifier, and calls the target native function based on the call interface address and the method channel provided by the network view container to obtain a corresponding call response;

[0274] When the first receiving unit 1603 is used to receive the call response from the second module, it is specifically used to:

[0275] A call response is received from the web view container in the second module.

[0276] In a possible implementation manner, the first sending unit 1602 is used to send the calling information to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier, specifically for:

[0277] Sending the calling information to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier and the preset calling interface index; wherein,

[0278] The calling interface index is obtained by the network view container based on the annotation of the native functions on the native platform in the Flutter code of the native application.

[0279] Based on the same inventive concept, the present application embodiment also provides a device for calling a target native function, see Fig.17 , which is a structural diagram of another device for calling the target native function provided in an embodiment of the present application. The device can be the above-mentioned terminal or a chip or integrated circuit therein, etc. The device includes a module / unit / technical means for executing the method executed by the terminal in the above-mentioned method embodiment.

[0280] Exemplarily, the device 1700 is applied to a second module in a native application on a native platform, including:

[0281] The second receiving unit 1701 is used to receive call information from the first module based on a preset transmission protocol, where the call information is obtained by the first module in response to a call operation triggered for a target native function embedded in the native platform, and the call information at least includes: a call interface identifier corresponding to the target native function obtained from the configuration information; the transmission protocol is used to constrain the transmission method between the first module and the second module regarding function calls and responses;

[0282] The second processing unit 1702 is used to obtain a corresponding calling interface address based on the calling interface identifier, and to call the target native function based on the calling interface address to obtain a corresponding calling response;

[0283] The second sending unit 1703 is used to return a call response to the first module based on the transmission protocol, so that the first module obtains a call result of the target native function based on the call response.

[0284] In a possible implementation, the call information further includes: call parameters corresponding to the target native function obtained based on the call operation;

[0285] The second processing unit 1702 is used to call the target native function based on the calling interface address and obtain the corresponding calling response, specifically to:

[0286] Based on the calling interface address and calling parameters, the target native function is called to process the calling parameters and obtain a corresponding calling response.

[0287] In a possible implementation manner, when the second receiving unit 1701 is used to receive the calling interface identifier corresponding to the target native function, it is specifically used to:

[0288] receiving a call operation identifier and a call interface identifier associated with the call operation identifier; wherein the call operation identifier corresponds to the call operation;

[0289] The second processing unit 1702 is used to call the target native function, and when obtaining the corresponding call response, specifically to:

[0290] Call the target native function, obtain the corresponding call response, and associate the call operation identifier with the call response;

[0291] When the second sending unit 1703 is used to return the call response to the first module, it is specifically used to:

[0292] A call response associated with the call operation identifier is returned to the first module.

[0293] In a possible implementation, the second module includes a network view container, and the operating environment provided by the network view container is developed based on the Flutter code;

[0294] The second processing unit 1702 is used to call the target native function based on the calling interface address and obtain the corresponding calling response, specifically to:

[0295] Based on the calling interface address and the method channel provided by the network view container, call the target native function and obtain the corresponding call response;

[0296] When the second sending unit 1703 is used to return the call response to the first module, it is specifically used to:

[0297] The calling network view container returns a calling response to the first module.

[0298] In a possible implementation manner, when the second processing unit 1702 is configured to obtain the corresponding calling interface address based on the calling interface identifier, it is specifically configured to:

[0299] Based on the calling interface identifier and the preset calling interface index, obtaining the calling interface address;

[0300] The calling interface index is obtained by the network view container based on the annotation of the native function on the native platform in the Flutter code of the native application.

[0301] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0302] After introducing the method and apparatus for calling a target native function according to an exemplary embodiment of the present application, next, an electronic device according to another exemplary embodiment of the present application is introduced.

[0303] Those skilled in the art will appreciate that various aspects of the present application may be implemented as a system, method or program product. Therefore, various aspects of the present application may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to as "circuit", "module" or "system" herein.

[0304] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In one embodiment, the electronic device may be a server, such as Figure 1 In this embodiment, the structure of the electronic device is as follows: Fig.18 As shown, it may include at least a memory 1801 , a communication module 1803 , and at least one processor 1802 .

[0305] The memory 1801 is used to store computer programs executed by the processor 1802. The memory 1801 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and programs required for running the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0306] The memory 1801 may be a volatile memory, such as a random-access memory (RAM); the memory 1801 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); or the memory 1801 may be any other medium that can be used to carry or store a desired computer program in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 1801 may be a combination of the above memories.

[0307] The processor 1802 may include one or more central processing units (CPU) or a digital processing unit, etc. The processor 1802 is used to implement the above-mentioned item recommendation method when calling the computer program stored in the memory 1801 .

[0308] The communication module 1803 is used to communicate with terminal devices and other servers.

[0309] The specific connection medium between the memory 1801, the communication module 1803 and the processor 1802 is not limited in the embodiment of the present application. Fig.18 In the embodiment, the memory 1801 and the processor 1802 are connected via a bus 1804. The bus 1804 is connected to the processor 1802 via a bus 1804. Fig.18 The connections between the other components are only for illustration and are not intended to be limiting. The bus 1804 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Fig.18 The diagram shows that only one thick line is used, but this does not mean that there is only one bus or only one type of bus.

[0310] The memory 1801 stores a computer storage medium, and the computer storage medium stores computer executable instructions, and the computer executable instructions are used to implement the item recommendation method of the embodiment of the present application. The processor 1802 is used to execute the above-mentioned item recommendation method.

[0311] In another embodiment, the electronic device may also be other electronic devices, such as Figure 1 The terminal device 101 is shown in FIG. In this embodiment, the structure of the electronic device can be as follows: Fig.19 As shown, it includes: a communication component 1910, a memory 1920, a display unit 1930, a camera 1940, a sensor 1950, an audio circuit 1960, a Bluetooth module 1970, a processor 1980 and other components.

[0312] The communication component 1910 is used to communicate with the server. In some embodiments, a wireless fidelity (WiFi) module may be included. The WiFi module belongs to a short-range wireless transmission technology. The electronic device can help the object to send and receive information through the WiFi module.

[0313] The memory 1920 can be used to store software programs and data. The processor 1980 executes various functions and data processing of the terminal device 101 by running the software programs or data stored in the memory 1920. The memory 1920 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. The memory 1920 stores an operating system that enables the terminal device 1910 to run. In the present application, the memory 1920 can store an operating system and various application programs, and can also store a computer program for executing the item recommendation method of the embodiment of the present application.

[0314] The display unit 1930 can also be used to display information input by the object or information provided to the object and a graphical user interface (GUI) of various menus of the terminal device 101. Specifically, the display unit 1930 may include a display screen 1932 disposed on the front of the terminal device 1910. The display screen 1932 may be configured in the form of a liquid crystal display, a light emitting diode, etc. The display unit 1930 may be used to display the defect detection interface, the model training interface, etc. in the embodiment of the present application.

[0315] The display unit 1930 can also be used to receive input digital or character information, and generate signal input related to the object setting and function control of the terminal device 101. Specifically, the display unit 1930 may include a touch screen 1931 set on the front of the terminal device 101, which can collect touch operations of objects on or near it, such as clicking a button, dragging a scroll box, etc.

[0316] The touch screen 1931 can be covered on the display screen 1932, or the touch screen 1931 and the display screen 1932 can be integrated to realize the input and output functions of the physical terminal device 101. The integrated display screen can be referred to as a touch display screen. In this application, the display unit 1930 can display the application and the corresponding operation steps.

[0317] The camera 1940 can be used to capture static images, and the subject can publish the images taken by the camera 1940 through the application. The camera 1940 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 1980 to convert it into a digital image signal.

[0318] The physical terminal device may also include at least one sensor 1950, such as an acceleration sensor 1951, a distance sensor 1952, a fingerprint sensor 1953, and a temperature sensor 1954. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0319] The audio circuit 1960, the speaker 1961, and the microphone 1962 can provide an audio interface between the object and the terminal device 101. The audio circuit 1960 can transmit the electrical signal converted from the received audio data to the speaker 1961, which is converted into a sound signal for output. The physical terminal device 1910 can also be configured with a volume button for adjusting the volume of the sound signal. On the other hand, the microphone 1962 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1960 and converted into audio data, and then the audio data is output to the communication component 1910 to be sent to, for example, another physical terminal device 101, or the audio data is output to the memory 1920 for further processing.

[0320] The Bluetooth module 1970 is used to exchange information with other Bluetooth devices having Bluetooth modules through the Bluetooth protocol. For example, the physical terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 1920 to exchange data.

[0321] The processor 1980 is the control center of the physical terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. It executes various functions of the terminal device and processes data by running or executing software programs stored in the memory 1920 and calling data stored in the memory 1920. In some embodiments, the processor 1980 may include one or more processing units; the processor 1980 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1980. In the present application, the processor 1980 can run the operating system, application programs, user interface display and touch response, as well as the item recommendation method of the embodiment of the present application. In addition, the processor 1980 is coupled to the display unit 1930.

[0322] In some possible implementations, various aspects of the method for calling the target native function provided by the present application can also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the item recommendation method according to various exemplary embodiments of the present application described above in this specification.

[0323] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0324] The program product of the embodiment of the present application may adopt a portable compact disk read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium containing or storing a program, which can be used by or in combination with a command execution system, apparatus, or device.

[0325] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0326] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0327] The computer program for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and also conventional procedural programming languages ​​such as "C" language or similar programming languages. The computer program can be executed entirely on the user electronic device, partially on the user electronic device, as a separate software package, partially on the user electronic device and partially on a remote electronic device, or entirely on the remote electronic device. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).

[0328] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.

[0329] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.

[0330] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0331] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0332] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0333] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0334] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A method for calling a target native function, applied to a first module in a native application on a native platform, wherein the first module is developed based on a development framework page Flutter Web code, and the native application further includes a second module, It is characterized in that The method comprises: In response to a call operation triggered for a target native function embedded in the native platform, corresponding call information is obtained, wherein the call information at least includes: a call interface identifier corresponding to the target native function obtained from the configuration information; Based on a preset transmission protocol, the call information is sent to the second module, so that the second module obtains the corresponding call interface address based on the call interface identifier, and calls the target native function based on the call interface address to obtain a corresponding call response; wherein the transmission protocol is used to constrain the transmission method of function calls and responses between the first module and the second module; Based on the transmission protocol, the call response is received from the second module, and based on the call response, a call result of the target native function is obtained.

2. The method according to claim 1, It is characterized in that The call information also includes: call parameters corresponding to the target native function obtained based on the call operation; Then, the calling information is sent to the second module, so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain a corresponding calling response, including: The calling information is sent to the second module, so that the second module calls the target native function based on the calling interface address and the calling parameters to process the calling parameters and obtain a corresponding calling response.

3. The method according to claim 1, It is characterized in that The sending the calling information to the second module so that the second module obtains a corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain a corresponding calling response, including: generating a call operation identifier corresponding to the call operation, and associating the call operation identifier with the call information; Sending the calling operation identifier and the calling information associated with the calling operation identifier to the second module, so that the second module calls the target native function, obtains a corresponding calling response, and performs association processing on the calling operation identifier and the calling response; Then the receiving the call response includes: Based on the calling operation identifier, a calling response associated with the calling operation identifier is received.

4. The method according to any one of claims 1 to 3, It is characterized in that The second module includes a network view container, and the operating environment provided by the network view container is developed based on Flutter code; Then, sending the calling information to the second module so that the second module obtains the corresponding calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address to obtain a corresponding calling response, including: Sending the calling information to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier, and calls the target native function based on the calling interface address and the method channel provided by the network view container to obtain a corresponding calling response; Then the receiving the call response from the second module includes: The call response is received from the web view container in the second module.

5. The method according to claim 4, It is characterized in that The sending the calling information to the network view container in the second module so that the network view container obtains the calling interface address based on the calling interface identifier includes: Sending the calling information to the network view container in the second module, so that the network view container obtains the calling interface address based on the calling interface identifier and the preset calling interface index; wherein, The calling interface index is obtained by the network view container based on the annotation of the native function on the native platform in the Flutter code of the native application.

6. A method for calling a target native function, applied to a second module in a native application on a native platform, wherein the second module is developed based on native code, and the native application includes a method developed based on Flutter Web code. It is characterized in that The method further comprises: Based on a preset transmission protocol, receiving call information from the first module, the call information is obtained by the first module in response to a call operation triggered for a target native function embedded in the native platform, the call information at least including: a call interface identifier corresponding to the target native function obtained from configuration information; the transmission protocol is used to constrain the transmission method of function calls and responses between the first module and the second module; Obtaining a corresponding calling interface address based on the calling interface identifier, and calling the target native function based on the calling interface address to obtain a corresponding calling response; Based on the transmission protocol, the call response is returned to the first module, so that the first module obtains the call result of the target native function based on the call response.

7. The method according to claim 6, It is characterized in that The call information also includes: call parameters corresponding to the target native function obtained based on the call operation; Then, based on the calling interface address, calling the target native function and obtaining a corresponding calling response includes: Based on the calling interface address and the calling parameters, the target native function is called to process the calling parameters to obtain a corresponding calling response.

8. The method according to claim 6, It is characterized in that The receiving target native function corresponding to the calling interface identifier includes: Receiving the calling operation identifier and the calling interface identifier associated with the calling operation identifier; wherein the calling operation identifier corresponds to the calling operation; Then, calling the target native function and obtaining a corresponding call response includes: Calling the target native function, obtaining a corresponding call response, and performing association processing on the call operation identifier and the call response; Then, returning the call response to the first module includes: Return a call response associated with the call operation identifier to the first module.

9. The method according to any one of claims 6 to 8, It is characterized in that The second module includes a network view container, and the operating environment provided by the network view container is developed based on Flutter code; Then, based on the calling interface address, calling the target native function and obtaining a corresponding calling response includes: Based on the calling interface address and the method channel provided by the network view container, calling the target native function to obtain a corresponding calling response; Then, returning the call response to the first module includes: The network view container is called to return the call response to the first module.

10. The method according to claim 9, It is characterized in that The obtaining a corresponding calling interface address based on the calling interface identifier includes: Based on the calling interface identifier and a preset calling interface index, obtaining the calling interface address; The calling interface index is obtained by the network view container based on the annotation of the native function on the native platform in the Flutter code of the native application.

11. A device for calling a target native function, applied to a first module in a native application on a native platform, wherein the first module is developed based on a development framework page Flutter Web code, and the native application further includes a second module, It is characterized in that The device comprises: A first processing unit, configured to obtain corresponding call information in response to a call operation triggered for a target native function embedded in the native platform, wherein the call information at least includes: a call interface identifier corresponding to the target native function obtained from the configuration information; A first sending unit is used to send the call information to the second module based on a preset transmission protocol, so that the second module obtains the corresponding call interface address based on the call interface identifier, and calls the target native function based on the call interface address to obtain a corresponding call response; wherein the transmission protocol is used to constrain the transmission method of function calls and responses between the first module and the second module; The first receiving unit is used to receive the call response from the second module based on the transmission protocol, and obtain the call result of the target native function based on the call response.

12. A device for calling a target native function, applied to a second module in a native application on a native platform, wherein the second module is developed based on native code, and the native application includes a device developed based on Flutter Web code. It is characterized in that The device comprises: a second receiving unit, configured to receive call information from the first module based on a preset transmission protocol, wherein the call information is obtained by the first module in response to a call operation triggered for a target native function embedded in the native platform, and the call information at least includes: a call interface identifier corresponding to the target native function obtained from configuration information; and the transmission protocol is used to constrain a transmission method for function calls and responses between the first module and the second module; A second processing unit is used to obtain a corresponding calling interface address based on the calling interface identifier, and based on the calling interface address, call the target native function to obtain a corresponding calling response; The second sending unit is used to return the call response to the first module based on the transmission protocol, so that the first module obtains the call result of the target native function based on the call response.

13. An electronic device, It is characterized in that The electronic device comprises: a memory and a processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to implement the steps of any method described in claims 1-5 or claims 6-10.

14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 5 or claims 6 to 10 are implemented.

15. A computer program product, It is characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method described in any one of claims 1 to 5 or claims 6 to 10.