User interface generation method and device of browser, electronic equipment and storage medium
By obtaining user interface requests, obtaining target execution objects from the server, generating and splicing front-end pages, the problem of low efficiency in browser user interface development is solved and more efficient user interface development is achieved.
Patent Information
- Application Number
- CN202311828285.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-06-27
AI Technical Summary
The development efficiency and cycle of existing browser user interfaces are relatively long, and a technical solution is needed to improve development efficiency.
By obtaining the user interface request, the target execution object is obtained from the server, the target front-end page is generated based on the object, and it is spliced and rendered with the preset front-end page to generate the final user interface.
The target execution object replaces the server to perform data processing on the front-end page, which significantly improves the development efficiency of the user interface.
Smart Images

Figure CN120216062A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic devices, and in particular, to a method, apparatus, electronic device, and storage medium for generating a user interface of a browser. Background Art
[0002] With the continuous development of computer technology, various functions required for browsers have gradually increased. During the development of a browser, what is ultimately presented to the user is the user interface. For the user interface of a browser, it is necessary to call encapsulated display controls such as view tags, image views, view tag buttons, image buttons, text error reports, scroll bars, dialog boxes, etc. from the server side, and it is necessary to write cumbersome code for laying out these controls, calculating sizes, drawing, setting fonts, etc. to generate the user interface. Moreover, the server side not only needs to provide data support for the controls in the user interface, but also needs to provide data support for the implementation of browser functions, resulting in a relatively long development efficiency and cycle for the user interface of the browser. Therefore, a technical solution for improving the development efficiency of the user interface of a browser is needed. Summary of the Invention
[0003] The present application provides a method, apparatus, electronic device, and storage medium for generating a user interface of a browser, and this method can improve the development efficiency of the user interface of the browser.
[0004] In a first aspect, a method for generating a user interface of a browser is provided, including:
[0005] Obtaining a first request for the user interface, where the first request carries first request data, and the first request data corresponds to the interface display service of the user interface;
[0006] In response to the first request, obtaining at least one target execution object corresponding to the first request data from the server side, where the target execution object is used to execute the interface display processing method corresponding to the first request data;
[0007] Generating a target front-end page corresponding to the first request data based on the target execution object, where the target front-end page includes at least one display control corresponding to the interface display processing method;
[0008] Performing page splicing on the target front-end page and a preset front-end page, and rendering the spliced page to obtain a target user interface.
[0009] In a second aspect, a device for generating a user interface of a browser is provided, including:
[0010] A first acquisition module, configured to acquire a first request of the user interface, where the first request carries first request data corresponding to the interface display service of the user interface;
[0011] A second acquisition module, configured to, in response to the first request, acquire at least one target execution object corresponding to the first request data from a server, where the target execution object is used to execute an interface display processing method corresponding to the first request data;
[0012] A generation module, configured to generate a target front-end page corresponding to the first request data based on the target execution object, where the target front-end page includes at least one display control corresponding to the interface display processing method;
[0013] A splicing module, configured to splice the target front-end page with a preset front-end page, and render the spliced page to obtain a target user interface.
[0014] In a third aspect, an electronic device is provided, where the electronic device includes:
[0015] A memory, configured to store executable program code;
[0016] A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the user interface generation method of the browser as described in any one of the above.
[0017] In a fourth aspect, a computer-readable storage medium is provided, where the computer-readable storage medium stores a computer program, and when the computer program is executed, the user interface generation method of the browser as described in any one of the above is implemented.
[0018] The beneficial effects brought by the technical solutions provided in some embodiments of this application at least include: The user interface generation method of the browser provided in this application acquires a first request of the user interface, where the first request carries first request data corresponding to the interface display service of the user interface; in response to the first request, acquires at least one target execution object corresponding to the first request data from a server, where the target execution object is used to execute an interface display processing method corresponding to the first request data; generates a target front-end page corresponding to the first request data based on the target execution object, where the target front-end page includes at least one display control corresponding to the interface display processing method; splices the target front-end page with a preset front-end page, and renders the spliced page to obtain a target user interface. By using the target execution object to replace the server to perform the data processing work of the front-end page, the development efficiency of the user interface is improved. Description of the Drawings
[0019] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0020] Figure 1 It is the first flowchart of the method for generating a user interface of a browser provided by an embodiment of the present application.
[0021] Figure 2 It is the first scenario diagram of the method for generating a user interface of a browser provided by an embodiment of the present application.
[0022] Figure 3 It is the second flowchart of the method for generating a user interface of a browser provided by an embodiment of the present application.
[0023] Figure 4 It is the second scenario diagram of the method for generating a user interface of a browser provided by an embodiment of the present application.
[0024] Figure 5 It is the third flowchart of the method for generating a user interface of a browser provided by an embodiment of the present application.
[0025] Figure 6 It is the third scenario diagram of the method for generating a user interface of a browser provided by an embodiment of the present application.
[0026] Figure 7 It is the fourth flowchart of the method for generating a user interface of a browser provided by an embodiment of the present application.
[0027] Figure 8 It is the structural diagram of the device for generating a user interface of a browser provided by an embodiment of the present application.
[0028] Figure 9 It is the first structural diagram of an electronic device provided by an embodiment of the present application.
[0029] Figure 10 It is the second structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0030] To make the features and advantages of this application more obvious and understandable, the following will clearly and completely describe the technical solutions in the embodiments of this application in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of this application.
[0031] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. On the contrary, they are only examples of devices and methods consistent with some aspects of this application as detailed in the appended claims.
[0032] Hereinafter, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as implying or suggesting relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features.
[0033] In the related art, generating the user interface of a browser requires calling the controls for user interface display from the server side, and cumbersome code writing such as layout, calculating sizes, drawing, and setting fonts for these controls is needed to generate the user interface. Moreover, the server side not only needs to provide data support for the controls in the user interface, but also needs to provide data support for the implementation of the browser's functions, resulting in relatively long development efficiency and cycle for the user interface of the browser.
[0034] To improve the development efficiency of the user interface of a browser, an embodiment of this application provides a method for generating the user interface of a browser. The execution subject of this method for generating the user interface of a browser can be an electronic device, such as an electronic device like a smart phone, a tablet computer, a laptop computer, etc.
[0035] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments. Please refer to Figure 1 , Figure 1 is the first flow diagram of the method for generating the user interface of a browser provided by the embodiment of this application. The specific process of this method for generating the user interface of a browser can be as follows:
[0036] S101, obtain a first request for the user interface, where the first request carries first request data, and the first request data corresponds to the interface display service of the user interface.
[0037] In this embodiment, a browser is an application used to retrieve, display, and transmit Web information resources. Users can browse interrelated information through the browser with the help of hyperlinks. Web information resources are marked by Uniform Resource Identifiers (URIs), and their presentation forms include a web page, a picture, a video, or any content presented on the Web. The page finally presented to the user is the user interface.
[0038] In some embodiments, during the development of the user interface of a browser, developers need to obtain a generation request for the user interface. The generation request carries request data, and developers need to detect the request data to determine the request type of the generation request. Among them, the request type can include a front-end request and a back-end request. For example, if the request data corresponds to the interface display service of the user interface, the request type of the generation request is a front-end request; if the request data corresponds to the function implementation service of the user interface, the request type of the generation request is a back-end request.
[0039] Optionally, if the generation request corresponds to the content displayed on the user interface, such as the settings page of the browser, bookmarks, browsing history, about, menu, avatar panel, certificate panel, etc., obtain a first request for the user interface. The first request carries first request data, and the first request data corresponds to the interface display service of the user interface. The first request is a front-end request.
[0040] S102, in response to the first request, obtain at least one target execution object corresponding to the first request data from the server, where the target execution object is used to execute the interface display processing method corresponding to the first request data.
[0041] It should be noted that in the related art, when obtaining a generation request corresponding to the interface display service of the user interface, it is necessary to call controls for user interface display from the server, such as view tags, image views, view tag buttons, image buttons, text error reports, scroll bars, dialog boxes, etc. The main function of the server is to implement the function implementation service of the browser. If the interface display service of the user interface also needs to call data from the server for display, it will increase the data processing volume of the server, thereby reducing the development efficiency of the user interface.
[0042] Therefore, in this embodiment, after obtaining the first request for the user interface, in response to the first request, obtain at least one target execution object corresponding to the first request data from the server, where the target execution object is used to execute the interface display processing method corresponding to the first request data, and the data carried by the interface display processing method can implement the interface display service.
[0043] It can be understood that the target execution object can be a control encapsulated by the server, such as a DialogDelegate control. The target execution object can serve as a static proxy object of the server, that is, the target execution object can replace the server to execute the interface display processing method corresponding to the first request data, so that the server does not need to perform data processing on the interface display service of the user interface, and the server only needs to provide data support for the function implementation service, while the target execution object replaces the server to execute the interface display service. The target execution object processes the front-end requests of the user interface, and the server processes the back-end requests of the user interface, so that the server releases the workload of data processing for front-end requests, thereby improving the development efficiency of the user interface of the browser.
[0044] S103, generate a target front-end page corresponding to the first request data based on the target execution object, where the target front-end page includes at least one display control corresponding to the interface display processing method.
[0045] In some embodiments, the target execution object serves as a proxy processing place for the server for the interface display service. Since the target execution object can execute the interface display processing method corresponding to the first request data, it is necessary to call the first response data corresponding to the display processing method from the target execution object and generate a target front-end page corresponding to the first request data based on the first response data, where the target front-end page includes at least one display control corresponding to the interface display processing method, such as view labels, image views, view label buttons, image buttons, text error messages, scroll bars and other controls.
[0046] It should be noted that the target execution object, as a control, does not carry the data for executing the display processing method itself. The target execution object can be connected to the server through an interface and obtain the data required for executing the display processing method from the server. Specifically, the first response data corresponding to the display processing method can be obtained from the server and transmitted to the target execution object, and the target execution object replaces the server to execute the interface display processing method based on the first response data to complete the interface display service.
[0047] Optionally, the first response data corresponding to the interface display processing method can also be obtained from a third-party database and transmitted to the target execution object, so that the server does not need to provide the data required for the interface display service, further reducing the data processing volume of the server to improve the development efficiency of the user interface. Of course, the first response data can also be obtained jointly from the server and the third-party database, and the specific acquisition method is not specifically limited here.
[0048] It should be noted that the target execution object can separate the interface display and function implementation to form an independent class. Developers can create subclasses based on this class to be responsible for managing and controlling the behavior of the target execution object, such as processing user input, updating controls, etc. Specifically, a target control is generated based on the target execution object; the first response data is called from the target execution object; and a target front-end page corresponding to the first request data is generated in the target control based on the first response data.
[0049] Among them, taking the target execution object as a class, a subclass can be created in the target execution object, that is, a target control is generated based on the target execution object. A target control is created within a target execution object, and this target control is a subclass. Since the target execution object carries the first response data, and the first response data is used to execute the interface display processing method, therefore, a front-end page such as an HTML page can be loaded in the target control based on the first response data, so as to implement the target execution object to replace the server-side to execute the interface display processing method to complete the interface display service. Among them, the front-end page includes multiple controls for display.
[0050] For example, please refer to Figure 2 , Figure 2 which is the first scenario schematic diagram of the user interface generation method of the browser provided by the embodiment of the present application. Among them, the target execution object can be a DialogDelegate control, and the target control can be a views::WebView control, that is, a views::WebView control is created in the DialogDelegate control, and the LoadURL method is called in the views::WebView control to load a front-end HTML page. The front-end HTML page includes multiple display controls, such as control A is a views::Label view label, control B is a views::ImageView image view, control C is a views::LabelButton view label button, control D is a views::ImageButton image button, control E is a views::Textfailed text failure, control F is a views::Scrollbar scroll bar, etc. display controls. Among them, in the front-end HTML page, technologies such as HTML, CSS, and JavaScript can be used to implement the layout and interaction logic of multiple display controls. For example, HTML elements (such as div, span), CSS styles, and JavaScript scripts are used to create and control multiple display controls.
[0051] S104, splice the target front-end page with a preset front-end page, and render the spliced page to obtain a target user interface.
[0052] After generating a target front-end page corresponding to the first request data based on the target execution object, the target front-end page can be spliced with a preset front-end page, and the spliced page can be re-rendered to obtain a target user interface. The preset front-end page may include content such as a settings page, bookmarks, and browsing history. Since data does not need to be called from the server to display the content such as the settings page, bookmarks, and browsing history when creating them. Therefore, the front-end developer can write front-end code to generate the preset front-end page, and the target front-end page is the interface display service completed by the target execution object on behalf of the server. To ensure the integrity of the user interface display function, the target front-end page is spliced with the preset front-end page and the spliced interface is reloaded to obtain a complete target user interface.
[0053] As can be seen from the above, in this embodiment, by obtaining a first request for a user interface, where the first request carries first request data corresponding to the interface display service of the user interface; in response to the first request, obtaining at least one target execution object corresponding to the first request data from the server, where the target execution object is used to execute the interface display processing method corresponding to the first request data; generating a target front-end page corresponding to the first request data based on the target execution object, where the target front-end page includes at least one display control corresponding to the interface display processing method; splicing the target front-end page with a preset front-end page, and rendering the spliced page to obtain a target user interface. By using the target execution object to replace the server to perform the data processing work of the front-end page, the development efficiency of the user interface is improved.
[0054] According to the method described in the previous embodiment, the following will give a further detailed description with examples. Please refer to Figure 3 , Figure 3 is the second flowchart of the method for generating a user interface of a browser provided by an embodiment of the present application. The specific process of the method for generating a user interface of the browser may include:
[0055] S201, obtain a first request for a user interface.
[0056] In this embodiment, during the development of the user interface of the browser, the developer needs to obtain a generation request for the user interface. The generation request carries request data, and the developer needs to detect the request data to determine the request type of the generation request. The request type may include a front-end request and a back-end request. For example, if the request data corresponds to the interface display service of the user interface, the request type of the generation request is a front-end request; if the request data corresponds to the function implementation service of the user interface, the request type of the generation request is a back-end request.
[0057] Optionally, if the content displayed in the generated request corresponding user interface, such as the settings page of the browser, bookmarks, browsing history, about, menu, avatar panel, certificate panel, etc., then obtain the first request of the user interface, where the first request carries first request data, and the first request data corresponds to the interface display service of the user interface. This first request is a front-end request.
[0058] S202, in response to the first request, obtain a target execution object corresponding to the first request data from the server.
[0059] Specifically, after obtaining the first request of the user interface, in response to the first request, obtain a target execution object corresponding to the first request data from the server. The target execution object is used to execute the interface display processing method corresponding to the first request data, and the data carried by the interface display processing method can implement the interface display service. That is, the target execution object can replace the server to execute the interface display processing method corresponding to the first request data, so that the server does not need to perform data processing on the interface display service of the user interface, and the server only needs to provide data support for the function implementation service, while the interface display service is executed by the target execution object instead of the server. The target execution object processes the front-end request of the user interface, and the server processes the back-end request of the user interface, so that the server releases the workload of data processing for the front-end request, thereby improving the development efficiency of the browser's user interface.
[0060] S203, generate a plurality of first target controls based on one target execution object.
[0061] It should be noted that the target execution object can separate the interface display and function implementation to form an independent class. Developers can create subclasses based on this class to be responsible for managing and controlling the behavior of the target execution object. Specifically, generate a plurality of first target controls based on one target execution object. Among them, taking the target execution object as a class, subclasses can be created in the target execution object, and multiple target controls can be created within one target execution object, and each target control is used as a subclass.
[0062] S204, call the first response data from the target execution object, and generate a first target front-end page corresponding to the first request data in each first target control based on the first response data, where the first target front-end page includes at least one display control.
[0063] In some embodiments, the target execution object serves as an agent processing location for the interface display service. Since the target execution object can execute the interface display processing method corresponding to the first request data, it is necessary to call the first response data corresponding to the display processing method from the target execution object, and generate a first target front-end page corresponding to the first request data based on the first response data. Among them, the first target front-end page includes at least one display control, such as view tags, image views, view tag buttons, image buttons, text error messages, scroll bars, and other controls.
[0064] Optionally, the first response data corresponding to the display processing method can be obtained from the server and / or a third-party database, and the first response data is transmitted to the target execution object. The target execution object executes the interface display processing method on behalf of the server based on the first response data to complete the interface display service.
[0065] In some embodiments, multiple first target controls are generated based on a target execution object; the first response data is called from the target execution object; and a first target front-end page corresponding to the first request data is generated in each first target control based on the first response data. Since the first response data is carried in the target execution object and the first response data is used to execute the interface display processing method, therefore, a first target front-end page such as an HTML page can be loaded in each first target control based on the first response data, and the first target front-end pages loaded by each first target control are spliced to obtain the target front-end page required for generating the user interface of the browser, so that the target execution object replaces the server to execute the interface display processing method to complete the interface display service.
[0066] It should be noted that by creating multiple first target controls in a target execution object and loading a first target front-end page through each first target control, the controls to be displayed on the user interface can be regionally divided, so as to realize the separate control of the target execution object over multiple first target controls. If the user interface needs to be modified, it is only necessary to determine the first target control where the display control to be modified is located, and re-execute the interface display processing method on the first target control to be modified based on the target execution object, and splice the modified first target control with the front-end pages corresponding to other unmodified first target controls again to obtain the modified user interface, without reloading all the display controls on the user interface, thereby reducing the data processing volume of the target execution object and improving the development efficiency of the user interface.
[0067] For example, please refer to Figure 4 , Figure 4This is the second scenario schematic diagram of the user interface generation method of the browser provided by the embodiments of the present application. Among them, the target execution object can be a DialogDelegate control. Multiple first target controls are generated based on the target execution object. The first target controls can be views::WebView control 1, views::WebView control 2, and views::WebView control 3 respectively. That is, multiple views::WebView controls are created in the DialogDelegate control, and the LoadURL method is called respectively in each views::WebView control to load a front-end HTML page. Each front-end HTML page includes at least one display control. For example, the front-end HTML page 1 is loaded in the views::WebView control 1, where the front-end HTML page 1 includes control A as a views::Label view label and control B as a views::ImageView image view; the front-end HTML page 2 is loaded in the views::WebView control 2, where the front-end HTML page 2 includes control C as a views::LabelButton view label button and control D as a views::ImageButton image button; the front-end HTML page 3 is loaded in the views::WebView control 3, where the front-end HTML page 3 includes control E as a views::Textfailed text failure and control F as a views::Scrollbar scroll bar. The front-end HTML page 1, the front-end HTML page 2, and the front-end HTML page 3 are spliced, so that the DialogDelegate control replaces the server to complete the interface display service.
[0068] In some embodiments, if control A in the user interface needs to be modified, determine the first target control where control A is located, that is, views::WebView control 1, and call the modification data from the target execution object, that is, the DialogDelegate control, to modify control A. For the controls in views::WebView control 2 and views::WebView control 3, there is no need to modify them, thus reducing the amount of data obtained from the target execution object, and further improving the development efficiency of the user interface while enhancing the compatibility of the user interface.
[0069] S205. If it is detected that the function corresponding to any display control in the first target front-end page is triggered, obtain a second request for the user interface, where the second request carries second request data, and the second request corresponds to the function implementation service of the user interface.
[0070] After generating a first target front-end page corresponding to the first request data based on the target execution object, if it is detected that the function corresponding to any display control in the first target front-end page is triggered, a second request for the user interface is obtained, where the second request carries second request data, and the second request data corresponds to the function of the user interface to implement a service, and the second request is a back-end request.
[0071] S206, in response to the second request, call second response data corresponding to the service implementation from the server, and control the display control to implement the corresponding function based on the second response data.
[0072] It should be noted that each display control is bound to a function event. If the function event corresponding to any display control is triggered, it is necessary to call the second response data corresponding to the function implementation processing method that can respond to this function event from the server. The second response data corresponding to the function implementation processing method can implement the service implementation, so as to control the display control to implement the corresponding function based on the second response data of the server. For example, when an image button control is triggered, the business logic for responding to the trigger of the image button control based on the second response data of the server is to enlarge the image.
[0073] Specifically, in its front-end code, the display control can listen for the user's interaction event with the display control through JavaScript, call a JavaScript function to respond to the trigger event, and call the interface provided by the server's handler through JavaScript to transfer the data of the interaction event to the server for data processing. After the server's handler processes the business logic, it returns the second response data to the display control through the JavaScript interface, and the display control updates the data in its front-end code based on the second response data to implement the function corresponding to the trigger of the display control.
[0074] S207, splice the first target front-end page with a preset front-end page, and render the spliced page to obtain a target user interface.
[0075] In some embodiments, after generating a first target front-end page corresponding to the first request data based on the target execution object, the first target front-end page can be spliced with a preset front-end page, and the spliced page can be re-rendered to obtain a target user interface. The preset front-end page may include content such as a settings page, bookmarks, and browsing history. Since data does not need to be called from the server for display when creating content such as the settings page, bookmarks, and browsing history, front-end developers can write front-end code to generate the preset front-end page. The target front-end page is an interface display service completed by the target execution object instead of the server. To ensure the integrity of the user interface display function, the first target front-end page is spliced with the preset front-end page and the spliced interface is reloaded to obtain a complete target user interface.
[0076] As can be seen from the above, in this embodiment, a first request of the user interface is obtained; in response to the first request, a target execution object corresponding to the first request data is obtained from the server; a plurality of first target controls are generated based on the target execution object; first response data is called from the target execution object, and a first target front-end page corresponding to the first request data is generated in each first target control based on the first response data, where the first target front-end page includes at least one display control; if it is detected that the function corresponding to any display control in the first target front-end page is triggered, a second request of the user interface is obtained, where the second request carries second request data, and the second request corresponds to the function implementation service of the user interface; in response to the second request, second response data corresponding to the function implementation service is called from the server, and the corresponding function is implemented by controlling the display control based on the second response data; the target front-end page is spliced with the preset front-end page, and the spliced page is rendered to obtain a target user interface. By using the target execution object to replace the server to perform the data processing work of the front-end page, the development efficiency of the user interface is improved. In addition, by creating a plurality of first target controls in the target execution object, individual control of the display control can be achieved when modifying the display control in the user interface, reducing the data processing volume of the target execution object and further improving the development efficiency of the user interface.
[0077] Optionally, please refer to Figure 5 , Figure 5 FIG.
[0078] S301, obtain a first request of the user interface.
[0079] For details, please refer to the above embodiments and will not be elaborated here.
[0080] S302. In response to the first request, obtain multiple target execution objects corresponding to the first request data from the server.
[0081] Specifically, after obtaining the first request of the user interface, in response to the first request, obtain multiple target execution objects corresponding to the first request data from the server. It should be noted that each target execution object can replace the server to execute the interface display processing method, so that the server does not need to perform data processing on the interface display service of the user interface, enabling the server to only provide data support for the function implementation service, and enabling the server to release the workload of data processing for front-end requests, thereby improving the development efficiency of the user interface of the browser.
[0082] The difference between this embodiment and the above embodiment is that: by simultaneously executing the interface display processing method corresponding to the first request data by multiple target execution objects, the collaborative development of the user interface by multiple target execution objects can be realized, which can improve the data processing speed of the interface display service and further enhance the development efficiency of the user interface.
[0083] S303. Generate multiple second target controls based on the multiple target execution objects, where one target execution object corresponds to at least one second target control.
[0084] Generate multiple second target controls based on the multiple target execution objects, where one target execution object corresponds to at least one second target control. Among them, each target execution object can be regarded as a class, and subclasses can be created respectively in each target execution object, and at least one second target control is created respectively within each target execution object, and each second target control is used as a subclass.
[0085] S304. Invoke the first response data from the target execution object, and generate a second target front-end page corresponding to the first request data in each second target control based on the first response data, where the second target front-end page includes at least one display control.
[0086] In some embodiments, generate multiple first target controls based on the multiple target execution objects; invoke the first response data from each target execution object; and generate a second target front-end page corresponding to the first request data in at least one second target control corresponding to each target execution object based on the first response data.
[0087] It should be noted that multiple target execution objects are obtained on the server side, and at least one second target control is created in each target execution object. By loading a second target front-end page through each second target control, the data required for the interface display service of the user interface can be processed separately by multiple target execution objects, reducing the amount of data that each target execution object needs to process. Thus, collaborative development of the user interface by multiple target execution objects can be achieved, further improving the development efficiency of the user interface. Additionally, if the user interface needs to be modified, only the target execution object corresponding to the display control that needs to be modified needs to be determined, and the interface display processing method is re-executed for the second target control that needs to be modified based on the target execution object. Then, the modified second target control is re-spliced with the front-end pages corresponding to other unmodified second target controls to obtain the modified user interface, without reloading all the display controls of the user interface, thereby enhancing the development efficiency of the user interface.
[0088] For example, please refer to Figure 6 , Figure 6It is the second scenario schematic diagram of the user interface generation method of the browser provided by the embodiments of the present application. Among them, the target execution objects can be DialogDelegate control 1, DialogDelegate control 2, and DialogDelegate control 3 respectively. A second target control is generated based on each target execution object, and the second target controls can be views::WebView control 1, views::WebView control 2, and views::WebView control 3 respectively. That is, multiple DialogDelegate controls are obtained from the server, at least one views::WebView control is created in each DialogDelegate control, and the LoadURL method is called in each views::WebView control to load a front-end HTML page. Each front-end HTML page includes at least one display control. For example, the front-end HTML page 1 is loaded in the views::WebView control 1, where the front-end HTML page 1 includes control A as a views::Label view label and control B as a views::ImageView image view; the front-end HTML page 2 is loaded in the views::WebView control 2, where the front-end HTML page 2 includes control C as a views::LabelButton view label button and control D as a views::ImageButton image button; the front-end HTML page 3 is loaded in the views::WebView control 3, where the front-end HTML page 3 includes control E as a views::Textfailed text failure and control F as a views::Scrollbar scroll bar. The front-end HTML page 1, the front-end HTML page 2, and the front-end HTML page 3 are spliced, so that the DialogDelegate control 1, the DialogDelegate control 2, and the DialogDelegate control 3 jointly replace the server to complete the interface display service, improving the development efficiency of the user interface.
[0089] In some embodiments, if control A in the user interface needs to be modified, the second target control where control A is located, i.e., the views::WebView control 1, is determined. Since the views::WebView control 1 corresponds to the DialogDelegate control 1, therefore, the modified data is called from the target execution object, i.e., the DialogDelegate control 1, to modify control A. For the controls in the DialogDelegate control 2 and the DialogDelegate control 3, there is no need to modify them. This not only reduces the amount of data obtained by each target execution object from the server, but also enables separate management and control of the display controls, further improving the development efficiency of the user interface while realizing the collaborative development of the user interface.
[0090] S305. If it is detected that the function corresponding to any display control in the second target front-end page is triggered, obtain the second request of the user interface, where the second request carries second request data, and the second request corresponds to the function implementation service of the user interface.
[0091] After generating the second target front-end page corresponding to the first request data based on the target execution object, if it is detected that the function corresponding to any display control in the second target front-end page is triggered, obtain the second request of the user interface, where the second request carries second request data, and the second request data corresponds to the function implementation service of the user interface. This second request is a back-end request.
[0092] S306. In response to the second request, call the second response data corresponding to the function implementation service from the server, and control the display control to implement the corresponding function based on the second response data.
[0093] For details, please refer to the above embodiments and will not be elaborated here.
[0094] S307. splice the second target front-end page with the preset front-end page, and render the spliced page to obtain the target user interface.
[0095] For details, please refer to the above embodiments and will not be elaborated here.
[0096] As can be seen from the above, in this embodiment, a first request of a user interface is obtained; in response to the first request, a plurality of target execution objects corresponding to the first request data are obtained from a server; a plurality of second target controls are generated based on the plurality of target execution objects, where one target execution object corresponds to at least one second target control; first response data is called from the target execution objects, and a second target front-end page corresponding to the first request data is generated in each second target control based on the first response data, where the second target front-end page includes at least one display control; if it is detected that a function corresponding to any display control in the second target front-end page is triggered, a second request of the user interface is obtained, where the second request carries second request data, and the second request corresponds to a function implementation service of the user interface; in response to the second request, second response data corresponding to the function implementation service is called from the server, and the corresponding function is implemented by controlling the display control based on the second response data; the target front-end page and a preset front-end page are page-spliced, and the spliced page is rendered to obtain a target user interface. By using target execution objects to replace the server to perform data processing work of the front-end page, the development efficiency of the user interface is improved. In addition, by creating a plurality of first target controls in the target execution objects, separate control of the display controls can be achieved when modifying the display controls in the user interface, reducing the data processing volume of the target execution objects and further improving the development efficiency of the user interface. In addition, by obtaining a plurality of target execution objects from the server to process the interface display service simultaneously, not only the data volume obtained by each target execution object from the server is reduced, but also the display controls can be separately managed and controlled, further improving the development efficiency of the user interface while realizing collaborative development of the user interface.
[0097] Optionally, please refer to Figure 7 , Figure 7 which is the fourth schematic flowchart of the method for generating a user interface of a browser provided by an embodiment of the present application. The specific process of the method for generating a user interface of the browser may include:
[0098] S401, obtain a modification request for a target user interface, where the modification request carries modification request data, and the modification request data corresponds to the interface display service.
[0099] In this embodiment, after obtaining the target user interface, if it is necessary to modify attributes such as the layout, size, and font of the display controls in the target user interface, a modification request for the target user interface needs to be obtained. Since the modification request data carried in the modification request corresponds to the interface display service, the modification request is a front-end request.
[0100] S402, in response to the modification request, call third response data corresponding to an interface display processing method from the target execution objects.
[0101] After obtaining the modified request for the target user interface, in response to the modification request, obtain third response data corresponding to the interface display processing method from the server and / or a third-party database; transmit the third response data to the target execution object, and call the third response data from the target execution object. The display processing method corresponding to the third response data can implement the modification task of the interface display service.
[0102] S403. Generate a third target front-end page corresponding to the modification request data based on the third response data, where the third target front-end page includes at least one modified display control.
[0103] In some embodiments, the target execution object serves as the proxy processing place for the server for the interface display service. Since the target execution object can execute the interface display processing method corresponding to the modification request data, it is necessary to call the third response data corresponding to the display processing method from the target execution object, and generate a third target front-end page corresponding to the modification request data based on the third response data, where the third target front-end page includes at least one modified display control.
[0104] S404. Perform page splicing on the third target front-end page and the preset front-end page, and render the spliced page to obtain the modified target user interface.
[0105] For details, please refer to the above embodiments and will not be elaborated here.
[0106] As can be seen from the above, in this embodiment, by obtaining the modification request of the target user interface, where the modification request carries modification request data, and the modification request data corresponds to the interface display service; in response to the modification request, call the third response data corresponding to the interface display processing method from the target execution object; generate a third target front-end page corresponding to the modification request data based on the target execution object, where the third target front-end page includes at least one modified display control; perform page splicing on the third target front-end page and the preset front-end page, and render the spliced page to obtain the modified target user interface. By using the target execution object to replace the server to perform the data processing work of the front-end page, the development efficiency of the user interface is improved.
[0107] In addition, the embodiment of the present application also provides a user interface generation device for a browser. Please refer to Figure 8 , Figure 8 which is the structural schematic diagram of the user interface generation device for the browser provided by the embodiment of the present application.
[0108] Among them, the user interface generation device 500 for the browser may include a first acquisition module 501, a second acquisition module 502, a generation module 503, and a splicing module 504, as follows:
[0109] A first acquisition module 501, configured to acquire a first request of a user interface, where the first request carries first request data, and the first request data corresponds to an interface display service of the user interface;
[0110] A second acquisition module 502, configured to, in response to the first request, acquire at least one target execution object corresponding to the first request data from a server, where the target execution object is used to execute an interface display processing method corresponding to the first request data;
[0111] A generation module 503, configured to generate a target front-end page corresponding to the first request data based on the target execution object, where the target front-end page includes at least one display control corresponding to the interface display processing method;
[0112] A splicing module 504, configured to splice the target front-end page with a preset front-end page, and render the spliced page to obtain a target user interface.
[0113] In some embodiments, the generation module 503 may further be configured to: call first response data corresponding to the interface display processing method from the target execution object; generate a target front-end page corresponding to the first request data based on the first response data.
[0114] In some embodiments, the user interface generation device 500 of the browser may further include a data acquisition module. Before calling the first response data from the target execution object, the data acquisition module may be configured to: acquire the first response data corresponding to the interface display processing method from a server and / or a third-party database, and transmit the first response data to the target execution object.
[0115] Optionally, the generation module 503 may further be configured to: generate a plurality of first target controls based on one target execution object; call first response data from the target execution object; generate a first target front-end page corresponding to the first request data in each first target control based on the first response data, where the first target front-end page includes at least one of the display controls.
[0116] Optionally, the generation module 503 may further be configured to: generate a plurality of second target controls based on a plurality of target execution objects, where one target execution object corresponds to at least one second target control; call first response data from each target execution object; generate a second target front-end page corresponding to the first request data in each second target control based on the first response data, where the second target front-end page includes at least one of the display controls.
[0117] In some embodiments, the user interface generation device 500 of the browser may further include a function implementation module. After generating a target front-end page corresponding to the first request data based on the target execution object, the function implementation module may be configured to: if it is detected that a function corresponding to any display control in the target front-end page is triggered, obtain a second request of the user interface, where the second request carries second request data, and the second request data corresponds to the function implementation service of the user interface; in response to the second request, call second response data corresponding to the function implementation service from the server, and control the display control to implement the corresponding function based on the second response data.
[0118] In some embodiments, the user interface generation device 500 of the browser may further include a modification module. After splicing the target front-end page with a preset front-end page and rendering the spliced page to obtain a target user interface, the modification module may be configured to: obtain a modification request of the target user interface, where the modification request carries modification request data, and the modification request data corresponds to the interface display service; in response to the modification request, call third response data corresponding to the interface display processing method from the target execution object; generate a third target front-end page corresponding to the modification request data based on the target execution object, where the third target front-end page includes at least one modified display control; splice the third target front-end page with the preset front-end page, and render the spliced page to obtain a modified target user interface.
[0119] It should be noted that the user interface generation device of the browser provided in the embodiments of the present application and the user interface generation method of the browser in the above embodiments belong to the same concept. Any method provided in the embodiments of the user interface generation method of the browser can be run on the user interface generation device of the browser. For the specific implementation process, please refer to the embodiments of the user interface generation method of the browser, which will not be elaborated here.
[0120] As can be seen from the above, in this embodiment, the first acquisition module 501 acquires the first request of the user interface, where the first request carries first request data, and the first request data corresponds to the interface display service of the user interface; in response to the first request, based on the second acquisition module 502, at least one target execution object corresponding to the first request data is acquired from the server, where the target execution object is used to execute the interface display processing method corresponding to the first request data; the generation module 503 generates a target front-end page corresponding to the first request data based on the target execution object, where the target front-end page includes at least one display control corresponding to the interface display processing method; based on the splicing module 504, the target front-end page is spliced with the preset front-end page, and the spliced page is rendered to obtain the target user interface. By using the target execution object to replace the server to perform the data processing work of the front-end page, the development efficiency of the user interface is improved.
[0121] This embodiment also provides a computer-readable storage medium, in which computer program code is stored. When the computer program code runs on a computer, the computer is caused to execute the above-mentioned related method steps to implement a method for generating a user interface of a browser provided in the above embodiment.
[0122] Among them, the storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc.
[0123] Since the instructions stored in the storage medium can execute the steps in any method for generating a user interface of a browser provided in the embodiments of the present application, the beneficial effects that can be achieved by any method for generating a user interface of a browser provided in the embodiments of the present application can be realized. For details, please refer to the previous embodiments and will not be elaborated here.
[0124] Correspondingly, an electronic device 600 is also provided in the embodiments of the present application. The electronic device 600 may include devices such as in-vehicle terminals. Please refer to Figure 9 , Figure 9 which is the first structural schematic diagram of the electronic device provided in the embodiments of the present application. The electronic device 600 includes a processor 601 and a memory 602. Among them, the processor 601 is electrically connected to the memory 602.
[0125] The processor 601 is the control center of the electronic device 600, connecting various parts of the entire electronic device through various interfaces and lines. By running or calling the computer program stored in the memory 602 and calling the data stored in the memory 602, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole.
[0126] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing by running the computer programs and modules stored in the memory 602. The memory 602 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, computer programs required for at least one function, etc.; the data storage area can store data created according to the use of the electronic device.
[0127] In addition, the memory 602 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0128] In this embodiment, the processor 601 in the electronic device 600 loads the instructions corresponding to the processes of one or more computer programs into the memory 602 according to the following steps, and the processor 601 runs the computer programs stored in the memory 602 to implement various functions as follows:
[0129] Obtain a first request for the user interface, where the first request carries first request data, and the first request data corresponds to the interface display service of the user interface;
[0130] In response to the first request, obtain at least one target execution object corresponding to the first request data from the server, where the target execution object is used to execute the interface display processing method corresponding to the first request data;
[0131] Generate a target front-end page corresponding to the first request data based on the target execution object, where the target front-end page includes at least one display control corresponding to the interface display processing method;
[0132] Perform page splicing on the target front-end page and a preset front-end page, and render the spliced page to obtain a target user interface.
[0133] In some embodiments, please refer to Figure 10 , Figure 10 which is the second structural schematic diagram of the electronic device provided by the embodiments of the present application. The electronic device 600 may include: a processor 601, a memory 602, a display screen 603, a camera component 604, an audio circuit 605, a sensor 606, and a power supply 607. Among them, the processor 601 is electrically connected to the display 603, the camera component 604, the audio circuit 605, the sensor 606, and the power supply 607 respectively.
[0134] The display screen 603 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device, and these graphical user interfaces can be composed of images, texts, icons, videos, and any combination thereof.
[0135] The imaging component 604 may include an image processing circuit, which can be implemented using hardware and / or software components and may include various processing units that define an Image Signal Processing pipeline. The image processing circuit may at least include: multiple cameras, an Image Signal Processor (ISP processor), a control logic unit, and an image memory, etc. Each of the cameras may at least include one or more lenses and an image sensor. The image sensor may include a color filter array (such as a Bayer filter). The image sensor can acquire the light intensity and wavelength information captured by each imaging pixel of the image sensor and provide a set of raw image data that can be processed by the image signal processor.
[0136] The audio circuit 605 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. Among them, the audio circuit 605 includes a microphone. The microphone is electrically connected to the processor 601. The microphone is used to receive the voice information input by the user.
[0137] The sensor 606 is used to collect information about the electronic device itself, or the user, or the external environment. For example, the sensor 606 may include one or more of sensors such as a vibration sensor, a temperature sensor, a distance sensor, a magnetic field sensor, a light sensor, an acceleration sensor, a fingerprint sensor, a Hall sensor, a position sensor, a gyroscope, an inertial sensor, an attitude sensor, a barometer, and a heart rate sensor.
[0138] The power supply 607 is used to supply power to each component of the electronic device 600. In some embodiments, the power supply 607 may be logically connected to the processor 601 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system.
[0139] In the embodiments provided in this 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 merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point, the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical or other forms.
[0140] For the user interface generation device of the browser in the embodiments of the present application, each functional module can be integrated in a processing chip, or each module can exist physically alone, or two or more modules can be integrated in one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0141] The above has introduced in detail the user interface generation method, device, electronic device and storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The above description of the embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A method for generating a user interface of a browser, characterized in that, including: a first request for obtaining the user interface, wherein the first request carries first request data corresponding to the interface display service of the user interface; responding to the first request, obtaining at least one target execution object corresponding to the first request data from a server, wherein the target execution object is used to execute an interface display processing method corresponding to the first request data; generating a target front-end page corresponding to the first request data based on the target execution object, wherein the target front-end page includes at least one display control corresponding to the interface display processing method; performing page splicing on the target front-end page and a preset front-end page, and rendering the spliced page to obtain a target user interface.
2. The method for generating a user interface of a browser according to claim 1, wherein The generating a target front-end page corresponding to the first request data based on the target execution object includes: invoking first response data corresponding to the interface display processing method from the target execution object; generating a target front-end page corresponding to the first request data based on the first response data.
3. The method for generating a user interface of a browser according to claim 2, wherein Before invoking the first response data from the target execution object, the method further includes: obtaining first response data corresponding to the interface display processing method from the server and / or a third-party database, and transmitting the first response data to the target execution object.
4. The method for generating a user interface of a browser according to claim 2, wherein The method further includes: generating a plurality of first target controls based on one of the target execution objects; invoking the first response data from the target execution object; generating a first target front-end page corresponding to the first request data in each of the first target controls based on the first response data, wherein the first target front-end page includes at least one of the display controls.
5. The method for generating a user interface of a browser according to claim 2, wherein, The method further includes: generating a plurality of second target controls based on a plurality of the target execution objects, wherein one of the target execution objects corresponds to at least one of the second target controls; invoking the first response data from each of the target execution objects; generating a second target front-end page corresponding to the first request data in each of the second target controls based on the first response data, wherein the second target front-end page includes at least one of the display controls.
6. The method for generating a user interface of a browser according to claim 1, wherein After generating the target front-end page corresponding to the first request data based on the target execution object, the method further includes: if it is detected that a function corresponding to any one of the display controls in the target front-end page is triggered, obtaining a second request for the user interface, wherein the second request carries second request data corresponding to the function implementation service of the user interface; responding to the second request, invoking second response data corresponding to the function implementation service from the server, and controlling the display control to implement the corresponding function based on the second response data.
7. The method for generating a user interface of a browser according to claim 1, wherein After performing page splicing on the target front-end page and a preset front-end page, and rendering the spliced page to obtain a target user interface, the method further includes: Obtain a modification request for the target user interface, where the modification request carries modification request data corresponding to the interface display service; In response to the modification request, call third response data corresponding to the interface display processing method from the target execution object; Generate a third target front-end page corresponding to the modification request data based on the target execution object, where at least one modified display control is included in the third target front-end page; Perform page splicing on the third target front-end page and the preset front-end page, and render the spliced page to obtain a modified target user interface.
8. A user interface generation device for a browser, characterized in that, The device includes: A first acquisition module, configured to acquire a first request for the user interface, where the first request carries first request data corresponding to the interface display service of the user interface; A second acquisition module, configured to, in response to the first request, acquire at least one target execution object corresponding to the first request data from a server, where the target execution object is used to execute an interface display processing method corresponding to the first request data; A generation module, configured to generate a target front-end page corresponding to the first request data based on the target execution object, where at least one display control corresponding to the interface display processing method is included in the target front-end page; A splicing module, configured to perform page splicing on the target front-end page and a preset front-end page, and render the spliced page to obtain a target user interface.
9. An electronic device, characterized in that, The electronic device includes: A memory, configured to store executable program code; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method for generating a user interface of a browser according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed, the method for generating a user interface of a browser according to any one of claims 1 to 7 is implemented.