Client and front end interaction method and device, electronic equipment and storage medium
By determining the calling status of the client method on the front end and calling it when it is callable, the problems of high cost of communication bridge interaction development and interaction failure in the prior art are solved, and more efficient and stable client and front-end interaction are achieved. .
Patent Information
- Application Number
- CN202311048939.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2025-02-21
AI Technical Summary
In the prior art, using communication bridges to interact with clients and front-ends has the risk of high development costs and interaction failures, especially when there is no need to inject communication bridge code into the client and perform additional specialization processing.
When entering a call request for calling the client method on the front end, determine the calling status of the client method requested, and initiate a call request to the client when it is in the callable state, call and execute the client method, and obtain the target Respond to the result and return to the front end.
It realizes the reduction of development and maintenance costs without specializing the client's code, and improves the smoothness of interaction between the client and the front-end.
Smart Images

Figure CN119493674A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present disclosure relate to computer technology, and more particularly to a method, device, electronic device and storage medium for interaction between a client and a front end. Background Art
[0002] At present, the interactive communication bridge between the client and the front end mainly relies on the communication bridge (JsBridge). In the related art, among the methods of using the communication bridge for the interaction between the client and the front end, one is to inject JsBridge into the front end to ensure that the front end calls the JSBridge method after the JSBridge initialization is completed, but this method requires version compatibility, and the other is to inject JSBridge into the client, and the implementation and interface exposure of the JSBridge method are all implemented by the client. Although no additional version compatibility is required, the client code needs to be additionally specialized. Otherwise, it is easy for the front end to fail to call the JSBridge method, resulting in the failure of the communication interaction between the front end and the client. Therefore, the use of the communication bridge for the interaction between the front end and the client in the related art has the technical problems of high development cost and easy interaction failure. Summary of the invention
[0003] The present disclosure provides a method, device, electronic device and storage medium for interaction between a client and a front end, so as to realize interaction between the client and the front end without injecting communication bridge code into the client and performing additional special processing on the injected code, thereby reducing development costs.
[0004] In a first aspect, an embodiment of the present disclosure provides a method for interaction between a client and a front end, the method comprising:
[0005] In response to a first call request for calling a client method input at a front end, determining a call state of the client method requested to be called;
[0006] In a case where the calling state of the client method is a callable state, initiating the first calling request to the client;
[0007] In response to the first call request, the client method is called and executed, a target response result corresponding to the client method is obtained, and the target response result is returned to the front end.
[0008] In a second aspect, an embodiment of the present disclosure further provides an interactive device between a client and a front end, the device comprising:
[0009] A front-end request response module, configured to determine a call status of the client method requested to be called in response to a first call request for calling a client method input at the front end;
[0010] A client request initiating module, used for initiating the first calling request to the client when the calling state of the client method is a callable state;
[0011] A response result returning module is used to call and execute the client method in response to the first call request, obtain a target response result corresponding to the client method, and return the target response result to the front end.
[0012] In a third aspect, an embodiment of the present disclosure further provides an electronic device, the electronic device comprising:
[0013] one or more processors;
[0014] a storage device for storing one or more programs,
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the client-front-end interaction method as described in any one of the embodiments of the present disclosure.
[0016] In a fourth aspect, the embodiments of the present disclosure further provide a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the client-front end interaction method as described in any one of the embodiments of the present disclosure.
[0017] The technical solution of the embodiment of the present disclosure determines the calling state of the client method requested to be called in response to the first calling request inputted at the front end, so as to implement a preliminary detection of the callability of the client method and ensure successful communication between the front end and the client. In the case where the calling state of the client method is a callable state, the first calling request is initiated to the client, which increases the possibility that the client can successfully respond to the first calling request to call the client method. In response to the first calling request, the client method is called and executed, the target response result corresponding to the client method is obtained, and the target response result is returned to the front end, thereby successfully realizing the interaction between the client and the front end. The technical solution of the embodiment of the present disclosure realizes the technical effect of reducing development and maintenance costs and improving the smoothness of interaction between the client and the front end without the need for special processing of the client code. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0019] Figure 1 A schematic diagram of a flow chart of a method for interaction between a client and a front end provided in an embodiment of the present disclosure;
[0020] Figure 2 A schematic diagram of a process of initializing a communication bridge applicable to an interaction method between a client and a front end provided in an embodiment of the present disclosure;
[0021] Figure 3 An interactive processing sequence diagram of an interactive method applicable to a client and a front end provided in an embodiment of the present disclosure;
[0022] Figure 4 A schematic diagram of a business-related plug-in applicable to the interaction method between a client and a front end provided in an embodiment of the present disclosure;
[0023] Figure 5 A schematic diagram of a data structure of a window applicable to the method of interaction between a client and a front end provided in an embodiment of the present disclosure;
[0024] Figure 6 A flowchart of another method for interaction between a client and a front end provided by an embodiment of the present disclosure;
[0025] Figure 7 A flowchart of an optional embodiment of a method for interaction between a client and a front end provided in an embodiment of the present disclosure;
[0026] Figure 8 A flowchart of another method for interaction between a client and a front end provided by an embodiment of the present disclosure;
[0027] Fig. 9 A schematic diagram of the structure of a device for interacting between a client and a front end provided in an embodiment of the present disclosure;
[0028] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0035] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0036] Figure 1 A flow chart of a method for interaction between a client and a front end provided in an embodiment of the present disclosure is provided. The embodiment of the present disclosure is applicable to a situation where a client and a front end interact with each other. The method can be executed by an interaction device between the client and the front end, which can be implemented in the form of software and / or hardware, and optionally, by an electronic device, which can be a mobile terminal, a PC or a server, etc.
[0037] like Figure 1 As shown, the method of this embodiment may specifically include:
[0038] S110. In response to a first call request for calling a client method input at a front end, determine a call status of the client method requested to be called.
[0039] In the embodiment of the present disclosure, the method of the first call request can be understood as a request initiated by the front end to the client to call the client method when the front end and the client establish a JsBridge (communication bridge) connection. Optionally, the first call request may include a request method. In the embodiment of the present disclosure, the request method may be a client method. In practical applications, the request method usually includes request parameters. The request parameters may be understood as the parameters included in the request method, that is, the parameters included in the client method. The number of request parameters in the client method may be one, two, or more than two. The call state of the client method may include a callable state and a non-callable state. When the call state of the client method is a callable state, it can be characterized as the client method being able to be called by the front end; when the client call state is a non-callable state, it can be characterized as the client method being unable to be called by the front end.
[0040] Specifically, after receiving the first call request for calling the client method input in the front end, the first call request can be parsed. Thereby, the request method in the first call request can be determined, that is, the client method that the front end needs to call to the client can be determined. After determining the client method requested to be called, all callable methods of the client can be obtained. Usually, the number of all callable methods of the client is usually multiple. At this time, the client method and each callable method can be respectively compared for consistency to obtain a comparison result. According to the comparison result, the call status of the client method requested to be called can be determined.
[0041] In the disclosed embodiment, the consistency comparison between the client method and each callable method may include: for each callable method, determining the method name of the callable method and the first parameter list in the callable method, wherein the first parameter list includes the formal parameters in the callable method. After determining the method name and formal parameters of the callable method, the method name of the client method and the second parameter list of the client method may be determined, wherein the second parameter list includes the formal parameters in the client method. Furthermore, the method name of the client method and the method name of the callable method may be compared for consistency, and the formal parameters of the client method and the formal parameters of the callable method may be compared for consistency.
[0042] On the basis of the above embodiments, in order to improve the efficiency of determining the calling status of the client method requested to be called, in the embodiments of the present disclosure, the method name of the client method and the method name of the callable method can be compared for consistency first. If the method names are consistent, the formal parameters of the client method and the formal parameters of the callable method can be compared for consistency.
[0043] As an optional embodiment of the present disclosure, when the comparison result shows that the client method requested to be called is included in all the callable methods of the client, it can be determined that the client has a client method that the front end needs to call. Then, it can be determined that the calling state of the client method requested to be called is a callable state.
[0044] As another optional embodiment of the disclosed embodiment, when the comparison result shows that the client method requested to be called is not included in all the callable methods of the client, it can be determined that the client method that the front end needs to call does not exist in the client. Then, it can be determined that the calling state of the client method requested to be called is a non-callable state.
[0045] In the embodiment of the present disclosure, the determining the calling state of the client method may include: determining the calling state of the client method by calling a method state detection method. In the embodiment of the present disclosure, the method state detection method may be a method predefined in the communication bridge for detecting the calling state of the client method.
[0046] In the embodiment of the present disclosure, before the response to the first call request for calling the client method input on the front end, it may also include: starting the web page view, mounting the second execution method on the global variable of the front end through the client, so that the front end calls the client method through the second execution method; executing the communication bridge initialization logic on the front end to create a calling process for the front end to call the client method based on the communication bridge initialization logic.
[0047] Among them, the web page view can be understood as a view used to display web page content on the client. In the embodiments of the present disclosure, there are multiple methods for starting a web page view. For example, starting a web page view can be to create a web page view and start the created web page view; or, it can be to load a pre-created web page view, and after the pre-created web page view is loaded, start the loaded web page view.
[0048] In the embodiment of the present disclosure, the global variables of the front end may be global variables pre-defined in the front end, and may be used to mount the second execution method. The second execution method may be understood as a method that needs to be used when the front end calls the client method. In the embodiment of the present disclosure, mounting the second execution method on the global variables of the front end by the client may be understood as mounting the second execution method to all variables of the front end by the client after the web page view is started.
[0049] In the embodiment of the present disclosure, the communication bridge initialization logic can be understood as a predefined call flow for creating a front-end to call a client method. The call flow can at least include determining the call state of the client method requested to be called. In the embodiment of the present disclosure, the communication bridge initialization logic is executed at the front end to create a call flow for the front end to call the client method based on the communication bridge initialization logic, thereby implementing the initialization process of the front end of the communication bridge, so that the candidate front end can use the method in the communication bridge.
[0050] like Figure 2 As shown, before processing the first call request input by the front end for calling the client method, that is, the front-end communication bridge method call, in the embodiment of the present disclosure, the web page view can be started, that is, the web page view is opened. After the web page view is opened, the second execution method (such as the Windows.OrionQuery method) can be mounted on the global variable of the front end by the client, that is, the client injects the second execution method into the web page view, so that the front end uses the second execution method to call the client method. On this basis, the communication bridge initialization logic can be executed on the front end to create a calling process for the front end to call the client method based on the communication bridge initialization logic.
[0051] S120: When the calling state of the client method is a callable state, initiate the first calling request to the client.
[0052] Specifically, when the calling state of the client method is a callable state, the first calling request for calling the client method inputted at the front end can be transmitted to the client based on the communication bridge established between the front end and the client.
[0053] S130. In response to the first call request, call and execute the client method, obtain a target response result corresponding to the client method, and return the target response result to the front end.
[0054] Among them, the target response result can be understood as the response result obtained after the client method is executed. In the embodiments of the present disclosure, there are multiple ways to obtain the target response result. For example, it can be a processing result obtained based on a synchronous processing mechanism, or it can be a processing result obtained based on an asynchronous processing mechanism. In the embodiments of the present disclosure, the processing mechanism used is not specifically limited here and can be set according to actual needs.
[0055] Specifically, after the client receives the first call request, the client method can be loaded into the memory. Then, the client method can be executed in the memory. After the client method is executed, the processing result corresponding to the client method, that is, the target response result, can be obtained. After the client generates the target response result, the target response result can be returned to the front end through the communication bridge established by the front end and the client.
[0056] In the embodiment of the present disclosure, there are multiple ways to return the target response result to the front end. Figure 3 As shown, when the client generates the target response result using the synchronous processing mechanism, when the client generates the target response result, the target response result can be sent to the front end, that is, Figure 3 Synchronous result is returned; when the client uses asynchronous processing mechanism to generate the target response result, the client can call the front-end method for receiving the target response result, that is, Figure 3 The callback method provided by the front end is called in the callback method to feed back the target response result generated by the client to the front end; when the client uses the asynchronous processing mechanism to generate the target response result, when the client obtains the target response processing result, the target response processing structure can be sent to the front end, that is, Figure 3 Asynchronous result return.
[0057] It should be noted that when the client uses an asynchronous processing mechanism to generate a target response result, when the client obtains the target response processing result, the target response processing structure is sent to the front end, which can not only avoid request blocking, but also improve request processing efficiency and reduce the complexity of information processing logic in the interaction between the front end and the client.
[0058] Generally, the web page view WebView depends on the window container provided by the window Window. In actual business scenarios, it is necessary to flexibly configure the related capabilities of WebWindow. Therefore, plug-in configuration can be provided for multiple capability dependencies, that is, business-related plug-ins.
[0059] On the basis of the above embodiments, in order to improve the scalability of the client service processing capability, the embodiment of the present disclosure may further include: in response to a plug-in configuration trigger operation for a service-related plug-in of the client, updating the service-related plug-in based on the configured service information.
[0060] Among them, the business-related plug-in can be understood as a plug-in associated with the business processing flow that is pre-packaged on the client according to the client business processing flow. The way to obtain the business-related plug-in can be to develop it based on the window container that the web view relies on according to the basic business needs. It should be noted that the number of business-related plug-ins on the client can be one, two, or more than two. In actual applications, the number of business-related plug-ins on the client is usually multiple, and each business-related plug-in can be set according to actual business needs. See Figure 4 The business-related plug-in may include at least one of a skeleton screen plug-in, an error page plug-in, an offline resource plug-in, and a communication bridge plug-in.
[0061] In the disclosed embodiment, the plug-in configuration trigger operation can be understood as a trigger operation for configuring the business-related plug-in of the client. The plug-in configuration trigger operation may include a state configuration trigger operation for the enabled state of the business-related plug-in and / or a logic configuration operation for the business response logic of the business-related plug-in. Among them, the state configuration trigger operation can be used to configure the enabled state of the business-related plug-in. The enabled state may include not enabled and enabled. The logic configuration operation can be used to configure the business response logic of the business-related plug-in. In addition, the plug-in configuration trigger operation may also include a trigger operation for deleting a business-related plug-in.
[0062] In the disclosed embodiment, through the plug-in configuration trigger operation, the configured business-related plug-in can inherit the functions of the original business-related plug-in, so that the configured business-related plug-in can reuse the classes and methods in the original business-related plug-in. In addition, through the plug-in configuration trigger operation, the configured business-related plug-in can also add customized functions to the basic functions of the original business-related plug-in to improve the scalability of the client business processing capability.
[0063] By adopting the above technical solution, different WebWindow can inherit the JsBridge of the parent class WebWindow and expand its business on its basis. By inheriting and passing in JSBKey (communication bridge key, used to identify the communication bridge), each WebWindow has its own JsBridge method. After the WebWindow is initialized, the front end can obtain all JsBridge callable methods supported by the current window, ensuring that the front end does not have to pay attention to the client version and can also ensure the security of the front-end method call.
[0064] Specifically, a plug-in configuration triggering operation for a business-related plug-in of a client is received, so that the business information configured for the business-related plug-in can be obtained based on the plug-in configuration triggering operation, and the business-related plug-in can be updated based on the configured business information.
[0065] In an embodiment of the present disclosure, before receiving a plug-in configuration trigger operation for a business-related plug-in of a client, the method may further include: displaying a plug-in configuration interface, wherein the plug-in configuration interface includes the plug-in identifier of each business-related plug-in. After receiving a selection trigger operation acting on the plug-in identifier, the selected business-related plug-in may be determined. Accordingly, receiving a plug-in configuration trigger operation for a business-related plug-in of a client may specifically include displaying a plug-in configuration item corresponding to the selected business-related plug-in after determining the selected business-related plug-in. In actual applications, the number of plug-in configuration items is usually multiple. Then, a plug-in configuration trigger operation for a business-related plug-in of a client may be received based on each of the plug-in configuration items. Among them, the plug-in configuration interface may be understood as an interface for displaying the plug-in identifier of a business-related plug-in. The plug-in configuration item may be understood as a configuration item for configuring the business-related plug-in.
[0066] In application scenarios, it is often encountered that the current page jumps to another page. Compared with the browser, this operation is a page jump. However, since the external window contains a lot of business information, it is often difficult to jump to the page. Therefore, in the embodiment of the present disclosure, the page jump is performed in the form of jumping from one window to another, such as jumping from the submission window to the login window.
[0067] In an embodiment of the present disclosure, the interaction between the client and the front end may also include: in response to a window jump trigger operation input in the web page view to jump from a first window to a second window, determining a communication bridge corresponding to the second window based on the window view identifier of the second window and a preset constraint relationship, so as to call a communication bridge method corresponding to the second window through the communication bridge to jump to the second window.
[0068] The window jump trigger operation can be understood as a trigger operation input in the web page view for jumping from the first window to the second window. The window view identifier can be used to distinguish different windows. Optionally, the window view identifier can be the name of the window. The preset constraint relationship can be used to indicate the correspondence between the window identifier of the second window and the communication bridge. Figure 5As shown, the data structure of the window includes a window identifier and a communication bridge, wherein the window identifier is a window type (WebWindowConfig), and the type of the communication bridge is a string type. Exemplarily, for a WebWindow window, the window view identifier of the WebWindow window is "WebWindowConfig", and the communication bridge corresponding to the WebWindow window is "CommonBridge". At this time, the preset constraint relationship may be a correspondence between WebWindowConfig and CommonBridge. In the disclosed embodiment, a communication bridge may correspond to one or more of the communication bridge methods. In other words, the correspondence between a communication bridge and a communication bridge method may be one-to-one or one-to-many. Specifically, when jumping from a submission window to a login window, a login window is constructed. When constructing the login window, the login bridge field is injected according to the preset constraint relationship to ensure that when the front end calls the jump method, it can obtain the interactive interface of the login window and can call one or more JSBridge methods under the login bridge.
[0069] Specifically, after receiving a window jump trigger operation input in the webpage view to jump from the first window to the second window, the window view identifier of the second window can be determined. Then, according to the correspondence between the window identifier of the second window and the communication bridge, that is, according to the preset constraint relationship, the communication bridge corresponding to the second window can be determined. Then, the communication bridge method corresponding to the second window can be called through the communication bridge to jump to the second window.
[0070] The technical solution of the embodiment of the present disclosure determines the calling state of the client method requested to be called in response to the first calling request inputted at the front end, so as to implement a preliminary detection of the callability of the client method and ensure successful communication between the front end and the client. In the case where the calling state of the client method is a callable state, the first calling request is initiated to the client, which increases the possibility that the client can successfully respond to the first calling request to call the client method. In response to the first calling request, the client method is called and executed, the target response result corresponding to the client method is obtained, and the target response result is returned to the front end, thereby successfully realizing the interaction between the client and the front end. The technical solution of the embodiment of the present disclosure realizes the technical effect of reducing development and maintenance costs and improving the smoothness of interaction between the client and the front end without the need for special processing of the client code.
[0071] Figure 6A flowchart of another method of interaction between a client and a front end provided in an embodiment of the present disclosure. The technical solution of this embodiment is based on the above-mentioned embodiment, and further refines how to call and execute the client method to obtain a target response result corresponding to the client method. Optionally, the calling and executing of the client method to obtain a target response result corresponding to the client method includes: sending the client method to a client method processor corresponding to the client method through a processor of a client communication bridge object corresponding to the client method; calling and executing the client method based on the client method processor to obtain a target response result corresponding to the client method. For specific implementation methods, please refer to the description of this embodiment. Among them, the technical features that are the same or similar to those in the above-mentioned embodiments are not repeated here.
[0072] like Figure 6 As shown, the method of this embodiment may specifically include:
[0073] S210: In response to a first call request for calling a client method input at a front end, determine a call status of the client method requested to be called.
[0074] S220: When the calling state of the client method is a callable state, initiate the first calling request to the client.
[0075] S230. In response to the first call request, send the client method to a client method processor corresponding to the client method through a processor of a client communication bridge object corresponding to the client method.
[0076] The client communication bridge object can be understood as a predefined object for communication between the client and the communication bridge. The processor of the client communication bridge object can be used to send the client method to the client method processor corresponding to the client method. The client method processor can be understood as a processor set on the client for calling and executing the client method.
[0077] Specifically, in response to the first call request, the client method requested to be called can be obtained. Thus, according to the correspondence between the client method and the client communication bridge object, the client communication bridge object corresponding to the client method can be determined. Then, based on the processor of the client communication bridge object corresponding to the client method, the client method can be sent to the client method processor corresponding to the client method.
[0078] Optionally, sending the client method to a client method processor corresponding to the client method through a processor of a client communication bridge object corresponding to the client method may include: sending the client method to the client communication bridge object; and when the client communication bridge object queries the client method, sending the client method to a client method processor corresponding to the client method through the communication bridge processor of the client communication bridge object.
[0079] See also Figure 7 When the front end calls a client method, the client method can be sent to the client communication bridge object through the method for sending the client method of the front end, so that the client communication bridge object queries whether the client method is included in the methods that can be called by the client communication bridge object. In the case that the client communication bridge object queries the client method, the communication bridge processor of the client communication bridge object can be called to send the client method to the client method processor corresponding to the client method.
[0080] The front-end environment runs in an independent renderer process, which is in a different address space from the client's Nodejs. Therefore, a reasonable mechanism is needed for communication. The data protocol is used to implement cross-Context interface calls, and the basic underlying data transmission is implemented at the client Native Platform layer (client platform layer). The front-end and client implement call protocol encapsulation.
[0081] In the embodiment of the present disclosure, before the client method is sent to the client method processor corresponding to the client method through the processor of the client communication bridge object corresponding to the client method, the method may also include: in response to the start trigger operation input on the client for the web page view, a client communication bridge processor may be created on the client, and the client communication bridge object corresponding to the client communication bridge processor may be saved in the platform layer of the client (see Figure 7 ). In addition, a front-end communication bridge object can be registered in the front end, and a communication bridge encapsulation code can be created in the platform layer based on the front-end communication bridge object and the client communication bridge object. The communication bridge encapsulation code is used to indicate the association relationship between the front-end communication bridge object and the client communication bridge object.
[0082] Among them, the start trigger operation can be understood as a trigger operation for starting a web page view. The platform layer of the client can be used to store the client communication bridge object corresponding to the client communication bridge processor. The front-end communication bridge object can be understood as an object used for communication between the front end and the communication bridge. In an embodiment of the present disclosure, creating a communication bridge encapsulation code based on the front-end communication bridge object and the client communication bridge object may include: determining an association relationship between the front-end communication bridge object and the client communication bridge object, and generating a communication bridge encapsulation code based on the association relationship.
[0083] Alternatively, if Figure 7 As shown, registering the front-end communication bridge object in the front-end may include: creating a web page view in the client and starting the web page view; creating a built-in browser object in the web page view through the front-end, wherein the built-in browser object includes a web page object; mounting a built-in query interface in the web page object to register the front-end communication bridge object.
[0084] The built-in browser object can be understood as an object created by the front end in the web page view. The built-in browser object can include a web page object. The web page object can be understood as an object for mounting a built-in query interface. The built-in query interface can be an interface for processing a front-end communication bridge object.
[0085] In an embodiment of the present disclosure, after the communication bridge encapsulation code is created based on the front-end communication bridge object and the client communication bridge object, it may also include: in response to a second call request for calling a front-end method input on the client, calling and executing a first execution method, so as to serialize the call data corresponding to the second call request based on the first execution method, obtain serialized call data, and inject the serialized call data into the communication bridge encapsulation code; transmitting the communication bridge encapsulation code to the front end, so that the front end executes the response logic corresponding to the front-end method.
[0086] The second call request can be understood as a request initiated by the client to the front end for calling the front end method when the front end and the client establish a communication bridge connection. The first execution method can be understood as serializing the call data corresponding to the second call request, obtaining serialized call data, and injecting the serialized call data into the communication bridge encapsulation code. The call data may include the name of the called method and associated parameters.
[0087] like Figure 7As shown, after receiving the second call request inputted on the client for calling the front-end method, the first execution method can be called and executed. Then, by executing the first execution method, the call data corresponding to the second call request can be serialized to obtain serialized call data. Then, the serialized call data can be injected into the communication bridge encapsulation code. After the data injection is completed, the communication bridge encapsulation code can be transmitted to the front end so that the front end executes the response logic corresponding to the front-end method.
[0088] In an embodiment of the present disclosure, the call data corresponding to the second call request is serialized based on the first execution method to obtain serialized call data, which may specifically include: by calling the first execution method, the name of the called method and the associated parameters are serialized to generate serialized data, i.e., serialized call data.
[0089] S240, calling and executing the client method based on the client method processor, obtaining a target response result corresponding to the client method, and returning the target response result to the front end.
[0090] Specifically, after the client method processor receives the client method, the client method can be loaded by executing the client method processor. After the client method is loaded, the client method is executed. After the client method is executed, a target response result corresponding to the client method can be obtained. After the target response result is obtained, the target response result can be fed back to the front end based on the communication bridge established between the client and the front end.
[0091] The technical solution of the embodiment of the present disclosure is to send the client method to the client method processor corresponding to the client method through the processor of the client communication bridge object corresponding to the client method; call and execute the client method based on the client method processor to obtain the target response result corresponding to the client method. The technical solution of the embodiment of the present disclosure is to connect the client and the front end with a communication bridge by using the processor of the client communication bridge object, thereby realizing the front end calling the client method.
[0092] Figure 8A flowchart of another method for interaction between a client and a front end provided in an embodiment of the present disclosure. The technical solution of this embodiment, based on the above-mentioned embodiment, further includes: before initiating the first call request to the client, querying a list of callable methods obtained from the client based on the client method; when it is found that the client method exists in the list of callable methods, determining the call state of the client method as a callable state. For specific implementation methods, please refer to the description of this embodiment. Among them, the technical features that are the same or similar to those of the above-mentioned embodiments are not repeated here.
[0093] like Figure 8 As shown, the method of this embodiment may specifically include:
[0094] S310: When the front end calls the client method, a list of callable methods obtained from the client is queried based on the client method.
[0095] The callable method list can be understood as a list of callable methods that the client can provide to the front end when the front end calls the client method. The callable method list can include the method name and method parameter information of the client method that the front end can call from the client.
[0096] Specifically, when the front end calls the client method, the list of callable methods stored in the client is obtained. Thus, the method names and method parameter information of the callable methods in the callable method list can be traversed. During the traversal process, for each callable method in the callable method list, the method name of the callable method in the callable method list and the method name of the client method are compared for consistency, and the method parameter information of the callable method and the method parameter information of the client method are compared for consistency. After the client method is compared with all the callable methods in the callable method list, a comparison result can be obtained. Then, it can be determined whether the client method exists in the callable method list based on the comparison result.
[0097] In an embodiment of the present invention, the advantage of setting a list of callable methods on the client is that it can uniformly manage the callable methods that the client can provide to the front end, so as to more quickly and effectively determine whether the client method that the front end needs to call can be called, thereby further improving the security of the interaction between the front end and the client.
[0098] S320: When it is found that the client method exists in the callable method list, the calling state of the client method is determined to be a callable state.
[0099] Specifically, when the callable method list is found to contain the client method, it can be determined that the client method that the front end needs to call exists on the client. At this time, it can be determined that the calling state of the client method that the front end needs to call is determined to be a callable state.
[0100] S330: In response to a first call request for calling a client method input at the front end, determine a call status of the client method requested to be called.
[0101] S340: When the calling state of the client method is a callable state, initiate the first calling request to the client.
[0102] S350. In response to the first call request, call and execute the client method, obtain a target response result corresponding to the client method, and return the target response result to the front end.
[0103] The technical solution of the embodiment of the present disclosure is, before the first call request is initiated to the client, a list of callable methods obtained from the client is queried based on the client method; when it is found that the client method exists in the list of callable methods, the call state of the client method is determined to be a callable state. In the technical solution of the embodiment of the present disclosure, by setting the list of callable methods on the client, unified management of the callable methods that the client can provide to the front end can be achieved, so as to more quickly and effectively determine whether the client method that the front end needs to call can be called, and further improve the security of the interaction between the front end and the client.
[0104] Fig. 9 A schematic diagram of a structure of a client-front end interaction device provided by an embodiment of the present disclosure, such as Fig. 9 As shown, the device includes: a front-end request response module 410, a client request initiation module 420 and a response result returning module 430.
[0105] Among them, the front-end request response module 410 is used to determine the calling status of the client method requested to be called in response to the first calling request for calling the client method input at the front end; the client request initiation module 420 is used to initiate the first calling request to the client when the calling status of the client method is a callable state; the response result returning module 430 is used to call and execute the client method in response to the first calling request, obtain the target response result corresponding to the client method, and return the target response result to the front end.
[0106] The technical solution of the embodiment of the present disclosure is to determine the calling state of the client method requested to be called by the front-end request response module in response to the first calling request for calling the client method input at the front end, so as to realize the pre-detection of the callability of the client method and ensure the successful communication between the front end and the client. When the calling state of the client method is a callable state, the client request initiation module initiates the first calling request to the client, thereby increasing the possibility that the client can successfully respond to the first calling request for calling the client method. The response result return module responds to the first calling request, calls and executes the client method, obtains the target response result corresponding to the client method, and returns the target response result to the front end, thereby successfully realizing the interaction between the client and the front end. The technical solution of the embodiment of the present disclosure realizes the technical effect of reducing the development and maintenance costs and improving the smoothness of the interaction between the client and the front end without the need for special code processing on the client.
[0107] Based on the above optional technical solutions, optionally, the response result returning module 430 includes a client method sending unit and a client method calling unit; wherein,
[0108] A client method sending unit, configured to send the client method to a client method processor corresponding to the client method through a processor of a client communication bridge object corresponding to the client method;
[0109] The client method calling unit is used to call and execute the client method based on the client method processor to obtain a target response result corresponding to the client method.
[0110] Based on the above-mentioned optional technical solutions, optionally, a client method sending unit is used to send the client method to the client communication bridge object; when the client communication bridge object queries the client method, the client method is sent to a client method processor corresponding to the client method through the communication bridge processor of the client communication bridge object.
[0111] On the basis of the above-mentioned optional technical solutions, optionally, the device also includes: a communication bridge encapsulation code creation module, which is used to create a client communication bridge processor on the client side in response to a start trigger operation for a web page view input on the client side before sending the client method to the client method processor corresponding to the client method through the processor of the client communication bridge object corresponding to the client method, and save the client communication bridge object corresponding to the client communication bridge processor in the platform layer of the client side; register the front-end communication bridge object in the front end, and create a communication bridge encapsulation code in the platform layer based on the front-end communication bridge object and the client communication bridge object, wherein the communication bridge encapsulation code is used to indicate the association relationship between the front-end communication bridge object and the client communication bridge object.
[0112] Based on the above-mentioned optional technical solutions, optionally, a communication bridge encapsulation code creation module is used to create a web page view on the client and start the web page view; create a built-in browser object in the web page view through the front end, wherein the built-in browser object includes a web page object; mount a built-in query interface in the web page object to register the front-end communication bridge object.
[0113] On the basis of the above-mentioned optional technical solutions, optionally, the device also includes: a communication bridge encapsulation code transmission module, which is used to call and execute a first execution method in response to a second call request input on the client for calling a front-end method after creating the communication bridge encapsulation code based on the front-end communication bridge object and the client communication bridge object, so as to serialize the call data corresponding to the second call request based on the first execution method to obtain serialized call data, and inject the serialized call data into the communication bridge encapsulation code, wherein the call data includes the name of the called method and associated parameters; and transmit the communication bridge encapsulation code to the front end so that the front end executes the response logic corresponding to the front-end method.
[0114] On the basis of the above-mentioned optional technical solutions, optionally, the device also includes: a communication bridge initialization logic execution module, which is used to start the web page view before the response to the first call request for calling the client method input on the front end, and mount the second execution method on the global variable of the front end through the client, so that the front end calls the client method through the second execution method; execute the communication bridge initialization logic on the front end to create a calling process for the front end to call the client method based on the communication bridge initialization logic, wherein the calling process at least includes: determining the calling status of the client method requested to be called.
[0115] Based on the above-mentioned optional technical solutions, optionally, the device also includes: a client method query module, which is used to query a list of callable methods obtained from the client based on the client method before initiating the first call request to the client; when it is found that the client method exists in the list of callable methods, the calling state of the client method is determined to be a callable state.
[0116] Based on the above-mentioned optional technical solutions, optionally, the device also includes: a business-related plug-in configuration module, which is used to respond to a plug-in configuration trigger operation for a business-related plug-in of a client, and update the business-related plug-in based on the configured business information, wherein the plug-in configuration trigger operation includes a state configuration trigger operation on the enabled state of the business-related plug-in and / or a logic configuration operation on the business response logic of the business-related plug-in.
[0117] On the basis of the above-mentioned optional technical solutions, optionally, the device also includes: a window jump module, which is used to respond to a window jump trigger operation input in the web page view to jump from the first window to the second window, and determine the communication bridge corresponding to the second window based on the window view identifier of the second window and a preset constraint relationship, so as to call the communication bridge method corresponding to the second window through the communication bridge to jump to the second window, wherein the preset constraint relationship is used to indicate the correspondence between the window identifier of the second window and the communication bridge, and the communication bridge corresponds to one or more of the communication bridge methods.
[0118] The client-front-end interaction device provided in the embodiments of the present disclosure can execute the client-front-end interaction method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0119] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
[0120] Fig.10 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Fig.10 , which shows an electronic device (eg, Fig.10The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0121] like Fig.10 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit / output (I / O) interface 505 is also connected to the bus 504.
[0122] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0123] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0124] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0125] The electronic device provided by the embodiment of the present disclosure and the method for interaction between the client and the front end provided by the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0126] The embodiment of the present disclosure provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method for interacting between a client and a front end provided in the above embodiment is implemented.
[0127] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-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 computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0128] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0129] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0130] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: responds to a first call request for calling a client method input at the front end, determines the call status of the client method requested to be called; when the call status of the client method is a callable state, initiates the first call request to the client; responds to the first call request, calls and executes the client method, obtains a target response result corresponding to the client method, and returns the target response result to the front end.
[0131] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0132] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0133] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
[0134] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0135] 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.
[0136] According to one or more embodiments of the present disclosure, [Example 1] provides a method for interaction between a client and a front end, including:
[0137] In response to a first call request for calling a client method input at a front end, determining a call state of the client method requested to be called;
[0138] In a case where the calling state of the client method is a callable state, initiating the first calling request to the client;
[0139] In response to the first call request, the client method is called and executed, a target response result corresponding to the client method is obtained, and the target response result is returned to the front end.
[0140] According to one or more embodiments of the present disclosure, [Example 2] provides a method for interaction between a client and a front end, including:
[0141] Optionally, the calling and executing the client method to obtain a target response result corresponding to the client method includes:
[0142] Sending the client method to a client method processor corresponding to the client method through a processor of a client communication bridge object corresponding to the client method;
[0143] The client method is called and executed based on the client method processor to obtain a target response result corresponding to the client method.
[0144] According to one or more embodiments of the present disclosure, [Example 3] provides a method for interaction between a client and a front end, including:
[0145] Optionally, sending the client method to a client method processor corresponding to the client method through a processor of a client communication bridge object corresponding to the client method comprises:
[0146] Sending the client method to the client communication bridge object;
[0147] In the case where the client communication bridge object queries the client method, the client method is sent to the client method processor corresponding to the client method through the communication bridge processor of the client communication bridge object.
[0148] According to one or more embodiments of the present disclosure, [Example 4] provides a method for interaction between a client and a front end, further comprising:
[0149] Before sending the client method to the client method processor corresponding to the client method through the processor of the client communication bridge object corresponding to the client method, in response to a start trigger operation for a web page view inputted at the client, a client communication bridge processor is created at the client, and a client communication bridge object corresponding to the client communication bridge processor is saved in the platform layer of the client;
[0150] A front-end communication bridge object is registered in the front end, and a communication bridge encapsulation code is created in the platform layer based on the front-end communication bridge object and the client communication bridge object, wherein the communication bridge encapsulation code is used to indicate the association relationship between the front-end communication bridge object and the client communication bridge object.
[0151] According to one or more embodiments of the present disclosure, [Example 5] provides a method for interaction between a client and a front end, including:
[0152] Optionally, registering the front-end communication bridge object in the front-end includes:
[0153] Creating a web page view on the client and starting the web page view;
[0154] Creating a built-in browser object in the web page view through the front end, wherein the built-in browser object includes a web page object;
[0155] A built-in query interface is mounted in the web page object to register the front-end communication bridge object.
[0156] According to one or more embodiments of the present disclosure, [Example 6] provides a method for interaction between a client and a front end, further comprising:
[0157] After the communication bridge encapsulation code is created based on the front-end communication bridge object and the client communication bridge object, the method further includes:
[0158] After the communication bridge encapsulation code is created based on the front-end communication bridge object and the client communication bridge object, in response to a second call request for calling a front-end method input on the client, a first execution method is called and executed to serialize the call data corresponding to the second call request based on the first execution method to obtain serialized call data, and the serialized call data is injected into the communication bridge encapsulation code, wherein the call data includes the name of the called method and associated parameters;
[0159] The communication bridge encapsulation code is transmitted to the front end, so that the front end executes the response logic corresponding to the front end method.
[0160] According to one or more embodiments of the present disclosure, [Example 7] provides a method for interaction between a client and a front end, further comprising:
[0161] Before responding to the first call request inputted at the front end for calling the client method, starting the web page view, mounting the second execution method on the global variable of the front end through the client, so that the front end calls the client method through the second execution method;
[0162] The communication bridge initialization logic is executed at the front end to create a calling process for the front end to call the client method based on the communication bridge initialization logic, wherein the calling process at least includes: determining a calling state of the client method requested to be called.
[0163] According to one or more embodiments of the present disclosure, [Example 8] provides a method for interaction between a client and a front end, further comprising:
[0164] Before initiating the first call request to the client, querying a list of callable methods obtained from the client based on the client method;
[0165] When it is found that the client method exists in the callable method list, the calling state of the client method is determined to be a callable state.
[0166] According to one or more embodiments of the present disclosure, [Example 9] provides a method for interaction between a client and a front end, further comprising:
[0167] In response to a plug-in configuration trigger operation for a business-related plug-in of a client, the business-related plug-in is updated based on configured business information, wherein the plug-in configuration trigger operation includes a state configuration trigger operation on an enabled state of the business-related plug-in and / or a logic configuration operation on a business response logic of the business-related plug-in.
[0168] According to one or more embodiments of the present disclosure, [Example 10] provides a method for interaction between a client and a front end, further comprising:
[0169] In response to a window jump trigger operation input in the web page view to jump from a first window to a second window, a communication bridge corresponding to the second window is determined based on the window view identifier of the second window and a preset constraint relationship, so as to call a communication bridge method corresponding to the second window through the communication bridge to jump to the second window, wherein the preset constraint relationship is used to indicate the correspondence between the window identifier of the second window and the communication bridge, and the communication bridge corresponds to one or more of the communication bridge methods.
[0170] According to one or more embodiments of the present disclosure, [Example 11] provides an interactive device between a client and a front end, including:
[0171] A front-end request response module, configured to determine a call status of the client method requested to be called in response to a first call request for calling a client method input at the front end;
[0172] A client request initiating module, used for initiating the first calling request to the client when the calling state of the client method is a callable state;
[0173] A response result returning module is used to call and execute the client method in response to the first call request, obtain a target response result corresponding to the client method, and return the target response result to the front end.
[0174] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0175] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0176] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for interaction between a client and a front end, characterized in that: include: In response to a first call request for calling a client method input at a front end, determining a call state of the client method requested to be called; In a case where the calling state of the client method is a callable state, initiating the first calling request to the client; In response to the first call request, the client method is called and executed, a target response result corresponding to the client method is obtained, and the target response result is returned to the front end.
2. The method for interaction between a client and a front end according to claim 1, characterized in that: The calling and executing the client method to obtain a target response result corresponding to the client method includes: Sending the client method to a client method processor corresponding to the client method through a processor of a client communication bridge object corresponding to the client method; The client method is called and executed based on the client method processor to obtain a target response result corresponding to the client method.
3. The method for interaction between a client and a front end according to claim 2, characterized in that: The sending the client method to the client method processor corresponding to the client method through the processor of the client communication bridge object corresponding to the client method comprises: Sending the client method to the client communication bridge object; In the case where the client communication bridge object queries the client method, the client method is sent to the client method processor corresponding to the client method through the communication bridge processor of the client communication bridge object.
4. The method for interaction between a client and a front end according to claim 3, characterized in that: Before sending the client method to the client method processor corresponding to the client method through the processor of the client communication bridge object corresponding to the client method, the method further includes: In response to a start trigger operation inputted at the client for the webpage view, creating a client communication bridge processor at the client, and saving a client communication bridge object corresponding to the client communication bridge processor in a platform layer of the client; A front-end communication bridge object is registered in the front end, and a communication bridge encapsulation code is created in the platform layer based on the front-end communication bridge object and the client communication bridge object, wherein the communication bridge encapsulation code is used to indicate the association relationship between the front-end communication bridge object and the client communication bridge object.
5. The method for interaction between a client and a front end according to claim 4, characterized in that: Registering the front-end communication bridge object at the front-end includes: Creating a web page view on the client and starting the web page view; Creating a built-in browser object in the web page view through the front end, wherein the built-in browser object includes a web page object; A built-in query interface is mounted in the web page object to register the front-end communication bridge object.
6. The method for interaction between a client and a front end according to claim 4, characterized in that: After the communication bridge encapsulation code is created based on the front-end communication bridge object and the client communication bridge object, the method further includes: In response to a second call request inputted at the client for calling a front-end method, calling and executing a first execution method, serializing the call data corresponding to the second call request based on the first execution method to obtain serialized call data, and injecting the serialized call data into the communication bridge encapsulation code, wherein the call data includes the name of the called method and associated parameters; The communication bridge encapsulation code is transmitted to the front end, so that the front end executes the response logic corresponding to the front end method.
7. The method for interaction between a client and a front end according to claim 1, characterized in that: Before responding to the first call request inputted at the front end for calling the client method, the method further includes: Start the web page view, and mount the second execution method on the global variable of the front end through the client, so that the front end calls the client method through the second execution method; The communication bridge initialization logic is executed at the front end to create a calling process for the front end to call the client method based on the communication bridge initialization logic, wherein the calling process at least includes: determining a calling state of the client method requested to be called.
8. The method for interaction between a client and a front end according to claim 1, characterized in that: Before initiating the first call request to the client, the method further includes: A list of callable methods obtained from the client based on the client method query; When it is found that the client method exists in the callable method list, the calling state of the client method is determined to be a callable state.
9. The method for interaction between a client and a front end according to claim 1, characterized in that: Also includes: In response to a plug-in configuration trigger operation for a business-related plug-in of a client, the business-related plug-in is updated based on configured business information, wherein the plug-in configuration trigger operation includes a state configuration trigger operation on an enabled state of the business-related plug-in and / or a logic configuration operation on a business response logic of the business-related plug-in.
10. The method for interaction between a client and a front end according to claim 1, characterized in that: Also includes: In response to a window jump trigger operation input in a web page view to jump from a first window to a second window, a communication bridge corresponding to the second window is determined based on the window view identifier of the second window and a preset constraint relationship, so as to call a communication bridge method corresponding to the second window through the communication bridge to jump to the second window, wherein the preset constraint relationship is used to indicate the correspondence between the window identifier of the second window and the communication bridge, and the communication bridge corresponds to one or more of the communication bridge methods.
11. An interactive device between a client and a front end, characterized in that: include: A front-end request response module, configured to determine a call status of the client method requested to be called in response to a first call request for calling a client method input at the front end; A client request initiating module, used for initiating the first calling request to the client when the calling state of the client method is a callable state; A response result returning module is used to call and execute the client method in response to the first call request, obtain a target response result corresponding to the client method, and return the target response result to the front end.
12. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the client-front-end interaction method as described in any one of claims 1-10.
13. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the client-front-end interaction method as described in any one of claims 1-10 when executed by a computer processor.