Page generation method, device, electronic device and storage medium

By creating a controller agent in the page generation method, obtaining and rendering data from the system and business side floors, the problem that the business side cannot realize the needs that the controller needs to be processed by the controller is solved, and more complex personalized development capabilities are achieved.

CN113254825BActive Publication Date: 2025-03-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110551546.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-20
Publication Date
2025-03-18
Estimated Expiration
2041-05-20

AI Technical Summary

Technical Problem

In the prior art, business parties can only develop personalized requirements in the view layer of the page, and cannot achieve requirements that need to be processed by the controller, such as adding network requests.

Method used

Create a controller agent by calling the corresponding controller, obtain the corresponding data of the system floor and the business side floor, and then render and generate the target page. The controller agent can process data and operation instructions on the business floor to realize calls to some functions of the controller.

Benefits of technology

This enables business parties to develop more complex requirements through controller agents, such as network requests, to meet more personalized development needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113254825B_ABST
    Figure CN113254825B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, electronic device and storage medium for page generation, and relates to the field of computer technology. A specific implementation of the method includes: receiving a page generation request for a target page, obtaining a page identifier in the page generation request, and querying a corresponding controller; calling a controller, creating a controller agent corresponding to the target page, and querying the system floors and business floor included in the target page; obtaining the corresponding data of the system floor, calling a controller agent to obtain the corresponding data of the business floor, and rendering the system floor and the business floor to generate the target page. This implementation can solve the problem that the generated page can only realize the simple requirements of the business party, such as adding network requests and other requirements that require controller processing cannot be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for generating a page. Background Art

[0002] Mobile client componentization has become a widely used technology. In order to reduce repeated component development, developers usually encapsulate the developed components so that business parties can use them directly without having to touch the complex logic in the components. As the personalized needs of different business parties increase, in order to reduce the component development pressure of developers, in the prior art, interfaces for business party development can be set during component development, so that business parties can develop personalized needs for the view layer of the page. However, the pages generated in this way can only meet the simple needs of the business party, and needs such as adding network requests that require controller processing cannot be met. Summary of the invention

[0003] In view of this, an embodiment of the present invention provides a method, device, electronic device and storage medium for page generation, which can solve the problem that the business party can develop personalized needs for the view layer of the page, but the generated page can only realize the simple needs of the business party, such as adding network requests and other needs that require controller processing and cannot be realized.

[0004] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for generating a page is provided.

[0005] A page generation method according to an embodiment of the present invention includes: receiving a page generation request for a target page, obtaining a page identifier in the page generation request to query a corresponding controller; calling the controller to create a controller agent corresponding to the target page, and querying system floors and business floors included in the target page; obtaining corresponding data of the system floor, calling the controller agent to obtain corresponding data of the business floor, so as to render the system floor and the business floor and generate the target page.

[0006] In one embodiment, calling the controller agent to obtain the corresponding data of the business party floor includes:

[0007] The controller agent is called to query the data model corresponding to the business party floor to obtain the corresponding data of the business party floor from the data model.

[0008] In yet another embodiment, after generating the target page, the method further includes:

[0009] Receiving a page operation instruction, acquiring floor data corresponding to the page operation instruction, so as to determine the floor type corresponding to the page operation instruction;

[0010] If the floor type is the system floor, sending the page operation instruction to the controller to call the controller to process the page operation instruction;

[0011] If the floor type is the business side floor, the page operation instruction is sent to the controller agent to call the controller agent to process the page operation instruction.

[0012] In yet another embodiment, the page operation instruction includes a floor interaction instruction;

[0013] Calling the controller agent to process the page operation instruction includes:

[0014] The controller agent is called to query the target floor identifier corresponding to the page operation instruction, and the corresponding data of the target floor corresponding to the target floor identifier is obtained, so as to update based on the page operation instruction and render the updated target floor.

[0015] In yet another embodiment, calling the controller agent to process the page operation instruction includes:

[0016] The controller agent is called, and the page operation instruction is sent to the controller through a preset interface, so as to call the controller to process the page operation instruction.

[0017] In yet another embodiment, rendering the business side floor includes:

[0018] Acquire the floor information of the business party floor to determine the floor order of the business party floor;

[0019] The controller agent is called to render the business side floors based on the floor sequence.

[0020] In yet another embodiment, calling a controller to create a controller proxy corresponding to the page includes:

[0021] An object class name corresponding to the controller proxy is received, and the object class name is stored to create the controller proxy based on the object class name.

[0022] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for generating a page is provided.

[0023] A page generation device according to an embodiment of the present invention includes: a receiving unit, used to receive a page generation request of a target page, obtain a page identifier in the page generation request, and query a corresponding controller; a creating unit, used to call the controller, create a controller agent corresponding to the target page, and query the system floor and business party floor included in the page; a generating unit, used to obtain corresponding data of the system floor, call the controller agent to obtain corresponding data of the business party floor, so as to render the system floor and the business party floor, and generate the target page.

[0024] In one embodiment, the generating unit is specifically used to:

[0025] The controller agent is called to query the data model corresponding to the business party floor to obtain the corresponding data of the business party floor from the data model.

[0026] In yet another embodiment, the receiving unit is further used to receive a page operation instruction, and obtain floor data corresponding to the page operation instruction to determine the floor type corresponding to the page operation instruction;

[0027] The device also includes:

[0028] A processing unit is used to send the page operation instruction to the controller if the floor type is the system floor, so as to call the controller to process the page operation instruction; if the floor type is the business party floor, send the page operation instruction to the controller agent, so as to call the controller agent to process the page operation instruction.

[0029] In yet another embodiment, the processing unit is specifically configured to:

[0030] The controller agent is called to query the target floor identifier corresponding to the page operation instruction, and the corresponding data of the target floor corresponding to the target floor identifier is obtained, so as to update based on the page operation instruction and render the updated target floor.

[0031] In yet another embodiment, the processing unit is specifically configured to:

[0032] The controller agent is called, and the page operation instruction is sent to the controller through a preset interface, so as to call the controller to process the page operation instruction.

[0033] In yet another embodiment, the generating unit is specifically configured to:

[0034] Acquire the floor information of the business party floor to determine the floor order of the business party floor;

[0035] The controller agent is called to render the business side floors based on the floor sequence.

[0036] In yet another embodiment, the creating unit is specifically configured to:

[0037] An object class name corresponding to the controller proxy is received, and the object class name is stored to create the controller proxy based on the object class name.

[0038] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0039] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the page generation method provided by the embodiment of the present invention.

[0040] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0041] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the method for generating a page according to an embodiment of the present invention is implemented.

[0042] An embodiment of the above invention has the following advantages or beneficial effects: In the embodiment of the present invention, when the target page is generated, the controller agent can be created by calling the corresponding controller, and after obtaining the corresponding data of the system floor, the corresponding data of the business floor can be obtained by calling the controller agent, and then the system floor and the business floor are rendered to generate the target page. In this way, in the embodiment of the present invention, when the page is generated, the controller can be called to create a controller agent, and then the corresponding data of the business floor and the rendering of the business floor can be obtained through the controller agent, so that the business party's needs such as network requests that need to be processed by the controller can be realized through the controller agent, and then more personalized development needs of the business party can be met.

[0043] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific implementation examples. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0045] Figure 1 is a schematic diagram of an architecture developed according to a component of an embodiment of the present invention;

[0046] Figure 2is a schematic diagram of a main process of a method for generating a page according to an embodiment of the present invention;

[0047] Figure 3 is a schematic diagram of a main process of a method for processing a page operation instruction according to an embodiment of the present invention;

[0048] Figure 4 is a schematic diagram of main units of an apparatus for page generation according to an embodiment of the present invention;

[0049] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0050] Figure 6 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiment of the present invention. DETAILED DESCRIPTION

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

[0052] It should be pointed out that the embodiments of the present invention and the features in the embodiments may be combined with each other if there is no conflict.

[0053] The embodiment of the present invention provides a system for page generation, which can be used in a scenario of page generation, for example, a scenario of component-based page generation. The page can be a web page or a page in an APP. The embodiment of the present invention takes a page in an APP as an example for explanation.

[0054] Each functional module in the APP is componentized. The most basic architecture for component development can adopt the MVC architecture. The MVC architecture mainly includes three parts: M (Model) represents the data model, V (View) represents the view, such as view controls such as buttons, and C (Controller) represents the controller. In the MVC architecture, business data and view controls are separated. Figure 1 The figure shows a schematic diagram of an MVC architecture. In the architecture, the data model and view are scheduled by the controller, which is responsible for specific view display and data interaction, such as obtaining the data corresponding to the view, passing the data corresponding to a view to the view for display, etc.

[0055] When developing a page, the developer splits the page into multiple floors. Each floor corresponds to a component developed by the developer, namely the initial component. After rendering, the initial elements of the page developed by the developer can be generated. The floors corresponding to these initial elements of the page can be called system floors. After the developer develops the component, the business party can redevelop the page based on the system floor to achieve personalized needs. The components developed by the business party are business party components. Rendering can realize the personalized page custom elements of the business party. The floors corresponding to these page custom elements can be called business party floors. Therefore, the page in the APP can include system floors and business party floors. The system floors and business party floors are integrated. When generating a page, the two types of floors are dynamically loaded and combined to generate the page required by the business party, thereby achieving component co-construction. The page itself can be regarded as a stateless container, and each floor can be presented on the page in various free combinations. The developer can define one or more standard interfaces in the component, that is, define some virtual method combinations, so that the business party can develop custom floors based on virtual methods, namely business party floors, and communicate with the system floors to achieve personalized needs.

[0056] At present, the business side can only develop the View layer to meet some simple requirements, but cannot develop at the controller and data model level. Therefore, some requirements that belong to the controller processing capabilities, such as requesting customized network interfaces, cannot be met, and the personalized needs of the business side cannot be met.

[0057] In order to meet the needs of the business side, in the embodiment of the present invention, a controller proxy can be set up to realize the development of personalized needs processed by the controller for the business side. Specifically, in the embodiment of the present invention, an interface for realizing the controller proxy can be set in the component to provide it to the business side. The business side can develop a controller proxy object based on the set interface, and then pass the information of the controller proxy object to the component, and realize the communication between the controller proxy and the controller through the interface call, so that the controller proxy can realize some functions of the controller, such as the life cycle, network request and other series of method calls, so as to realize the development of more needs of the business side for the business side floor. Among them, the life cycle methods in the controller mainly include: page creation init method, page is about to be rendered viewWillAppear, page disappearance viewDidDisappear method, etc., and the network request can be the requestApi method.

[0058] It should be noted that the methods that can be implemented by the controller agent can be determined based on the interface provided by the component, and the specific developer can set the available interface based on the needs of the business party to facilitate the business party to develop personalized needs.

[0059] The embodiment of the present invention provides a method for generating a page, which can be executed by a page generating system. Figure 2 As shown, the method includes:

[0060] S201: receiving a page generation request of a target page, obtaining a page identifier in the page generation request, and querying a corresponding controller.

[0061] The page can be a web page or a page in an APP. The page generation request can be input by the user. Figure 1 As can be seen from the shown architecture, both the view and the data model are scheduled through the controller, so after receiving the page generation request of the target page, the page identifier in the page request can be obtained first, and then the corresponding controller can be queried based on the page identifier to execute the page generation process.

[0062] S202: Call the controller, create a controller proxy corresponding to the target page, and query the system floor and business floor included in the target page.

[0063] Among them, in the embodiment of the present invention, in order to realize the personalized needs of the business party, the business party develops a controller agent based on the interface provided by the component, and can pass the information of the controller agent to the component. Therefore, after calling the controller in this step, the controller can create a controller agent corresponding to the target page based on the information of the passed controller agent. In the embodiment of the present invention, the created controller agent corresponds to the target page one by one, that is, the controller agent corresponds to the controller one by one.

[0064] Specifically, the business side can develop a controller proxy object, and after the development is completed, pass the controller proxy object class name to the component through a preset interface. After the component stores the object class name of the controller proxy, the controller proxy can be created in this step, that is, a specific controller proxy instance is created. In this step, the controller is called to create the controller proxy corresponding to the page, which can be executed as follows: receiving the object class name corresponding to the controller proxy, storing the object class name, and creating the controller proxy based on the object class name.

[0065] It should be noted that, for an APP, it may include multiple pages. For example, for an online shopping APP, a user can enter the item details page by searching for a certain type of item. Generally, the item details page may also include some item recommendation floors. The user can enter a new item details page by clicking on these item recommendation floors. Therefore, for an APP, it includes multiple item details pages, but each item details page is independent. If the business party directly passes the controller proxy object to the component after developing a controller proxy object suitable for the item details page, the controller proxy object will correspond to multiple item details pages, and it is difficult for the developer to determine which page the controller proxy object interacts and communicates with. In the embodiment of the present invention, after developing the controller proxy object, the business party can only pass the object class name of the controller proxy, and each time a page is generated, the controller can be called to create a controller proxy corresponding to the page one by one, thereby realizing a one-to-one binding relationship between the controller proxy and the page, and avoiding communication confusion between the controller proxy and the page.

[0066] In the embodiment of the present invention, each page is jointly developed by the business party and the developer, so it includes system floors and business party floors. When the page is generated, the system floors and business party floors included in the target page can be queried by calling the controller. The target page can include at least one system floor and at least one page floor. Specifically, the floor information of the system floor and the business party floor can be queried, such as floor identification, floor type, floor attribute and other information.

[0067] S203: Obtain the corresponding data of the system floor, call the controller agent to obtain the corresponding data of the business floor, render the system floor and the business floor, and generate the target page.

[0068] Among them, the system floor is developed by the developer, and its processing is performed by the controller, so after calling the controller in this step, the corresponding data of the system floor can be obtained to facilitate the rendering of the system floor. The business floor is developed by the business party, and its processing is performed by the controller agent, and the business floor is developed based on the system floor, so after obtaining the corresponding data of the system floor, this step can call the controller agent to obtain the corresponding data of the business floor based on the corresponding data of the system floor, so as to facilitate the rendering of the business floor. After the system floor and the business floor are rendered, the generated target page can be obtained.

[0069] During the page generation process, the system can automatically schedule the life cycle methods of the controller, for example, the init method of the controller is called when the page is created, and the viewWillAppear method is called when the page is about to be rendered. Since the business floor in the page needs to be processed by the controller proxy, when each method in the controller is called, the controller can call the corresponding method in the controller proxy at the same time, so as to call the controller proxy to process the business floor. Specifically, in an embodiment of the present invention, the controller can be set to call the method corresponding to the controller proxy, for example, the self.controllerDelegate.viewWillAppear() method is set in the viewWillAppear of the controller, and when viewWillAppear is called in the controller, the self.controllerDelegate.viewWillAppear() method can be called at the same time, thereby realizing the call of viewWillAppear in the controller proxy. In this way, the controller can call each life cycle method in the controller proxy through the above method, and can also realize the need to initiate a network request in the business floor when the page is generated, that is, the business side obtains the open ability of the controller, and can develop personalized needs processed by the controller.

[0070] In an embodiment of the present invention, when rendering the system floors and the business side floors, each floor can be rendered in sequence. Specifically, for the business side floors, the floor information of the business side floors can be obtained in this step to determine the floor order of each business side floor, and then the controller agent is called to render the business side floors based on the floor order. The floor information can be obtained from the server, and the floor information can include a floor identification list. The corresponding floor is generated based on the floor identification in the floor identification list, and the controller agent is assigned to each floor through a preset field, and then the controller agent is called to render each floor in sequence based on the corresponding data of each floor.

[0071] It should be noted that in the embodiment of the present invention, an attribute field can be extended in the base class of each business party floor to realize the assignment of the controller agent through this field, so that the subclass of each business party floor does not need to perform the assignment processing separately, and the communication between each business party floor and the controller agent can be realized at any time. In the page rendering, the business party floor list can be traversed through the loop function, and the controller agent can be passed to each business party floor one by one through the attribute assignment method, thereby realizing the rendering of the business party floor.

[0072] In an embodiment of the present invention, when generating a page, a controller can be called to create a controller proxy, and then the corresponding data of the business party's floor and the rendering of the business party's floor can be obtained through the controller proxy, so that the business party's needs such as network requests that require controller processing can be realized through the controller proxy, thereby meeting the business party's more personalized development needs.

[0073] In the embodiment of the present invention, the generated target page includes the system floor and the business floor. When the page element corresponding to the system floor is operated, the corresponding method in the controller can be called for processing. When the page element corresponding to the business floor is operated, the corresponding method in the controller proxy can be called for processing. Specifically, the method for calling the page after the page element corresponding to the system floor in the target page is operated may be pageFun1, and the method for calling the page after the page element corresponding to the business floor is operated may be self.controllerDelegate.pageFun1(). In this way, through the controller proxy, the path for the View in the business floor to access the Controller can be realized, that is, Figure 1 The User Action link shown, that is, the view belonging to the business floor can communicate with the controller.

[0074] Therefore, combined Figure 1 The architecture shown and Figure 2 In the embodiment shown in the embodiment of the present invention, the processing process of the operation in the target page after the target page is generated is specifically described, such as Figure 3 As shown, the method includes:

[0075] S301: receiving a page operation instruction, and acquiring floor data corresponding to the page operation instruction to determine the floor type corresponding to the page operation instruction.

[0076] Among them, the page operation instruction is issued after the user operates the target page. After receiving the page operation instruction, the corresponding floor data can be obtained based on the page operation instruction. The floor data may include a floor identification. In this step, the target page is generated based on the corresponding data of each floor, so there is a corresponding relationship between the corresponding data of each floor and the floor identification. The corresponding data of each floor may include information such as the control position, name, and display content. After receiving the page operation instruction in this step, the floor data corresponding to the page operation instruction can be obtained, that is, the control position, name, display content, and other information corresponding to the page operation instruction, and then the floor identification corresponding to the page operation instruction can be determined. After determining the floor identification, the floor type corresponding to the page operation instruction can be queried based on the floor identification.

[0077] In the embodiment of the present invention, the floor types include system floors and business floors. The page elements corresponding to the system floors are operated and processed by the controller, and the page elements corresponding to the business floors are operated and processed by the controller agent. Therefore, after determining the floor type corresponding to the page operation instruction, it can be determined how to process the page operation instruction.

[0078] S302: If the floor type is a system floor, the page operation instruction is sent to the controller to call the controller to process the page operation instruction.

[0079] Among them, if the floor type is a system floor, it means that the page operation instruction operates the page element corresponding to the system floor, and the page operation instruction can be sent to the controller to call the controller to process the page operation instruction.

[0080] S303: If the floor type is a business floor, the page operation instruction is sent to the controller agent to call the controller agent to process the page operation instruction.

[0081] Among them, if the floor type is the business side floor, it means that the page operation instruction operates the page element corresponding to the business side floor, and the page operation instruction can be sent to the controller agent to call the controller agent to process the page operation instruction.

[0082] It should be noted that the target page includes system floors and business floors, but the floors are usually not independent of each other and can communicate with each other. For example, clicking on floor A can trigger an action on floor B, such as when the control on floor A is operated, the video played on floor B stops playing. The interaction between floors in the system floor is handled by the controller, while the interaction between floors in the business floor can be handled by the controller proxy.

[0083] Therefore, in this step, the page operation instructions may specifically include floor interaction instructions, that is, communication between floors is required when the page operation instructions are executed. At this time, this step can be executed as follows: call the controller agent, query the target floor identifier corresponding to the page operation instruction, obtain the corresponding data of the target floor corresponding to the target floor identifier, update based on the page operation instruction, and render the updated target floor.

[0084] Among them, the target floor identifier is the identifier of the floor that needs to interact with the floor where the page operation instruction is located. Calling the controller agent can obtain the corresponding data of the target floor corresponding to the target floor identifier, and then based on the corresponding data of the target floor, the corresponding data of the target floor can be updated by calling the corresponding method and rendered to realize that the page elements of the target floor in the target page are updated along with the page operation instruction.

[0085] Taking receiving the page operation instructions of floor A in the target page and triggering the corresponding operation in floor B as an example, the corresponding method of the page operation instructions of floor A in the controller agent can be floorAHandler. The getFloorWithUniqueId method can be set in floorAHandler to obtain the corresponding data of the floor corresponding to UniqueId, that is, the corresponding data of floor B is called through this method, and then the corresponding method of floor B (such as functionResFloorAClick) is called to update the corresponding data of floor B, thereby realizing communication between floor A and floor B.

[0086] It should be noted that the controller proxy is not completely equivalent to the controller, so the controller proxy cannot realize all the functions of the controller. For some functions that the controller proxy cannot realize, corresponding interfaces can be set in the embodiment of the present invention so that the controller proxy calls these interfaces through a preset method to convert the unrealizable functions to the controller for realization. Therefore, calling the controller proxy to process the page operation instruction in this step can also be specifically performed as follows: calling the controller proxy, sending the page operation instruction to the controller through a preset interface, so as to call the controller to process the page operation instruction.

[0087] For example, through the getFloorWithUniqueId method in the controller, it is possible to obtain the floor instance corresponding to the floor identifier UniqueId, that is, the corresponding data of the floor identifier UniqueId. Therefore, in an embodiment of the present invention, a self.realController.getFloorWithUniqueId method can be added in the controller agent. When communication between floors is required, this method can be called to send page operation instructions to the controller to obtain the corresponding data of the target floor corresponding to the target floor identifier, and update the corresponding data of the target floor based on the page operation instructions.

[0088] It should be noted that the communication between floors can also include the scenario of updating the corresponding data of multiple floors, such as setting the background color of all floors. At this time, the controller agent can batch obtain the corresponding data of each floor in the above way, and then update the corresponding data of each floor in turn. The communication between floors can be realized through the above process. That is, through this step, we can see that we have opened up the interaction between View and View, the interaction between Controller and View, etc., so as to meet the personalized development needs of the business side.

[0089] In the embodiment of the present invention, communication between different floors can be achieved through the controller agent, thereby realizing more personalized needs of the business party.

[0090] In the embodiment of the present invention, since a controller proxy is created, the business party can implement some controller functions based on the controller proxy, so the business party can also set a data model to store and parse the corresponding data of the business party floor through the data model. In this way, when the page is generated, the corresponding data of the business party floor can be obtained by calling the controller proxy, querying the data model corresponding to the business party floor, and obtaining the corresponding data of the business party floor from the data model.

[0091] For example, the business side can initiate a network request in the business side floor and develop a corresponding data model. When the network request returns, the corresponding data model can be used to parse and store the data returned by the network request. When the page is generated, the controller proxy can be called to obtain the data corresponding to the network request from the data model.

[0092] Through the above process, the business side has opened up Figure 1 The link between the Controller and Model in the Controller and Model, and because each business floor can call the controller proxy, the corresponding data of the business floor can call the controller proxy to obtain the corresponding data model analysis, without the need for each floor to parse separately. For example, when the field x is sent through the network interface API1 in business floor A, the controller proxy can be called through self.controllerDelegate.modelA.x to obtain the corresponding data. In this way, by calling the controller proxy to obtain data from the data model, not only can the data model be reused, but also the problems of repeated development, difficult maintenance, and high memory consumption of the business floor can be solved.

[0093] In the embodiment of the present invention, the controller proxy can realize the one-to-one correspondence between the controller and the controller proxy in the page, and through the technical means such as the call of the life cycle method, the business floor is completely opened up. Figure 1 The communication links between the three roles of the MVC architecture not only provide the business side with the ability to open customized floors, but also enable the business side to develop at the View level, Contoller level and data model Model level, so that the developer can deal with both global and local issues. The business side can also realize many development requirements that were not completed before, and further open up the expansion capabilities of components.

[0094] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a device 400 for generating a page, such as Figure 4 As shown, the device 400 includes:

[0095] The receiving unit 401 is used to receive a page generation request of a target page, obtain a page identifier in the page generation request, and query a corresponding controller;

[0096] A creation unit 402 is used to call the controller, create a controller proxy corresponding to the target page, and query the system floor and business party floor included in the page;

[0097] The generating unit 403 is used to obtain the corresponding data of the system floor, call the controller agent to obtain the corresponding data of the business floor, render the system floor and the business floor, and generate the target page.

[0098] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 2 The method of the illustrated embodiment is the same and will not be repeated here.

[0099] In an implementation of the embodiment of the present invention, the generating unit 403 is specifically configured to:

[0100] The controller agent is called to query the data model corresponding to the business party floor to obtain the corresponding data of the business party floor from the data model.

[0101] In another implementation of the embodiment of the present invention, the receiving unit 401 is further used to receive a page operation instruction, obtain floor data corresponding to the page operation instruction, and determine the floor type corresponding to the page operation instruction;

[0102] The device 400 further includes:

[0103] A processing unit is used to send the page operation instruction to the controller if the floor type is the system floor, so as to call the controller to process the page operation instruction; if the floor type is the business party floor, send the page operation instruction to the controller agent, so as to call the controller agent to process the page operation instruction.

[0104] In another implementation of the embodiment of the present invention, the processing unit is specifically configured to:

[0105] The controller agent is called to query the target floor identifier corresponding to the page operation instruction, and the corresponding data of the target floor corresponding to the target floor identifier is obtained, so as to update based on the page operation instruction and render the updated target floor.

[0106] In another implementation of the embodiment of the present invention, the processing unit is specifically configured to:

[0107] The controller agent is called, and the page operation instruction is sent to the controller through a preset interface, so as to call the controller to process the page operation instruction.

[0108] In another implementation of the embodiment of the present invention, the generating unit 403 is specifically configured to:

[0109] Acquire the floor information of the business party floor to determine the floor order of the business party floor;

[0110] The controller agent is called to render the business side floors based on the floor sequence.

[0111] In another implementation of the embodiment of the present invention, the creating unit 402 is specifically configured to:

[0112] An object class name corresponding to the controller proxy is received, and the object class name is stored to create the controller proxy based on the object class name.

[0113] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 2 or Figure 3 The method of the illustrated embodiment is the same and will not be repeated here.

[0114] In an embodiment of the present invention, when generating a page, a controller can be called to create a controller proxy, and then the corresponding data of the business party's floor and the rendering of the business party's floor can be obtained through the controller proxy, so that the business party's needs such as network requests that require controller processing can be realized through the controller proxy, thereby meeting the business party's more personalized development needs.

[0115] According to an embodiment of the present invention, the embodiment of the present invention further provides an electronic device and a readable storage medium.

[0116] The electronic device of an embodiment of the present invention comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the page generation method provided by the embodiment of the present invention.

[0117] Figure 5 An exemplary system architecture 500 is shown to which the method or apparatus for page generation according to the embodiment of the present invention can be applied.

[0118] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0119] The user can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various client applications can be installed on the terminal devices 501, 502, 503.

[0120] The terminal devices 501 , 502 , and 503 may be, but are not limited to, smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0121] The server 505 may be a server that provides various services. The server may analyze and process the received data such as the floor information query request, and feed back the processing result (such as the floor information - just an example) to the terminal device.

[0122] It should be noted that the page generation method provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the page generation device is generally set in the server 505 .

[0123] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0124] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 suitable for implementing an embodiment of the present invention. Figure 6 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0125] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0126] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0127] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

[0128] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0129] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0130] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, a creating unit, and a generating unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the receiving unit may also be described as a "unit of the function of the receiving unit".

[0131] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes the page generation method provided by the present invention.

[0132] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for generating a page, characterized in that: include: Receive a page generation request for a target page, obtain a page identifier in the page generation request, and query a corresponding controller; Call the controller, create a controller proxy corresponding to the target page, and query the system floor and business floor included in the target page; Obtain the corresponding data of the system floor, call the controller agent to obtain the corresponding data of the business floor, render the system floor and the business floor, and generate the target page; After generating the target page, the method further includes: Receiving a page operation instruction, acquiring floor data corresponding to the page operation instruction, so as to determine the floor type corresponding to the page operation instruction; If the floor type is the system floor, sending the page operation instruction to the controller to call the controller to process the page operation instruction; If the floor type is the business side floor, the page operation instruction is sent to the controller agent to call the controller agent to process the page operation instruction.

2. The method according to claim 1, characterized in that Calling the controller agent to obtain the corresponding data of the business party floor includes: The controller agent is called to query the data model corresponding to the business party floor to obtain the corresponding data of the business party floor from the data model.

3. The method according to claim 1, characterized in that The page operation instructions include floor interaction instructions; Calling the controller agent to process the page operation instruction includes: The controller agent is called to query the target floor identifier corresponding to the page operation instruction, and the corresponding data of the target floor corresponding to the target floor identifier is obtained, so as to update based on the page operation instruction and render the updated target floor.

4. The method according to claim 1, characterized in that: Calling the controller agent to process the page operation instruction includes: The controller agent is called, and the page operation instruction is sent to the controller through a preset interface, so as to call the controller to process the page operation instruction.

5. The method according to claim 1, characterized in that Rendering the business side floor, including: Acquire the floor information of the business party floor to determine the floor order of the business party floor; The controller agent is called to render the business side floor based on the floor sequence.

6. The method according to claim 1, characterized in that Call the controller and create the controller proxy corresponding to the page, including: An object class name corresponding to the controller proxy is received, and the object class name is stored to create the controller proxy based on the object class name.

7. A device for generating a page, characterized in that: include: A receiving unit, configured to receive a page generation request of a target page, obtain a page identifier in the page generation request, and query a corresponding controller; A creation unit, used to call the controller, create a controller proxy corresponding to the target page, and query the system floor and business party floor included in the page; A generating unit, used for acquiring the corresponding data of the system floor, calling the controller agent to acquire the corresponding data of the business party floor, so as to render the system floor and the business party floor, and generate the target page; The receiving unit is further used to receive a page operation instruction, obtain floor data corresponding to the page operation instruction, and determine the floor type corresponding to the page operation instruction; The device also includes: a processing unit, configured to send the page operation instruction to the controller if the floor type is the system floor, so as to call the controller to process the page operation instruction; If the floor type is the business side floor, the page operation instruction is sent to the controller agent to call the controller agent to process the page operation instruction.

8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Page rendering method, device and equipment and computer readable storage medium

    CN112100552A