CN107423070B - Page generation method and device - Google Patents

Page generation method and device Download PDF

Info

Publication number
CN107423070B
CN107423070B CN201710657548.7A CN201710657548A CN107423070B CN 107423070 B CN107423070 B CN 107423070B CN 201710657548 A CN201710657548 A CN 201710657548A CN 107423070 B CN107423070 B CN 107423070B
Authority
CN
China
Prior art keywords
control
event
data
target
style
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
CN201710657548.7A
Other languages
Chinese (zh)
Other versions
CN107423070A (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 QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201710657548.7A priority Critical patent/CN107423070B/en
Publication of CN107423070A publication Critical patent/CN107423070A/en
Application granted granted Critical
Publication of CN107423070B publication Critical patent/CN107423070B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a page generation method and a device, after a page generation request is obtained, page data corresponding to a target page is obtained from a server side according to the request; determining a control style corresponding to the control data from a preset style file; then, creating a control body according to the control data and the control style, and establishing an association relation between the control body and an associated event to obtain a control; and finally, typesetting and rendering the controls contained in the target page to generate the target page. According to the content, the style of each control in the page generated by the client and the events associated with each control can be flexibly adjusted by adjusting the page data of the server.

Description

Page generation method and device
Technical Field
The invention relates to the technical field of mobile application, in particular to a page generation method and device.
Background
With the increasing popularity and performance of intelligent mobile terminal devices, various service providers have increasingly strengthened mobile services and provided high-quality mobile application clients to meet user requirements.
In the prior art, when a client generates a page, styles of controls in the page and events associated with the controls depend on page data inherent to the client. For example: the method comprises the steps that a picture is displayed in a certain control, the picture displayed in the control changes when a page is newly opened or refreshed every time, but the style (such as shape, position and the like) of the control cannot be changed, and an event executed by clicking the control is that the current picture is displayed in a full screen mode all the time and cannot be changed into a replacement picture. For the same page, the style of each control in the page and the event associated with each control are fixed during each generation, and flexible adjustment cannot be performed.
Disclosure of Invention
In view of this, the present invention provides a page generation method and device, so as to solve the problem that the style of each control and the event associated with each control in a page in the prior art cannot be flexibly adjusted. The technical scheme is as follows:
in a first aspect, the present invention provides a page generating method, including:
acquiring a page generation request for generating a target page;
acquiring page data corresponding to the target page from a server according to the page generation request, wherein the page data comprises at least one group of control data;
determining a control style corresponding to the control data according to a preset style file;
according to the control data and the control style, creating a control body corresponding to the control data, and according to the control data, establishing an association relation between the control body and an associated event to obtain the control, wherein the associated event is an event which needs to be executed after a user operates the control body;
and performing typesetting rendering on the control contained in the target page to generate the target page.
Optionally, the control data includes service data, and the service data is used for indicating service content of the control;
determining a control style corresponding to the control data according to a preset style file, wherein the determining comprises the following steps:
analyzing the style identification contained in the service data;
and querying a control style corresponding to the style identification from a preset style file.
Optionally, the method further comprises:
and acquiring the preset style file from the server side according to the set time and storing the preset style file in the client side.
Optionally, the control data includes service data and behavior data, where the service data is used to indicate service content of the control, and the behavior data is used to indicate event content corresponding to the control;
the creating a control body corresponding to the control data according to the control data and the control style, and establishing an association relationship between the control body and an associated event according to the control data to obtain the control comprises:
creating a control body corresponding to the control data according to the service data and the control style;
and establishing an incidence relation between the control body and the behavior data to obtain the control.
Optionally, the method further comprises:
when control operation of a user for a target control on the target page is detected, target behavior data associated with the target control is obtained, wherein the target control is any one control on the target page;
and analyzing the target behavior data associated with the target control, obtaining a target event corresponding to the control operation, and executing the target event.
Optionally, the control data further includes event transfer path data, wherein an event transfer path list is generated according to the event transfer path data, and the event transfer path list corresponds to the events included in the behavior data one to one; the method further comprises the following steps:
after the target event is executed, generating a result identifier corresponding to the execution result of the target event;
inquiring whether an event transfer path corresponding to the result identification exists in an event transfer path list corresponding to the target event;
and when an event transfer path corresponding to the result identification exists, acquiring a cascade event corresponding to the event transfer path, and executing the cascade event, wherein the cascade event is an event which needs to be executed after the execution result of the target event is obtained.
In a second aspect, the present invention further provides a page generating apparatus, including:
a first obtaining unit, configured to obtain a page generation request for generating a target page;
the second obtaining unit is used for obtaining page data corresponding to the target page from a server according to the page generation request, and the page data comprises at least one group of control data;
the first determining unit is used for determining a control style corresponding to the control data according to a preset style file;
the creating unit is used for creating a control body corresponding to the control data according to the control data and the control style, and creating an association relation between the control body and an associated event according to the control data to obtain the control, wherein the associated event is an event which needs to be executed after a user operates the control body;
and the first generating unit is used for performing typesetting rendering on the control contained in the target page to generate the target page.
Optionally, the control data includes service data, and the service data is used for indicating service content of the control; the first determination unit includes:
the analysis subunit is used for analyzing the style identification contained in the service data;
and the query subunit is used for querying the control style corresponding to the style identification from the preset style file.
Optionally, the apparatus further comprises:
and the storage unit is used for acquiring the preset style file from the server side according to the set time and storing the preset style file into the client side.
Optionally, the control data includes service data and behavior data, where the service data is used to indicate service content of the control, and the behavior data is used to indicate event content corresponding to the control; the creation unit includes:
the creating subunit is used for creating a control body corresponding to the control data according to the service data and the control style;
and the association subunit is used for establishing an association relationship between the control body and the behavior data to obtain the control.
Optionally, the apparatus further comprises:
a third obtaining unit, configured to obtain target behavior data associated with a target control when a control operation of a user for the target control on the target page is detected, where the target control is any one of the controls on the target page;
the analysis unit is used for analyzing the target behavior data associated with the target control to obtain a target event corresponding to the control operation;
a first execution unit for executing the target event.
Optionally, the control data further includes event transfer path data, and the apparatus further includes:
a second generating unit, configured to generate an event transfer path list according to the event transfer path data, where the event transfer path list corresponds to the events included in the behavior data one to one;
a third generating unit, configured to generate a result identifier corresponding to an execution result of the target event after the target event is executed;
the query unit is used for querying whether an event transfer path corresponding to the result identifier exists in an event transfer path list corresponding to the target event;
and a second execution unit, configured to, when an event transfer path corresponding to the result identifier exists, obtain a cascading event corresponding to the event transfer path, and execute the cascading event, where the cascading event is an event that needs to be executed after obtaining an execution result of the target event.
The invention provides a page generation method and a device, after a page generation request is obtained, page data corresponding to a target page is obtained from a server side according to the request; determining a control style corresponding to the control data from a preset style file; then, creating a control body according to the control data and the control style, and establishing an association relation between the control body and an associated event to obtain a control; and finally, typesetting and rendering the controls contained in the target page to generate the target page. According to the content, the style of each control in the page generated by the client and the events associated with each control can be flexibly adjusted by adjusting the page data of the server.
Of course, it is not necessary for any product in which the invention is practiced to achieve all of the above-described advantages at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a page generation method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a process for determining a style of a control according to an embodiment of the present invention;
FIG. 3 is a flowchart of a process for creating a control according to an embodiment of the present invention;
FIG. 4 is a flowchart of another page generation method according to an embodiment of the present invention;
FIG. 5 is a flowchart of another page generation method according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a page generation apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a first determining unit according to an embodiment of the present invention;
FIG. 8 is a schematic structural diagram of a creating unit according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of another page generating apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of another page generating apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The page generation method and device provided by the invention are applied to the client in the mobile application service system. In a mobile application service system, a server and at least one of the aforementioned clients are generally included. The server is usually disposed in a dedicated computer, and the client is usually disposed in a mobile terminal of a user, such as a smart phone, a tablet computer, and the like.
Referring to fig. 1, a flowchart of a page generation method according to an embodiment of the present invention is shown, and as shown in fig. 1, the method may include:
step S11: and acquiring a page generation request for generating a target page.
In the embodiment of the invention, a user interacts with a server through each page in a client, and each page comprises a corresponding control. For example, when a user starts a client, the client may present the user with a home page of the client; and when the user operates the corresponding control in the home page, the client presents the corresponding page to the user. After the client acquires the corresponding operation of opening a new page by the user, the corresponding functional unit generates a corresponding page generation request, and then a page generation device in the client acquires the request.
Step S12: and acquiring page data corresponding to the target page from the server according to the page generation request.
The page data comprises at least one group of control data, the control data comprises business data and behavior data, and the business data is used for indicating the business content of the control; the behavior data is used for indicating the event content corresponding to the control;
in one embodiment of the invention, the server and the client agree on a template protocol, and agree on the configuration rule of the page data. The page data includes data structures of the types page, card, block, video, image, meta, button, click, clickdata, and the like. The types of video, image, meta, button and the like are service data, and the service contents of each control in the page are respectively defined; click and clickdata are behavior data used to define the event content of a control. The page data comprises at least one group of control data, the group of control data is used for creating a control in the page, and each group of control data comprises a service data and a group of behavior data.
For each page, a technician uses a configuration tool to configure control data corresponding to each control in the page in advance at a server, and then the server generates page data of each page according to preset rules and the configured data. The client needs to obtain the page data from the server.
Step S13: and determining a control style corresponding to the control data according to a preset style file.
In an embodiment of the present invention, for each set of control data, a control style corresponding to the set of control data is determined from a preset style file based on service data included in the set of control data.
In one embodiment of the invention, a preset style file is used to describe the style of the control. The client can obtain the preset style file from the server and store the preset style file locally. For example, when the client is started, the client acquires style file information from the server, judges whether the local preset style file needs to be updated according to the style file information, and downloads the latest style file from the server and caches the latest style file to the local as the local preset style file if the local preset style file needs to be updated.
The embodiment of the invention does not limit that the latest style file must be downloaded from the server side, and can also download the style file according to the address in the style file information. Meanwhile, it is not limited that the local preset style file must be updated when the client is started, and the local preset style file is updated only before the preset style file is used.
In the embodiment of the invention, the preset style file stored by the client is always the latest, so that the condition that the control style corresponding to the control data does not exist in the preset style file is avoided.
Referring to fig. 2, which is a flowchart illustrating a process of determining a style of a control according to an embodiment of the present application, as shown in fig. 2, S13 may include S131 to S132:
step S131: and analyzing the style identification contained in the service data.
In the embodiment of the invention, the service data comprises a style identification, the style identification can be a field, and the field stores a style name.
Step S132: and querying a control style corresponding to the style identification from a preset style file.
The control style includes the position, size, appearance, etc. of the control. The control style corresponding to the control data can be changed by adjusting the relevant data in the service data.
In the embodiment, the style of the control in the page is adjusted by adjusting the style identification in the service data, so that the control style adjustment has certain flexibility.
Step S14: and establishing a control body corresponding to the control data according to the control data and the control style, and establishing an association relation between the control body and an associated event according to the control data to obtain the control.
Referring to fig. 3, a flowchart illustrating a process of creating a control according to an embodiment of the present application is shown, and as shown in fig. 3, the process may include:
and S141, creating a control body corresponding to the control data according to the service data and the control style.
And S142, establishing an incidence relation between the control body and the behavior data to obtain the control.
In an embodiment of the present invention, for each set of control data, the control style corresponding to the set of control data and the service data included in the set of control data are combined to create a control body corresponding to the set of control data. The control body refers to a control style displayed on a page, such as a button, an input box and the like.
And establishing an incidence relation between the control body and the associated event corresponding to the control while establishing the control body, so that the control establishing process is completed. The associated event refers to an event that needs to be executed when the user operates the control body, for example, after a certain control is clicked, a corresponding new page is opened, and in this application scenario, "opening a corresponding new page" is the associated event corresponding to the control.
By adjusting the related data in the behavior data in the control data, the event associated with the control corresponding to the control data can be changed.
Of course, the number of controls in the page generated by the client may also be increased/decreased by adding/deleting control data in the page data file.
Step S15: and performing typesetting rendering on the control contained in the target page to generate the target page.
In the embodiment of the invention, the created controls in the page are typeset and rendered, and the target page is generated.
According to the page generation method provided by the embodiment of the invention, after a page generation request is obtained, page data corresponding to a target page is obtained from a server side according to the request; determining a control style corresponding to the control data from a preset style file; then, creating a control body according to the control data and the control style, and establishing an association relation between the control body and an associated event to obtain a control; and finally, typesetting and rendering the controls contained in the target page to generate the target page. According to the content, the style of each control in the page generated by the client and the events associated with each control can be flexibly adjusted by adjusting the page data of the server.
Referring to fig. 4, a flowchart of another page generation method provided in the embodiment of the present invention is shown, in which after a target page is generated, a corresponding event is executed according to a corresponding operation of a user on the target page in the embodiment.
As shown in fig. 4, the method further includes the following steps based on the embodiment shown in fig. 1:
step S21: when the control operation of a user for a target control on a target page is detected, target behavior data associated with the target control is obtained.
The target control is any one of the controls on the target page.
In an embodiment of the present invention, when the client is an application program on the mobile terminal side, after detecting a touch operation of a user on a page of the client, a target control to be touched is determined according to a touch position of the user.
And the controls in the client are in a tree hierarchical relationship, firstly searching the controls corresponding to the touch positions in the control of the current layer, if the controls do not exist, tracing to obtain the controls searched in the previous layer, and so on until the hit controls are searched.
Step S22: and analyzing the target behavior data associated with the target control, obtaining a target event corresponding to the control operation, and executing the target event.
In one embodiment of the invention, the control operation of the user on the target page can be divided into a single click type, a double click type and the like, and different types correspond to different events. The behavior data comprises click data and click data, an event path corresponding to each operation type is defined in the click data, the event path points to an event in the click data, and the click data can contain a plurality of events. Of course, the event content corresponding to the event pointed by the event path may also be empty.
And when the event content pointed by the operation type of the user is not empty, determining that the event is a target event, and executing the target event. The target event may be the opening of a new page, and in this application scenario, S11-S15 are executed. The target event may also be a change to the target control or other controls on the page instead of opening a new page, for example, after a certain image control on the page is triggered, a picture in the image control is changed by one, in this case, after the target event is completed, the next operation of the user is waited, and then steps S21 to S22 are executed.
According to the page generation method provided by the embodiment, the associated event of the control can be flexibly adjusted by adjusting the behavior data in the control data associated with the control, so that the process of generating the page is more flexible.
Referring to fig. 5, a flowchart of another page generation method provided in an embodiment of the present invention is shown, in which in this embodiment, the control data further includes event transfer path data, and the event transfer path data is used to indicate that a certain event needs to be transferred to a next event to be executed after being executed.
In an embodiment of the present invention, an event transfer path list is generated according to the event transfer path data, and the event transfer path list corresponds to the events included in the behavior data one to one. The event transfer path lists corresponding to different events are different, and the event transfer path list corresponding to each event contains event transfer path data corresponding to all execution results after the event is executed.
As shown in fig. 5, the method of this embodiment further includes, on the basis of the embodiment shown in fig. 4:
step S31: and when the target event is completely executed, generating a result identifier corresponding to the execution result of the target event.
In the embodiment of the invention, for each event which can be triggered by a user in a page, the execution result types of the event can be generally success, failure and cancellation; for example, a result flag "0" may be defined to represent failure, a result flag "1" to represent success, and a result flag "2" to represent cancellation. Of course, other types of result identifiers may be used as long as the correspondence is satisfied. The invention does not limit the execution result to be success, failure and cancellation, and can be divided into a plurality of types according to the actual requirement, and the types are respectively corresponding to corresponding result marks.
Step S32: inquiring whether an event transfer path corresponding to the result identification exists in an event transfer path list corresponding to the target event; if so, go to S33; if not, the current flow ends.
And inquiring whether an event transfer path corresponding to the currently obtained execution result identifier exists according to the event transfer path list corresponding to the target event, and if the event transfer path exists, indicating that the cascade event corresponding to the execution result still needs to be executed.
Step S33: and acquiring a cascading event corresponding to the event transfer path, and executing the cascading event.
In an embodiment of the present invention, the cascading event is an event that needs to be executed after obtaining the execution result of the target event. For example, a "subscribe" green control exists on the page, and when the user operates the green control and executes a subscription event, the server returns an execution result of "subscribe successfully" or "subscribe unsuccessfully". And when the subscription is successful, generating a corresponding result identifier of '1', and searching for the cascading event corresponding to the '1' in the event transfer path list. If the content of the cascading event is to change the control from green to gray, and simultaneously, the 'subscription' word on the control is changed to 'view'. According to the page generation method provided by the embodiment of the invention, the cascade events of the control events can be flexibly adjusted by adjusting the event transfer path data in any group of control data in the page data, so that the flexibility of the page generation process is further improved.
For example, the control data also contains eventmap data, i.e., event transfer path data. For each group of control data, the behavior data contains events corresponding to different operation types, and according to the event transfer path data, an event transfer path list can be generated for each event. Any event transfer path list comprises the result identifications, and each result identification corresponds to one event transfer path. As for the result identifiers "0", "1", and "2" in step S31, in the event transition path list, the three items each correspond to one event transition path, and of course, the corresponding event transition path may be empty. Taking the result identifier "1" as an example, find "1" in the event transfer path list, and if there is an event transfer path corresponding to "1", obtain the cascading event according to the target to which it points and execute it. The cascading event can be stored in a page data file and downloaded to the local along with the page data file when a page is opened; or the event transfer path can be stored in the server and searched and acquired according to the event transfer path.
In one embodiment of the invention, after the cascading events are obtained, if the event transfer path data corresponding to the cascading events exist, the event transfer path data are obtained and an event transfer path list is constructed at the same time. And after the execution of the cascading events is finished, converting the execution result into a result identifier, searching an event transfer path corresponding to the result identifier in an event transfer path list of the cascading events, and if the event transfer path exists, acquiring a new cascading event pointed by the event transfer path and executing the new cascading event. And the like, and the multi-stage free combination of the cascading events is realized.
Corresponding to the above-mentioned embodiment of the page generation method, the invention also provides an embodiment of a page generation device. Referring to fig. 6, a schematic structural diagram of a page generation apparatus provided in an embodiment of the present invention is shown, and as shown in fig. 6, the apparatus includes: a first acquisition unit 110, a second acquisition unit 120, a first determination unit 130, a creation unit 140, and a first generation unit 150.
A first obtaining unit 110, configured to obtain a page generation request for generating a target page;
the second obtaining unit 120 is configured to obtain, according to the page generation request, page data corresponding to the target page from the server.
The page data comprises at least one group of control data, and the control data comprises business data and behavior data.
The first determining unit 130 is configured to determine a control style corresponding to the control data according to a preset style file.
The control data comprises business data, and the business data is used for indicating the business content of the control; in one embodiment of the present invention, as shown in fig. 7, the first determining unit 130 includes:
and the parsing subunit 131 is configured to parse the style identifier included in the service data.
And the query subunit 132 is configured to query the control style corresponding to the style identifier from the preset style file.
The control style includes the position, size, appearance, etc. of the control. The control style corresponding to the control data can be changed by adjusting the relevant data in the service data.
In an embodiment of the present invention, the apparatus further includes a storage unit 160 connected to the first determining unit, and configured to obtain the preset style file from the server according to a set time and store the preset style file in the client.
The preset style file is used to describe the style of the control. The client can acquire the latest preset style file from the server according to the specified time and store the latest preset style file locally. The preset style file stored by the client is always the latest, so that the condition that the control style corresponding to the control data does not exist in the preset style file is avoided.
The creating unit 140 is configured to create a control body corresponding to the control data according to the control data and the control style, and establish an association relationship between the control body and an associated event according to the control data to obtain the control.
In an embodiment of the present invention, the control data includes business data and behavior data, where the business data is used to indicate business content of the control, and the behavior data is used to indicate event content corresponding to the control. As shown in fig. 8, the creating unit 140 includes: creating sub-unit 141 and associating sub-unit 142.
And the creating subunit 141 is configured to create a control body corresponding to the control data according to the service data and the control style.
And the association subunit 142 is configured to establish an association relationship between the control body and the behavior data, so as to obtain the control.
In an embodiment of the present invention, for each set of control data, the control style corresponding to the set of control data and the service data included in the set of control data are combined to create a control body corresponding to the set of control data. And establishing an incidence relation between the control body and the event corresponding to the control while establishing the control body, so that the control establishing process is completed.
The first generating unit 150 is configured to perform layout rendering on the controls included in the target page, and generate the target page.
In the embodiment of the invention, the preset style file is the latest style file downloaded from the server side.
The page generation device provided by the embodiment of the invention obtains the page generation request, and then obtains the page data corresponding to the target page from the server side according to the request; determining a control style corresponding to the control data from a preset style file; then, creating a control body according to the control data and the control style, and establishing an association relation between the control body and an associated event to obtain a control; and finally, typesetting and rendering the controls contained in the target page to generate the target page. According to the content, the style of each control in the page generated by the client and the events associated with each control can be flexibly adjusted by adjusting the page data of the server.
Referring to fig. 9, a schematic structural diagram of another page generation apparatus according to an embodiment of the present application is shown, and as shown in fig. 9, the apparatus further includes, on the basis of the embodiment shown in fig. 6:
a third obtaining unit 210, configured to obtain, when a control operation of a user for a target control on the target page is detected, target behavior data associated with the target control.
The target control is any one of the controls on the target page.
And the analyzing unit 220 is configured to analyze the target behavior data associated with the target control to obtain a target event corresponding to the control operation.
A first executing unit 230, configured to execute the target event.
The page generation device provided by this embodiment can flexibly adjust the associated event of the control by adjusting the behavior data in the control data associated with the control, so that the process of generating the page is more flexible.
Referring to fig. 10, a schematic structural diagram of another page generating apparatus according to an embodiment of the present application is shown, where in the embodiment, the control data further includes event transfer path data. As shown in fig. 10, the present embodiment further includes, on the basis of the embodiment shown in fig. 9: a second generating unit 310, a third generating unit 320, a querying unit 330 and a second executing unit 340.
A second generating unit 310, configured to generate an event transfer path list corresponding to the events included in the behavior data one to one according to the event transfer path data.
A third generating unit 320, configured to generate a result identifier corresponding to an execution result of the target event after the target event is executed.
The types of execution results of the events can be generally success, failure and cancellation; for example, a result flag "0" may be defined to represent failure, a result flag "1" to represent success, and a result flag "2" to represent cancellation. Of course, other types of result identifiers may be used as long as the correspondence is satisfied. The invention does not limit the execution result to be success, failure and cancellation, and can be divided into a plurality of types according to the actual requirement, and the types are respectively corresponding to corresponding result marks.
The querying unit 330 is configured to query whether an event transfer path corresponding to the result identifier exists in an event transfer path list corresponding to the target event.
A second executing unit 340, configured to, when there is an event transfer path corresponding to the result identifier, acquire a cascading event corresponding to the event transfer path, and execute the cascading event.
The cascading events are other events associated with the execution result of the target event.
For example, a "subscribe" green control exists on the page, and when the user operates the green control and executes a subscription event, the server returns an execution result of "subscribe successfully" or "subscribe unsuccessfully". And when the subscription is successful, generating a corresponding result identifier of '1', and searching for the cascading event corresponding to the '1' in the event transfer path list. If the content of the cascading event is to change the control from green to gray, and simultaneously, the 'subscription' word on the control is changed to 'view'.
The page generation device provided by the embodiment of the invention can flexibly adjust the cascade events of the control events by adjusting the event transfer path data in any group of control data in the page data, thereby further improving the flexibility of the page generation process.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The page generation method and device provided by the invention are described in detail, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the above embodiment is only used for helping understanding the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (12)

1. A page generation method is characterized by comprising the following steps:
acquiring a page generation request for generating a target page;
acquiring page data corresponding to the target page from a server according to the page generation request, wherein the page data comprises at least one group of control data, and the control data comprises a style identification for identifying a style of the control;
determining a control style corresponding to the control data from a latest preset style file obtained by a server according to the style identification, wherein the preset style file is used for describing the control style corresponding to the control;
creating a control body corresponding to the control data according to the control data and the control style, and establishing an association relation between the control body and an associated event according to the control data to obtain a control, wherein the associated event is an event which needs to be executed after a user operates the control body;
and performing typesetting rendering on the control contained in the target page to generate the target page.
2. The method of claim 1, wherein the control data comprises business data, and the business data comprises a style identification;
determining a control style corresponding to the control data from the latest preset style file obtained by the server according to the style identification, wherein the determining comprises the following steps:
analyzing the style identification contained in the service data;
and querying a control style corresponding to the style identification from the latest preset style file.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
and acquiring the latest preset style file from the server side according to the set time and storing the latest preset style file in the client side.
4. The method according to claim 1 or 2, wherein the control data comprises business data and behavior data, the business data is used for indicating the business content of the control, and the behavior data is used for indicating the event content corresponding to the control;
the creating a control body corresponding to the control data according to the control data and the control style, and establishing an association relationship between the control body and an associated event according to the control data to obtain a control, including:
creating a control body corresponding to the control data according to the service data and the control style;
and establishing an incidence relation between the control body and the behavior data to obtain the control.
5. The method of claim 4, further comprising:
when control operation of a user for a target control on the target page is detected, target behavior data associated with the target control is obtained, wherein the target control is any one control on the target page;
and analyzing the target behavior data associated with the target control, obtaining a target event corresponding to the control operation, and executing the target event.
6. The method according to claim 5, wherein the control data further includes event transfer path data, wherein an event transfer path list is generated according to the event transfer path data, and the event transfer path list corresponds to the events included in the behavior data one to one; the method further comprises the following steps:
after the target event is executed, generating a result identifier corresponding to the execution result of the target event;
inquiring whether an event transfer path corresponding to the result identification exists in an event transfer path list corresponding to the target event;
and when an event transfer path corresponding to the result identification exists, acquiring a cascade event corresponding to the event transfer path, and executing the cascade event, wherein the cascade event is an event which needs to be executed after the execution result of the target event is obtained.
7. A page generating apparatus, comprising:
a first obtaining unit, configured to obtain a page generation request for generating a target page;
a second obtaining unit, configured to obtain, from a server, page data corresponding to the target page according to the page generation request, where the page data includes at least one set of control data, and the control data includes a style identifier for identifying a style of a control;
a first determining unit, configured to determine, according to the style identifier, a control style corresponding to the control data from a latest preset style file obtained by a server, where the preset style file is used to describe a control style corresponding to a control;
the creating unit is used for creating a control body corresponding to the control data according to the control data and the control style, and creating an association relation between the control body and an associated event according to the control data to obtain a control, wherein the associated event is an event which needs to be executed after a user operates the control body;
and the first generating unit is used for performing typesetting rendering on the control contained in the target page to generate the target page.
8. The apparatus according to claim 7, wherein the control data comprises service data, and the service data comprises style identification; the first determination unit includes:
the analysis subunit is used for analyzing the style identification contained in the service data;
and the query subunit is used for querying the control style corresponding to the style identification from the latest preset style file.
9. The apparatus of claim 7 or 8, further comprising:
and the storage unit is used for acquiring the latest preset style file from the server side according to the set time and storing the latest preset style file in the client side.
10. The apparatus according to claim 7 or 8, wherein the control data includes business data and behavior data, the business data is used for indicating the business content of the control, and the behavior data is used for indicating the event content corresponding to the control; the creation unit includes:
the creating subunit is used for creating a control body corresponding to the control data according to the service data and the control style;
and the association subunit is used for establishing an association relationship between the control body and the behavior data to obtain the control.
11. The apparatus of claim 10, further comprising:
a third obtaining unit, configured to obtain target behavior data associated with a target control when a control operation of a user for the target control on the target page is detected, where the target control is any one of the controls on the target page;
the analysis unit is used for analyzing the target behavior data associated with the target control to obtain a target event corresponding to the control operation;
a first execution unit for executing the target event.
12. The apparatus of claim 11, wherein the control data further comprises event transfer path data, the apparatus further comprising:
a second generating unit, configured to generate an event transfer path list according to the event transfer path data, where the event transfer path list corresponds to the events included in the behavior data one to one;
a third generating unit, configured to generate a result identifier corresponding to an execution result of the target event after the target event is executed;
the query unit is used for querying whether an event transfer path corresponding to the result identifier exists in an event transfer path list corresponding to the target event;
and a second execution unit, configured to, when an event transfer path corresponding to the result identifier exists, obtain a cascading event corresponding to the event transfer path, and execute the cascading event, where the cascading event is an event that needs to be executed after obtaining an execution result of the target event.
CN201710657548.7A 2017-08-03 2017-08-03 Page generation method and device Active CN107423070B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710657548.7A CN107423070B (en) 2017-08-03 2017-08-03 Page generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710657548.7A CN107423070B (en) 2017-08-03 2017-08-03 Page generation method and device

Publications (2)

Publication Number Publication Date
CN107423070A CN107423070A (en) 2017-12-01
CN107423070B true CN107423070B (en) 2021-02-23

Family

ID=60436384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710657548.7A Active CN107423070B (en) 2017-08-03 2017-08-03 Page generation method and device

Country Status (1)

Country Link
CN (1) CN107423070B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519250B (en) * 2019-08-20 2022-04-15 南京尚网网络科技有限公司 Method and equipment for providing information flow

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108280133A (en) * 2017-12-26 2018-07-13 苏宁云商集团股份有限公司 A kind of control method and equipment for page browsing
CN108572825B (en) * 2018-05-28 2021-11-16 郑州悉知信息科技股份有限公司 User interface processing method, device and equipment
CN110134477B (en) * 2019-04-24 2021-07-20 北京字节跳动网络技术有限公司 Method, device, medium and electronic equipment for dynamically laying out user pages
CN112130855A (en) * 2020-09-16 2020-12-25 京东数字科技控股股份有限公司 Method and device for generating page
CN112230922A (en) * 2020-10-26 2021-01-15 深圳市中农网有限公司 Page construction method and device, storage medium and computer equipment
CN112306606A (en) * 2020-10-30 2021-02-02 上海连尚网络科技有限公司 Method and equipment for presenting control style
CN112433778B (en) * 2020-11-09 2023-09-01 北京奇艺世纪科技有限公司 Mobile device page display method and device, electronic device and storage medium
CN115951923B (en) * 2023-03-15 2023-05-16 深圳市思为软件技术有限公司 Subscription event management method, display system, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6146027A (en) * 1992-12-23 2000-11-14 Object Technology Licensing Corp. Method and apparatus for providing an object-oriented application interface for a computer system
CN102043861A (en) * 2010-12-29 2011-05-04 重庆新媒农信科技有限公司 Web page data structured display method based on mobile terminal
CN102207872A (en) * 2011-06-04 2011-10-05 中国移动通信集团内蒙古有限公司 Method and system for customizing Web UI (User Interface) control according to user requirements
CN106570013A (en) * 2015-10-09 2017-04-19 北京国双科技有限公司 Method and device for processing page access data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6146027A (en) * 1992-12-23 2000-11-14 Object Technology Licensing Corp. Method and apparatus for providing an object-oriented application interface for a computer system
CN102043861A (en) * 2010-12-29 2011-05-04 重庆新媒农信科技有限公司 Web page data structured display method based on mobile terminal
CN102207872A (en) * 2011-06-04 2011-10-05 中国移动通信集团内蒙古有限公司 Method and system for customizing Web UI (User Interface) control according to user requirements
CN106570013A (en) * 2015-10-09 2017-04-19 北京国双科技有限公司 Method and device for processing page access data

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519250B (en) * 2019-08-20 2022-04-15 南京尚网网络科技有限公司 Method and equipment for providing information flow

Also Published As

Publication number Publication date
CN107423070A (en) 2017-12-01

Similar Documents

Publication Publication Date Title
CN107423070B (en) Page generation method and device
CN106682219B (en) Associated document acquisition method and device
CN110245069B (en) Page version testing method and device and page display method and device
US20110170682A1 (en) Universal contact manager
CN113268261B (en) Page content display method and device and electronic equipment
CN106649446B (en) Information pushing method and device
CN108776592B (en) Page construction method, device, equipment and storage medium
CN109086158B (en) Abnormal cause analysis method and device and server
CN108595965B (en) Method and device for preventing attribute information of interface control from being stolen
CN111047434B (en) Operation record generation method and device, computer equipment and storage medium
CN109783589A (en) The method, apparatus and storage medium of electronic map parsing address
CN115329131A (en) Material label recommendation method and device, electronic equipment and storage medium
CN109697129A (en) A kind of information sharing method, equipment and computer readable storage medium
CN110515979B (en) Data query method, device, equipment and storage medium
CN111125156B (en) Data query method and device and electronic equipment
CN110597812B (en) Menu configuration method, device, terminal and readable storage medium
CN110503504B (en) Information identification method, device and equipment of network product
CN112433741B (en) Page processing method, device and system, electronic equipment and storage medium
CN111522748B (en) Automatic test case generation method, device, server and storage medium
EP2712162A1 (en) Method and system for inputting information to mobile terminal as well as mobile terminal
CN114090692A (en) Full-media-asset data synchronization method, system, device and computer-readable storage medium
CN107665226A (en) The method for pushing and pusher of a kind of information
CN111367703A (en) Troubleshooting method and device
CN110674386B (en) Resource recommendation method, device and storage medium
CN112256654A (en) Document sharing method and device

Legal Events

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