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

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

Info

Publication number
CN113254825A
CN113254825A CN202110551546.6A CN202110551546A CN113254825A CN 113254825 A CN113254825 A CN 113254825A CN 202110551546 A CN202110551546 A CN 202110551546A CN 113254825 A CN113254825 A CN 113254825A
Authority
CN
China
Prior art keywords
floor
page
controller
operation instruction
service
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.)
Pending
Application number
CN202110551546.6A
Other languages
Chinese (zh)
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/CN113254825A/en
Publication of CN113254825A publication Critical patent/CN113254825A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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)

Abstract

The invention discloses a page generation method and device, electronic equipment and a storage medium, and relates to the technical field of computers. One embodiment of the method comprises: receiving a page generation request of a target page, and acquiring a page identifier in the page generation request to query a corresponding controller; calling a controller, creating a controller agent corresponding to a target page, and inquiring a system floor and a service side floor included by the target page; and acquiring corresponding data of the system floor, calling a controller agent to acquire corresponding data of the service party floor so as to render the system floor and the service party floor and generate a target page. The implementation method can solve the problem that the generated page can only realize the simple requirements of a service party, such as the requirement of adding network requests and the like which needs to be processed by the controller cannot be realized.

Description

Page generation method and 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 an 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 redevelopment, developers usually encapsulate developed components and the business uses them directly without touching complex logic within the components. With the increasing personalized requirements of different business parties, in order to reduce the component development pressure of a developer, an interface for development of the business party can be set during component development in the prior art, so that the business party can develop the personalized requirements on the view layer of the page. However, the page generated in this way can only realize simple requirements of the service side, and the requirements such as increasing network requests and the like which need to be processed by the controller cannot be realized.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a page, an electronic device, and a storage medium, 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 achieve simple requirements of the business party, such as increasing a network request and the like, which cannot be achieved by a requirement that needs to be processed by a controller.
To achieve the above object, according to an aspect of the embodiments of the present invention, a method for page generation is provided.
The method for generating the page comprises the following steps: receiving a page generation request of a target page, and acquiring a page identifier in the page generation request to query 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 by the target page; and acquiring corresponding data of the system floor, calling the controller agent to acquire corresponding data of the service party floor so as to render the system floor and the service party floor, and generating the target page.
In one embodiment, invoking the controller agent to obtain corresponding data of the service floor comprises:
and calling the controller agent, and inquiring a data model corresponding to the service party floor so as to obtain corresponding data of the service party floor from the data model.
In 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, the page operation instruction is sent 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;
calling the controller agent to process the page operation instruction, wherein the calling comprises the following steps:
and calling the controller agent, inquiring the target floor identification corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identification, 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 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.
In yet another embodiment, rendering the service floor includes:
acquiring floor information of the service party floor to determine the floor sequence of the service party floor;
and calling the controller agent, and rendering the service party floor based on the floor sequence.
In another embodiment, invoking a controller to create 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 so as to create the controller agent based on the object class name.
To achieve the above object, according to another aspect of the embodiments of the present invention, an apparatus for page generation is provided.
The device for generating the page in the embodiment of the invention comprises the following components: the system comprises a receiving unit, a processing unit and a processing unit, wherein 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 query a corresponding controller; the creating unit is used for 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 page; and the generating unit is used for acquiring corresponding data of the system floor, calling the controller agent to acquire corresponding data of the service party floor, rendering the system floor and the service party floor, and generating the target page.
In an embodiment, the generating unit is specifically configured to:
and calling the controller agent, and inquiring a data model corresponding to the service party floor so as to obtain corresponding data of the service party floor from the data model.
In another embodiment, the receiving unit is further configured to receive a page operation instruction, and acquire floor data corresponding to the page operation instruction to determine a floor type corresponding to the page operation instruction;
the device further comprises:
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 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 another embodiment, the processing unit is specifically configured to:
and calling the controller agent, inquiring the target floor identification corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identification, updating based on the page operation instruction, and rendering the updated target floor.
In another 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 another embodiment, the generating unit is specifically configured to:
acquiring floor information of the service party floor to determine the floor sequence of the service party floor;
and calling the controller agent, and rendering the service party floor based on the floor sequence.
In another embodiment, the creating unit is specifically configured to:
and receiving an object class name corresponding to the controller agent, and storing the object class name so as 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.
An electronic device of an embodiment of the present invention includes: one or more processors; 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 realize 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, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention stores thereon a computer program, and the computer program, when executed by a processor, implements the method for generating a page provided by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: in the embodiment of the invention, when the target page is generated, the controller proxy can be created by calling the corresponding controller, after the corresponding data of the system floor is obtained, the controller proxy is called to obtain the corresponding data of the service side floor, and then the system floor and the service side floor are rendered, so that the target page is generated. In this way, in the embodiment of the present invention, when the page is generated, the controller can be called to create the controller proxy, and then the corresponding data of the service party floor and the rendering of the service party floor are obtained through the controller proxy, so that the requirements of the service party such as a network request and the like which need to be processed by the controller can be realized through the controller proxy, and further more personalized development requirements of the service party can be satisfied.
Further effects of the above-mentioned non-conventional alternatives will be 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 according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a main flow of a method of page generation according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a main flow of a method for processing page operation instructions according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main elements of an apparatus for page generation 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 employed;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as 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 should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
The embodiment of the invention provides a page generation system, which can be used for a page generation scene, for example, a scene based on component page generation. The page may be a network page or an APP page, and the APP page is taken as an example in the embodiment of the present invention for description.
Each functional module in the APP is modularized, the most basic architecture of component development can adopt an MVC architecture, and the MVC architecture mainly comprises three parts: m (model) represents a data model, v (view) represents a view, e.g., a view control such as a button, c (controller) represents a controller, and service data and view controls are separated in the MVC architecture. Fig. 1 is a schematic diagram of an MVC architecture. In the architecture, the data model and the view are scheduled by a controller, and the controller is responsible for specific view presentation and data interaction, for example, acquiring data corresponding to the view, transferring data corresponding to a certain view to the view for presentation, and the like.
The page is split into a plurality of floors by a developer during page development, each floor corresponds to a component developed by the developer, namely an initial component, page initial elements developed by the developer can be generated after rendering, and the floors corresponding to the page initial elements can be called system floors. After the developer develops the components, the business party can redevelop the page based on the system floor to realize personalized requirements. The components developed by the service party are service party components, page self-defining elements capable of realizing service party personalization are rendered, and floors corresponding to the page self-defining elements can be called service party floors. Therefore, the page in the APP can comprise a system floor and a service party floor, the system floor and the service party 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 service party can be generated, and the component co-construction is achieved. The page itself can be seen as a stateless container, and floors can be presented on the page in various free combinations. The developer can define one or more standard interfaces in the assembly, namely define some virtual method combinations, so that the service can develop a self-defined floor, namely a service floor, based on the virtual method and communicate with the system floor to realize personalized requirements.
At present, a business side can only realize the development of a View layer to realize some simple requirements, but cannot develop the View layer on the level of a controller and a data model, so that the requirements of the processing capacity of the controller such as a network interface for requesting customization and the like cannot be realized, and the personalized requirements of the business side cannot be met.
In order to meet the requirements of the business party, the embodiment of the invention can be provided with the controller agent so as to realize the development of the personalized requirements processed by the controller for the business party. Specifically, in the embodiment of the present invention, an interface for implementing a controller proxy may be set in the component to provide the component to a service party, and the service party may develop a controller proxy object based on the set interface, then transfer information of the controller proxy object to the component, and implement communication between the controller proxy and the controller through interface call, so that the controller proxy may implement some functions of the controller, such as a life cycle, a network request, and a series of method calls, thereby implementing development of more requirements of the service party on a service party floor. The life cycle method in the controller mainly comprises the following steps: a page creation init method, a to-be-rendered viewwillapplearer method, a page disappearing viewdiddispear method, and the like, and the network request may be a requestApi method.
It should be noted that, the method that the controller agent can implement may be determined based on the interface provided by the component, and a specific developer may set the interface that can be provided based on the requirement of the service party, so as to facilitate the service party to develop the personalized requirement.
An embodiment of the present invention provides a method for generating a page, where the method may be executed by a page generation system, and as shown in fig. 2, the method includes:
s201: and receiving a page generation request of the target page, and acquiring a page identifier in the page generation request to query the corresponding controller.
The page may 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 that 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 page generation process.
S202: and calling a controller, creating a controller agent corresponding to the target page, and inquiring a system floor and a service side floor included by 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 proxy based on the interface provided by the component, and can transmit the information of the controller proxy to the component. Therefore, after the controller is called in this step, the controller can create a controller agent corresponding to the target page based on the transferred information of the controller agent.
Specifically, the business party develops the controller proxy object, and transmits the name of the controller proxy object to the component through a preset interface after the development is completed, and after the component stores the name of the object class of the controller proxy, the creation of the controller proxy can be realized in this step, that is, a specific controller proxy instance is created. In this step, a controller is called, a controller agent corresponding to the page is created, and the method can be executed as: and 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.
It should be noted that for an APP, it may include multiple pages, for example, for an APP for online shopping, a user may enter an item detail page by searching for some kind of item, and in general, some item recommendation floors may be included in the item detail page, and the user may further enter a new item detail page by clicking on these item recommendation floors, so that for an APP, it includes multiple item detail pages, but each item detail page is independent. If a business party develops a controller proxy object suitable for an article detail page, the controller proxy object is directly transmitted to a component, the controller proxy object corresponds to a plurality of article detail pages, and a developer difficultly determines which page the controller proxy object interacts and communicates with.
In the embodiment of the invention, each page is jointly developed by a service party and a development party, so that the page comprises a system floor and a service party floor, the system floor and the service party floor which are included in a target page can be inquired by calling a 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 floor, such as the information of the floor identifier, the floor type, the floor attribute, etc., may be queried.
S203: and acquiring corresponding data of the system floor, calling a controller agent to acquire corresponding data of the service party floor so as to render the system floor and the service party floor and generate a target page.
The system floor is developed by a developer, and the processing of the system floor is executed by the controller, so that the corresponding data of the system floor can be acquired after the controller is called in the step, and the rendering of the system floor is facilitated. The service side floor is developed for the service side, the processing of the service side floor is executed by the controller agent, and the service side floor is developed based on the system floor, so the controller agent can be called after the corresponding data of the system floor is obtained in the step, so that the corresponding data of the service side floor is obtained based on the corresponding data of the system floor, and the rendering of the service side floor is facilitated. And obtaining the generated target page after rendering the system floor and the service side floor.
In the process of generating the page, the system may automatically schedule a lifecycle method of the controller, for example, an init method of the controller is called when the page is created, and a viewwillapplicator method is called when the page is to be rendered. Since the service side floor in the page needs to be processed by the controller agent, when each method in the controller is called, the controller can simultaneously call the corresponding method in the controller agent so as to call the controller agent to process the service side floor. Specifically, in the embodiment of the present invention, a method corresponding to the controller agent may be set in the controller, for example, a self.controllerdiellengelate.viewwillapplicator () method is set in the viewwillapplicator of the controller, and when the viewwillapplicator is called in the controller, the self.controllerdiegage.viewwillapplicator () method may be simultaneously called, so that the viewwillapplicator in the controller agent is called. Therefore, the controller can call the life cycle methods in the controller agent, and the requirement of initiating the network request in the service party floor when the page is generated can be met, namely, the service party 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 floor and the service side floor are rendered, the floors can be sequentially rendered according to the sequence. Specifically, for the service side floor, the floor information of the service side floor can be obtained in this step to determine the floor sequence of each service side floor, and then the controller agent is called to render the service side floor based on the floor sequence. The floor information can be obtained from the server side, the floor information can include a floor identification list, corresponding floors are generated based on floor identifications in the floor identification list, the controller agents are assigned to the floors through preset fields, and then the floors are sequentially rendered based on corresponding data of the floors by calling the controller agents.
It should be noted that, in the embodiment of the present invention, an attribute field may be extended in the base class of each service party floor, so as to implement assignment of the controller agent through the attribute field, and thus, communication between each service party floor and the controller agent at any time can be implemented without independently executing assignment processing in the subclass of each service party floor. In the page rendering process, the service party floor list can be traversed through a circulation function, and the controller agents are transmitted to each service party floor one by one in an attribute assignment mode, so that the service party floor rendering is realized.
In the embodiment of the invention, when the page is generated, the controller can be called to create the controller proxy, and then the corresponding data of the service party floor and the rendering of the service party floor are obtained through the controller proxy, so that the requirements of the service party such as network requests and the like needing to be processed by the controller can be realized through the controller proxy, and further more personalized development requirements of the service party can be met.
In the embodiment of the invention, the generated target page comprises a system floor and a service floor, when the page element corresponding to the system floor is operated, a corresponding method in the controller can be called for processing, and when the page element corresponding to the service floor is operated, a corresponding method in the controller agent 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 service floor is operated may be self. Thus, through the Controller agent, the path of the View in the service side floor accessing the Controller, that is, the link of the User Action shown in fig. 1, that is, the View belonging to the service side floor can realize the communication with the Controller.
Therefore, with reference to the architecture shown in fig. 1 and the embodiment shown in fig. 2, in the embodiment of the present invention, a specific description is given to a processing procedure of an operation in a target page after the target page is generated, as shown in fig. 3, the method includes:
s301: and receiving the page operation instruction, and acquiring floor data corresponding to the page operation instruction to determine the 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 can include floor marks, and the target page is generated based on corresponding data of each floor in the step, so that a corresponding relation exists between the corresponding data of each floor and the floor marks, and the corresponding data of each floor can include information such as control positions, names and display contents. After the floor identification is determined, the floor type corresponding to the page operation instruction can be inquired based on the floor identification.
In the embodiment of the invention, the floor types comprise a system floor and a service floor, the page element corresponding to the system floor is operated and processed by the controller, and the page element corresponding to the service floor is operated and processed by the controller agent, so that after the floor type corresponding to the page operation instruction is determined, how to process the page operation instruction can be determined.
S302: and if the floor type is a system floor, sending the page operation instruction to the controller so as to call the controller to process the page operation instruction.
If the floor type is a system floor, the page element corresponding to the system floor is indicated to be operated by the page operation instruction, and the page operation instruction can be sent to the controller so as to call the controller to process the page operation instruction.
S303: and if the floor type is a 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.
If the floor type is a service side floor, the page element corresponding to the service side floor operated by the page operation instruction is described, and the page operation instruction can be sent to the controller agent so as to call the controller agent to process the page operation instruction.
The destination page includes each system floor and a service floor, but the floors are not usually independent from each other and can communicate with each other. For example, clicking on the floor a may trigger an action on the floor B, such as stopping playing a video played on the floor B after the control on the floor a is operated. Interactions between floors in the system floor are handled by the controller, while interactions between floors in the service floor are handled by the controller agent.
Therefore, 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, at this time, this step may be executed as: and calling a controller agent, inquiring a target floor identification corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identification, updating based on the page operation instruction, and rendering the updated target floor.
The calling controller agent can acquire corresponding data of the target floor corresponding to the target floor identification, and then can update the corresponding data of the target floor by calling a corresponding method based on the corresponding data of the target floor and render the corresponding data so as to realize that the page element of the target floor in the target page is updated along with the page operation instruction.
For example, the page operation instruction of the floor a in the target page is received, and the corresponding operation in the floor B is triggered, the method corresponding to the page operation instruction of the floor a in the controller agent may be a floor ahandler, and a getFloorWithUniqueId method may be set in the floor ahandler to obtain corresponding data of the floor corresponding to the UniqueId, that is, the corresponding data of the floor B is called by the method, and then a method corresponding to the floor B (for example, functionResflororactick) is called to update the corresponding data of the floor B, so that communication between the floor a and the floor B is realized.
It should be noted that the controller agent cannot be completely identical to the controller, so that the controller agent cannot implement all functions of the controller, and for some functions that cannot be implemented by the controller agent, in the embodiment of the present invention, corresponding interfaces may be set, so that the controller agent invokes the functions that cannot be implemented by the interfaces through a preset method to convert the functions that cannot be implemented into the controller to implement the functions. Therefore, invoking the controller agent to process the page operation instruction in this step may be specifically implemented as: 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.
For example, in the controller, the method of getFloorWithUniqueId can be used to obtain 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 present invention, a self.
It should be noted that the communication between floors may also include a scene of updating the corresponding data of multiple 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 sequentially update the corresponding data of each floor. The communication between floors can be realized through the process, namely, through the step, the interaction between the View and the View, the interaction between the Controller and the View and the like can be realized, so that the personalized development requirement of a service party 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 requirements of service parties can be realized.
In the embodiment of the invention, because the controller agent is created, the service party can realize the functions of some controllers based on the controller agent, and the service party can also set a data model to store and analyze the corresponding data of the service party floor through the data model. Thus, when the page is generated, acquiring the corresponding data of the service party floor can be specifically executed as: and calling a controller agent, and inquiring a data model corresponding to the service party floor so as to obtain corresponding data of the service party floor from the data model.
For example, the service party may initiate a network request in the service party floor and develop a corresponding data model, so that when the network request returns, the data returned by the network request may be parsed and stored using the corresponding data model, and when the page is generated, the controller agent may be invoked to obtain the data corresponding to the network request from the data model.
Through the above process, the service party equivalently gets through the link between the Controller and the Model in fig. 1, and since each service party floor can call the Controller agent, the corresponding data of the service party floor can call the Controller agent to obtain the corresponding data Model analysis, and the individual analysis of each floor is not needed. For example, when the field x is sent through the network interface API1 in the service floor a, the controller agent may be called through self. Therefore, the data is acquired from the data model by calling the controller agent, so that the data model multiplexing can be realized, and the problems of repeated development of service side floors, difficulty in maintenance, high memory consumption and the like are solved.
In the embodiment of the invention, the one-to-one correspondence between the controllers in the page and the controller agents can be realized through the controller agents, the communication links among the three roles of M-V-C of the architecture in the figure 1 in the service floor can be thoroughly opened through technical means such as calling of methods such as a life cycle and the like, so that the capability of opening the self-defined floor by the service party can be provided, the development of the service party on a View level, a Contoller level and a data Model level can be realized, the development party can handle the double problems of the whole situation and the local situation, and the service party can realize a plurality of development requirements which cannot be completed before and further open the expansion capability of the components.
In order to solve the problems in the prior art, an embodiment of the present invention provides an apparatus 400 for generating a page, as shown in fig. 4, where the apparatus 400 includes:
a receiving unit 401, configured to receive a page generation request of a target page, and obtain a page identifier in the page generation request 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;
a generating unit 403, configured to obtain corresponding data of the system floor, and 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 the manner of implementing the embodiment shown in fig. 2, and the description thereof is omitted.
In an 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 party floor so as to obtain corresponding data of the service party 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:
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 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 another implementation manner of the embodiment of the present invention, the processing unit is specifically configured to:
and calling the controller agent, inquiring the target floor identification corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identification, updating based on the page operation instruction, and rendering the updated target floor.
In 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 another implementation manner of the embodiment of the present invention, the generating unit 403 is specifically configured to:
acquiring floor information of the service party floor to determine the floor sequence of the service party floor;
and calling the controller agent, and rendering the service party floor based on the floor sequence.
In 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 so as to create the controller agent based on the object class name.
It should be understood that the embodiment of the present invention is implemented in the same manner as the embodiment shown in fig. 2 or fig. 3, and is not repeated herein.
In the embodiment of the invention, when the page is generated, the controller can be called to create the controller proxy, and then the corresponding data of the service party floor and the rendering of the service party floor are obtained through the controller proxy, so that the requirements of the service party such as network requests and the like needing to be processed by the controller can be realized through the controller proxy, and further more personalized development requirements of the service party 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 of the embodiment of the invention comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the processor, and the instructions are executed by the at least one processor to cause the at least one processor to execute the method for generating the page provided by the embodiment of the invention.
Fig. 5 illustrates an exemplary system architecture 500 to which the page generation method or page generation apparatus of an embodiment 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 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 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, smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server that provides various services, and the server may analyze and process data such as a received floor information query request, and feed back a processing result (for example, floor information — just an example) to the terminal device.
It should be noted that the method for generating a page provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the apparatus 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, a block diagram of a computer system 600 suitable for use in implementing embodiments of the present invention is shown. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that 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 necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; 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, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 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, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the 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 illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the 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 present invention, 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, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart 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 described in the embodiments of the present invention may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a receiving unit, a creating unit, and a generating unit. Where the names of these elements do not in some cases constitute a limitation of the element itself, for example, a receiving element may also be described as "an element of the function of the receiving element".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated 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 for page generation provided by the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for page generation, comprising:
receiving a page generation request of a target page, and acquiring a page identifier in the page generation request to query 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 by the target page;
and acquiring corresponding data of the system floor, calling the controller agent to acquire corresponding data of the service party floor so as to render the system floor and the service party floor, and generating the target page.
2. The method of claim 1, wherein invoking the controller agent to obtain corresponding data for the service floor comprises:
and calling the controller agent, and inquiring a data model corresponding to the service party floor so as to obtain corresponding data of the service party floor from the data model.
3. The method of claim 1, after the generating the target page, further comprising:
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, the page operation instruction is sent 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.
4. The method of claim 3, wherein the page operation command comprises a floor interaction command;
calling the controller agent to process the page operation instruction, wherein the calling comprises the following steps:
and calling the controller agent, inquiring the target floor identification corresponding to the page operation instruction, acquiring corresponding data of the target floor corresponding to the target floor identification, updating based on the page operation instruction, and rendering the updated target floor.
5. The method of claim 3, 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.
6. The method of claim 1, wherein rendering the service floor comprises:
acquiring floor information of the service party floor to determine the floor sequence of the service party floor;
and calling the controller agent, and rendering the service party floor based on the floor sequence.
7. The method of claim 1, wherein invoking a controller to create a controller agent corresponding to the page comprises:
and receiving an object class name corresponding to the controller agent, and storing the object class name so as to create the controller agent based on the object class name.
8. An apparatus for page generation, comprising:
the system comprises a receiving unit, a processing unit and a processing unit, wherein 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 query a corresponding controller;
the creating unit is used for 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 page;
and the generating unit is used for acquiring corresponding data of the system floor, calling the controller agent to acquire corresponding data of the service party floor, rendering the system floor and the service party floor, and generating the target page.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202110551546.6A 2021-05-20 2021-05-20 Page generation method and device, electronic equipment and storage medium Pending CN113254825A (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (1)

Publication Number Publication Date
CN113254825A true CN113254825A (en) 2021-08-13

Family

ID=77182999

Family Applications (1)

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

Country Status (1)

Country Link
CN (1) CN113254825A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562670A (en) * 2022-11-15 2023-01-03 深圳市客路网络科技有限公司 Page configuration method and device, electronic equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115562670A (en) * 2022-11-15 2023-01-03 深圳市客路网络科技有限公司 Page configuration method and device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
US7756905B2 (en) System and method for building mixed mode execution environment for component applications
US11095957B2 (en) Method and apparatus for publishing information, and method and apparatus for processing information
CN109800083A (en) A kind of method, apparatus, system and storage medium that micro services collaboration is called
JP7048663B2 (en) Code execution methods, devices, rendering devices, storage media, and programs
CN108052377B (en) Cloud-based input processing method and device, server and storage medium
CN113778404A (en) Page generation method and device
CN113254825A (en) Page generation method and device, electronic equipment and storage medium
JP7010562B2 (en) Wrapping method, registration method, device, rendering device, and program
CN109840109B (en) Method and apparatus for generating software development toolkit
CN110069185B (en) Method and apparatus for co-running hosted applications
CN113760561A (en) Data processing method and device
CN111240998A (en) Test case processing method and device
CN107741970B (en) Method and device for laying out main page
CN108804442B (en) Serial number generation method and device
CN113741862A (en) Communication system and method for mobile terminal expansion development
CN111626802A (en) Method and apparatus for processing information
CN111124523A (en) Method and apparatus for initializing applications
CN110659916A (en) Order amount splitting method and device
CN111651146B (en) Function generation method, device, equipment and medium
CN114255084A (en) Advertisement page display method, device and system
CN112925521A (en) Interface generation method and device
CN113312900A (en) Data verification method and device
CN109840073B (en) Method and device for realizing business process
CN112631638A (en) Terminal application updating method and device, storage medium and electronic equipment
CN113760487A (en) Service processing 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