[go: up one dir, main page]

CN113254825B - Page generation method, device, electronic device and storage medium - Google Patents

Page generation method, device, electronic device and storage medium Download PDF

Info

Publication number
CN113254825B
CN113254825B CN202110551546.6A CN202110551546A CN113254825B CN 113254825 B CN113254825 B CN 113254825B CN 202110551546 A CN202110551546 A CN 202110551546A CN 113254825 B CN113254825 B CN 113254825B
Authority
CN
China
Prior art keywords
floor
page
controller
operation instruction
page operation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110551546.6A
Other languages
Chinese (zh)
Other versions
CN113254825A (en
Inventor
戴旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202110551546.6A priority Critical patent/CN113254825B/en
Publication of CN113254825A publication Critical patent/CN113254825A/en
Application granted granted Critical
Publication of CN113254825B publication Critical patent/CN113254825B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

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.

Description

Page generation method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for generating a page, an electronic device, and a storage medium.
Background
Mobile client componentization has become a widely used technology, and in order to reduce component repeated development, a developer generally encapsulates the developed component, and a business party can directly use the component without touching complex logic in the component. Along with the increasing personalized demands of different business parties, in order to reduce the component development pressure of a developer, an interface for the development of the business party can be arranged in the prior art when the component is developed, so that the business party can develop the personalized demands of the view layer of the page. However, the page generated in this way can only meet the simple requirements of the service side, such as the requirement of adding a network request and the like for processing by the controller, but cannot be realized.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for generating a page, which can solve the problem that a business party can develop personalized requirements for a view layer of a page, but the generated page can only implement simple requirements of the business party, for example, increase a network request and other requirements that need to be processed by a controller cannot be implemented.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of page generation.
The page generation method comprises the steps of receiving a page generation request of a target page, obtaining page identifiers in the page generation request to inquire corresponding controllers, calling the controllers, creating a controller agent corresponding to the target page, inquiring a system floor and a business side floor included in the target page, obtaining corresponding data of the system floor, calling the controller agent to obtain corresponding data of the business side floor, rendering the system floor and the business side floor, and generating the target page.
In one embodiment, invoking the controller agent to obtain corresponding data for the service party floor includes:
And calling the controller agent, and inquiring a data model corresponding to the service side floor to acquire corresponding data of the service side floor from the data model.
In yet another embodiment, after the generating the target page, the method further includes:
Receiving a page operation instruction, and acquiring floor data corresponding to the page operation instruction to determine a floor type corresponding to the page operation instruction;
if the floor type is the system floor, sending the page operation instruction to the controller so as to call the controller to process the page operation instruction;
And if the floor type is the service side floor, sending the page operation instruction to the controller agent so as to call the controller agent to process the page operation instruction.
In yet another embodiment, the page operation instructions include floor interaction instructions;
invoking the controller agent to process the page operation instruction, including:
And calling the controller agent, inquiring a target floor identifier corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identifier, updating based on the page operation instruction, and rendering the updated target floor.
In yet another embodiment, invoking the controller agent to process the page operation instruction includes:
and calling the controller agent, and sending the page operation instruction to the controller through a preset interface so as to call the controller to process the page operation instruction.
In yet another embodiment, rendering the business side floor includes:
acquiring the floor information of the service party floors to determine the floor sequence of the service party floors;
And calling the controller agent, and rendering the service party floors based on the floor sequence.
In yet another embodiment, invoking a controller, creating a controller agent corresponding to the page, includes:
And receiving an object class name corresponding to the controller agent, and storing the object class name to create the controller agent based on the object class name.
To achieve the above object, according to another aspect of an embodiment of the present invention, there is provided an apparatus for generating a page.
The device for generating the page comprises a receiving unit, a creating unit and a generating unit, wherein the receiving unit is used for receiving a page generation request of a target page, acquiring page identifiers in the page generation request to inquire corresponding controllers, the creating unit is used for calling the controllers, creating a controller agent corresponding to the target page and inquiring a system floor and a service side floor included in the page, the generating unit is used for acquiring corresponding data of the system floor, calling the controller agent to acquire corresponding data of the service side floor to render the system floor and the service side floor, and generating the target page.
In one embodiment, the generating unit is specifically configured to:
And calling the controller agent, and inquiring a data model corresponding to the service side floor to acquire corresponding data of the service side floor from the data model.
In yet another embodiment, the receiving unit is further configured to receive a page operation instruction, and obtain floor data corresponding to the page operation instruction, so as to determine a floor type corresponding to the page operation instruction;
The apparatus further comprises:
And the processing unit is used for sending the page operation instruction to the controller to call the controller to process the page operation instruction if the floor type is the system floor, and sending the page operation instruction to the controller proxy to call the controller proxy to process the page operation instruction if the floor type is the service side floor.
In a further embodiment, the processing unit is specifically configured to:
And calling the controller agent, inquiring a target floor identifier corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identifier, updating based on the page operation instruction, and rendering the updated target floor.
In a further embodiment, the processing unit is specifically configured to:
and calling the controller agent, and sending the page operation instruction to the controller through a preset interface so as to call the controller to process the page operation instruction.
In a further embodiment, the generating unit is specifically configured to:
acquiring the floor information of the service party floors to determine the floor sequence of the service party floors;
And calling the controller agent, and rendering the service party floors based on the floor sequence.
In a further embodiment, the creation unit is specifically configured to:
And receiving an object class name corresponding to the controller agent, and storing the object class name to create the controller agent based on the object class name.
To achieve the above object, according to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus.
The electronic equipment comprises one or more processors and a storage device, wherein the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to achieve the page generation method provided by the embodiment of the invention.
To achieve the above object, according to still another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer readable medium of an embodiment of the present invention has stored thereon a computer program which, when executed by a processor, implements a method for page generation provided by the embodiment of the present invention.
One embodiment of the invention has the advantages that in the embodiment of the invention, when the target page is generated, the controller agent can be created by calling the corresponding controller, and after the corresponding data of the system floor is acquired, the corresponding data of the service side floor can be acquired by calling the controller agent, so that the system floor and the service side floor are rendered, and the target page is generated. In the embodiment of the invention, when the page is generated, the controller can be called to create the controller agent, and further, the corresponding data of the service side floor and the rendering of the service side floor are acquired through the controller agent, so that the requirement of the service side such as a network request and the like for processing by the controller can be realized through the controller agent, and further, the development requirement of more individuation of the service side can be met.
Further effects of the above-described non-conventional alternatives are described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of an architecture for component development in accordance with an embodiment of the invention;
FIG. 2 is a schematic diagram of one main flow of a method of page generation according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of one main flow of a method of page operation instruction processing according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main units of a page generation apparatus according to an embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
FIG. 6 is a schematic diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It is noted that embodiments of the invention and features of the embodiments may be combined with each other without conflict.
The embodiment of the invention provides a system for generating a page, which can be used for generating a scene of the page, for example, generating the scene of the page based on components. The page can be a network page or an APP page, and in the embodiment of the invention, the APP page is taken as an example for explanation.
The most basic architecture for component development can adopt an MVC architecture, wherein the MVC architecture mainly comprises three parts, namely M (Model) represents a data Model, V (View) represents views such as View controls like buttons, C (Controller) represents a Controller, and service data and the View controls are separated in the MVC architecture. As shown in fig. 1, an MVC architecture is schematically illustrated. In the architecture, both the data model and the views are scheduled by a controller, which is responsible for specific view presentation, data interaction, e.g., obtaining data corresponding to a view, transferring data corresponding to a view to the view for presentation, etc.
When the developer develops the page, the page is split into a plurality of floors, each floor corresponds to a component developed by the developer, namely an initial component, after rendering, page initial elements developed by the developer can be generated, and the floors corresponding to the page initial elements can be called as system floors. After the developer develops the component, the business can redevelop the page based on the system floor so as to realize personalized requirements. The components developed by the business party are business party components, page custom elements which can realize individuation of the business party are rendered, and floors corresponding to the page custom elements can be called business party floors. Therefore, the page in the APP can comprise a system floor and a business side floor, the system floor and the business side floor are integrated, and when the page is generated, the two types of floors are dynamically loaded and combined, so that the page required by the business side can be generated, and the co-construction of the components is achieved. The page itself can be regarded as a stateless container and floors can be presented in various free combinations on the page. The developer can define one or more standard interfaces in the component, namely define some virtual method combinations, so that the business can develop a custom floor, namely a business floor based on the virtual method and communicate with a system floor to realize personalized requirements.
At present, a business party can only realize the development of a View layer to realize some simple requirements, but cannot develop on the level of a controller and a data model, so that the requirements of processing capacity of the controller such as a request self-defined network interface and the like cannot be realized, and the personalized requirements of the business party cannot be met.
In order to meet the demands of the service party, in the embodiment of the invention, a controller agent can be set to realize the personalized demand development processed by the controller for the service party. Specifically, in the embodiment of the invention, an interface for realizing the controller agent can be set in the component so as to provide the component for the service party, the service party can develop the controller agent object based on the set interface, then the information of the controller agent object is transferred to the component, and the communication between the controller agent and the controller is realized through interface call, so that the controller agent can realize the call of a series of methods such as life cycle, network request and the like of the controller, and further, the development of more demands of the service party on the service party floor is realized. The life cycle method in the controller mainly comprises a page creation init method, a page to be rendered VIEWWILLAPPEAR, a page disappearance VIEWDIDDISAPPEAR method and the like, and the network request can be a requestApi method.
It should be noted that, the method that the controller agent may implement may be determined based on the interface provided by the component, and the specific developer may set the available interface based on the requirement of the service party, so as to facilitate the service party to develop the personalized requirement.
The embodiment of the invention provides a page generation method, which can be executed by a page generation system, as shown in fig. 2, and comprises the following steps:
S201, receiving a page generation request of a target page, and acquiring a page identification in the page generation request to inquire a corresponding controller.
The page can be a network page or an APP page. The page generation request may be input by a user, and as can be seen from the architecture shown in fig. 1, both the view and the data model are scheduled by the controller, so after receiving the page generation request of the target page, the page identifier in the page request may be obtained first, and then the corresponding controller is queried based on the page identifier, so as to execute the flow of page generation.
S202, calling a controller, creating a controller agent corresponding to the target page, and inquiring a system floor and a service side floor included in the target page.
In the embodiment of the invention, in order to realize the personalized requirements of the service party, the service party develops the controller agent based on the interface provided by the component and can transmit the information of the controller agent to the component. Therefore, after the controller is called in the step, the controller can create the controller agent corresponding to the target page based on the transferred information of the controller agent.
Specifically, the service side develops the controller agent to be a controller agent object, and after the development is completed, the controller agent object class name is transferred to the component through a preset interface, and after the component stores the object class name of the controller agent, the controller agent can be created in this step, that is, a specific controller agent instance is created. The controller is called in the step, the controller agent corresponding to the page is created, and the method can be executed to receive the object class name corresponding to the controller agent, store the object class name and create the controller agent based on the object class name.
It should be noted that, for an APP, it may include multiple pages, for example, for an APP shopping online, the user may search for some type of item and enter item detail pages, typically, some item recommendation floors may be included in the item detail pages, and the user may click on these item recommendation floors and enter a new item detail page again, so for an APP, it includes multiple item detail pages, but each item detail page is independent. If a business party directly passes a controller agent object to a component after developing the controller agent object for an item detail page, the controller agent object may correspond to a plurality of item detail pages, and it is difficult for a developer to determine with which page the controller agent object interacts and communicates, in an embodiment of the present invention, after developing the controller agent object, the service party can only transmit the object class name of the controller agent, and when each page is generated, the calling controller can create a controller agent corresponding to the page one by one, so that the one-to-one binding relationship between the controller agent and the page is realized, and communication confusion between the controller agent and the page is avoided.
In the embodiment of the invention, each page is developed together by the service party and the developer, so that the page comprises a system floor and a service party floor, the system floor and the service party floor included in the target page can be queried by calling the controller when the page is generated, and the target page can comprise at least one system floor and at least one page floor. Specifically, the floor information of the system floor and the service party floor, such as the information of the floor identification, the floor type, the floor attribute and the like, can be queried.
S203, acquiring corresponding data of the system floor, calling a controller agent to acquire corresponding data of the service side floor so as to render the system floor and the service side floor and generate a target page.
The system floor is developed by a developer, and the processing is executed by the controller, so that the corresponding data of the system floor can be acquired after the controller is called by the step, thereby facilitating the rendering of the system floor. The service side floor is developed for the service side, the processing is executed by the controller agent, and the service side floor is developed based on the system floor, so that after the corresponding data of the system floor is obtained, the controller agent can be called in the step to obtain the corresponding data of the service side floor based on the corresponding data of the system floor, so that the service side floor is rendered conveniently. And the generated target page can be obtained after the system floor and the service party floor are rendered.
During the page generation process, the system may automatically schedule the lifecycle method 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. Because the service side floors in the page need 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 that the controller proxy is called to process the service side floors. Specifically, in the embodiment of the present invention, a method corresponding to the call controller agent may be set in the controller, for example, a self.controller delegate.viewWillApparer () method is set in VIEWWILLAPPEAR of the controller, and when VIEWWILLAPPEAR is called in the controller, the self.controller delegate.viewWillApparer () method may be called at the same time, so as to implement the call of VIEWWILLAPPEAR in the controller agent. The method can realize the calling of the controller to each life cycle method in the controller agent, and can also realize the requirement of initiating the network request in the service side floor when the page is generated, namely, the service side obtains the opening capability of the controller, and the development of the personalized requirement processed by the controller can be carried out.
In the embodiment of the invention, when the system floors and the service floors are rendered, all floors can be sequentially rendered. Specifically, for the service party floors, in this step, the floor information of the service party floors may be obtained to determine the floor sequence of each service party floor, and then call the controller agent to render the service party floors based on the floor sequence. The floor information can be obtained from a server, the floor information can comprise a floor identification list, corresponding floors are generated based on floor identifications in the floor identification list, a controller agent is assigned to each floor through a preset field, and each floor is sequentially rendered based on corresponding data of each floor by calling the controller agent.
In the embodiment of the invention, an attribute field can be extended in the base class of each service side floor to realize the assignment of the controller agent through the field, so that the sub-class of each service side floor does not need to independently execute assignment processing, and the communication between each service side floor and the controller agent at any time can be realized. In the page rendering process, the service Fang Louceng list is traversed through a circulation function, and the controller agent is transmitted to each service side floor one by one in an attribute assignment mode, so that service side floor rendering is realized.
In the embodiment of the invention, when the page is generated, the controller can be called to create the controller agent, and further, the corresponding data of the service side floor and the rendering of the service side floor are acquired through the controller agent, so that the requirements of the service side such as a network request and the like, which need to be processed by the controller, can be realized through the controller agent, and further, the development requirements of more individuation of the service side can be met.
In the embodiment of the invention, the generated target page comprises a system floor and a service side floor, when the page element corresponding to the system floor is operated, the corresponding method in the controller can be called to process, and when the page element corresponding to the service side floor is operated, the corresponding method in the controller agent can be called to process. 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 service side floor is operated may be self.controllerdelegate.pagefun1 (). Thus, the path of View access Controller in service side floor, namely the link of User Action shown in fig. 1, can be realized through the Controller agent, that is, the View belonging to service side floor can realize communication with the Controller.
Therefore, in connection with the architecture shown in fig. 1 and the embodiment shown in fig. 2, in the embodiment of the present invention, a specific description will be given of a processing procedure for operating in a target page after the target page is generated, as shown in fig. 3, where the method includes:
s301, receiving a page operation instruction, and acquiring floor data corresponding to the page operation instruction so as to determine a floor type corresponding to the page operation instruction.
The page operation instruction is sent after the user operates the target page, and after the page operation instruction is received, the corresponding floor data can be obtained based on the page operation instruction. The floor data may include a floor identifier, in this step, the target page is generated based on the corresponding data of each floor, so that there is a correspondence between the corresponding data of each floor and the floor identifier, the corresponding data of each floor may include information such as a control position, a name, a display content, etc., after receiving the page operation instruction in this step, the floor data corresponding to the page operation instruction, that is, the information such as the control position, the name, the display content, etc., corresponding to the page operation instruction may be obtained, and then the floor identifier corresponding to the page operation instruction may be determined. After determining the floor identification, the floor type corresponding to the page operation instruction can be queried based on the floor identification.
In the embodiment of the invention, the floor types comprise a system floor and a service party floor, the page elements corresponding to the system floor are operated and processed by the controller, and the page elements corresponding to the service party floor are operated and processed by the controller agent, so that after the floor type corresponding to the page operation instruction is determined, the page operation instruction can be determined.
S302, if the floor type is a system floor, sending a page operation instruction to the controller so as to call the controller to process the page operation instruction.
If the floor type is the system floor, the page element corresponding to the system floor, which indicates that the page operation instruction operates, can send the page operation instruction to the controller so as to call the controller to process the page operation instruction.
And S303, if the floor type is the service floor, sending the page operation instruction to the controller agent so as to call the controller agent to process the page operation instruction.
If the floor type is the service floor, the page element corresponding to the service floor, which is operated by the page operation instruction, is described, and the page operation instruction can be sent to the controller agent, so that the controller agent can be conveniently called to process the page operation instruction.
The destination page includes each system floor and service floor, but the floors are not usually independent from each other, so that communication can be performed. For example, clicking on floor a may trigger an action on floor B, such as stopping playing the video played on floor B after the control on floor a is operated. Interactions between floors in the system floors are handled by the controller, while interactions between floors in the business floors are handled by the controller agents.
In this step, the page operation instruction may specifically include a floor interaction instruction, that is, communication between floors is required when the page operation instruction is executed, where the step may be executed by calling a controller agent, querying a destination floor identifier corresponding to the page operation instruction, obtaining corresponding data of the destination floor corresponding to the destination floor identifier, so as to update based on the page operation instruction, and rendering the updated destination floor.
The target floor identification is an identification of a floor where interaction with the page operation instruction is required, the call controller agent can acquire corresponding data of the target floor corresponding to the target floor identification, and then the corresponding data of the target floor can be updated by calling a corresponding method based on the corresponding data of the target floor, and rendering is performed, so that page elements of the target floor in the target page are updated along with the page operation instruction.
For example, when receiving the page operation instruction of the floor a in the target page and triggering the corresponding operation in the floor B, the method corresponding to the page operation instruction of the floor a in the controller agent may be floorAHandler, floorAHandler, where a getFloorWithUniqueId method may be set to obtain corresponding data of the corresponding floor UniqueId, that is, the corresponding data of the floor B is called by this method, and then the method corresponding to the floor B (e.g. functionResFloorAClick) is called to update the corresponding data of the floor B, so as to implement the communication between the floor a and the floor B.
It should be noted that, the controller agent is not completely equivalent to the controller, so the controller agent cannot realize all functions of the controller, and for some functions that cannot be realized by the controller agent, a corresponding interface may be set in the embodiment of the present invention, so that the controller agent invokes the interfaces through a preset method to convert the functions that cannot be realized into the controller for realization. The step of calling the controller agent to process the page operation instruction can be specifically executed by calling the controller agent to send the page operation instruction to the controller through a preset interface so as to call the controller to process the page operation instruction.
For example, in the controller, by means of the getFloorWithUniqueId method, the floor instance corresponding to the floor identifier UniqueId, that is, the corresponding data of the floor identifier UniqueId, so in the embodiment of the invention, a self.realcntroller.getfloorwithunique method may be added in the controller agent, and when communication between floors is required, the method may be called, and a page operation instruction may be sent to the controller to obtain the corresponding data of the target floor corresponding to the target floor identifier, and based on the page operation instruction, the corresponding data of the target floor is updated.
It should be noted that the communication between floors may also include a scenario of updating the corresponding data of the plurality of floors, for example setting the background color of all floors. At this time, the controller agent may obtain the corresponding data of each floor in batch in the above manner, and then update the corresponding data of each floor in sequence. Through the process, communication between floors can be achieved, namely through the step, the interaction between View and View, the interaction between Controller and View and the like can be seen, and accordingly personalized development requirements of business parties can be met.
In the embodiment of the invention, the communication between different floors can be realized through the controller agent, so that more personalized demands of service parties can be realized.
In the embodiment of the invention, the controller agent is created, so that the business party can realize the functions of some controllers based on the controller agent, and the business party can also set a data model to store and analyze corresponding data of the floor of the business party through the data model. The method for acquiring the corresponding data of the service side floor can be specifically executed by calling the controller agent to inquire the data model corresponding to the service side floor so as to acquire the corresponding data of the service side floor from the data model when the page is generated.
For example, the service party can initiate a network request in a service party floor and develop a corresponding data model, so that when the network request returns, the corresponding data model can be used to analyze and store the data returned by the network request, and when the page is generated, the controller agent can be called to acquire the data corresponding to the network request from the data model.
Through the above process, the service side is equivalent to opening the link between the Controller and the Model in fig. 1, and since each service side floor can call the Controller agent, the corresponding data of the service side floor can call the Controller agent to obtain the corresponding data Model analysis, without needing to analyze each floor separately. For example, when the field x is issued through the network interface API1 in the service floor a, the controller agent may be called by self. Therefore, the controller agent is called to acquire data from the data model, so that multiplexing of the data model can be realized, and the problems of repeated development of service side floors, difficulty in maintenance, large memory consumption and the like are solved.
In the embodiment of the invention, the controllers in the page are in one-to-one correspondence with the controller agents, and the communication links among the three roles of the M-V-C of the architecture of the figure 1 in the service floor are thoroughly opened through technical means such as calling of methods such as life cycle and the like, so that the capability of the service party for opening the custom floor can be provided, the development of the service party on the View level, the Contoller level and the Model level of the data Model is realized, the development party can process the global and local double problems, the service party can also realize a plurality of development requirements which cannot be finished before, and the expansion capability of the components is further opened.
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, as shown in fig. 4, the device 400 includes:
a receiving unit 401, configured to receive a page generation request of a target page, and acquire a page identifier in the page generation request, so as to query a corresponding controller;
A creating unit 402, configured to invoke the controller, create a controller agent corresponding to the target page, and query a system floor and a service floor included in the page;
and the generating unit 403 is configured to obtain corresponding data of the system floor, call the controller agent to obtain corresponding data of the service party floor, so as to render the system floor and the service party floor, and generate the target page.
It should be understood that the manner of implementing the embodiment of the present invention is the same as that of implementing the embodiment shown in fig. 2, and will not be described herein.
In one implementation manner of the embodiment of the present invention, the generating unit 403 is specifically configured to:
And calling the controller agent, and inquiring a data model corresponding to the service side floor to acquire corresponding data of the service side floor from the data model.
In another implementation manner of the embodiment of the present invention, the receiving unit 401 is further configured to receive a page operation instruction, and obtain floor data corresponding to the page operation instruction, so as to determine a floor type corresponding to the page operation instruction;
The apparatus 400 further comprises:
And the processing unit is used for sending the page operation instruction to the controller to call the controller to process the page operation instruction if the floor type is the system floor, and sending the page operation instruction to the controller proxy to call the controller proxy to process the page operation instruction if the floor type is the service side floor.
In yet another implementation manner of the embodiment of the present invention, the processing unit is specifically configured to:
And calling the controller agent, inquiring a target floor identifier corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identifier, updating based on the page operation instruction, and rendering the updated target floor.
In yet another implementation manner of the embodiment of the present invention, the processing unit is specifically configured to:
and calling the controller agent, and sending the page operation instruction to the controller through a preset interface so as to call the controller to process the page operation instruction.
In yet another implementation manner of the embodiment of the present invention, the generating unit 403 is specifically configured to:
acquiring the floor information of the service party floors to determine the floor sequence of the service party floors;
And calling the controller agent, and rendering the service party floors based on the floor sequence.
In yet another implementation manner of the embodiment of the present invention, the creating unit 402 is specifically configured to:
And receiving an object class name corresponding to the controller agent, and storing the object class name to create the controller agent based on the object class name.
It should be understood that the manner of implementing the embodiments of the present invention is the same as that of implementing the embodiments shown in fig. 2 or 3, and will not be described herein.
In the embodiment of the invention, when the page is generated, the controller can be called to create the controller agent, and further, the corresponding data of the service side floor and the rendering of the service side floor are acquired through the controller agent, so that the requirements of the service side such as a network request and the like, which need to be processed by the controller, can be realized through the controller agent, and further, the development requirements of more individuation of the service side can be met.
According to an embodiment of the present invention, an electronic device and a readable storage medium are also provided.
The electronic device comprises at least one processor and a memory in communication connection with the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the page generation method provided by the embodiment of the invention.
FIG. 5 illustrates an exemplary system architecture 500 of a page generation method or page generation apparatus to which embodiments of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used as a medium to provide communication links between the terminal devices 501, 502, 503 and the server 505. The network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 505 via the network 504 using the terminal devices 501, 502, 503 to receive or send messages or the like. Various client applications may be installed on the terminal devices 501, 502, 503.
The terminal devices 501, 502, 503 may be, but are not limited to, smartphones, tablets, laptop and desktop computers, and the like.
The server 505 may be a server providing various services, and may analyze received data such as a floor information inquiry request, etc., and may feed back the processing result (e.g., floor information—only by way of example) to the terminal device.
It should be noted that, the method for generating a page provided in the embodiment of the present invention is generally executed by the server 505, and accordingly, the device for generating a page is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, there is illustrated a schematic diagram of a computer system 600 suitable for use in implementing embodiments of the present invention. The computer system shown in fig. 6 is merely an example, and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in fig. 6, 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 section 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, ROM 602, and RAM 603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Connected to the I/O interface 605 are an input section 606 including a keyboard, a mouse, and the like, an output section 607 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like, a storage section 608 including a hard disk, and the like, and a communication section 609 including a network interface card such as a LAN card, a modem, and the like. The communication section 609 performs communication processing via a network such as the internet. The drive 610 is also connected to the I/O interface 605 as needed. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is installed as needed on drive 610 so that a computer program read therefrom is installed as needed into storage section 608.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 601.
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 two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present invention may be implemented in software or in hardware. The described units may also be provided in a processor, which may be described, for example, as a processor comprising a receiving unit, a creating unit and a generating unit. The names of these units do not in any way constitute a limitation of the unit itself, for example, a receiving unit may also be described as a "unit of the function of the receiving unit".
As a further aspect, the invention also provides a computer readable medium which may be comprised in the device described in the above embodiments or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to perform the method of page generation provided by the present invention.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (9)

1. A method of page generation, comprising:
Receiving a page generation request of a target page, and acquiring a page identifier in the page generation request to inquire a corresponding controller;
Calling the controller, creating a controller agent corresponding to the target page, and inquiring a system floor and a service side floor included in the target page;
The corresponding data of the system floor is obtained, the controller agent is called to obtain the corresponding data of the service party floor so as to render the system floor and the service party floor, and the target page is generated;
after the target page is generated, the method further comprises:
Receiving a page operation instruction, and acquiring floor data corresponding to the page operation instruction to determine a floor type corresponding to the page operation instruction;
if the floor type is the system floor, sending the page operation instruction to the controller so as to call the controller to process the page operation instruction;
And if the floor type is the service side floor, sending the page operation instruction to the controller agent so as to call the controller agent to process the page operation instruction.
2. The method of claim 1, wherein invoking the controller agent to obtain the corresponding data for the service party floor comprises:
And calling the controller agent, and inquiring a data model corresponding to the service side floor to acquire corresponding data of the service side floor from the data model.
3. The method of claim 1, wherein the page operation instructions comprise floor interaction instructions;
invoking the controller agent to process the page operation instruction, including:
And calling the controller agent, inquiring a target floor identifier corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identifier, updating based on the page operation instruction, and rendering the updated target floor.
4. The method of claim 1, wherein invoking the controller agent to process the page operation instruction comprises:
and calling the controller agent, and sending the page operation instruction to the controller through a preset interface so as to call the controller to process the page operation instruction.
5. The method of claim 1, wherein rendering the business side floor comprises:
acquiring the floor information of the service party floors to determine the floor sequence of the service party floors;
And calling the controller agent, and rendering the service party floors based on the floor sequence.
6. The method of claim 1, wherein invoking a controller to create a controller agent for the page comprises:
And receiving an object class name corresponding to the controller agent, and storing the object class name to create the controller agent based on the object class name.
7. An apparatus for generating a page, comprising:
the receiving unit is used for receiving a page generation request of a target page, and acquiring a page identifier in the page generation request so as to inquire a corresponding controller;
the creation unit is used for calling the controller, creating a controller agent corresponding to the target page, and inquiring a system floor and a service party floor included in the page;
the generation unit is used for acquiring the corresponding data of the system floor, calling the controller agent to acquire the corresponding data of the service party floor so as to render the system floor and the service party floor and generate the target page;
the receiving unit is further used for receiving a page operation instruction, acquiring floor data corresponding to the page operation instruction and determining a floor type corresponding to the page operation instruction;
The apparatus further comprises:
And the processing unit is used for sending the page operation instruction to the controller to call the controller to process the page operation instruction if the floor type is the system floor, and sending the page operation instruction to the controller proxy to call the controller proxy to process the page operation instruction if the floor type is the service side floor.
8. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-6.
9. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-6.
CN202110551546.6A 2021-05-20 2021-05-20 Page generation method, device, electronic device and storage medium Active CN113254825B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110551546.6A CN113254825B (en) 2021-05-20 2021-05-20 Page generation method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110551546.6A CN113254825B (en) 2021-05-20 2021-05-20 Page generation method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN113254825A CN113254825A (en) 2021-08-13
CN113254825B true CN113254825B (en) 2025-03-18

Family

ID=77182999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110551546.6A Active CN113254825B (en) 2021-05-20 2021-05-20 Page generation method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113254825B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113704671B (en) * 2021-09-07 2025-02-21 北京沃东天骏信息技术有限公司 Page generation method and device
CN115562670B (en) * 2022-11-15 2023-04-25 深圳市客路网络科技有限公司 Page configuration method, device, electronic equipment and medium
CN118964067B (en) * 2024-10-15 2025-01-14 数字广东网络建设有限公司 Interaction method, device, equipment and medium of content page and native controller

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100552A (en) * 2020-08-06 2020-12-18 北京沃东天骏信息技术有限公司 Page rendering method, device, equipment and computer readable storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2368246B (en) * 2000-10-17 2004-09-01 Hewlett Packard Co Overview subsystem for information page server
US7039037B2 (en) * 2001-08-20 2006-05-02 Wang Jiwei R Method and apparatus for providing service selection, redirection and managing of subscriber access to multiple WAP (Wireless Application Protocol) gateways simultaneously
US20090150800A1 (en) * 2007-12-05 2009-06-11 Glenn Wood Apparatus, Method and Computer Program Product for Generating Debriefing Charts
CN102779170B (en) * 2012-06-25 2015-01-07 北京奇虎科技有限公司 A system and method for identifying the text floor of a web page
WO2014018319A2 (en) * 2012-07-21 2014-01-30 Trulia, Inc. Automated landing page generation and promotion for real estate listings
CN106294475A (en) * 2015-06-04 2017-01-04 阿里巴巴集团控股有限公司 The generation method and apparatus of the page
CN108460035B (en) * 2017-02-17 2021-12-24 阿里巴巴集团控股有限公司 Method and device for obtaining barrier-free function state and processing page
CN111461801A (en) * 2019-01-18 2020-07-28 阿里巴巴集团控股有限公司 A method and device for generating a page

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100552A (en) * 2020-08-06 2020-12-18 北京沃东天骏信息技术有限公司 Page rendering method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN113254825A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
CN113254825B (en) Page generation method, device, electronic device and storage medium
US11695582B2 (en) Method, system, and non-transitory computer-readable record medium for providing multiple group calls in one chatroom
US20140143305A1 (en) Apparatus and system for providing software service using software virtualization and method thereof
CN113360160B (en) Method, device, electronic device and storage medium for deploying application
JP7048663B2 (en) Code execution methods, devices, rendering devices, storage media, and programs
CN113076163A (en) Card rendering method and device
CN117616395A (en) Continuous application liveness and integrity during migration
CN107247629A (en) Cloud computing system and cloud computing method and device for controlling server
CN108337314A (en) Distributed system, information processing method and device for master server
CN114035879B (en) Page theme color replacement method, device, electronic equipment and computer readable medium
JP2023547061A (en) Access control for online presentations
CN109840109B (en) Method and apparatus for generating software development toolkit
CN114675820A (en) Service arrangement data processing method and device, electronic equipment and storage medium
CN116016420B (en) A task list sharing method, device, equipment and medium
JP2021068414A (en) Wrapping method, registration method, device, rendering device, and program
CN113032004A (en) Method, apparatus and program product for managing development jobs in a development environment
CN108804442B (en) Serial number generation method and device
CN113741862A (en) Communication system and method for mobile terminal expansion development
CN114064176B (en) View interaction method, device, electronic device and computer-readable medium
CN114527972B (en) A page generation method, device, electronic device and computer readable medium
CN116319644A (en) Session menu processing method and device and electronic equipment
CN116774996A (en) Integrated development system, code processing method, electronic device, and storage medium
CN111124523A (en) Method and apparatus for initializing applications
CN113449228B (en) Page rendering method and device
CN113535185A (en) Sharing implementation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant