Detailed Description
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will explain the specific embodiments of the present invention with reference to the accompanying drawings. It is evident that the drawings in the following description are only examples of the invention, from which other drawings and other embodiments can be obtained by a person skilled in the art without inventive effort.
For simplicity of the drawing, only the parts relevant to the invention are schematically shown in each drawing, and they do not represent the actual structure thereof as a product. Additionally, in order to simplify the drawing for ease of understanding, components having the same structure or function in some of the drawings are shown schematically with only one of them, or only one of them is labeled. Herein, "a" means not only "only this one" but also "more than one" case.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
In this context, it should be noted that the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected, unless otherwise explicitly stated and defined. Either mechanically or electrically. Can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
In addition, in the description of the present invention, the terms "first," "second," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Example 1
In one embodiment, referring to fig. 1 of the specification, a flow diagram of a user entry generation method based on popularization information provided by the invention is shown. Referring to fig. 2 of the specification, a schematic structural diagram of a user entry generation method based on popularization information is shown.
The invention provides a user entry generation method based on popularization information, which comprises the following steps:
S101: and acquiring the materials uploaded by the user and the filled popularization information.
The uploaded materials comprise any one or more of video, audio, pictures, websites and the like.
Specifically, an online form may be created that contains the necessary fields to require the user to fill in promotional information, such as product descriptions, titles, keywords, target audience, etc. File upload functionality may also be provided to allow a user to upload material, such as pictures, videos, or documents.
S102: and generating a plurality of webpage templates according to the materials uploaded by the user and the filled popularization information.
Specifically, the method and the system can analyze the materials and the popularization information uploaded by the user, construct a web page skeleton, insert the materials and customize the patterns, ensure responsive design, generate templates of different styles, and finally select the best template based on aesthetic evaluation or other indexes to be used for generating a final popularization page so as to meet different popularization requirements and improve user experience.
In one possible implementation, S102 specifically includes substeps S1021 to S1027:
s1021: and analyzing the materials uploaded by the user and the filled popularization information to generate a DOM tree.
Wherein DOM (Document Object Model) tree is a tree data structure used to represent and organize HTML (Hypertext Markup Language) document structures, DOM tree presents the entire web page document in the form of a tree, allowing programmatically accessing and manipulating various parts of the web page.
S1022: head, body, header, section, main, footer and div in the DOM tree are obtained.
Wherein head represents a header, body represents a body, header represents a header portion, section represents organizing web page content, main represents a main content portion, footer represents a footer portion, div represents a generic block-level container element for grouping or packaging content together, div element itself has no specific semantics but is very useful in web page layout and style for creating custom web page structures and layouts.
S1023: HTML elements are created according to head, body, header, section, main, footer and div in the DOM tree, and each HTML element is organized according to the DOM tree structure.
S1024: head, body, header, section, main, footer in the DOM tree and div are inserted into the corresponding HTML elements.
S1025: and constructing association relations among continuous and related HTML elements, dividing the association relations into the same group, adjusting the layout of each group of HTML elements according to different screen sizes, and recording the layout in a dynamic loading layout table.
It should be noted that HTML elements that are adjacent to each other and have relevance on a page are combined together so that their arrangement and display on the page can be more coordinated and meet design requirements. Further, once the related HTML elements are grouped together, a particular layout may be made for the elements in those groups. This means you can control the position, size, spacing, etc. of these elements on the page to ensure that they are visually consistent.
For example, the title, body, author information, and release date of an article typically form a related group, and the relationship between them facilitates the logical organization of the page content.
The layout and style of the page can be adjusted according to different screen sizes (such as mobile phone, tablet computer and desktop computer) of the user equipment by loading the dynamic loading layout table. Different screen sizes may require different layouts to ensure that the content is properly displayed and manipulated on a variety of devices.
In the present invention, by combining adjacent and related HTML elements together for modification, it is ensured that the elements within each group have a consistent style and layout in different templates.
S1026: the div number contained in each group of HTML elements is counted.
S1027: and modifying div in each group of HTML elements according to the groups, adjusting the page structure, and generating a plurality of webpage templates, wherein the modification times of each group of HTML elements are in direct proportion to the div number contained in each group of HTML elements.
It should be noted that deletion, rearrangement, style modification div may adjust the page structure.
In the invention, the page structure of each group can be flexibly adjusted according to the div number in different groups by the number of modification times proportional to the div number. This means that groups with more divs may require more adjustments to meet design requirements, while groups with fewer divs may require less adjustments. The design of the responsiveness makes the generated webpage templates more diversified.
S103: and calculating the aesthetic index of each webpage template according to the color complexity, the duty ratio, the visual saliency and the readability of each webpage template.
Color complexity refers to the complexity of the type and combination of colors used in the web page. Too cluttered and uncoordinated colors may make the web page appear confusing and unattractive. A reasonable color match and carefully selected palette may enhance the aesthetics of the web page. Thus, the aesthetic index may be affected by color complexity, and highly complex or non-collocated colors may reduce the aesthetic score.
The duty ratio refers to the relative proportion of elements such as text, images, blank spaces and the like in the webpage. The proper duty cycle can help the page to present a clear structure, making the content easier to read and understand. If the duty cycle is not reasonable, the page may appear crowded or too open, affecting aesthetics. The aesthetic index takes into account the duty cycle to ensure that the layout and layout of the pages meets aesthetic principles.
Wherein the visual saliency represents the degree to which an element on a web page is visually noticeable. In general, some elements (e.g., main titles, important images) should be more visually noticeable, while other elements (e.g., auxiliary text or background) should be less noticeable. Visual saliency can be achieved by reasonable typesetting, color and contrast. The aesthetic index takes into account visual salience to ensure that key elements on the page can draw the attention of the user.
Where readability refers to the legibility and understandability of text on a web page. Font size, line spacing, word spacing, color contrast, etc., all affect the readability of text. If the text is difficult to read or understand, the user experience will be affected, thereby reducing aesthetics. The aesthetic index may take these factors into account to ensure that the text is easy to read and understand.
In one possible embodiment, S103 specifically includes substeps S1031 to S1035:
s1031: and calculating the color complexity of each webpage template.
S1032: and calculating the duty ratio of each webpage template.
S1033: and calculating the visual saliency of each webpage template.
S1034: the readability of each web page template is calculated.
S1035: calculating the aesthetic index of each web page template according to the following formula:
;
Where ρ represents an aesthetic index, col represents color complexity, μ 1 represents a weight of color complexity, rate represents duty cycle, μ 2 represents a weight of duty cycle, VS represents visual saliency, μ 3 represents a weight of visual saliency, read represents readability, μ 4 represents a weight of readability.
In the present invention, by considering a number of factors (color complexity, duty cycle, visual saliency, and readability), a comprehensive assessment of the aesthetics of a web page template may be provided. Not only are single factors focused on in the evaluation process, but also the interrelationship between them is considered so as to more accurately reflect the overall aesthetic degree of the webpage. Further, an objective computing method is adopted to evaluate each factor, such as computing color complexity, duty cycle, visual saliency and readability, without relying on subjective aesthetic judgment, so that subjective bias can be reduced, and evaluation is more objective.
In one possible implementation, the weights for color complexity, duty cycle, visual saliency, and readability are determined in the following manner:
By comparing color complexity, duty ratio, visual saliency and readability in pairs, a discrimination matrix A is established by combining a nine-level scale method:
;
wherein a ij represents the first The importance degree of the evaluation index relative to the j-th evaluation index, the value of a ij is determined by a nine-pole scale method,/>。
Nine pole scale, among other things, is a method commonly used to compare and evaluate the relative importance between different options, commonly used for weight determination, decision analysis, and sorting options. A number is selected in a series of levels to indicate the importance of one option relative to another for a certain criterion or factor. The level in the nine-level scale is from 1 to 9. Where 1 represents the relative importance of the two options being exactly equal and 9 represents the extreme importance of one option with respect to the other. 1 denotes equal importance, 3 denotes slightly biased importance, 5 denotes moderately biased importance, 7 denotes strongly biased importance, 9 denotes extreme importance, 2, 4, 6, 8 then denote intermediate states between adjacent levels, for the case between two levels of relative extent.
Calculating eigenvectors and eigenvalues of the discrimination matrix A:
;
wherein lambda represents the eigenvalue of the discrimination matrix A, w represents the eigenvector of the discrimination matrix A, I represents the identity matrix, the largest eigenvalue is denoted as lambda max, and the eigenvector corresponding to the largest eigenvalue is denoted as 。
And carrying out normalization processing on the feature vector w max corresponding to the maximum feature value:
;
wherein the normalized vector Individual components/>Weights respectively representing the evaluation indexes can be respectively recorded as/>。
It should be noted that a weight is assigned to each factor, allowing the emphasis point of the evaluation to be adjusted according to different items or user needs. For example, if a particular item is more focused on color matching, higher weights may be assigned to color complexity to ensure satisfaction in terms of color.
According to the invention, the weight of each evaluation index can be obtained by analyzing the discrimination matrix and the feature vector, the relative importance of each evaluation index can be better understood, a more reliable basis is provided for the calculation of the aesthetic index, the optimization of the webpage design is facilitated, and the user satisfaction is improved.
In one possible implementation, S1031 is specifically:
and constructing a pixel histogram of the webpage template.
Among them, a Pixel Histogram (Pixel Histogram) is a graphical representation for describing the frequency of occurrence of various Pixel values in a digital image. It shows the number or relative frequency of pixels in the image with a particular gray level (pixel value). Pixel histograms are typically represented in gray scale (from 0 to 255, corresponding to black to white) on the horizontal axis and pixel count or frequency on the vertical axis.
And counting the value probability of the pixel value of each pixel point in the pixel histogram.
The color complexity is calculated according to the following formula:
;
Where Col denotes color complexity, G denotes a pixel value, G denotes a value range of the pixel value, and P g denotes a value probability of the pixel value G in the pixel histogram.
In the invention, the color characteristics of the image can be better understood and managed by analyzing the pixel histogram and calculating the color complexity, which is helpful for optimizing the visual effect of the image and meeting the design requirement.
In one possible embodiment, S1032 is specifically:
The duty cycle of each web page template is calculated according to the following formula:
;
Wherein, rate represents the duty cycle, S 1 represents the total area of the single-color blank area in the web page template, and S represents the total area of the web page template.
In the present invention, the duty ratio is one of important indicators for evaluating the layout of a page. By calculating the ratio of the total area of the single-color blank areas to the total area of the whole webpage template, the number of blank areas on the page relative to the content area can be known. This helps determine whether the overall design and layout of the page is reasonable and whether the content is sufficiently prominent.
In one possible implementation, S1033 specifically includes grandchild steps S10331 to S10336:
S10331: and converting the webpage template into a color feature map, a brightness feature map and a direction feature map.
S10332: for a particular one of the color, luminance and direction feature maps, a center-to-perimeter contrast value is calculated by center-to-perimeter contrast:
;
Where v denotes the center-to-perimeter contrast value, v c denotes the average value of the feature values of the center region, and v s denotes the average value of the feature values of the perimeter region.
It should be noted that, converting the web page template into a color feature map, a brightness feature map and a direction feature map, and then calculating the center-to-periphery contrast value through the center-to-periphery contrast can identify which regions in the web page are more visually significant, and help determine which portions attract the attention of the user, so that the web page is better designed to highlight the key content.
S10333: normalization processing is carried out on each central-peripheral comparison value:
;
Wherein, The normalized center-to-perimeter contrast value is represented by v max, the maximum value of each center-to-perimeter contrast value is represented by v min, the normalized center-to-perimeter contrast value in the color profile is denoted as v 1, the normalized center-to-perimeter contrast value in the luminance profile is denoted as v 2, and the normalized center-to-perimeter contrast value in the direction profile is denoted as v 3.
S10334: and obtaining a comprehensive contrast value according to the central-peripheral contrast value after normalization processing in the color feature map, the brightness feature map and the direction feature map:
;
Wherein, Representing the integrated contrast value, α 1 represents the weight of the color feature map, α 2 represents the weight of the luminance feature map, and α 3 represents the weight of the direction feature map.
The person skilled in the art may set the weights of the color feature map, the luminance feature map, and the direction feature map, and the weights of the luminance feature map, and the direction feature map, and the invention is not limited thereto.
S10336: calculating the comprehensive contrast value of each pixel pointAs the visual saliency VS.
It should be noted that, calculating the average value of each pixel point to obtain the visual saliency VS as a quantitative index can be used for comparing the relative visual saliency of different web page templates, so as to help the designer select the template with the most attractive and influencing effects.
In the invention, by calculating the visual saliency, important information about which parts are attractive on the webpage can be provided, so that the webpage design and optimization are guided to meet the visual requirements of users and improve the user experience. This is important to attract the attention of the user and to effectively convey information.
In one possible implementation, S1034 is specifically:
;
Wherein Read represents the readability of the device, Representing the average sentence length, β 1 representing the weight of the average sentence length, r representing the complex sentence proportion, β 2 representing the weight of the complex sentence proportion. The person skilled in the art may set the weights β 1 of the average sentence length and the weights β 2 of the complex sentence ratio according to the actual situation, which is not limited by the present invention.
In the invention, the complexity degree of the text can be known by evaluating the sentence length and the complex sentence proportion, which is helpful for ensuring that the information on the webpage can be effectively transmitted to the user without confusing the user due to the too complex sentence structure.
S104: and generating a popularization page based on the webpage template with the highest aesthetic index.
Alternatively, the three web page templates with the highest aesthetic indexes may be presented to the user for the user to select the final web page template.
Specifically, the promotion information and the materials uploaded by the user are imported into the selected webpage template. Such information may include text, images, links, buttons, etc., embedding promotional information and material into corresponding locations according to the structure of the template. And customizing the webpage template according to the specific popularization requirements. This may include altering text content, replacing images, adjusting color theme, modifying font style, etc. Ensuring that the template content is consistent with the promotion content. And according to the length and the structure of the popularization information, the layout and typesetting of the webpage templates are adjusted. Ensuring that the text is easy to read and that the images and buttons are properly positioned on the page.
Optionally, manual adjustment and editing is also supported for automatically generated promotional pages.
S105: and generating a user inlet aiming at the popularization page.
The user entrance comprises any one or more of a long website, a short link, a two-dimensional code, a WeChat card, a tremble card and the like.
In a possible implementation manner, the user access is a short link, and the present invention proposes a new short link generation method, and S105 specifically includes sub-steps S1051 to S1059:
s1051: and generating the URL for the promotion page.
It should be noted that long URLs can be very complex and lengthy, and after the short links are generated, the number of characters can be significantly reduced, thereby saving storage space, especially in situations where the number of characters is limited, such as social media posts or text messages.
S1052: the vowels in the URL are removed.
S1053: splicing the random number, the secret key and the URL after removing the vowel, and calculating a hash value:
;
where h represents a Hash value, hash represents a Hash operation, key represents a key, URL represents a URL from which a vowel is removed.
In the present invention, by including the key in the hash calculation, the security of the data can be increased. Only people who know the key can generate the correct hash value. This helps prevent unauthorized users from forging hash values or cracking links. A random number is used each time a short link is generated, which means that even if the same URL generates a short link multiple times, a different hash value is obtained. This helps to ensure that each generated short link is unique. And, the hash value may be used to verify the data integrity of the link. If the linked content is tampered with during transmission or storage, the hash values will not match, indicating that the data may have been corrupted.
S1054: the first 4 bytes of the hash value h are taken as a 32-bit unsigned integer and assigned to the variable A.
In the present invention, the original hash value can be shortened to a 32-bit unsigned integer by taking the first 4 bytes of the hash value. This helps create shorter links that are more readable and easy to use.
S1055: and clearing the highest 2 bits in the variable A to obtain an unsigned integer of 30 bits, and assigning the unsigned integer to the variable B.
S1056: the variable B and the binary 00111101 are subjected to bitwise and operation, and the operation result is stored in the variable C.
In the present invention, the risk of collision between generated hash values can be reduced by zeroing the top 2 bits and performing a bit and operation on the result. This means that the generated short links are more likely to be unique and not conflict with existing links.
S1057: and right-shifting the variable B by 5 bits, performing bitwise and operation with the binary 00111101 again, and storing characters obtained by the bitwise and operation in the variable C.
S1058: s1057 is repeated until 6 characters are stored in the variable C.
In the present invention, by bitwise and manipulation of hash values, it can be ensured that short links are generated with a fixed length, which makes them easier to handle and share.
S1059: the 6 characters are combined into a short link and a mapping relationship is established between the short link and the URL.
In the present invention, by performing bit manipulation on the hash value, custom logic to generate short links can be implemented to meet specific requirements, such as generating shorter, unique, and readable links, while increasing security and reducing collision risk. These operations may make the short link generation process more flexible and controllable.
S106: user portals are shared to target clients.
Compared with the prior art, the invention has at least the following beneficial technical effects:
(1) According to the method and the device, the webpage template is automatically generated according to the uploaded materials of the user and the filled popularization information, then the popularization page and the corresponding user entrance are automatically generated based on the webpage template with the highest aesthetic index, manual participation is not needed, time and labor are saved, the generation efficiency of the popularization information and the user entrance is improved, and the propaganda period is shortened.
(2) According to the invention, the aesthetic indexes of the webpage templates are calculated according to the color complexity, the duty ratio, the visual saliency and the readability of the webpage templates, the aesthetic degrees of the webpage templates and the promotion pages are evaluated more objectively through the aesthetic indexes, the aesthetic conformity of the generated promotion pages to the masses is improved, the workload of engineers for adjusting on the basis of the automatically generated promotion pages is reduced, and the propaganda effect of the promotion pages is improved.
After S106, further including:
S107: the actual page visited by the target client is monitored.
S108: and calculating the similarity between the popularization page and the actual page.
In a possible implementation manner, the present invention proposes a new method for calculating page similarity, and S108 specifically includes:
S1081: and obtaining DOM trees of the promotion page and the actual page.
S1082: traversing the DOM tree of the promotion page and the actual page, and judging whether the HTML elements of the DOM tree have consistency. If yes, go to the next step. Otherwise, judging that the promotion page is tampered.
In the invention, by comparing DOM tree structures, the system can quickly detect whether the promotion page is tampered or has abnormality. If the DOM tree structure is inconsistent, it is stated that the page may have been subject to unauthorized modification, which helps to discover potential risks or fraud ahead of time.
S1083: calculating the structural similarity of the DOM tree of the promotion page and the actual page, wherein the structural similarity of the DOM tree is calculated according to the following formula as the similarity between the promotion page and the actual page:
;
wherein sim represents the structural similarity of the DOM tree, W i represents the weight of the ith layer in the DOM tree, Representing the height of the DOM tree, σ ij represents the/>Element influencing factor of jth HTML element in layer, X ij represents the/>The degree of change of the j-th HTML element in the layer,/>N i represents the/>Total number of HTML elements in a layer.
It should be noted that, the structural similarity of the DOM tree can capture the similarity between the promoted page and the actual page more accurately. The DOM tree represents the structure and organization of the pages, and thus reflects the actual similarity of the pages more than simply comparing text content or labels. The method is applicable to various types of webpages, is not affected by specific labels or text contents no matter what content or layout of the webpages is, and is more universal. In addition, the structural similarity of the DOM tree considers the overall structure of the page, including the nested relation and the arrangement sequence of elements, so that the similarity measurement is more comprehensive and is not only content matching.
In the method, the structural similarity of the DOM tree can be calculated more accurately by balancing different levels of the DOM tree and the variation degree of the HTML elements. This helps to reduce false positives, ensures that an alarm is only issued when there is actually a problem, and thus reduces the false positive rate.
In one possible embodiment, the firstThe degree of change X ij of the j-th HTML element in the layer is determined in the following manner:
when the first DOM tree is in the two DOM trees When the j-th HTML element in the layer is identical,/>。
When the first DOM tree is in the two DOM treesWhen the j-th HTML element in the layer is different but belongs to the same class,/>。
When the first DOM tree is in the two DOM treesWhen the j-th HTML element in the layer is present or absent from the layer, the j-th HTML element is present。
When the first DOM tree is in the two DOM treesAnd when the j-th HTML elements in the layer do not belong to the same class, determining that the promotion page is tampered.
First, theThe element influence factor sigma ij of the j-th HTML element in the layer is determined in the following manner:
When the jth HTML element belongs to the jth Layer time,/>。
When the jth HTML element does not belong to the jthLayer time,/>。
The DOM tree is the firstThe determination method of the layer weight W i is as follows:
;
In the method, the structural similarity of the DOM tree can be calculated more accurately by defining the variation degree, the element influence factors and the weights of different layers under different conditions.
S109: when the similarity between the popularization page and the actual page is smaller than the preset similarity, judging that the popularization page is tampered, and sending alarm information to a target client.
In the invention, by monitoring the actual page accessed by the target client, the system can periodically check whether the promotion page is modified or tampered with by unauthorized. This helps to maintain the integrity of the promotional page, ensuring that the page that the user sees is the intended version. Further, if the similarity between the promoted page and the actual page is lower than the preset similarity, this may indicate that the promoted page is subject to tampering or malicious attack. In this case, the system may immediately issue an alert to the target client, helping them to alert of possible fraud or security problems.
Example 2
In one embodiment, the invention provides a user portal generation system based on promotion information, which is used for executing the user portal generation method based on promotion information in embodiment 1.
The user portal generating system based on the promotion information provided by the invention can realize the steps and effects of the user portal generating method based on the promotion information in the embodiment 1, and in order to avoid repetition, the invention is not repeated.
Compared with the prior art, the invention has at least the following beneficial technical effects:
(1) According to the method and the device, the webpage template is automatically generated according to the uploaded materials of the user and the filled popularization information, then the popularization page and the corresponding user entrance are automatically generated based on the webpage template with the highest aesthetic index, manual participation is not needed, time and labor are saved, the generation efficiency of the popularization information and the user entrance is improved, and the propaganda period is shortened.
(2) According to the invention, the aesthetic indexes of the webpage templates are calculated according to the color complexity, the duty ratio, the visual saliency and the readability of the webpage templates, the aesthetic degrees of the webpage templates and the promotion pages are evaluated more objectively through the aesthetic indexes, the aesthetic conformity of the generated promotion pages to the masses is improved, the workload of engineers for adjusting on the basis of the automatically generated promotion pages is reduced, and the propaganda effect of the promotion pages is improved.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the invention, which are described in detail and are not to be construed as limiting the scope of the invention. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the invention, which are all within the scope of the invention. Accordingly, the scope of protection of the present invention is to be determined by the appended claims.