APP web page jump method, device, electronic device and storage device
By obtaining the current business event information of the APP and determining the destination web page routing information based on the webview component, the problem of difficulty in implementing APP web page jump is solved, business split calls and coupling are realized, and the efficiency of web page jump is improved.
Patent Information
- Application Number
- CN202111233245.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2041-10-22
AI Technical Summary
In the prior art, it is difficult to implement APP web page jump, especially when business events continue to increase, which will lead to an increase in business events in the webView, resulting in the coupling of business logic.
By obtaining the current business event information of the APP, based on the preset webview component, the destination webpage routing information is determined, and the corresponding destination webpage routing is called, and the destination webpage component is called, so that the APP can jump to the destination webpage.
The business split call is realized, which avoids the coupling of page interaction logic in webview components and reduces the difficulty of implementing APP web page jumps.
Smart Images

Figure CN113961859B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer network technology, and in particular to an APP web page jump method, device, electronic device and storage device. Background Art
[0002] With the popularity of mobile terminals, the types of APP business are increasing. However, it is not suitable to use native function development to embed short-term activities and introduction pages. It is usually necessary to embed H5 web pages to achieve this. H5 web pages are displayed using webView.
[0003] In the prior art, webView is usually in the main project of the APP, using unified routing. Native interactive events are all in the container file webView. When the native needs to call a web page, it is necessary to call the target web page based on the main project of the APP. During the entire application cycle of the APP, its business events will be added and modified. When a new business event appears, it is necessary to first determine the interaction field of the new business event, and then add a new interactive event in the container file to ensure that the new business event can call the web page based on the interaction field.
[0004] However, if the business events of the APP continue to increase, the business events in the webView will also increase adaptability. At this time, business logic coupling will occur, increasing the difficulty of implementing APP web page jumps. Summary of the invention
[0005] The present application provides an APP web page jump method, device, electronic device and storage device to solve the defects of the prior art such as the difficulty in implementing APP web page jump.
[0006] The first aspect of the present application provides an APP web page jump method, comprising:
[0007] Obtain the current business event information of the APP; wherein the current business event information is used to characterize the functions and page interaction logic of the current business of the APP;
[0008] Based on the preset webview component, determine the target webpage routing information according to the current business event information;
[0009] According to the target web page routing information, calling the corresponding target web page routing;
[0010] The target web page routing is used to call the corresponding target web page component so that the APP jumps to the corresponding target web page.
[0011] Optionally, the webview component includes a registration management class, in which the routes of each business event of the APP are registered, and the preset webview component determines the target webpage routing information according to the current business event information, including:
[0012] Based on the webview component, determining the target webpage routing information corresponding to the current business event according to the current business event information and the registration management class;
[0013] The target webpage routing information at least includes the target routing IP and routing parameters.
[0014] Optionally, the step of using the target webpage route to call a corresponding target webpage component includes:
[0015] Locating the target web page component according to the corresponding relationship between the target web page routing information and the target web page component information;
[0016] Parsing the web protocol of the target web page component;
[0017] The target web page component is called according to the web protocol of the target web page component by utilizing the target web page routing.
[0018] Optionally, the APP includes multiple business event components, and the logics between the business event components are independent of each other. The obtaining of the current business event information of the APP includes:
[0019] Determine the business event components that the user is currently using in the app;
[0020] The current business event information is determined according to the encapsulation logic of the business event component.
[0021] Optionally, also include:
[0022] Obtaining operation information of the user in the target webpage;
[0023] According to the operation information, determine whether it is currently necessary to call back from the target web page to the APP native interface;
[0024] If yes, determine the corresponding target business event component according to the APP operation logic represented by the operation information;
[0025] Based on the target business event component, call back to the corresponding APP native interface.
[0026] Optionally, the webview component includes all business event components of the APP, and the calling back to the corresponding APP native interface based on the target business event component includes:
[0027] The webview component is used to call the target business event component so that the APP calls back to the corresponding APP native interface.
[0028] Optionally, also include:
[0029] When a new business event occurs in the APP, the new business event is encapsulated as a new business event component according to the function of the new business event and the page interaction logic;
[0030] Register the newly added business event component and add it to the webview component.
[0031] The second aspect of the present application provides an APP web page jump device, including:
[0032] An acquisition module is used to acquire the current business event information of the APP; wherein the current business event information is used to characterize the function and page interaction logic of the current business of the APP;
[0033] A routing determination module, used to determine the target web page routing information based on the preset webview component and the current business event information;
[0034] A route calling module, used to call the corresponding target web page route according to the target web page route information;
[0035] The web page jump module is used to use the target web page route to call the corresponding target web page component so that the APP jumps to the corresponding target web page.
[0036] Optionally, the webview component includes a registration management class, in which the routes of each business event of the APP are registered, and the routing calling module is specifically used to:
[0037] Based on the webview component, determining the target webpage routing information corresponding to the current business event according to the current business event information and the registration management class;
[0038] The target webpage routing information at least includes the target routing IP and routing parameters.
[0039] Optionally, the web page jump module is specifically used to:
[0040] Locating the target web page component according to the corresponding relationship between the target web page routing information and the target web page component information;
[0041] Parsing the web protocol of the target web page component;
[0042] The target web page component is called according to the web protocol of the target web page component by utilizing the target web page routing.
[0043] Optionally, the APP includes multiple business event components, the logics of the business event components are independent of each other, and the acquisition module is specifically used to:
[0044] Determine the business event components that the user is currently using in the app;
[0045] The current business event information is determined according to the encapsulation logic of the business event component.
[0046] Optionally, the device further comprises:
[0047] The callback module is used to obtain the user's operation information in the target web page; based on the operation information, determine whether it is currently necessary to call back from the target web page to the APP native interface; if so, determine the corresponding target business event component based on the APP operation logic represented by the operation information; based on the target business event component, call back to the corresponding APP native interface.
[0048] Optionally, the callback module is specifically used to:
[0049] The webview component is used to call the target business event component so that the APP calls back to the corresponding APP native interface.
[0050] Optionally, the device further comprises:
[0051] The new business module is used to encapsulate a new business event into a new business event component according to the function and page interaction logic of the new business event when a new business event occurs in the APP; and register and add the new business event component to the webview component.
[0052] A third aspect of the present application provides an electronic device, comprising: at least one processor and a memory;
[0053] The memory stores computer-executable instructions;
[0054] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in the first aspect and various possible designs of the first aspect.
[0055] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the first aspect and various possible designs of the first aspect are implemented.
[0056] The technical solution of this application has the following advantages:
[0057] The present application provides an APP web page jump method, device, electronic device and storage device, the method comprising: obtaining the current business event information of the APP; wherein the current business event information is used to characterize the functions and page interaction logic of the current business of the APP; based on the preset webview component, determining the target web page routing information according to the current business event information; calling the corresponding target web page routing according to the target web page routing information; using the target web page routing to call the corresponding target web page component, so that the APP jumps to the corresponding target web page. The method provided by the above scheme realizes the split calling of the business by componentizing the web page and directly calling the web page component through the web page routing, avoiding the coupling of the page interaction logic of the webview component, and reducing the difficulty of implementing the APP web page jump. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application, and a person skilled in the art can also obtain other drawings based on these drawings.
[0059] Figure 1 This is a schematic diagram of the structure of the APP web page jump system based on the embodiment of the present application;
[0060] Figure 2 A flowchart of an APP web page jump method provided in an embodiment of the present application;
[0061] Figure 3 APP web page jump logic diagram provided in the embodiment of the present application;
[0062] Figure 4 APP component call relationship diagram provided for the embodiment of the present application;
[0063] Figure 5 A schematic diagram of the structure of the APP web page jump device provided in an embodiment of the present application;
[0064] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0065] The above drawings have shown clear embodiments of the present application, which will be described in more detail below. These drawings and text descriptions are not intended to limit the scope of the present disclosure in any way, but to illustrate the concepts of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0067] In addition, the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following embodiments, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0068] In the prior art, webView is usually in the main project of APP, using unified routing, and native interactive events are all in the container file webView. When the native needs to call a web page, it is necessary to call the target web page based on the main project of APP. During the entire application cycle of APP, its business events will be increased and modified. When a new business event appears, it is necessary to first determine the interaction field of the new business event, and then add a new interactive event to the container file to ensure that the new business events added later can call the web page based on the interaction field. However, if the business events of APP continue to increase, the business events in webView will also increase adaptability. At this time, business logic coupling will occur. Before the APP web page jumps, the business logic analysis of APP needs to be performed, which increases the difficulty of implementing APP web page jumps.
[0069] In view of the above problems, the APP web page jump method, device, electronic device and storage device provided in the embodiment of the present application obtain the current business event information of the APP; wherein the current business event information is used to characterize the function and page interaction logic of the current business of the APP; based on the preset webview component, determine the target web page routing information according to the current business event information; call the corresponding target web page routing according to the target web page routing information; use the target web page routing to call the corresponding target web page component, so that the APP jumps to the corresponding target web page. That is, by componentizing the web page and directly calling the web page component through the web page routing, the split calling of the business is realized, the coupling of the page interaction logic of the webview component is avoided, and the difficulty of implementing the APP web page jump is reduced.
[0070] The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. The embodiments of the present invention will be described below in conjunction with the accompanying drawings.
[0071] First, the structure of the APP web page jump system based on this application is explained:
[0072] The APP web page jump method, device, electronic device and storage device provided in the embodiments of the present application are suitable for implementing the APP web page jump installed on the mobile terminal. Figure 1 As shown, it is a structural diagram of the APP web page jump system based on the embodiment of the present application, which mainly includes a webview component, a web page component and an APP web page jump device, wherein the APP web page jump system belongs to the APP architecture content. Specifically, the APP web page jump device collects the current business event information of the APP, and then uses the webview component to call the corresponding web page component according to the obtained information to realize the jump of the APP web page.
[0073] The embodiment of the present application provides an APP web page jump method for implementing the APP web page jump installed on the mobile terminal. The execution subject of the embodiment of the present application is an electronic device, such as a server, a desktop computer, a laptop computer, a tablet computer and other electronic devices that can be used to control the APP.
[0074] like Figure 2 FIG. 1 is a flow chart of an APP web page jump method provided in an embodiment of the present application, and the method includes:
[0075] Step 201, obtaining the current business event information of the APP.
[0076] Among them, the current business event information is used to characterize the functions and page interaction logic of the current business of the APP.
[0077] Step 202, based on the preset webview component and according to the current business event information, determine the target webpage routing information.
[0078] It should be noted that the webview component is a web container that provides an interaction method between the native APP and the web page. It can be achieved by extracting the webview page to display related functions and encapsulating the basic capabilities of the web page.
[0079] Specifically, during the development of APP services, the corresponding jump webpage can be pre-designed according to the interaction requirements of the service, and the page routing and service information of the jump webpage can be associated and managed. Therefore, when the APP needs to jump from the native to the webpage, the page routing information associated with it can be determined based on the information of the current service event.
[0080] Step 203: Call the corresponding target web page route according to the target web page route information.
[0081] Specifically, during the application of the APP, the jump of the APP interface can be realized based on the page route. Therefore, in order to realize the jump of the web page normally, the embodiment of the present application selects the target route information obtained according to the above embodiment to call the corresponding target web page route. Among them, the specific calling method of the target page route can refer to the existing technology, and the embodiment of the present application does not limit it.
[0082] Step 204: Use the target web page routing to call the corresponding target web page component, so that the APP jumps to the corresponding target web page.
[0083] It should be noted that the network component provided in the embodiment of the present application can specifically be an H5 component, and the interaction logic between each H5 component is independent. Putting any H5 component online or offline will not affect the overall page interaction system of the APP.
[0084] In addition, routing can also provide the app with the function of dynamically configuring page jumps. For example, the homepage product module can be configured by the backend to display which entrances and pages to enter. For example, if there is an event on the homepage banner (activity operation position) today and users click to enter the cleaning introduction page, the banner content will configure the cleaning introduction page routing. When the user clicks, the cleaning introduction page routing will be called to jump to the cleaning introduction page. Tomorrow, this event will end and there will be a new event to the moving order page. In this case, the moving route will be configured to achieve the jump to the moving order page.
[0085] Specifically, in one embodiment, the target web page component can be located according to the correspondence between the target web page routing information and the target web page component information; the web protocol of the target web page component can be parsed; and the target web page component can be called according to the web protocol of the target web page component by using the target web page routing.
[0086] Among them, the web protocol of the target web page component is a web general component protocol provided in the embodiment of the present application, and the calling of the target web page component can be implemented based on the web protocol of the target web page component.
[0087] Specifically, in one embodiment, the web protocol of the target web page component may be parsed to determine the page route corresponding to the target web page component, and then the target web page component may be called based on the page route.
[0088] Based on the above embodiment, the webview component includes a registration management class, in which the routes of various business events of the APP are registered. As an implementable method, in one embodiment, based on the webview component, the target web page routing information corresponding to the current business event can be determined according to the current business event information and the registration management class.
[0089] The target web page routing information at least includes the target routing IP and routing parameters.
[0090] It should be noted that the registration management class can specifically provide the registration information of the route and the corresponding calling interface.
[0091] Specifically, according to the function and page interaction logic of the current business represented by the current business event information, the corresponding routing registration information and calling interface information can be searched in the registration management class, and the routing registration information includes routing IP and routing parameters.
[0092] Specifically, in one embodiment, the APP includes multiple business event components, the logics between the business event components are independent of each other, and obtaining the current business event information of the APP includes:
[0093] Step 2011, determining the business event component currently used by the user in the APP;
[0094] Step 2012: determine the current business event information according to the encapsulation logic of the business event component.
[0095] For example, when the APP is a life service APP, "moving" and "cleaning" can be used as different business event components, which are logically independent of each other. However, in actual applications, after the user implements the service provided by the "moving" business event component, the logic can jump to the "cleaning" business event component to improve the user experience.
[0096] Among them, the current business event information specifically refers to the operation information performed by the user based on the current business event component, such as functional requirements and page interaction requirements. Since the business event component is packaged according to the preset logic, the corresponding business event information is determined according to the packaging logic on which it is based. For example, after the user completes the payment of the "moving" fee, he needs to jump to the order details interface, then the jump requirement of this order details interface is the current business event information.
[0097] Specifically, in one embodiment, the above embodiment mainly provides a process of natively jumping from an APP to a web page, and the method further includes:
[0098] Step 301, obtaining the user's operation information in the target web page;
[0099] Step 302: determine whether it is necessary to call back from the target web page to the APP native interface according to the operation information;
[0100] Step 303: If yes, determine the corresponding target business event component according to the APP operation logic represented by the operation information;
[0101] Step 304 calls back to the corresponding APP native interface based on the target business event component.
[0102] Specifically, referring to the above embodiment, after the user completes the payment of the "moving" fee (operation information), according to the preset logic, it should jump to the order details interface. At this time, it can be determined that it is currently necessary to call back from the target web page to the APP native interface.
[0103] Specifically, in one embodiment, the webview component includes all business event components of the APP, and the webview component can be used to call the target business event component to make the APP call back to the corresponding APP native interface.
[0104] Specifically, the embodiment of the present application separates out a separate webview function as a basic component (business event component), which is specifically composed of multiple business lines. Therefore, when an APP callback is required, it can be achieved by calling the target business event component corresponding to the target APP native interface.
[0105] Specifically, in one embodiment, when a new business event occurs in the APP, the new business event is encapsulated as a new business event component according to the function of the new business event and the page interaction logic; the new business event component is registered and added to the webview component.
[0106] Specifically, this application componentizes the APP business logic, that is, in the APP, a part of the basic components implements common functions (such as login, sharing, payment, etc.), and on this basis, it is split into different business components (business event components) according to the business. The business components can rely on the common components to use their functions, but the business components are independent of each other (such as renting, finding a house, moving, cleaning and maintenance, etc.). There is no mutual reference between the pages by default, so that the business can be pluggable, and some functions can also be removed to form a separate app.
[0107] In order to facilitate those skilled in the art to better understand the APP web page jump method provided in the embodiment of the present application, as shown in Figure 3 As shown in the figure, it is the APP web page jump logic diagram provided in the embodiment of the present application. First, Figure 3 Explanation of the professional terms involved:
[0108] +load: This is the class loading method. The class is first loaded when the app starts, and then instantiated when it is used.
[0109] MethodRegisterManager: It is a method registration management class that provides interfaces for method registration and method calling.
[0110] JS->Native method split: JS passes the message to the native method (toMoveOrderDetail) through the method name call, and the native method receives the message to implement specific functions (such as jumping to the moving order line details page). For example, the original logic needs to implement the jump to the moving order details page, and the method name "toMoveOrderDetail" will be agreed with H5, and then the app will accept the "toMoveOrderDetail" event on the H5 container page to implement the "jump to the moving order details page" function. The function is implemented in the H5 container page, which requires the webView to introduce the moving order details class. Similarly, to add a jump to the cleaning order details, it is necessary to introduce the cleaning order details class.
[0111] In the APP web page jump method provided in the embodiment of the present application, the registration interaction method provided by MethodRegisterManager will be used in the moving component to register an interaction event named "toMoveOrderDetail" to achieve jumping to the moving order details page (at this time, the implementation method is in the component, without other coupling). When jumping to the H5 page, the management class will provide a method to obtain all method names that have been registered by the management class. At this time, H5 triggers the interaction (such as clicking a button) and calls the "toMoveOrderDetail" event. The management class can find the registered time implementation through the method name to achieve the jump to the moving details page. Similarly, the cleaning department also decouples the page for the cleaning department's jump.
[0112] Handle native call JS events: For example, call the native sharing function through interaction, and then give rewards after sharing is completed. At this time, the native needs to get the result after sharing is completed and inform H5 (the agreed method name is "shareResult", parameter {"channel":"wechat"}). The previous logical call sharing was also completed on the H5 container page, so the call to native->H5 was also completed on the H5 container page. Now that the functions are split, the sharing method is split into components, and the components need to get the results and inform the H5 container. The new interaction method is to add the "sendDateToJS" method in the registration management class. After sharing is completed, call "sendDateToJS("shareResult",{"channel":"wechat"})", pass the callback method name and parameters to webView, and after webView receives the sendDateToJS event, pass the parameters to H5 according to the method name. sendDateToJS is also encapsulated as a method route, and data can also be sent to H5 through this route.
[0113] The new interaction method refers to the newly defined web general protocol method. JSBridge is a bridge class for protocol parsing, responsible for parsing the general protocol. This method may be notified to the H5 side in advance, so the "jsToOc" method is used as the entry to handle the functions of the general protocol part.
[0114] callMethod:data:completionHandler: is a JS->native method, where the method name (toMoveOrderDetail) is after callMethod, the parameters are after data, and completionHandler is the method that calls H5 after the time is completed. Generally, JS calls native to process something, and then returns the result to H5 after the processing is completed. Therefore, a callback method is reserved in the method call, and the event callback can be processed directly. If you cannot call directly in the callback (such as sharing the result), you can use the "sendToJS" method of the interactive method management class, or the routing method
[0115] BridgeEngine: It is the place where the new interaction handles the protocol content. The protocol defines that H5 needs to call a native route, call parameters, callback method name and other information. The callback method name can be used to callback data before execution. Directly calling the method name to callback is similar to the call method of callH5Handler, which is generally a direct callback with results.
[0116] The new interaction also needs to handle the logic that can no longer be called back (such as sharing results). To unify the entry, the "sendToJS" method is also used (the same applies to routing). Add the parameter "NewMethod" to determine the new and old methods (because the calling methods are different).
[0117] JSBridge: is the new general protocol interaction solution file, "callMethod:data:completionHandler:" is the calling method in the new version interaction, using the same "callMethod:data:completionHandler"
[0118] resultTo: is the name of the callback method defined in the protocol.
[0119] Among them, Figure 3As shown, the method provided in the embodiment of the present application can adapt to the existing logic, support the adaptation of subsequent new methods, and support the interactive calling of old and new methods. For the existing interactive methods (old logic, existing defined interactive logic, mainly to adapt to the existing version), an interactive registration method is provided, and each business line registers the functions that the H5 component needs to support in its own component, and webview will call all registered methods when it is called and instantiated. For the newly added web general protocol, a unified parsed call is made. And the method correspondence between the new protocol call of the old method can realize the interactive transition.
[0120] The registration call provided in the embodiment of the present application is divided into old logic registration and new logic registration:
[0121] Old logic registration refers to the existing interaction methods at this stage, that is, the business logic coupled to the main project webview page, which needs to be split into the corresponding business line. Register the interaction method in the business line component through the business line registration method. Get all registered methods when opening the page, and register them again in the webview page. Because the registration methods are in their respective components, you can get all the registration methods of the business line by referencing the component, which can split the coupled functions without losing the business line functions. If there is a reference to the component, you can get all the interaction logic and realize the cross-component function call of the web page. If you remove the component, the related interactions will be removed at the same time, reducing logic-related processing problems.
[0122] New logic registration refers to registering a set of acceptance and parsing schemes that comply with the general web component interface protocol. Through the general protocol, incoming events, types, and callbacks are accepted, and the calls are parsed uniformly to complete the method calls. The call events are connected with the routes, and the previous encapsulated interaction method is changed to encapsulated routes. The events passed to H5 are also passed back to the specified callback name through the callback, and accepted and processed by H5, which can realize the complete path for H5 to call the native route.
[0123] The native method given to H5 is called through the proxy, adding a proxy to the registration method, and calling the proxy's callback method to pass the native logic to H5.
[0124] For example, Figure 4 As shown, it is a call relationship diagram of the APP components provided in an embodiment of the present application. Figure 4 The calling relationships between different classes. The English in the box can be understood as the class name, from left to right:
[0125] 1. Business line H5 interaction registration file (xxx represents different business line names, such as moving is MoveMethodInterface, cleaning is CleanMethodInterface. It is generally recommended that H5 registration methods be written in the same file), which mainly handles the interaction logic of each business line.
[0126] 2. General H5 interactive registration file, to realize the registration of general methods (such as sharing, payment, etc.). All interactive methods use the registration method, and the H5 container page only obtains and calls all registration methods, and no longer implements specific interactive methods.
[0127] 3. The H5 container page that has been split into components. WebViewMethodProtocol is the protocol that the H5 container must comply with, that is, the methods that need to be implemented, such as sending events to H5. The main function is to standardize the required method names. If you change the web container later, you only need to replace the H5 container page, and the new page also contains the methods specified in the WebViewMethodProtocol protocol.
[0128] 4. The new interactive routing processing logic file is mainly responsible for the parsing and calling of the new general interactive protocol.
[0129] It should be further explained that, based on the general webview component, a webview component suitable for the app is built based on the existing basic capabilities of the app. Adapt the app-specific logic, such as the encapsulation of general capability calls such as unified login, short link parsing, sharing, contacting customer service, and payment. The difference from the basic component is the adaptation of the app business. Move the interaction event registration in the original main project webview to each business line. At the same time, when splitting, first encapsulate the method implementation as a route for the new protocol call. Realize the intercommunication between the existing logic and the new protocol parsing call method, and then call the existing logic through the new protocol method. And in order to uniformly search for registered methods, build the MethodDefine component to uniformly define all interactive method names. At the same time, in order to prevent repeated registration of methods, records of repeated registration methods are also added during registration, and page prompts are given in the case of webview page debugging.
[0130] The APP web page jump method provided in the embodiment of the present application obtains the current business event information of the APP; wherein the current business event information is used to characterize the function and page interaction logic of the current business of the APP; based on the preset webview component, the target web page routing information is determined according to the current business event information; according to the target web page routing information, the corresponding target web page routing is called; and the corresponding target web page component is called by the target web page routing, so that the APP jumps to the corresponding target web page. That is, by componentizing the web page and directly calling the web page component through the web page routing, the split call of the business is realized, the coupling of the page interaction logic of the webview component is avoided, and the difficulty of implementing the APP web page jump is reduced. In addition, by removing the lightweight webview component, the function is split into each business line, the business coupling is solved, and the debugging of the development business function is convenient. In addition, the interaction is sunk into the component, the split call of the business is realized, the business coupling is reduced, the call of all registered events is supported, and the binding of the introduction of the business line and the interaction method is realized. In addition, forward and backward compatibility is realized, the existing method is registered, and the historical logic is forward compatible. The introduction of the protocol interaction scheme can also support the subsequent new logic processing and support the gradual migration of the H5 call method. Moreover, this unified interaction solution opens up the mutual calls between routing and H5, and event interaction directly calls routing. Subsequently, only routing needs to be formulated without adding new interaction logic.
[0131] An embodiment of the present application provides an APP web page jump device, which is used to execute the APP web page jump method provided in the above embodiment.
[0132] like Figure 5 , which is a schematic diagram of the structure of an APP web page jump device provided in an embodiment of the present application. The APP web page jump device 50 includes an acquisition module 501, a route determination module 502, a route calling module 503 and a web page jump module 504.
[0133] Among them, the acquisition module is used to obtain the current business event information of the APP; wherein the current business event information is used to characterize the functions and page interaction logic of the current business of the APP; the routing determination module is used to determine the target web page routing information based on the preset webview component and the current business event information; the routing call module is used to call the corresponding target web page routing according to the target web page routing information; the web page jump module is used to use the target web page routing to call the corresponding target web page component, so that the APP jumps to the corresponding target web page.
[0134] Specifically, in one embodiment, the webview component includes a registration management class, in which the routes of various business events of the APP are registered, and the routing calling module is specifically used for:
[0135] Based on the webview component, determine the target web page routing information corresponding to the current business event according to the current business event information and registration management class;
[0136] The target web page routing information at least includes the target routing IP and routing parameters.
[0137] Specifically, in one embodiment, the web page jump module is specifically used to:
[0138] Locating the target web page component according to the corresponding relationship between the target web page routing information and the target web page component information;
[0139] Parse the web protocol of the target web page component;
[0140] The target web page routing is utilized to call the target web page component according to the web protocol of the target web page component.
[0141] Specifically, in one embodiment, the APP includes multiple business event components, the logics between the business event components are independent of each other, and the acquisition module is specifically used to:
[0142] Determine the business event components that the user is currently using in the app;
[0143] According to the encapsulation logic of the business event component, the current business event information is determined.
[0144] Specifically, in one embodiment, the device further includes:
[0145] The callback module is used to obtain the user's operation information in the target web page; based on the operation information, determine whether it is necessary to call back from the target web page to the APP native interface; if so, determine the corresponding target business event component based on the APP operation logic represented by the operation information; based on the target business event component, call back to the corresponding APP native interface.
[0146] Specifically, in one embodiment, the callback module is specifically used to:
[0147] Use the webview component to call the target business event component so that the APP calls back to the corresponding APP native interface.
[0148] Specifically, in one embodiment, the device further includes:
[0149] The new business module is used to encapsulate new business events into new business event components according to the functions of the new business events and the page interaction logic when new business events occur in the APP; the new business event components are registered and added to the webview component.
[0150] Regarding the APP web page jumping device in this embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0151] The APP web page jump device provided in the embodiment of the present application is used to execute the APP web page jump method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.
[0152] An embodiment of the present application provides an electronic device for executing the APP web page jump method provided in the above embodiment.
[0153] like Figure 6 , which is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 60 includes: at least one processor 61 and a memory 62;
[0154] The memory stores computer-executable instructions; at least one processor executes the computer-executable instructions stored in the memory, so that at least one processor executes the APP web page jump method provided in the above embodiment.
[0155] An electronic device provided in an embodiment of the present application is used to execute the APP web page jump method provided in the above embodiment. Its implementation method and principle are the same and will not be repeated here.
[0156] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the APP web page jump method provided in any of the above embodiments is implemented.
[0157] The storage medium containing computer executable instructions in the embodiment of the present application can be used to store computer executable instructions of the APP web page jump method provided in the aforementioned embodiment. Its implementation method and principle are the same and will not be repeated here.
[0158] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0159] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0160] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0161] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0162] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0163] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for jumping to an APP webpage, characterized in that: include: Obtain the current business event information of the APP; wherein the current business event information is used to characterize the functions and page interaction logic of the current business of the APP; Based on the preset webview component, determine the target webpage routing information according to the current business event information; According to the target web page routing information, calling the corresponding target web page routing; Using the target web page routing to call the corresponding target web page component, so that the APP jumps to the corresponding target web page; The webview component includes a registration management class, in which the routes of each business event of the APP are registered. The preset webview component determines the target webpage routing information according to the current business event information, including: Based on the webview component, determining the target webpage routing information corresponding to the current business event according to the current business event information and the registration management class; The target webpage routing information at least includes the target routing IP and routing parameters, and the registration management class is used to provide routing registration information and a corresponding calling interface.
2. The method according to claim 1, characterized in that The method of using the target webpage route to call a corresponding target webpage component includes: Locating the target web page component according to the corresponding relationship between the target web page routing information and the target web page component information; Parsing the web protocol of the target web page component; The target web page component is called according to the web protocol of the target web page component by utilizing the target web page routing.
3. The method according to claim 1, characterized in that The APP includes multiple business event components, and the logics between the business event components are independent of each other. The obtaining of the current business event information of the APP includes: Determine the business event components that the user is currently using in the app; The current business event information is determined according to the encapsulation logic of the business event component.
4. The method according to claim 3, characterized in that Also includes: Obtaining operation information of the user in the target webpage; According to the operation information, determine whether it is currently necessary to call back from the target web page to the APP native interface; If yes, determine the corresponding target business event component according to the APP operation logic represented by the operation information; Based on the target business event component, call back to the corresponding APP native interface.
5. The method according to claim 4, characterized in that The webview component includes all business event components of the APP, and the callback to the corresponding APP native interface based on the target business event component includes: The webview component is used to call the target business event component so that the APP calls back to the corresponding APP native interface.
6. The method according to claim 5, characterized in that Also includes: When a new business event occurs in the APP, the new business event is encapsulated as a new business event component according to the function of the new business event and the page interaction logic; Register the newly added business event component and add it to the webview component.
7. An APP web page jump device, characterized in that: include: An acquisition module is used to acquire the current business event information of the APP; wherein the current business event information is used to characterize the function and page interaction logic of the current business of the APP; A routing determination module, used to determine the target web page routing information based on the preset webview component and the current business event information; A route calling module, used to call the corresponding target web page route according to the target web page route information; A web page jump module, used to call a corresponding target web page component using the target web page route, so that the APP jumps to the corresponding target web page; The webview component includes a registration management class, in which the routes of each business event of the APP are registered, and the route determination module is specifically used to: Based on the webview component, determining the target webpage routing information corresponding to the current business event according to the current business event information and the registration management class; The target webpage routing information at least includes the target routing IP and routing parameters, and the registration management class is used to provide routing registration information and a corresponding calling interface.
8. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Page skipping method and device, electronic equipment and storage medium
CN110221872A
Page skipping method and device, storage medium and computer equipment
CN110347942A