Interaction method and device, equipment and storage medium

By parsing and passing in interactive templates to call business methods, it solves the timeliness problem when updating the interactive capabilities of mobile applications and H5 pages, realizes dynamic and customizable interactions, and improves the flexibility and development efficiency of interactive capabilities.

CN118796186APending Publication Date: 2024-10-18BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410870673.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

When updating the interactive capabilities of mobile applications and H5 pages, the existing technology has low timeliness and insufficient dynamics. The expansion of interactive capabilities relies on development and is complex to implement, affecting performance.

Method used

By responding to the target protocol call request of the H5 page, parsing the protocol identifier to obtain configuration data, and passing in the interaction template to call the business method, the dynamic and customizable interaction between the target application and the H5 page is realized, avoiding the release of a new version of the target application, and utilizing the interaction The template implements universal invocation of all business methods.

Benefits of technology

It improves the flexibility and scalability of interactive capabilities, realizes rapid and efficient updates of interactive capabilities, reduces development dependencies, and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796186A_ABST
    Figure CN118796186A_ABST
Patent Text Reader

Abstract

The invention provides an interaction method and device, equipment and a storage medium, and relates to the field of computers, in particular to the technical fields of mobile application development, Internet, data processing and the like. The interaction method comprises the following steps: in response to a call request of an H5 page for a target protocol, analyzing the call request to obtain a protocol identifier and an input parameter value of the target protocol; obtaining configuration data contained in the target protocol based on the protocol identifier, wherein the configuration data comprises a method identifier, an entry parameter and a return parameter of a service method in the target application; transmitting the configuration data and the input parameter value into an interaction template, calling a service method through the interaction template, and obtaining a return parameter value corresponding to a return parameter obtained by executing the service method; and transmitting the return parameter value to the H5 page. According to the method and the device, the dynamic and customizable interaction between the H5 page and the target application can be realized, the interaction capability expansion does not depend on development, the timeliness is better, and the development efficiency can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical fields of mobile application development, the Internet, data processing, etc. in the computer field, and in particular to an interaction method, device, equipment, and storage medium. Background Art

[0002] In mobile application development, by embedding the fifth generation Hypertext Markup Language 5 (H5) page in the mobile application, based on the interaction between the mobile application and the H5 page, some dynamic content or activity pages can be quickly launched online, avoiding frequent updates of the mobile application version.

[0003] Currently, two-way interaction between H5 pages and native codes of mobile applications is usually achieved through JSBridge. However, when the interaction capabilities of mobile applications and H5 pages are updated, the above interaction solution has the problem of low timeliness. Summary of the invention

[0004] The present disclosure provides an interaction method, apparatus, device and storage medium for improving timeliness when the interaction capabilities of mobile applications and H5 pages are updated.

[0005] According to a first aspect of the present disclosure, there is provided an interaction method, comprising:

[0006] Respond to the call request of the H5 page to the target protocol, parse the call request to obtain the protocol identifier and input parameter value of the target protocol;

[0007] Acquire configuration data included in the target protocol based on the protocol identifier, wherein the configuration data includes a method identifier, input parameters, and return parameters of a business method in the target application;

[0008] Passing the configuration data and the input parameter value into the interaction template, so as to call the business method through the interaction template, and obtain a return parameter value corresponding to the return parameter obtained by executing the business method;

[0009] The return parameter value is passed to the H5 page.

[0010] According to a second aspect of the present disclosure, there is provided an interaction device, comprising:

[0011] A parsing unit, used to respond to a call request of the H5 page to the target protocol, and parse the call request to obtain a protocol identifier and an input parameter value of the target protocol;

[0012] An acquisition unit, configured to acquire configuration data contained in the target protocol based on the protocol identifier, wherein the configuration data includes a method identifier, input parameters, and return parameters of a business method in a target application;

[0013] A processing unit, configured to pass the configuration data and the input parameter value into an interaction template, so as to call the business method through the interaction template and obtain a return parameter value corresponding to the return parameter obtained by executing the business method;

[0014] A transmitting unit is used to transmit the return parameter value to the H5 page.

[0015] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the interaction method described in the first aspect.

[0016] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the interaction method described in the first aspect.

[0017] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising: a computer program, wherein the computer program is stored in a readable storage medium, and at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the interaction method described in the first aspect.

[0018] The technology disclosed in the present invention solves the problem of low timeliness when the interactive capabilities of mobile applications and H5 pages are updated. By responding to the call request of the H5 page to the target protocol, the configuration data contained in the target protocol is obtained based on the protocol identifier obtained by parsing the call request. The configuration data includes the method identifier, input parameters and return parameters of the business method in the target application, that is, the configuration data corresponds to the business method in the target application, so that the interactive capabilities corresponding to the business method between the target application and the H5 page are configurable. When the interactive capabilities of the target application and the H5 page are updated, by updating the configuration data corresponding to the interactive capabilities, the new interactive capabilities can be launched more quickly and efficiently, and the interaction between the H5 page and the target application can be made dynamic and customizable, so that more interactive capabilities can be provided to the H5 page without releasing a new version for the target application, that is, the interactive capability expansion does not depend on development, has better timeliness, and can greatly improve development efficiency; the configuration data and input parameter values ​​are passed into the interactive template to call the business method through the interactive template to obtain the return parameter value corresponding to the return parameter obtained by executing the business method. By using interaction templates, you can achieve universal calling capabilities for all business methods of the target application, which can further improve development efficiency while ensuring accurate calling of business methods.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0021] Figure 1 is a schematic diagram of an application scenario to which the interactive method disclosed herein is applicable;

[0022] Figure 2 is a schematic diagram according to a first embodiment of the present disclosure;

[0023] Figure 3 is a schematic diagram according to a second embodiment of the present disclosure;

[0024] Figure 4 is a schematic diagram according to a third embodiment of the present disclosure;

[0025] Figure 5 is a schematic diagram according to a fourth embodiment of the present disclosure;

[0026] Figure 6 is a schematic diagram according to a fifth embodiment of the present disclosure;

[0027] Figure 7 is a schematic diagram according to a sixth embodiment of the present disclosure;

[0028] Figure 8 FIG. 8 is a schematic block diagram of an example electronic device 800 that may be used to implement embodiments of the present disclosure. DETAILED DESCRIPTION

[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0030] The present disclosure provides an interactive method, device, equipment and storage medium, which are applied to the technical fields of mobile application development, Internet and data processing in the computer field, so as to achieve the purpose of improving the timeliness when the interactive capabilities of mobile applications and H5 pages are updated.

[0031] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0032] In mobile application development, it is very common to open H5 pages in mobile applications. By embedding H5 pages in mobile applications, some dynamic content or activity pages can be quickly launched based on the interaction between mobile applications and H5 pages, avoiding frequent updates of mobile application versions. For example, based on the interaction between mobile applications and H5 pages, system functions (such as cameras, geographic locations, or push notifications, etc.) and business functions of mobile applications can be called in H5 pages, enhancing the interactive capabilities of H5 pages, which means that interactive capabilities are particularly important.

[0033] Currently, two-way interaction between H5 pages and native codes of mobile applications is usually achieved through JSBridge (a technology for communication between scripting language JavaScript and native applications). However, when the interaction capabilities of mobile applications and H5 pages are updated, it is necessary to modify the native code of the mobile application and release a new version to support the updated interaction capabilities. Therefore, the above interaction scheme has the problems of low timeliness, insufficient dynamics, and strong dependence on development for the expansion of interaction capabilities. In addition, the implementation of the above interaction scheme is relatively complex, involving two-way calls and message processing between JavaScript and native code. Frequent interaction between JavaScript and native code may affect performance.

[0034] In a related art, mobile applications for iOS (a mobile operating system) can interact with H5 pages through a custom URL Scheme. For example, an H5 page can trigger certain functions in a mobile application through a specific URL Scheme. However, the length of the URL is limited, which is not suitable for transmitting large amounts of data, and can only communicate in one direction, mainly used to call the business functions of native mobile applications from the H5 page, and reverse communication is not easy to handle.

[0035] In another related technology, mobile applications and H5 pages can interact by using an intermediary service such as an intermediate server or message queue. For example, the H5 page sends a request to the server, and the server notifies the mobile application. However, this related method is usually applied to more complex scenarios and is not suitable for real-time communication. It is usually used to store and read persistent data. It may also be necessary to deal with data synchronization issues to ensure the consistency of data in the two environments.

[0036] In another related technology, data can be shared between mobile applications and H5 pages through local storage, where local storage includes, for example, NSUserDefault (a class for storing user preferences and configuration information of applications) or local files. However, network communication will introduce delays and is not suitable for scenarios with high real-time requirements; implementation and maintenance are relatively complex and require server-side support and management; it depends on the network environment and the stability of the server and may be affected by network fluctuations.

[0037] In summary, the above related technologies basically have the problems of insufficient dynamics, low timeliness, and strong reliance on development for communication capability expansion. Therefore, a smarter and more convenient interaction method is needed to dynamically provide interaction capabilities to improve the flexibility and scalability of interaction capabilities.

[0038] In order to solve the above problems, the present disclosure can realize the dynamic and customizable interaction between the H5 page and the target application by updating the configuration data corresponding to the interaction capability in the configuration center when the interaction capability between the target application and the H5 page is updated, without releasing a new version for the target application, that is, the expansion of the interaction capability does not depend on development, has better timeliness, and can greatly improve development efficiency. By calling the business methods of the target application through the interaction template, the universal calling capability of all business methods of the target application can be realized, which can further improve development efficiency on the basis of ensuring accurate calling of business methods.

[0039] Figure 1 Schematic diagram of an application scenario to which the interactive method of the present disclosure is applicable. In the application scenario, the user uses the client ( Figure 1In the example of FIG. 101, the target application is accessed by the mobile phone 101, and the H5 page is embedded in the target application. The mobile phone 101 responds to the call request of the H5 page to the target protocol, obtains the configuration data contained in the target protocol based on the protocol identifier of the target protocol, calls the business method of the target application based on the configuration data and the input parameter value in the call request, and passes the return parameter value obtained by executing the business method through the server 102 to the H5 page. Among them, the configuration data is obtained by the target application from the configuration platform on the server 103.

[0040] It should be noted that Figure 1 This is only a schematic diagram of an application scenario provided by the embodiment of the present disclosure. Figure 1 The types and number of devices included in the configuration are limited.

[0041] The following specific embodiments are used to describe in detail the technical solution of the present invention and how the technical solution of the present invention solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.

[0042] Figure 2 is a schematic diagram according to the first embodiment of the present disclosure. The interaction method provided in the first embodiment of the present disclosure can be applied to an electronic device, which can be Figure 1 The client shown. Figure 2 As shown, the interaction method provided by the first embodiment of the present disclosure includes:

[0043] S201. Respond to the call request of the H5 page to the target protocol, parse the call request to obtain the protocol identifier and input parameter value of the target protocol.

[0044] In the disclosed embodiment, the target protocol is obtained by converting the business method of the target application corresponding to the target protocol, and the target protocol corresponds to the business method of the target application one-to-one. The protocol identifier of the target protocol is used to uniquely identify the target protocol. The H5 page calls the target protocol, which can be understood as the H5 page calling the business method or business capability corresponding to the target protocol, and the parameter value is the parameter value corresponding to the parameter of the business method corresponding to the target protocol. In this step, in response to the H5 page's call request for the target protocol, the call request can be parsed to obtain the protocol identifier and input parameter value of the target protocol.

[0045] S202: Acquire configuration data included in the target protocol based on the protocol identifier, where the configuration data includes a method identifier, input parameters, and return parameters of a business method in the target application.

[0046] It is understandable that since the release of client (such as mobile client) applications is periodic, it is impossible to perform real-time operations on the native code of online applications, resulting in the lack of real-time and inability to modify the interaction between the original application and the H5 page. At the same time, there may be a large number of no longer used interactive capabilities between the application and the H5 page that cannot be taken offline, and there are code redundancy issues. In order to solve the above problems, the embodiments of the present disclosure solve the above problems by updating (such as adding, modifying or deleting) the configuration data contained in the protocol, which can dynamically expand the interactive capabilities between the application and the H5 page, realize the real-time online and dynamic update of the interactive capabilities, so that the application can provide the business capabilities corresponding to the interactive capabilities required by the H5 page.

[0047] Exemplarily, the configuration data is data corresponding to the business method of the target application generated by a script according to preset rules, and the target application can locally cache different configuration data contained in different protocols. For specific information on how to generate configuration data, please refer to the subsequent embodiments. In this step, after obtaining the protocol identifier and input parameter value of the target protocol, the configuration data cached locally by the target application can be queried according to the protocol identifier of the target protocol, so that the configuration data contained in the target protocol can be obtained. The configuration data includes the method identifier, input parameters and return parameters of the business method in the target application. Among them, the configuration data cached locally by the target application is, for example, the latest configuration data obtained from the configuration platform when the target application is started. For specific information on how to obtain the configuration data, please refer to the subsequent embodiments.

[0048] S203: Pass the configuration data and input parameter values ​​into the interaction template, so as to call the business method through the interaction template and obtain the return parameter value corresponding to the return parameter obtained by executing the business method.

[0049] It is understandable that if the application needs to provide new interactive capabilities to the H5 page, the developer needs to develop encapsulation and expose the corresponding business methods, which lacks timeliness and has poor scalability. Considering the dynamic characteristics of Objective-C (an object-oriented programming language) and referring to the programming thinking mode of aspect-oriented programming (AOP), the message passing mechanism and method signature mechanism can be used when the application is in the runtime state to realize the call of the dynamic business method of the application by encapsulating and managing all the details of message passing, and finally achieve the purpose of full method coverage and callability. Among them, the message passing mechanism and method signature mechanism are provided by NSInvocation (a class of IOS message passing and method calling) of the iOS system (a mobile operating system). The main working principle of NSInvocation includes the following five steps: 1. Get the method signature; 2. Set the target class and the business method to be called; 3. Set parameters, where the parameters can be set dynamically as the input parameters of the business method; 4. Execute the business method call and pass all parameters to the business method; 5. Get the return parameter value of the business method, that is, get the return parameter value of the business method after the business method is executed.

[0050] After achieving the feasibility of calling all methods of iOS business, it is necessary to realize the general calling capability of all methods. Therefore, a general interaction template can be designed based on the working principle of NSInvocation, and the combination of generating called objects, obtaining calling methods, parsing input parameters, and returning parameters can be realized through the interaction template. Figure 3 is a schematic diagram according to the second embodiment of the present disclosure. Figure 3 As shown, the client application provided by the second embodiment of the present disclosure has an H5 page embedded in the client application. For the call request of the H5 page to the target protocol, the call to the corresponding business capability of the client application can be implemented through the interaction template, thereby obtaining new interaction capabilities.

[0051] In this step, after obtaining the configuration data contained in the target protocol, the configuration data and the input parameter value can be passed into the interaction template to call the business method through the interaction template to obtain the return parameter value corresponding to the return parameter obtained by executing the business method. For specific information on how to call the business method through the interaction template and obtain the return parameter value corresponding to the return parameter obtained by executing the business method, please refer to the subsequent embodiments.

[0052] S204: passing the return parameter value to the H5 page.

[0053] In this step, after obtaining the return parameter value corresponding to the return parameter of the business method in the target application, the return parameter value is passed to the H5 page to complete the interaction with the target application.

[0054] In the disclosed embodiment, by responding to the call request of the H5 page to the target protocol, the configuration data contained in the target protocol is obtained based on the protocol identifier obtained by parsing the call request, and the configuration data includes the method identifier, input parameter and return parameter of the business method in the target application, that is, the configuration data corresponds to the business method in the target application, so that the interaction capability corresponding to the business method between the target application and the H5 page is configurable. When the interaction capability of the target application and the H5 page is updated, by updating the configuration data corresponding to the interaction capability, the new interaction capability can be launched more quickly and efficiently, and the interaction between the H5 page and the target application can be dynamic and customizable, so that more interaction capabilities can be provided to the H5 page without releasing a new version for the target application, that is, the interaction capability expansion does not depend on development, has better timeliness, and can greatly improve development efficiency; the configuration data and input parameter values ​​are passed into the interaction template to call the business method through the interaction template to obtain the return parameter value corresponding to the return parameter obtained by executing the business method. By using the interaction template, the universal calling capability of all business methods of the target application can be realized, and the development efficiency can be further improved on the basis of ensuring accurate calling of the business method.

[0055] Based on the above embodiments, Figure 4 is a schematic diagram according to the third embodiment of the present disclosure. Figure 4 As shown, the method for generating configuration data provided by the third embodiment of the present disclosure includes:

[0056] S401. Obtain a business method.

[0057] For example, first, developers can find the corresponding business methods in the target application according to the interaction capabilities required by the business. The information of the business method includes, for example, the called instance object, the called method name, the called method input parameters, the return type and the return parameter value, etc. The business method is, for example, the business method applied in the following iOS system:

[0058] (void)sendWithUK:(NSSString*)uk

[0059] nickName:(NSSString*)nickName

[0060] avatarurl:(NSSString*)avatarurl

[0061] rickTextMag:(NSDictionary*)rickTextMag

[0062] confirmAlert:(BOOL)confirmAlert;

[0063] Among them, sendWithUK, nickName, avatarurl, rickTextMag and confirmAlert are all method names, and (NSSString*)uk, (NSSString*)nickname, (NSSString*)avatarurl, (NSDictionary*)rickTextMag and (BOOL)confirmAlert are all input parameters.

[0064] In the disclosed embodiment, steps S401 to S403 are automatically executed by a script, for example. The business method is input into the script, and accordingly, the script can obtain the business method and continue to execute step S402.

[0065] S402: Parse the business method to obtain the method name, input parameters, and return parameters of the business method.

[0066] In this step, for example, by parsing the business method through a script, the method name, input parameters, and return parameters of the business method can be obtained.

[0067] S403: Concatenate the method identifier, input parameters, and return parameters of the business method according to a preset protocol format to generate configuration data. The method identifier of the business method is obtained according to the method name of the business method.

[0068] Exemplarily, after obtaining the method name, input parameters and return parameters of the business method, the method identifier of the business method can be obtained according to the method name of the business method, and then the method identifier, input parameters and return parameters of the business method are spliced ​​according to the preset protocol format to generate configuration data. For example, based on the business method applied in the iOS system of the example of step S401, the following configuration data can be obtained:

[0069]

[0070] Among them, "test" is the protocol identifier of the protocol; "sendWithUK_nickName_avatarurl_rickTextMag_confirmAlert" is the method identifier of the business method, {"sendWithUK":"","nickName":"","avatarurl":"","rickTextMag":"","confirmAlert":""} is the input parameter, and the corresponding input parameter value can be obtained by parsing the call request of the H5 page to the target protocol; "returnParam" corresponds to the return parameter.

[0071] After generating the configuration data, the developer can configure the generated configuration data into the configuration platform, so that the client can obtain the configuration data from the configuration platform.

[0072] In the disclosed embodiments, configuration data corresponding to the business method can be automatically generated according to the business method, which facilitates configuration of the generated configuration data and improves development efficiency.

[0073] Based on the above embodiments, Figure 5 is a schematic diagram according to a fourth embodiment of the present disclosure, which is used to obtain configuration data before obtaining configuration data included in the target protocol based on the protocol identifier. Figure 5 As shown, the configuration data acquisition method provided by the fourth embodiment of the present disclosure includes:

[0074] S501. When a target application is started, configuration data is obtained from a configuration platform.

[0075] Exemplarily, after generating configuration data corresponding to a business method according to preset rules through a script, the generated configuration data may be configured into a configuration platform, so that when a target application is started, the target application may obtain the latest configuration data from the configuration platform.

[0076] S502: Determine whether the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application.

[0077] Exemplarily, the first version number of the configuration data obtained from the configuration platform can be compared with the second version number of the configuration data of the local target application to determine whether the first version number and the second version number are the same. If the first version number and the second version number are the same, it can be determined that the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application, and step S503 is executed; if the first version number and the second version number are not the same, it can be determined that the configuration data obtained from the configuration platform is inconsistent with the local configuration data of the target application, and step S504 is executed.

[0078] S503: Do not update the local configuration data of the target application.

[0079] S504: Update the local configuration data of the target application to the configuration data obtained from the configuration platform.

[0080] In this step, after determining that the configuration data obtained from the configuration platform is inconsistent with the local configuration data of the target application, the local configuration data of the target application can be updated to the configuration data obtained from the configuration platform. It can be understood that if it is determined that the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application, there is no need to update the local configuration data of the target application.

[0081] In the disclosed embodiment, by uniformly managing the configuration data corresponding to the business methods on the configuration platform, the interaction capabilities between the target application and the H5 page corresponding to the business methods are configurable. When the interaction capabilities between the target application and the H5 page are updated, the new interaction capabilities can be launched more quickly and efficiently by updating the configuration data corresponding to the interaction capabilities on the configuration platform, giving the H5 page more interaction capabilities without the need to release a new version for the target application, which has better timeliness and effectively improves development efficiency.

[0082] Based on the above embodiments, for the update of the local configuration data of the target application, in a possible implementation method, the embodiments of the present disclosure may also include: when the target application switches from the foreground to the background or from the background to the foreground, obtaining configuration data from the configuration platform, and determining whether the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application; if not, updating the local configuration data to the configuration data obtained from the configuration platform.

[0083] Exemplarily, when the target application switches from the foreground to the background, or when the target application switches from the background to the foreground, configuration data can be obtained from the configuration platform, and the third version number of the configuration data obtained from the configuration platform is compared with the fourth version number of the local configuration data of the target application to determine whether the third version number and the fourth version number are the same. If the third version number and the fourth version number are the same, it can be determined that the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application; if the third version number and the fourth version number are different, it can be determined that the configuration data obtained from the configuration platform is inconsistent with the local configuration data of the target application. If they are inconsistent, the local configuration data can be updated to the configuration data obtained from the configuration platform.

[0084] Regarding the updating of the local configuration data of the target application, in another possible implementation manner, the embodiment of the present disclosure may further include: obtaining updated configuration data pushed by the configuration platform; and updating the local configuration data of the target application to the updated configuration data.

[0085] For example, according to business demands, the developer configures the configuration data corresponding to the new interaction capability on the configuration platform, and the configuration platform can push the updated configuration data to the electronic device executing the embodiment of the present method. Accordingly, the electronic device executing the embodiment of the present method can obtain the updated configuration data pushed by the configuration platform, and update the local configuration data of the target application to the updated configuration data. Among them, the embodiment of the present disclosure does not limit the push method.

[0086] Based on the above embodiment, a business method is called through an interaction template to obtain a return parameter value corresponding to the return parameter obtained by executing the business method, including: obtaining the method signature corresponding to the business method, the target class to which the business method belongs, and the method name of the business method according to the method identifier of the business method; based on the target class, method name, input parameters, return parameters, and input parameter values, the business method is called through the method signature to obtain the return parameter value corresponding to the return parameter obtained by executing the business method.

[0087] Exemplarily, the interaction template is a general template obtained by encapsulating and managing all details of message transmission based on the working principle of NSInvocation. Specifically, when calling a business method through an interaction template, first, the interaction template can obtain the method signature corresponding to the business method, the target class to which the business method belongs, and the method name of the business method according to the method identifier of the business method. Thus, based on the target class, method name, input parameters, return parameters, and input parameter values, the business method is called through the method signature to obtain the return parameter value corresponding to the return parameter obtained by executing the business method.

[0088] Figure 6 FIG. 5 is a schematic diagram of a fifth embodiment of the present disclosure. Based on the above embodiments, the present disclosure further describes the interaction method. Figure 6 As shown, the interaction method provided by the fifth embodiment of the present disclosure includes:

[0089] S601. Respond to the call request of the H5 page to the target protocol, parse the call request to obtain the protocol identifier and input parameter value of the target protocol.

[0090] The implementation principle and technical effects of S601 may refer to the aforementioned embodiments and will not be described in detail here.

[0091] In the disclosed embodiment, Figure 2 The step S202 may further include the following two steps S602 and S603:

[0092] S602: Determine whether the target protocol is supported according to the protocol identifier.

[0093] Exemplarily, the target application locally caches configuration data of different protocols obtained from the configuration platform. Therefore, based on the protocol identifier of the target protocol, it is possible to query whether the protocol identifiers of the different protocols in the local cache contain the protocol identifier of the target protocol. If so, it can be determined that the target protocol is supported; if not, it can be determined that the target protocol is not supported.

[0094] S603: If the target protocol is supported, obtain configuration data included in the target protocol based on the protocol identifier.

[0095] In this step, if it is determined that the target protocol is supported, the configuration data included in the target protocol can be obtained based on the protocol identifier. For specific information on how to obtain the configuration data included in the target protocol based on the protocol identifier, please refer to the above embodiment and will not be repeated here.

[0096] Understandably, if the target protocol is not supported ( Figure 6 (not shown in the figure), corresponding processing can be performed, such as transmitting corresponding prompt information to the H5 page, etc. Accordingly, the developer can add corresponding configuration data to the configuration platform for the target protocol, so as to support the target protocol.

[0097] S604: Pass the configuration data and input parameter values ​​into the interaction template, so as to call the business method through the interaction template and obtain the return parameter value corresponding to the return parameter obtained by executing the business method.

[0098] The implementation principle and technical effects of S604 may refer to the aforementioned embodiments and will not be described in detail here.

[0099] In the disclosed embodiment, Figure 2 The step S204 may further include the following step S605:

[0100] S605: passing the return parameter value to the H5 page by returning the callback result.

[0101] It can be understood that the callback result format can be agreed upon in advance. After obtaining the return parameter value corresponding to the return parameter obtained by executing the business method, the return parameter value is passed to the H5 page in the agreed callback result format by returning the callback result.

[0102] In the disclosed embodiment, the configuration data corresponds to the business method in the target application, so that the interaction capability between the target application and the H5 page corresponding to the business method is configurable. When the interaction capability between the target application and the H5 page is updated, the new interaction capability can be launched more quickly and efficiently by updating the configuration data corresponding to the interaction capability without releasing a new version for the target application. That is, the interaction capability expansion does not depend on development, has better timeliness, and can greatly improve development efficiency. By calling the business method through the interaction template, the return parameter value corresponding to the return parameter obtained by executing the business method can be obtained, so that the universal calling capability of all business methods of the target application can be realized, which can further improve development efficiency on the basis of ensuring accurate calling of business methods.

[0103] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.

[0104] Figure 7is a schematic diagram according to the sixth embodiment of the present disclosure. Figure 7 As shown, the interactive device 700 provided in the sixth embodiment of the present disclosure includes: a parsing unit 701, an acquiring unit 702, a processing unit 703 and a transmitting unit 704. Among them:

[0105] The parsing unit 701 is used to respond to the call request of the H5 page to the target protocol, and parse the call request to obtain the protocol identifier and input parameter value of the target protocol.

[0106] The acquisition unit 702 is used to acquire the configuration data contained in the target protocol based on the protocol identifier, where the configuration data includes the method identifier, input parameters, and return parameters of the business method in the target application.

[0107] The processing unit 703 is used to pass the configuration data and the input parameter value into the interaction template, so as to call the business method through the interaction template and obtain the return parameter value corresponding to the return parameter obtained by executing the business method.

[0108] The transmission unit 704 is used to transmit the return parameter value to the H5 page.

[0109] In some embodiments, the interactive device 700 may also include a generation unit (not shown in the figure) for generating configuration data in the following manner: obtaining a business method; parsing the business method to obtain the method name, input parameters and return parameters of the business method; concatenating the method identifier, input parameters and return parameters of the business method according to a preset protocol format to generate configuration data, wherein the method identifier is obtained based on the method name of the business method.

[0110] In some embodiments, the acquisition unit 702 may include: a first determination module (not shown in the figure), used to determine whether the target protocol is supported according to the protocol identifier; a first configuration data acquisition module (not shown in the figure), used to obtain the configuration data contained in the target protocol based on the protocol identifier if the target protocol is supported.

[0111] In some embodiments, when the processing unit 703 is used to call a business method through an interaction template to obtain a return parameter value corresponding to the return parameter obtained by executing the business method, it may include: a business method information acquisition module (not shown in the figure), which is used to obtain the method signature corresponding to the business method, the target class to which the business method belongs, and the method name of the business method according to the method identifier of the business method; a calling module (not shown in the figure), which is used to call the business method through the method signature based on the target class, method name, input parameters, return parameters, and input parameter values, and obtain the return parameter value corresponding to the return parameter obtained by executing the business method.

[0112] In some embodiments, the acquisition unit 702 may also include: a second configuration data acquisition module (not shown in the figure), used to obtain configuration data from the configuration platform when the target application is started; a second determination module (not shown in the figure), used to determine whether the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application; and a first update module (not shown in the figure), used to update the local configuration data to the configuration data obtained from the configuration platform if they are inconsistent.

[0113] In some embodiments, the acquisition unit 702 may also include: a third configuration data acquisition module (not shown in the figure), which is used to obtain configuration data from the configuration platform when the target application switches from the foreground to the background or from the background to the foreground; a third determination module (not shown in the figure), which is used to determine whether the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application; and a second update module (not shown in the figure), which is used to update the local configuration data to the configuration data obtained from the configuration platform if they are inconsistent.

[0114] In some embodiments, the acquisition unit 702 may also include: a fourth configuration data acquisition module (not shown in the figure), used to obtain the updated configuration data pushed by the configuration platform; a third update module (not shown in the figure), used to update the local configuration data of the target application to the updated configuration data.

[0115] In some embodiments, the transfer unit 704 may include: a transfer module (not shown in the figure) for transferring the return parameter value to the H5 page by returning the callback result.

[0116] Figure 7 The provided interactive device can execute the steps in the method embodiment corresponding to the above-mentioned interactive method. Its implementation principle and technical effects are similar and will not be repeated here.

[0117] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the solution provided by any of the above embodiments.

[0118] According to an embodiment of the present disclosure, the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute a solution provided by any of the above embodiments.

[0119] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.

[0120] Figure 8 8 is a schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0121] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can store data stored in a read-only memory (ROM) ( Figure 8 A computer program in ROM 802 is loaded from storage unit 808 to random access memory (RAM) ( Figure 8 The computer programs in the RAM 803 are used to perform various appropriate actions and processes. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. The input / output (I / O) interface ( Figure 8 The I / O interface 805 is also connected to the bus 804 .

[0122] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0123] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as interactive methods. For example, in some embodiments, the interactive method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via the ROM 802 and / or the communication unit 809. When the computer program is loaded into the RAM 803 and executed by the computing unit 801, one or more steps of the interactive method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to execute the interaction method in any other appropriate manner (eg, by means of firmware).

[0124] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0125] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0126] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer 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 foregoing.

[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0128] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.

[0129] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0130] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0131] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, fusions, sub-fusions and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. An interactive method, comprising: Responding to a call request of a fifth generation hypertext markup language H5 page to a target protocol, parsing the call request to obtain a protocol identifier and input parameter value of the target protocol; Based on the protocol identifier, obtain configuration data included in the target protocol, where the configuration data includes a method identifier, input parameters, and return parameters of a business method in the target application; Passing the configuration data and the input parameter value into the interaction template, so as to call the business method through the interaction template, and obtain a return parameter value corresponding to the return parameter obtained by executing the business method; The return parameter value is passed to the H5 page.

2. The interactive method according to claim 1, wherein: The configuration data is generated in the following way: Obtaining the business method; Parse the business method to obtain the method name, input parameters and return parameters of the business method; The method identifier, input parameters and return parameters of the business method are spliced ​​according to a preset protocol format to generate the configuration data, wherein the method identifier is obtained according to the method name of the business method.

3. The interactive method according to claim 2, wherein: The acquiring the configuration data included in the target protocol based on the protocol identifier includes: Determining whether the target protocol is supported according to the protocol identifier; If the target protocol is supported, the configuration data included in the target protocol is obtained based on the protocol identifier.

4. The interactive method according to claim 1, wherein: The calling the business method through the interaction template to obtain a return parameter value corresponding to the return parameter obtained by executing the business method includes: According to the method identifier of the business method, obtain the method signature corresponding to the business method, the target class to which the business method belongs, and the method name of the business method; Based on the target class, the method name, the input parameters, the return parameters and the input parameter values, the business method is called through the method signature to obtain a return parameter value corresponding to the return parameter obtained by executing the business method.

5. The interactive method according to any one of claims 1 to 4, wherein: Before acquiring the configuration data included in the target protocol based on the protocol identifier, the method further includes: When the target application is started, obtaining configuration data from a configuration platform; Determining whether the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application; If they are inconsistent, the local configuration data is updated to the configuration data obtained from the configuration platform.

6. The interactive method according to any one of claims 1 to 4, wherein: Also includes: When the target application switches from the foreground to the background or from the background to the foreground, acquiring configuration data from the configuration platform; Determining whether the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application; If they are inconsistent, the local configuration data is updated to the configuration data obtained from the configuration platform.

7. The interactive method according to any one of claims 1 to 4, wherein: Also includes: Get the updated configuration data pushed by the configuration platform; The local configuration data of the target application is updated to the updated configuration data.

8. The interactive method according to any one of claims 1 to 4, wherein: The transferring the return parameter value to the H5 page includes: The return parameter value is passed to the H5 page by returning the callback result.

9. An interactive device, comprising: A parsing unit, used to respond to a call request of a fifth generation hypertext markup language H5 page to a target protocol, and parse the call request to obtain a protocol identifier and an input parameter value of the target protocol; An acquisition unit, configured to acquire configuration data contained in the target protocol based on the protocol identifier, wherein the configuration data includes a method identifier, input parameters, and return parameters of a business method in a target application; A processing unit, configured to pass the configuration data and the input parameter value into an interaction template, so as to call the business method through the interaction template and obtain a return parameter value corresponding to the return parameter obtained by executing the business method; A transmitting unit is used to transmit the return parameter value to the H5 page.

10. The interactive device according to claim 9, wherein: The interaction device further comprises a generating unit, which is used to generate configuration data in the following manner: Obtaining the business method; Parse the business method to obtain the method name, input parameters and return parameters of the business method; The method identifier, input parameters and return parameters of the business method are spliced ​​according to a preset protocol format to generate the configuration data, wherein the method identifier is obtained according to the method name of the business method.

11. The interactive device according to claim 10, wherein: The acquisition unit comprises: A first determination module, configured to determine whether the target protocol is supported according to the protocol identifier; The first configuration data acquisition module is configured to acquire the configuration data included in the target protocol based on the protocol identifier if the target protocol is supported.

12. The interactive device according to claim 9, wherein: The processing unit, when used to call the business method through the interaction template and obtain a return parameter value corresponding to the return parameter obtained by executing the business method, includes: A business method information acquisition module, used to acquire, according to the method identifier of the business method, the method signature corresponding to the business method, the target class to which the business method belongs, and the method name of the business method; A calling module is used to call the business method through the method signature based on the target class, the method name, the input parameter, the return parameter and the input parameter value, and obtain the return parameter value corresponding to the return parameter obtained by executing the business method.

13. The interactive device according to any one of claims 9 to 12, wherein: The acquisition unit further includes: A second configuration data acquisition module, used to acquire configuration data from a configuration platform when the target application is started; A second determination module, used to determine whether the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application; The first updating module is used to update the local configuration data to the configuration data obtained from the configuration platform if there is inconsistency.

14. The interactive device according to any one of claims 9 to 12, wherein: The acquisition unit further includes: A third configuration data acquisition module, configured to acquire configuration data from a configuration platform when the target application switches from the foreground to the background or from the background to the foreground; A third determination module, used to determine whether the configuration data obtained from the configuration platform is consistent with the local configuration data of the target application; The second updating module is used to update the local configuration data to the configuration data obtained from the configuration platform if there is inconsistency.

15. The interactive device according to any one of claims 9 to 12, wherein: The acquisition unit further includes: A fourth configuration data acquisition module is used to acquire updated configuration data pushed by the configuration platform; The third updating module is used to update the local configuration data of the target application to the updated configuration data.

16. The interactive device according to any one of claims 9 to 12, wherein: The transmission unit comprises: The transfer module is used to transfer the return parameter value to the H5 page by returning the callback result.

17. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the interaction method according to any one of claims 1 to 8.

18. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the interactive method according to any one of claims 1 to 8.

19. A computer program product, comprising a computer program, which implements the steps of the interaction method according to any one of claims 1 to 8 when executed by a processor.