Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
Before explaining the technical scheme provided by the embodiment of the application, an application scenario and a hardware architecture related to the embodiment of the application are explained.
First, an application scenario according to an embodiment of the present application will be described.
It can be understood that, for an application program or a website, there are already a large number of existing pages (referred to as original pages in the embodiment of the present application), and for a large number of original pages, there may be various requirements of a user, and the application scenario related to the embodiment of the present application is described below with reference to the requirements of the user.
Application scenarios: the contents of multiple original pages are merged into one page.
As shown in fig. 1a, a schematic diagram of combining multiple original pages into one page is provided for the embodiment of the present application.
Fig. 1a illustrates an example of a plurality of original pages as two original pages. Fig. 1a is an example, the number of the plurality of original pages is not limited to 2, and may be any positive integer greater than or equal to 2, such as 3, 4, 5, …, for example.
Assume that the two original pages areoriginal page 11 andoriginal page 12, respectively. The service item function of theoriginal page 11 is in-line transfer, and the service item function of theoriginal page 12 is opening a bank card. If the user needs to execute the operation of opening the bank card and in-line transfer, at this time, theoriginal page 11 and theoriginal page 12 may be combined and displayed, and if the combinedpage 13 is displayed, the user may open the bank card and in-line transfer through the combinedpage 13. Theoriginal page 11 and theoriginal page 12 do not need to be searched by the user respectively, the complexity of user operation is reduced, and the user experience is improved.
In the embodiment of the present application, exemplarily, each minimum unit displayed on a page is a business element, and as shown in fig. 1a, "transfer account", "account name", "amount", "bank of deposit", "name", "identification number", "mobile phone number", "password" and the like are all business elements.
In the application scenario, since a new page is obtained based on merging of multiple original pages, the new page involves re-layout of one or more business elements included in the new page. For example, if thepage 11 and thepage 12 are combined to obtain a new page, if the layout of the business elements included in the new page is disordered, the user may perform an incorrect operation or fill in the content that should not be filled in, which may cause an additional operation to the user.
Illustratively, as shown in fig. 1b, the two original pages are merged into a new page, and the layout of the new page is cluttered.
Assume that the two original pages areoriginal page 11 andoriginal page 12, respectively, and the subsequent page ispage 14.
As shown in fig. 1b, the layout positions of the service element "transfer account" and the service element "opening bank" in thepage 14 are wrong, and the user does not need to fill the transfer account when opening the bank card, and the transfer account cannot open the bank card unless filling the opening bank, which causes the user to fill in a mistake or fill in contents that the user does not need to fill in, and brings extra operation to the user.
Next, a hardware architecture according to the embodiment of the present application will be described.
As shown in fig. 2, a schematic diagram of a hardware architecture related to an embodiment of the present application is provided, where the hardware architecture includes aterminal device 21 and aserver 22.
Illustratively, theterminal device 21 may be any electronic product capable of interacting with a user through one or more modes of a keyboard, a touch PAD, a touch screen, a remote controller, a voice interaction device, a handwriting device, and the like, for example, a mobile phone, a notebook computer, a tablet computer, a palm computer, a personal computer, a wearable device, a smart television, a PAD, and the like.
Theserver 22 may be, for example, one server, a server cluster composed of a plurality of servers, or a cloud computing server center. Theserver 22 may include a processor, memory, and a network interface, among others.
It should be noted that fig. 2 is merely an example, and the type of theterminal device 21 may be various and is not limited to the notebook computer in fig. 2.
Illustratively, the user may upload the page merge request to theserver 22 based on theterminal device 21.
Illustratively, the user may upload the page merge request through a user interface on a client or a website presented by theterminal device 21.
For example, there are various ways to generate the page merge request, and the embodiments of the present application provide, but are not limited to, the following two.
For example, theterminal device 21 may be a terminal device of an operation and maintenance person, or may be a terminal device of a client using the client, and the operation and maintenance person and the client are collectively referred to as a user in the embodiment of the present application.
The first implementation manner of generating the page merging request is as follows: theterminal device 21 may display atarget user interface 30, where the target user interface may display service item functions corresponding to a plurality of original pages, respectively, and a user may select the plurality of original page functions and generate a page merge request according to a selection result of the user.
Fig. 3 is a process diagram for generating a page merge request according to an embodiment of the present application.
Fig. 3 is an example, and does not limit a display manner of the service item functions corresponding to the plurality of original pages.
Illustratively, each original interface corresponds to a service item function, and the user can increase the service item function by clicking thebutton 31 and decrease the service item function by clicking thebutton 32.
Illustratively, the user may select the relationship between the business item functions by clicking on thelogical operations button 33. Illustratively, an represents the intersection of multiple business item functions.
The user may select a plurality of business item functions via thegoal user interface 30 shown in FIG. 3. After the user finishes the selection through fig. 3, theterminal device 21 may generate a page merge request.
Illustratively, the page merge request includes a plurality of business item functions.
The second implementation manner of generating the page merging request is as follows: theterminal device 21 may display a target user interface, the target user interface may display a search box, the user may input a service item function of a page required by the user in the search box, if there is no original page corresponding to the service item function, the page required by the user is determined to be a target page to be generated, and a page merging request is generated based on the service item function of the page to be generated.
Illustratively, the page merge request includes a business item function of the target page to be generated. Such thatserver 22 obtains a plurality of original pages.
Illustratively, the service item functions respectively corresponding to the multiple original pages are all partial functions of the service item function of the target page to be generated, that is, the service item functions respectively corresponding to the multiple original pages respectively correspond to sub-functions of the service item function of the target page.
In an optional implementation manner, after receiving the page merging request, theserver 22 may execute the page merging method provided in the embodiment of the present application, obtain a new target page through a plurality of original pages, and send the target page to theterminal device 21. And theterminal device 21 is configured to display the target page, so that the user interacts with theterminal device 21 based on the target page.
In an optional implementation manner, after receiving the page merge request, theserver 22 may send the element sequence sets corresponding to the multiple original pages required by the target page to theterminal device 21, so that theterminal device 21 may execute the page merge method provided in the embodiment of the present application to obtain the target page, and display the target page.
It should be understood by those skilled in the art that the terminal devices and servers described above are merely examples, and other existing or future terminal devices or servers may be suitable for use in the present disclosure, and are included within the scope of the present disclosure and are hereby incorporated by reference.
The page merging method provided by the embodiment of the present application is described below with reference to an application scenario and a hardware architecture.
As shown in fig. 4, which is a flowchart of a page merging method provided in this embodiment of the present application, the method may be applied to theterminal device 21 or theserver 22 shown in fig. 2, and the method may include the following steps S41 to S45.
Step S41: and if the page merging request is obtained, determining element sequence sets corresponding to a plurality of original pages to be merged respectively.
The element sequence set corresponding to the original page comprises the identification of each service element contained in the original page, and the sequence of the identification of each service element contained in the element sequence set is the layout sequence of each service element in the original page.
Illustratively, each minimum unit displayed on the page is a business element, and as shown in fig. 1a to 1b, "roll-out account", "roll-in account", "account name", "amount", "bank of deposit", "name", "identification number", "mobile phone number", "password" and the like are all business elements.
In an alternative implementation manner, before the step S41 is further executed, the following steps a11 to a13 are further included.
Step A11: the method comprises the steps of constructing page models corresponding to a plurality of pages respectively, wherein the page models corresponding to the pages comprise corresponding relations of page identifications, business project functions and field model identifications, and the business project functions are functions corresponding to the pages.
Step A12: and constructing the column models corresponding to the identifications of the plurality of column models respectively, wherein the column models comprise the corresponding relation of the identifications of the service elements, the functions of the service elements and the identifications of the attribute information corresponding to the service elements.
Step A13: and constructing an attribute model, wherein the attribute model comprises the corresponding relation between the identification of the attribute information and the attribute information.
For example, the attribute information of the service element may include: the business element is at least one of shape, size, color, coordinate position in the page.
Illustratively, the service element may include a filling box such as an input box, a selection box or a search box, and the attribute information of the service element may further include one or more of a size of the filling box, a color of the filling box, and a data format of content to be input in the filling box.
Illustratively, the types of the service elements are different, and the content included in the attribute information of the service elements may be different and may be the same.
The content included in the attribute information is only an example, and it is understood that the attribute information may include more or less parameters than the above, for example, a font format, and the like.
Illustratively, each page corresponds to one page model, one field model and one attribute model, and the page models, the field models and the attribute models corresponding to different pages are different; illustratively, a plurality of pages correspond to a page model, a field model and an attribute model.
For example, there are various characterization forms of the page model, the field model, and the attribute model, and the embodiments of the present application provide but are not limited to: array, linked list, function, table, matrix. The following description will take the representation forms of the page model, the field model and the attribute model as tables, and each page corresponds to one page model, one field model and one attribute model as an example. The page model, the field model, and the attribute model corresponding to thepage 11 are described as an example.
TABLE 1 Page model
In table 1, the identifier of the field model is only an example, and does not limit the composition of the identifier of the field model. Illustratively, the identification of the field model may be composed of one or more of numbers, characters, and special symbols.
Table 2 column model
In table 2, the identification of the service element is only an example, and does not limit the composition of the identification of the service element. Illustratively, the service element identifier may be composed of one or more of a number, a character, and a special symbol. Illustratively, the sequence of the identifications of the business elements included in the field model is the sequence of the business elements displayed on the page.
TABLE 3 Attribute model
It is to be appreciated that to facilitate the device identifying the property model, the property model can be converted to, for example, the property model shown in table 4.
TABLE 4
Wherein, w represents the width, h represents the height, t represents the data type, ID represents the data format, and c represents the color.
For example, the correspondence between the page identifier and the page set may be constructed in advance. For example, the characterization form of the page set corresponding to the identification of the page may be: array, linked list, function, table, matrix, the matrix is taken as an example for explanation. The page set corresponding topage 11 may be [ L001, L002, L003, L004 ].
After a plurality of original pages are abstracted, each original page can be converted into a corresponding set expression form. Therefore, the calculation of intersection, union, difference set and the like can be carried out on the pages through logic operation, so that the conversion of the page development from a code mode to a mathematical mode is realized, the change of the pages is infinitely possible after the mathematical mode is formed, and the encoding is not needed.
In an optional implementation manner, the element sequence sets corresponding to the multiple original pages may be obtained through the field models corresponding to the multiple original pages, respectively.
In an optional implementation manner, a page set corresponding to each of the multiple original pages may be used as an element order set corresponding to each of the multiple original pages.
In an alternative implementation manner, before the step S41 is further executed, the following steps B11 to B12 are further included.
Step B11: and constructing element template tables corresponding to a plurality of pages respectively, wherein the element template tables corresponding to the pages comprise the identification of each service element in the pages, the name of the service element and the identification of attribute information corresponding to the service element.
Each page corresponds to an element template table.
Step B12: and constructing a page instance table, wherein the page instance table comprises element sequence sets respectively corresponding to the identifications of the multiple pages.
For example, there are various characterization forms of the element template table and the element order set, and the embodiments of the present application provide but are not limited to: array, linked list, function, table, matrix. The following description will take the form of the element template table and the characterization form of the element order set as a table.
Suppose a website includes three original pages, which are: the element templates corresponding to theoriginal page 1, theoriginal page 2 and the original page 3, 3 original pages are as follows.
Table 5 element template table oforiginal page 1
Table 6 element template table oforiginal page 2
Table 7 element template table of original page 3
As a difference between Table 5 and Table 2, the column model in Table 2 does not include page identifiers, so that Table 1 and Table 2 are needed to be used in combination, and the element template table in Table 5 includes page identifiers, so that Table 1 is not needed to be used in combination.
The identifications of the service elements in tables 5 to 7 are only examples, and do not limit the composition of the identifications of the service elements. Illustratively, the service element identifier may be composed of one or more of a number, a character, and a special symbol. The description of the attribute information in tables 5 to 7 can refer to the description of the attribute information in table 3 or table 4, and will not be described again here.
The page instance table corresponding to the website may be as shown in table 8.
Table 8 example page table
In an optional implementation manner, element order sets respectively corresponding to a plurality of original pages to be merged may be obtained from the page example table.
Step S42: and acquiring an element set corresponding to a target page to be generated, wherein the element set is a union set of element sequence sets corresponding to the multiple original pages respectively.
The identifications of the business elements included in the element set are all different.
For example, if the number of the original pages is 3, and the original pages areoriginal page 1,original page 2, and original page 3.
If the target page to be generated includes original page 1 (corresponding to the identifier H001), original page 2 (corresponding to the identifier H002), and original page 3 (corresponding to the identifier H003), then the identifiers of the business elements included in the element set are: the elementary ordered set of H001 is the elementary ordered set of U.H 002 and the elementary ordered set of U.H 003.
If the element order set of H001 ismatrix 1, the element order set of H002 ismatrix 2, and the element order set of H003 is matrix 3, the element set corresponding to the target page ismatrix 1 ═matrix 2 ═ matrix 3.
Matrix 1 ═ E001, E002, E003 ];matrix 2 ═ E002, E003, E005 ]; the matrix 3 ═ E004, E001, E002], then the set of elements corresponding to the target page is ═ E001, E002, E003, E004, E005.
Step S43: and constructing an element relation dependency graph based on element sequence sets respectively corresponding to the plurality of original pages, wherein nodes contained in the element relation dependency graph are identifications of the service elements, the direction of a directed edge connecting two nodes contained in the element relation dependency graph is from the service element positioned above the original page to the service element positioned below the original page, and the weight of the directed edge represents the number of the service elements between the two nodes in the original page where the two nodes connected by the directed edge are positioned.
The description will be made by taking a plurality of original pages as theoriginal page 1, theoriginal page 2, and the original page 3. Since the element set corresponding to the target page is [ E001, E002, E003, E004, E005], the element relationship dependency graph includes 5 nodes, which are: e001, E002, E003, E004, E005.
Fig. 5 is a schematic diagram of an element relationship dependency graph provided in the embodiment of the present application.
In the following, referring to fig. 5, a description will be given of "the direction of a directed edge connecting two nodes is directed from a business element located above an original page to a business element located below the original page".
For the node E001, the identifier of the next element of E001 in theoriginal page 1 and the original page 3 is E002, so the arrow connecting the node E001 and the node E002 has a directional edge pointing to E002; in original page 3, node E001 is located behind node E004, so the directed edge connecting node E001 with node E004 points to node E001. The connection mode between other nodes and the direction of the directed edge are set in the above manner, so that the element relationship dependency graph shown in fig. 5 is obtained.
The following describes "the weight of the directed edge characterizes the number of traffic elements between two nodes connected by the directed edge in the original page where the two nodes are located" with reference to fig. 5.
For example, the weight of the directed edge is SUM (the number of traffic elements between two nodes in the original page where the two nodes connected by the directed edge respectively correspond to each original page are located).
For example, if a plurality of original pages to be merged are: the calculation process of the weight of the directed edge between the node E001 and the node E002 is as follows for theoriginal page 1, theoriginal page 2, and the original page 3:
theoriginal page 1 and the original page 3 include a node E001 and a node E002, the number of traffic demands spaced between the node E001 and the node E002 in theoriginal page 1 is 0, and the number of traffic demands spaced between the node E001 and the node E002 in the original page 3 is 0, so that the obtained weight of the directional edge of the node E001 and the node E002 is (0+0) or 0.
For example, the weight of the directed edge is SUM (1 corresponding to each original page/the number of traffic elements between two nodes in the original page where the two nodes connected by the directed edge are located).
For example, if a plurality of original pages to be merged are: the calculation process of the weight of the directed edge between the node E001 and the node E002 is as follows for theoriginal page 1, theoriginal page 2, and the original page 3:
theoriginal page 1 and the original page 3 include a node E001 and a node E002, the number of traffic demands for the interval between the node E001 and the node E002 in theoriginal page 1 is 0, and the number of traffic demands for the interval between the node E001 and the node E002 in the original page 3 is 0, so that the obtained weight of the directional edge of the node E001 and the node E002 is (1/0+1/0) ∞.
In fig. 5, the weight of the directed edge is taken as SUM (1 corresponding to each original page/the number of traffic elements between two nodes in the original page where the two nodes connected by the directed edge are located). The weight of the directed edge between the nodes is as shown in figure 5.
In an optional implementation manner, a business element dependency rule may be preset, where the business element dependency rule is a method for calculating the weight of the directed edge.
Step S44: and sequencing the identifications of the business elements contained in the element set based on the constructed element relation dependency graph so as to obtain a target layout sequence of each business element contained in the element set on the target page.
The weight of the directed edge in the element relation dependency graph can represent the degree of close relation between the service elements, and it is assumed that the greater the weight of the directed edge is, the fewer the number of the service elements spaced between two nodes connected by the directed edge is, the greater the weight of the directed edge is, which indicates that the two nodes connected by the directed edge are closer, that is, the positions of the service elements corresponding to the two nodes in the page are closer. The element relation dependency graph has the direction of the directed edge and represents the sequence of the business elements appearing in the page. Therefore, the target layout sequence of each business element contained in the element set on the target page can be obtained based on the element relation dependency graph.
In an alternative implementation, the implementation method of step S44 includes the following steps C11 to C14.
Step C11: for any node which is not sorted, searching a first target directed edge with the minimum number of interval service elements represented by weights corresponding to directed edges connected with the node from the element relation dependency graph, and determining the sorting order of two nodes connected with the first target directed edge based on the direction of the first target directed edge.
The following description will take an example in which the format of the directional edge is { the start node of the directional edge → the end node of the directional edge, and the weight of the directional edge }.
The following description will be made by taking fig. 5 as an example. For the node E001, there are two directional edges connected to the node E001 in the element relationship dependency graph shown in fig. 5, which are { E001 → E002, ∞ }, { E004 → E001, ∞ }, respectively, and the two directional edges have the same weight, but have different directions, and based on this, the order of the node E001, the node E002, and the node E004 can be determined.
It is understood that the element relationship dependency graph shown in fig. 5 is an ideal case. That is, the weights between two nodes connected with the directed edge are the same, and the pointing directions of the directed edge between the nodes are uniform without conflict.
The following description will take an undesirable element relationship dependency graph as an example. Fig. 6 is a diagram illustrating a relationship dependency of another element according to an embodiment of the present application.
The resulting element relationship dependency graph is assumed to be shown in fig. 6.
In fig. 6, the weight of the directed edge is taken as SUM (1 corresponding to each original page/the number of traffic elements between two nodes in the original page where the two nodes connected by the directed edge are located). The greater the weight, the fewer the number of traffic elements that are spaced between two nodes that are connected by a directed edge.
For the node E001, there are 3 directional edges connected to the node E001 in the element relationship dependency graph shown in fig. 6, which are { E004 → E001, 1}, { E001 → E003, 0.5}, and { E001 → E002, 2}, respectively, where the directional edge { E001 → E002, 2} has the largest weight, so that it is determined that { E001 → E002, 2} is the first target directional edge, and it is determined that the next node of E001 is E002.
Step C12: for another node connected with the first target directed edge, searching a second target directed edge with the minimum number of interval service elements represented by corresponding weights in directed edges (directed edges except the first target directed edge) connected with the node from the element relation dependency graph, and determining the ordering order of two nodes connected with the second target directed edge based on the direction of the second target directed edge.
Still taking FIG. 6 as an example, step C11 determines that the next node of node E001 is E002; for another node E002 connected to the first target directed edge { E001 → E002, 2}, finding a directed edge (other than { E001 → E002, 2 }) connected to the node E002 from the element relationship dependency graph shown in fig. 6 is: { E002 → E005, 0.5}, { E004 → E002, 0.5}, and { E002 → E003, 2}, wherein the directional edge { E002 → E003, 2} is determined to be the second target directional edge if the weight of the directional edge { E002 → E003, 2} is the largest. The second target directed edge points from node E002 to node E003, so node E003 is located after node E002.
And step C13, for another node connected with the ith target directed edge, searching the ith +1 target directed edge with the smallest number of interval service elements represented by corresponding weights in the directed edges (directed edges except the ith target directed edge) connected with the node from the element relation dependency graph, and determining the ordering order of the two nodes connected with the ith +1 target directed edge based on the direction of the ith +1 target directed edge. Wherein i is a positive integer greater than or equal to 1.
Step C14: for another node connected to the i +1 th target directed edge, if the nodes connected to the node are all sorted, the step C13 is terminated, otherwise, i ═ i +1 is returned to the step C13 until the identifications of all the business elements included in the element set are sorted.
Still taking fig. 6 as an example, the step C12 determines that another node E003 connected to the second target directed edge finds the directed edges (directed edges other than { E002 → E003, 2 }) connected to the node E003 from the element relationship dependency graph shown in fig. 6 as follows: { E001 → E003, 0.5}, and { E003 → E005, 1}, wherein if the weight of the directional edge { E003 → E005, 1} is the largest, it is determined that the directional edge { E003 → E005, 1} is the third target directional edge. The third target directed edge points from node E003 to node E005, so node E005 is located after node E003.
For another node E005 to which the determined third target directed edge is connected, searching the directed edge (directed edge other than { E003 → E005, 1 }) connected to the node E005 from the element relationship dependency graph shown in fig. 6 is: { E002 → E005, 0.5}, wherein the execution of step C13 for node E005 is terminated because E002 has been sorted.
Since the node E004 is not sorted yet, for the node E004, finding the directed edges connected with the node E004 from the element relationship dependency graph shown in fig. 6 is: { E004 → E001, 1}, { E004 → E002, 0.5}, wherein the directional edge { E004 → E001, 1} has the largest weight, and the directional edge { E004 → E001, 1} is determined to be the first target directional edge. The first target directed edge is pointed to node E001 by node E004, so node E001 is located behind node E004.
The identities of all the business elements in this set of elements are sorted, so the target layout order based on fig. 6 is: e004, E001, E002, E003, E005.
Step S45: and generating the target page based on preset attribute information corresponding to the service element identifier contained in the element set and the target layout sequence.
And the attribute information corresponding to the identification of the business element is the basis for presenting the business element on the target page.
Illustratively, step S45 includes the following steps D11 to D13 in implementation.
Step D11: and acquiring the identifiers of the attribute information corresponding to the identifiers of the business elements in the target layout sequence respectively based on the corresponding relation between the preset identifiers of the business elements and the identifiers of the attribute information.
For example, the correspondence between the identifier of the preset service element and the identifier of the attribute information may be a field model shown in table 2, or an element template table shown in table 5.
Step D12: the attribute information corresponding to the identifier of each attribute information obtained in step D11 is obtained from the correspondence between the identifier of the preset attribute information and the attribute information.
For example, the "correspondence between the identifier of the preset attribute information and the attribute information" may be an attribute model shown in table 3 or table 4.
Step D13: and rendering the pages in sequence according to the sequence of the identifications of the business elements in the target layout sequence and based on the attribute information respectively corresponding to the identifications of the business elements to obtain the target pages.
In the page merging method provided by the embodiment of the application, if a page merging request is obtained, element sequence sets corresponding to a plurality of original pages to be merged are determined; acquiring an element set corresponding to a target page to be generated, wherein the element set is a union set of element sequence sets corresponding to the multiple original pages respectively; constructing an element relation dependency graph based on element sequence sets respectively corresponding to the original pages; since the weight of the directed edge in the element relationship dependency graph can represent the degree of close relationship between the service elements, assuming that the greater the weight of the directed edge is, the fewer the number of the service elements spaced between two nodes connected by the directed edge is, the greater the weight of the directed edge is, which indicates that the two nodes connected by the directed edge are closer, i.e., the positions of the service elements corresponding to the two nodes in the page are closer. The element relation dependency graph has the direction of the directed edge and represents the sequence of the business elements appearing in the page. Therefore, the target layout order of each business element contained in the element set on the target page can be obtained based on the element relation dependency graph, and the target page can be generated based on the preset attribute information corresponding to the identification of the business element contained in the element set and the target layout order. In the process, coding work is not needed, and the efficiency of page combination is improved. Moreover, the position layout of each business element in the target page is more reasonable, and errors in the layout positions of each business element in the generated target page can be avoided, so that the user can fill in errors or fill in contents which are not needed to be filled in the book, and extra operation is brought to the user.
In an optional implementation manner, the order of the identifiers of the service elements included in the element set corresponding to the target page may be random; in an optional implementation manner, the order of the identifications of the business elements included in the element set corresponding to the target page is ordered. The following describes a process of obtaining an ordered element set corresponding to a target page to be generated. The embodiments of the present application provide, but are not limited to, the following two.
The first method for acquiring the element set corresponding to the target page to be generated includes steps F11 to F13.
Step F11: and obtaining priority levels respectively corresponding to the identifiers of the multiple original pages from the corresponding relationship between the preset identifiers of the original pages and the priority levels.
For example, the representation form of the correspondence between the preset original page identifier and the priority level may be any one of a matrix, a table, a linked list, and a function, and the following description will take the table as an example.
TABLE 9 correspondence of identification and priority of original pages
| Identification of original pages | Priority level |
| H001 |
| 2 |
| H002 | 3 |
| H003 | 1 |
| H004 | 4 |
Step F12: in the element sequence sets respectively corresponding to the multiple original pages, if the element sequence sets respectively corresponding to any two original pages have the same identifier of the target service element, deleting the identifier of the target service element contained in the element sequence set corresponding to the original page with a low priority level, and reserving the identifier of the target service element contained in the element sequence set corresponding to the original page with a high priority level, so as to obtain the de-duplicated element sequence sets respectively corresponding to the multiple original pages.
The description will be made by taking a plurality of original pages asoriginal page 1,original page 2, and original page 3, respectively. The element order set oforiginal page 1 ═ E001, E002, E003 ]; the element order set oforiginal page 2 ═ E002, E003, E005 ]; the element order set of the original page 3 is ═ E004, E001, E002.
As the priority level of the identifier of the original page 3 > the priority level of the identifier of theoriginal page 1 > the priority level of the identifier of theoriginal page 2, for the node E001, keeping the E001 in the element sequence set of the original page 3, and deleting the E001 in the element sequence set of theoriginal page 1; for the node E002, keeping E002 in the element sequence set of the original page 3, and deleting E002 in the element sequence sets of theoriginal page 1 and theoriginal page 2; for node E003, E003 in the element order set oforiginal page 1 is retained and E003 in the element order set oforiginal page 2 is deleted. Thus, the deduplicated element sequence set of theoriginal page 1 is [ E003], the deduplicated element sequence set of theoriginal page 2 is [ E005], and the deduplicated element sequence set of the original page 3 is [ E004, E001, E002 ].
Step F13: and sequencing and combining the de-duplicated element sequence sets corresponding to the original pages respectively according to the priority levels corresponding to the original pages respectively to obtain the element set.
The deduplicated element sequence set of theoriginal page 1 is [ E003], the deduplicated element sequence set of theoriginal page 2 is [ E005], the deduplicated element sequence set of the original page 3 is [ E004, E001, E002], and the order is sorted according to priority to obtain [ E004, E001, E002], [ E003], [ E005 ]. The combined element set is [ E004, E001, E002, E003, E005 ].
The second method for acquiring the element set corresponding to the target page to be generated includes steps F21 to F25.
Step F21: and acquiring a union set of element sequence sets respectively corresponding to the original pages to obtain a union set element set.
Step F22: and obtaining the priority levels respectively corresponding to the identifications of the business elements contained in the union element set from the corresponding relation between the preset identifications of the business elements and the priority levels.
For example, the representation form of the correspondence between the service element identifier and the priority level may be any one of a matrix, a table, a linked list, and a function, and the following description will take the table as an example.
TABLE 10 correspondence of identification and priority of business elements
| Identification of business elements | Priority level |
| E001 |
| 2 |
| E002 | 3 |
| E003 | 4 |
| E004 | 1 |
| E005 | 5 |
Step F23: and obtaining the binding relationship of the identifications of the plurality of service elements contained in the union element set from the binding relationship of the identifications of the plurality of preset service elements.
Illustratively, the number of service elements spaced between two service elements is zero if the two service elements have a binding relationship.
Step F24: and ordering the identifications of the business elements contained in the union element set based on the priority levels respectively corresponding to the identifications of the business elements contained in the union element set and the binding relationship of the identifications of the business elements contained in the union element set.
Illustratively, step F24 includes the following steps F241 to F243.
Step F241: and sorting the identifiers of the service elements in the union element set in a descending order according to the priority level to obtain a first sorting result.
Step F242: for the identifier of the first service element which is not sorted twice in the first sorting result, if the identifier of the service element having a binding relationship with the identifier of the first service element is not adjacent to the identifier of the first service element, determining the sorting order of the identifier of the first service element and the identifier of the service element, that is, the identifier of the first service element is located in front of the identifier of the service element and adjacent to the identifier of the service element.
In the embodiment of the present application, the descending order of the identifiers of the service elements according to the priority level is referred to as a first order, and the order in step F242 is referred to as a second order.
Step F243: returning to step F242; and obtaining a second sorting result until the identifiers of the service elements in the first sorting result are sorted for the second time, wherein the second sorting result is the element set.
Step F25: determining the sorted union element set as the element set.
The two manners can obtain an ordered element set, and the ordered element set reflects the layout manner of each service element in the target page to a certain extent, for example, the probability of the identifier of the first service element in the ordered element set is greater than that of the identifier of the first service element in the target page. Step S44 ranks the identifications of the business elements included in the element set based on the constructed element relationship dependency graph, so that the target layout order of the business elements included in the element set on the target page is more accurate. Such an implementation of step S44 is explained below, and the method includes steps G11 to G15.
Step G11: and acquiring the identification of the unordered first service element contained in the element set.
An ordered set of elements is assumed to be [ E004, E002, E003, E001, E005 ]. The first service element not ordered is identified as being located at the first node of the element set, E004, when step G11 is performed for the first time. Since the identifier of the first service element in the ordered element set is the identifier of the first service element of the target page with a high probability, the identifier of the first service element in the target layout order is the identifier of the first service element in the ordered element set.
Step G12: and obtaining the identification of at least one business element which is connected with the identification of the first business element through a directed edge and is not ordered from the element relation dependency graph.
Step G13: and obtaining the identifier of the target service element corresponding to the weight with the minimum number of the service elements spaced between the first service element from the identifiers of the at least one service element.
For the node E004, the identifier of the service element connected to the node E004 in the element relationship dependency graph shown in fig. 6 is 2, which are E001 and E002 (both not ordered), where the weight of { E004 → E001, 1} is the largest (the largest weight represents the smallest number of service elements spaced from the first service element), so that it is determined that E004 is the identifier of the target service element.
Step G14: and determining the sequence of the identifier of the target service element and the identifier of the first service element based on the direction of a directed edge connecting the identifier of the target service element and the identifier of the first service element, wherein the identifier of the target service element is adjacent to the identifier of the first service element.
Since the directional edge { E004 → E001, 1} points from E004 to E001, node E004 precedes node E001.
Step G15: and G12 is returned until the identifications of all the business elements contained in the element set are sorted.
Taking the node E001 as the identifier of the first service element that is not sorted, returning to step G12, obtaining the identifiers of the service elements connected to the node E001 by the directed edges from the element relationship dependency graph shown in fig. 6 as follows: e002, E003, and E004, wherein E004 has been sorted, the identities of the service elements connected to the node E001 through the directed edge and not sorted are: e002, E003. Here, { E001 → E002, 2} has the largest weight, and therefore, it is determined that E002 is the identity of the target traffic element. Since the directed edge { E001 → E002, 2} is directed from node E001 to node E002, node E002 is located behind node E001.
Taking the node E002 as the identifier of the first service element that is not sorted, returning to step G12, the identifiers of the service elements connected to the node E002 by the directed edge obtained from the element relationship dependency graph shown in fig. 6 are: e005, E003, E001, and E004, wherein E004 and E001 have been sorted, and the identifiers of the service elements connected to the node E002 by the directed edge and not sorted are: e005, E003. Since the weight of { E002 → E003, 2} is the largest, it is determined that E003 is the identifier of the target traffic element. Since the directed edge { E002 → E003, 2} is directed from node E002 to node E003, node E003 is located behind node E002.
Taking the node E003 as the identifier of the first service element that is not sorted, returning to step G12, obtaining the identifiers of the service elements connected to the node E003 through the directed edge from the element relationship dependency graph shown in fig. 6 as follows: e001, E002, and E005, wherein E001 and E002 have been sorted, the identities of the service elements connected to the node E003 via the directed edge and not sorted are: E005. since { E003 → E005, 1} is a unique directional edge, it is determined that E005 is the identifier of the target traffic element. Since the directed edge { E003 → E005, 1} points from the node E003 to the node E005, the node E005 is located behind the node E003. The identifiers of all the service elements contained in the element set are sorted, the sorting is finished, and the obtained target layout sequence is as follows: e004, E001, E002, E003, E005.
In an alternative implementation, the adjacency matrix a may be generated based on the element relationship dependency graph, so that the subsequent step S44 orders the identities of the business elements included in the element set based on the element relationship dependency graph.
Assuming that the element relationship dependency graph is as shown in fig. 6, for example, if the weight of the directed edge is greater, the number of the service elements representing the interval between two nodes connected by the directed edge is less, where the weight of the directed edge is 0, the two nodes connected by the directed edge are hardly appeared on the same page; if the weight of the directed edge is infinite, it represents that two nodes connected by the directed edge appear and are adjacent to each other on a plurality of original pages to be merged, and the adjacency matrix a is specifically as follows:
the adjacency matrix a refers to a mark pointing from the mark of the service element located in the jth row to the mark of the service element located in each column, and the value of j in the adjacency matrix a is 1, 2, 3, 4, and 5. The following describes a first example of the behavior.
The identification of the business element located in the first row is E001, and the weight of the identification of the business element located in the first row to the identification of the business element located in the first column is ∞. Because E001 is the same as E001, i.e., the degree of correlation is very high, it is replaced with ∞. The weight of the identifier E001 of the service element located in the first row to the identifier E002 of the service element located in the second column is 2; the weight of the identifier E001 of the service element located in the first row to the identifier E003 of the service element located in the third column is 0.5; the weight of the identifier E001 of the service element located in the first row pointing to the identifier E004 of the service element located in the fourth column is 0, that is, the identifier E001 and the identifier E004 are not present in the same original page; the identifier E001 of the service element located in the first row points to the identifier E005 of the service element located in the fifth column with a weight of 0, i.e. the representation E001 and E005 hardly appear in the same original page.
In the page merging method provided by the embodiment of the application, the target page can be dynamically generated based on the requirements of the user, and illustratively, the page merging request is automatically generated based on the operation habits of the user and is not manually input. For example, in a news application and a video application, each person has different operation habits, for example, the habits of viewing news are different, and then the server corresponding to different applications or different applications can generate a page merge request based on the operation habits of the user, so that the pages viewed by different users through the applications are different. Namely, each page contains business elements which are dynamically pushed.
The method is described in detail in the embodiments disclosed in the present application, and the method of the present application can be implemented by various types of apparatuses, so that an apparatus is also disclosed in the present application, and the following detailed description is given of specific embodiments.
As shown in fig. 7, a structure diagram of a page merging device provided in an embodiment of the present application includes: adetermination module 71, anacquisition module 72, aconstruction module 73, aranking module 74, and ageneration module 75, wherein:
a determiningmodule 71, configured to determine, if a page merging request is obtained, element sequence sets corresponding to multiple original pages to be merged, where the element sequence sets corresponding to the original pages include identifiers of service elements included in the original pages, and an order of the identifiers of the service elements included in the element sequence sets is a layout order of the service elements on the original pages;
an obtainingmodule 72, configured to obtain an element set corresponding to a target page to be generated, where the element set is a union of element sequence sets corresponding to the multiple original pages, respectively;
aconstructing module 73, configured to construct an element relationship dependency graph based on element sequence sets corresponding to the multiple original pages, where a node included in the element relationship dependency graph is an identifier of the service element, a direction of a directed edge connecting two nodes included in the element relationship dependency graph is from the service element located above the original page to the service element located below the original page, and a weight of the directed edge represents a number of the service elements between the two nodes in the original page where the two nodes connected by the directed edge are located;
asorting module 74, configured to sort, based on the constructed element relationship dependency graph, the identifiers of the business elements included in the element set, so as to obtain a target layout order of each business element included in the element set on the target page;
agenerating module 75, configured to generate the target page based on preset attribute information corresponding to an identifier of a business element included in the element set and the target layout order, where the attribute information corresponding to the identifier of the business element is a basis for presenting the business element on the target page.
In an optional implementation manner, the obtaining module includes:
the first obtaining unit is used for obtaining priority levels respectively corresponding to the identifiers of the multiple original pages from the corresponding relation between the preset identifiers of the original pages and the priority levels;
a second obtaining unit, configured to delete, if any two element sequence sets respectively corresponding to the multiple original pages have the same identifier of the target service element in the element sequence sets respectively corresponding to any two original pages, the identifier of the target service element included in the element sequence set corresponding to the original page with the lower priority, and retain the identifier of the target service element included in the element sequence set corresponding to the original page with the higher priority, so as to obtain the deduplicated element sequence sets respectively corresponding to the multiple original pages;
and the merging unit is used for sorting and merging the de-duplicated element sequence sets corresponding to the multiple original pages according to the priority levels corresponding to the multiple original pages respectively to obtain the element set.
In an optional implementation manner, the obtaining module includes:
a second obtaining unit, configured to obtain a union of element sequence sets respectively corresponding to the multiple original pages to obtain a union element set;
a third obtaining unit, configured to obtain, from a preset correspondence between an identifier of a service element and a priority level, a priority level corresponding to each identifier of the service element included in the union element set;
a fourth obtaining unit, configured to obtain, from binding relationships of identifiers of a plurality of preset service elements, a binding relationship of identifiers of the plurality of service elements included in the union element set;
the sorting unit is used for sorting the identifications of the business elements contained in the union element set based on the priority levels respectively corresponding to the identifications of the business elements contained in the union element set and the binding relationship of the identifications of the business elements contained in the union element set;
a first determining unit, configured to determine the sorted union element set as the element set.
In an optional implementation manner, the nodes included in the element relationship dependency graph are all identifiers of the business elements included in the element set, and the sorting module includes:
a fifth obtaining unit, configured to obtain an identifier of a first service element that is not sorted and is included in the element set;
a sixth obtaining unit, configured to obtain, from the element relationship dependency graph, an identifier of at least one service element that is connected to the identifier of the first service element through a directed edge and is not sorted;
a seventh obtaining unit, configured to obtain, from the identifier of the at least one service element, an identifier of a target service element corresponding to a weight that indicates a minimum number of service elements spaced from the first service element;
a second determining unit, configured to determine, based on a direction of a directed edge connecting an identifier of the target service element and an identifier of the first service element, an order of the identifier of the target service element and the identifier of the first service element, where the identifier of the target service element is adjacent to the identifier of the first service element;
and taking the identifier of the target service element as the identifier of the first service element which is not sequenced and is contained in the element set, and triggering the sixth acquisition unit until the identifiers of all the service elements contained in the element set are sequenced.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 8 is a block diagram illustrating an apparatus for a server in accordance with an example embodiment.
Servers include, but are not limited to: aprocessor 81, amemory 82, anetwork interface 83, an I/O controller 84, and acommunication bus 85.
It should be noted that the structure of the server shown in fig. 8 does not constitute a limitation of the server, and the server may include more or less components than those shown in fig. 8, or combine some components, or arrange different components, as will be understood by those skilled in the art.
The following describes each component of the server in detail with reference to fig. 8:
theprocessor 81 is a control center of the server, connects various parts of the entire server using various interfaces and lines, and performs various functions of the server and processes data by operating or executing software programs and/or modules stored in thememory 82 and calling data stored in thememory 82, thereby performing overall monitoring of the server.Processor 81 may include one or more processing units; illustratively, theprocessor 81 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into theprocessor 81.
Processor 81 may be a Central Processing Unit (CPU), or an application Specific Integrated circuit (asic), or one or more Integrated circuits configured to implement embodiments of the present invention, etc.;
theMemory 82 may include a Memory, such as a Random-Access Memory (RAM) 821 and a Read-Only Memory (ROM) 822, and may also include amass storage device 823, such as at least 1 disk Memory. Of course, the server may also include hardware needed for other services.
Thememory 82 is used for storing the executable instructions of theprocessor 81. Theprocessor 81 has the following functions: if a page merging request is obtained, determining element sequence sets corresponding to a plurality of original pages to be merged respectively, wherein the element sequence sets corresponding to the original pages comprise identifiers of all service elements contained in the original pages, and the sequence of the identifiers of all the service elements contained in the element sequence sets is the layout sequence of all the service elements in the original pages;
acquiring an element set corresponding to a target page to be generated, wherein the element set is a union set of element sequence sets corresponding to the multiple original pages respectively;
constructing an element relation dependency graph based on element sequence sets respectively corresponding to the plurality of original pages, wherein nodes contained in the element relation dependency graph are identifications of the service elements, the direction of a directed edge contained in the element relation dependency graph and connecting the two nodes points to the service elements positioned below the original pages from the service elements positioned above the original pages, and the weight of the directed edge represents the number of the service elements between the two nodes in the original pages where the two nodes connected by the directed edge are positioned;
sequencing the identifications of the business elements contained in the element set based on the constructed element relation dependency graph so as to obtain a target layout sequence of each business element contained in the element set on the target page;
and generating the target page based on preset attribute information corresponding to the service element identifier contained in the element set and the target layout sequence, wherein the attribute information corresponding to the service element identifier is the basis for presenting the service element on the target page.
Theprocessor 81, thememory 82, thenetwork interface 83, and the I/O controller 84 may be connected to each other by acommunication bus 85, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
In an exemplary embodiment, the server may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described page merging method.
In an exemplary embodiment, the disclosed embodiments provide a storage medium comprising instructions, such as amemory 82 comprising instructions, executable by aprocessor 81 of a server to perform the above-described method. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer readable storage medium is provided, which can be directly loaded into the internal memory of a computer, such as thememory 82, and contains software codes, and the computer program can be loaded into the computer and executed to implement the steps shown in any embodiment of the page merge method.
In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into an internal memory of a computer, for example, a memory included in the server, and contains software codes, and which can be loaded into and executed by the computer to implement the steps shown in any embodiment of the page merging method described above.
Note that the features described in the embodiments in the present specification may be replaced with or combined with each other. For the device or system type embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
It is further 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.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.