CN116382766A - Page packaging method and device, storage medium and electronic device - Google Patents

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

Info

Publication number
CN116382766A
CN116382766A CN202310187348.5A CN202310187348A CN116382766A CN 116382766 A CN116382766 A CN 116382766A CN 202310187348 A CN202310187348 A CN 202310187348A CN 116382766 A CN116382766 A CN 116382766A
Authority
CN
China
Prior art keywords
packaged
page
current page
component object
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310187348.5A
Other languages
Chinese (zh)
Inventor
李尧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202310187348.5A priority Critical patent/CN116382766A/en
Publication of CN116382766A publication Critical patent/CN116382766A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Storage Device Security (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The application discloses a page packaging method and device, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the page packaging method comprises the following steps: generating a network identification code matched with a current page to be packaged according to object attribute information of a component object contained in the current page to be packaged; searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page; under the condition that a reference page similar to the current page to be packaged does not exist, the current page to be packaged is packaged according to the attribute information of the component object in the current page to be packaged.

Description

Page packaging method and device, storage medium and electronic device
Technical Field
The application relates to the technical field of smart families, in particular to a page packaging method and device, a storage medium and an electronic device.
Background
With the rapid development of the internet, the type of software is switched from the past Windows desktop program to the Web page mainly comprising a Browser and the mobile application age, and the Browser/Server is advanced from a simple two-layer architecture to a multi-layer architecture and a micro-service, so that an automatic test technology gradually enters a brand new age.
The current-stage Web automation test brings higher requirements on the research and development capability of test engineers, and the workload of the test engineers is increased, and team-level capability requirements and infrastructures brought by quality building are not landable in a short time, so how to realize the development of Web automation with low cost and threshold is of great importance.
Currently, the most mainstream Web automation development is based on a PO mode, that is, a method of regarding a page as an object, information such as elements on the page as attributes of the object, and a series of business operations as objects.
The development of the Web automation PO mode requires a tester to stand at a subjective angle to package the Page, but the automation development is often completed by cooperation of multiple persons, different persons do not have a unified concept on the Page dimension to be packaged, a large number of repeated redundant codes possibly exist due to repeated Page definition, the maintenance workload is increased, and the development efficiency is also obviously reduced.
In the related art, there may be a large number of repeated redundant codes due to repeated page definitions, and an effective solution has not been proposed yet.
Disclosure of Invention
The embodiment of the application provides a page packaging method and device, a storage medium and an electronic device, which at least solve the problems that in the related art, a large number of repeated redundant codes possibly exist due to repeated page definition.
According to an embodiment of the present application, there is provided a method for packaging a page, including: generating a network identification code matched with a current page to be packaged according to object attribute information of a component object contained in the current page to be packaged; searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page; and under the condition that the reference page similar to the current page to be packaged does not exist, packaging the current page to be packaged according to the attribute information of the component object in the current page to be packaged.
In an exemplary embodiment, generating, according to object attribute information of a component object included in a current page to be packaged, a network identifier matched with the current page to be packaged includes: determining the quantity information of the component objects and the type information of the component objects according to the object attribute information; determining a first character string corresponding to the quantity information and a second character string corresponding to the type information; and calculating the first character string and the second character string through a message digest algorithm to generate a network identification code matched with the current page to be packaged.
In an exemplary embodiment, before generating the network identifier matched with the current page to be packaged according to the object attribute information of the component object included in the current page to be packaged, the method further includes: acquiring a first script for scanning the current page to be packaged; running the first script to determine a component object of the current page to be packaged and quantity information of the component object through a selector in the first script, wherein the selector is used for positioning the component object on the current page to be packaged; and determining the type information of the component object according to the configuration information of the component object, wherein the configuration information is used for indicating the parameter configuration of the component object.
In an exemplary embodiment, acquiring a first script for scanning the current page to be packaged includes: automatically generating a second script according to a pre-recorded use case operation, wherein the use case operation is used for indicating the operation performed on the current page to be packaged; processing each row of codes of the second script to determine identification information of a current page to be packaged in the second script; determining a corresponding scanning method according to the identification information as a parameter, wherein the scanning method is a method for indicating to scan the component object on the current page to be packaged; the scanning method is inserted into the second script to generate the first script.
In one exemplary embodiment, automatically generating the second script based on the pre-recorded use case operations includes: determining a component object predefined by the system and attribute information of the component object; determining a selector corresponding to the current page object to be packaged according to the attribute information, wherein the selector is used for positioning the component object in the current page to be packaged; and generating the second script according to the selector and the use case operation.
In an exemplary embodiment, after packaging the current page to be packaged, the method further includes: determining a page object of the current page to be packaged according to the component object of the current page to be packaged; generating a target file according to the page object of the current page to be packaged and the application operation code corresponding to the current page to be packaged; and sending the target file to a terminal device so that the terminal device displays the target file.
In an exemplary embodiment, according to attribute information of the component object in the current page to be packaged, packaging the current page to be packaged includes: acquiring attribute information and configuration information of a plurality of component objects in the current page to be packaged; and packaging the plurality of component objects according to the attribute information and the configuration information to obtain a packaged current page to be packaged.
According to another embodiment of the embodiments of the present application, there is also provided a packaging apparatus for a page, including: the generating module is used for generating a network identification code matched with the current page to be packaged according to the object attribute information of the component object contained in the current page to be packaged; the searching module is used for searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is larger than a target threshold value, and the reference page is a packaged page; and the packaging module is used for packaging the current page to be packaged according to the attribute information of the component object in the current page to be packaged under the condition that the reference page similar to the current page to be packaged does not exist.
According to yet another aspect of the embodiments of the present application, there is also provided a computer readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the above-mentioned page packaging method when running.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the above-mentioned page packaging method through the computer program.
In the embodiment of the application, according to the object attribute information of the component object contained in the current page to be packaged, generating a network identification code matched with the current page to be packaged; searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page; under the condition that a reference page similar to the current page to be packaged does not exist, packaging the current page to be packaged according to the attribute information of the component object in the current page to be packaged; by adopting the technical scheme, the problems that a large number of repeated redundant codes possibly exist due to repeated page definition are solved, and the like.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of a method for encapsulating a page according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of packaging pages according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a method of packaging a page according to an embodiment of the present application;
FIG. 4 is a block diagram of a page packaging apparatus according to an embodiment of the present application;
fig. 5 is a block diagram (two) of a page packaging device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiment of the application, a page packaging method is provided. The page packaging method is widely applied to full-house intelligent digital control application scenes such as Smart Home (Smart Home), intelligent Home equipment ecology, intelligent Home (intelligent house) ecology and the like. Alternatively, in the present embodiment, the above-described page packaging method may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a method for packaging a page is provided and applied to a computer terminal, and fig. 2 is a flowchart of a method for packaging a page according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, generating a network identification code matched with a current page to be packaged according to object attribute information of a component object contained in the current page to be packaged;
the object attribute information includes: the number information of the component objects and the type information of the component objects.
Step S204, searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page;
it should be noted that, in the embodiment of the present invention, two conditions are used to identify a page: 1) A network address of the page; 2) The network identification code idCode of the page.
Step S206, under the condition that the reference page similar to the current page to be packaged does not exist, the current page to be packaged is packaged according to the attribute information of the component object in the current page to be packaged.
It should be noted that, in the case that there is a reference page similar to the current page to be packaged, the current page to be packaged is described as being packaged at this time, and in order to reduce the generation of redundant codes, the current page to be packaged is not packaged.
Through the steps, according to the object attribute information of the component object contained in the current page to be packaged, generating a network identification code matched with the current page to be packaged; searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page; under the condition that a reference page similar to the current page to be packaged does not exist, the current page to be packaged is packaged according to the attribute information of the component object in the current page to be packaged, so that the problem that a large number of repeated redundant codes possibly exist due to repeated page definition in the related technology is solved.
In an exemplary embodiment, generating, according to object attribute information of a component object included in a current page to be packaged, a network identifier matched with the current page to be packaged includes: determining the quantity information of the component objects and the type information of the component objects according to the object attribute information; determining a first character string corresponding to the quantity information and a second character string corresponding to the type information; and calculating the first character string and the second character string through a message digest algorithm to generate a network identification code matched with the current page to be packaged.
It should be noted that, in the embodiment of the present invention, the network identification code matched with the current page to be packaged is generated through the number information of the component objects and the type information of the component objects, and the specific is that: determining a first character string corresponding to the quantity information and a second character string corresponding to the type information; and calculating a third character string formed by the first character string and the second character string to obtain the network identification code matched with the current page to be packaged.
It should be noted that, the message digest algorithm in the present invention may be MD2, MD4, MD5, etc., which is not limited in this embodiment of the present invention.
Because the current front-end page is often advocated to be in the design style of a single page, the situation that page addresses are the same but page components are quite different is quite likely to occur, according to the method in the embodiment of the invention, the network identification code matched with the current page to be packaged can be generated, further different pages can be distinguished through the network address of the current page to be packaged and the network identification code of the current page to be packaged, and even if the network addresses of the pages are the same, the pages can still be distinguished through the network identification code matched with the current page to be packaged. According to the embodiment of the invention, different pages are distinguished through the network address of the current page to be packaged and the network identification code of the current page to be packaged, so that only one page is packaged for the page with the same network address and network identification code, and the technical effect of not repeatedly packaging the same page is achieved.
In an exemplary embodiment, before generating the network identifier matched with the current page to be packaged according to the object attribute information of the component object contained in the current page to be packaged, the method includes: acquiring a first script for scanning the current page to be packaged; running the first script to determine a component object of the current page to be packaged and quantity information of the component object through a selector in the first script, wherein the selector is used for positioning the component object on the current page to be packaged; and determining the type information of the component object according to the configuration information of the component object, wherein the configuration information is used for indicating the parameter configuration of the component object.
It should be noted that, a first script for scanning the current page to be packaged is run, and when the first script is scanned, all the component objects predefined by the system are traversed, and the component objects of the current page to be packaged are determined through a selector in the first script, so that under the condition of determining the component objects, the type information of the component objects is determined according to the configuration information of the component objects.
In an exemplary embodiment, acquiring a first script for scanning the current page to be packaged includes: automatically generating a second script according to a pre-recorded use case operation, wherein the use case operation is used for indicating the operation performed on the current page to be packaged; processing each row of codes of the second script to determine identification information of a current page to be packaged in the second script; determining a corresponding scanning method according to the identification information as a parameter, wherein the scanning method is a method for indicating to scan the component object on the current page to be packaged; the scanning method is inserted into the second script to generate the first script.
In the embodiment of the invention, a series of use case operations are recorded by using playwrite, a second script is automatically generated according to the recorded use case operations, each line of codes in the second script is processed, tag information of a current page to be packaged in the second script is used as a parameter, and a line of scanning method is inserted.
In one exemplary embodiment, automatically generating the second script based on the pre-recorded use case operations includes: determining a component object predefined by the system and attribute information of the component object; determining a selector corresponding to the current page object to be packaged according to the attribute information, wherein the selector is used for positioning the component object in the current page to be packaged; and generating the second script according to the selector and the use case operation.
It should be noted that, in the embodiment of the present invention, component objects used by the front end in high frequency are required to be defined according to the system, for example: the button component is pressed, and a scan_selector attribute is configured for the component object, wherein the scan_selector attribute is a selector used when scanning pages, and the component object is positioned on the current page to be packaged through the selector.
In an exemplary embodiment, after packaging the current page to be packaged, the method further includes: determining a page object of the current page to be packaged according to the component object of the current page to be packaged; generating a target file according to the page object of the current page to be packaged and the application operation code corresponding to the current page to be packaged; and sending the target file to a terminal device so that the terminal device displays the target file.
That is, at the end of script execution, a json file is automatically exported, where the json file includes: the page object of the current page to be packaged of the first script scanning plane and the application operating code corresponding to the current page to be packaged can be checked and maintained by a developer according to the json file.
In an exemplary embodiment, according to attribute information of the component object in the current page to be packaged, packaging the current page to be packaged includes: acquiring attribute information and configuration information of a plurality of component objects in the current page to be packaged; and packaging the plurality of component objects according to the attribute information and the configuration information to obtain a packaged current page to be packaged.
It should be noted that, the method for encapsulating the component object includes: the embodiment of the invention is not limited in terms of overall encapsulation and custom encapsulation.
In order to better understand the process of the above-mentioned page packaging method, the following description is given with reference to the optional embodiment to implement the above-mentioned page packaging method flow, but the method is not limited to the technical solution of the embodiment of the present application.
In this embodiment, a method for packaging a page is provided, and fig. 3 is a schematic diagram of a method for packaging a page according to an embodiment of the present application, as shown in fig. 3, specifically including the following steps:
step S301: component objects which are required to be used at high frequency according to the project definition front-end page;
defining a scan_selector attribute of a component object, such as a button component, the scan_selector attribute being a selector used when scanning a page, the selector being used to locate the component object on a front page;
step S302: recording a series of use case operations through playwrite, and generating a second script according to the use case operations;
step S303: based on the second script, each line of codes of the second script is processed, a page object in the second script is used as a parameter, and a scanning method corresponding to the page object in one line is inserted to obtain a first script;
step S304: running a first script to scan a front page;
when the front-end page is scanned, all the component objects defined in the front-end page are traversed, the component objects on the page are scanned according to the scan_selector attribute of the component objects, a page object is finally generated according to the component objects on the page, invalid data of the page object are removed, and an idCode value corresponding to the front-end page is generated by using an MD5 algorithm according to the number of the component objects and the types of the component objects;
step S305: and automatically exporting a json file after script operation is finished, wherein the json file comprises: a page object list corresponding to a front-end page and application operation codes corresponding to the front-end page related to the second script;
step S306: all the related page information in the running process of the first script is determined through the json file, and then the subsequent page packaging can distinguish the different pages according to the idCode and the page paths, so that the page packaging in the standard PO mode is completed.
According to the embodiment of the invention, the playwrite is used as an automation frame, the codeGen function of the playwrite can record page operation and generate codes, and the positioning of page elements is more reliable than other automation frames. Through the recording function and the designed scanning scheme, the development threshold is reduced, and after the script is developed, a user obtains the idCode value of the page, so that different pages are distinguished according to the idCode value and the network address of the page, and the package of the subsequent page is more standard.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
FIG. 4 is a block diagram of a page packaging apparatus according to an embodiment of the present application; as shown in fig. 4, includes:
the generating module 42 is configured to generate a network identifier matched with a current page to be packaged according to object attribute information of a component object included in the current page to be packaged;
a searching module 44, configured to search whether a reference page similar to the current page to be packaged exists or not by using the network identifier and the network address of the current page to be packaged, where a page similarity between the reference page and the current page to be packaged is greater than a target threshold, and the reference page is a packaged page;
and the packaging module 46 is configured to package the current page to be packaged according to the attribute information of the component object in the current page to be packaged when there is no reference page similar to the current page to be packaged.
By the device, the network identification code matched with the current page to be packaged is generated according to the object attribute information of the component object contained in the current page to be packaged; searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page; under the condition that a reference page similar to the current page to be packaged does not exist, the current page to be packaged is packaged according to the attribute information of the component object in the current page to be packaged, so that the problem that a large number of repeated redundant codes possibly exist due to repeated page definition in the related technology is solved.
In an exemplary embodiment, the generating module 42 is configured to determine the number information of the component objects and the type information of the component objects according to the object attribute information; determining a first character string corresponding to the quantity information and a second character string corresponding to the type information; and calculating the first character string and the second character string through a message digest algorithm to generate a network identification code matched with the current page to be packaged.
It should be noted that, in the embodiment of the present invention, the network identification code matched with the current page to be packaged is generated through the number information of the component objects and the type information of the component objects, and the specific is that: determining a first character string corresponding to the quantity information and a second character string corresponding to the type information; and calculating a third character string formed by the first character string and the second character string to obtain the network identification code matched with the current page to be packaged.
It should be noted that, the message digest algorithm in the present invention may be MD2, MD4, MD5, etc., which is not limited in this embodiment of the present invention.
Because the current front-end page is often advocated to be in the design style of a single page, the situation that page addresses are the same but page components are quite different is quite likely to occur, according to the method in the embodiment of the invention, the network identification code matched with the current page to be packaged can be generated, further different pages can be distinguished through the network address of the current page to be packaged and the network identification code of the current page to be packaged, and even if the network addresses of the pages are the same, the pages can still be distinguished through the network identification code matched with the current page to be packaged. According to the embodiment of the invention, different pages are distinguished through the network address of the current page to be packaged and the network identification code of the current page to be packaged, so that only one page is packaged for the page with the same network address and network identification code, and the technical effect of not repeatedly packaging the same page is achieved.
In one exemplary embodiment, fig. 5 is a block diagram of a structure of a packaging apparatus of a page according to an embodiment of the present application (ii); as shown in fig. 5, the apparatus further includes: an obtaining module 52, configured to obtain a first script for scanning the current page to be packaged; an operation module 54, configured to operate the first script to determine, by using a selector in the first script, a component object of the current page to be packaged, and quantity information of the component object, where the selector is configured to locate the component object on the current page to be packaged; a determining module 56, configured to determine type information of the component object according to configuration information of the component object, where the configuration information is used to indicate parameter configuration of the component object.
It should be noted that, a first script for scanning the current page to be packaged is run, and when the first script is scanned, all the component objects predefined by the system are traversed, and the component objects of the current page to be packaged are determined through a selector in the first script, so that under the condition of determining the component objects, the type information of the component objects is determined according to the configuration information of the component objects.
In an exemplary embodiment, the obtaining module 52 is configured to automatically generate a second script according to a pre-recorded use case operation, where the use case operation is used to indicate an operation performed on the current page to be packaged; processing each row of codes of the second script to determine identification information of a current page to be packaged in the second script; determining a corresponding scanning method according to the identification information as a parameter, wherein the scanning method is a method for indicating to scan the component object on the current page to be packaged; the scanning method is inserted into the second script to generate the first script.
In one exemplary embodiment, the obtaining module 52 is configured to determine a component object predefined by the system, and attribute information of the component object; determining a selector corresponding to the current page object to be packaged according to the attribute information, wherein the selector is used for positioning the component object in the current page to be packaged; and generating the second script according to the selector and the use case operation.
In an exemplary embodiment, a determining module 56 is configured to determine a page object of the current page to be packaged according to the component object of the current page to be packaged; generating a target file according to the page object of the current page to be packaged and the application operation code corresponding to the current page to be packaged; and sending the target file to a terminal device so that the terminal device displays the target file.
In an exemplary embodiment, the encapsulation module 54 is configured to obtain attribute information and configuration information of a plurality of component objects in the current page to be encapsulated; and packaging the plurality of component objects according to the attribute information and the configuration information to obtain a packaged current page to be packaged.
Embodiments of the present application also provide a storage medium including a stored program, wherein the program performs the method of any one of the above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, generating a network identification code matched with a current page to be packaged according to object attribute information of a component object contained in the current page to be packaged;
s2, searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page;
and S3, under the condition that the reference page similar to the current page to be packaged does not exist, packaging the current page to be packaged according to the attribute information of the component object in the current page to be packaged.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, generating a network identification code matched with a current page to be packaged according to object attribute information of a component object contained in the current page to be packaged;
s2, searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page;
and S3, under the condition that the reference page similar to the current page to be packaged does not exist, packaging the current page to be packaged according to the attribute information of the component object in the current page to be packaged.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices and, in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be implemented as individual integrated circuit modules, or as individual integrated circuit modules. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method for packaging a page, comprising:
generating a network identification code matched with a current page to be packaged according to object attribute information of a component object contained in the current page to be packaged;
searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is greater than a target threshold value, and the reference page is a packaged page;
and under the condition that the reference page similar to the current page to be packaged does not exist, packaging the current page to be packaged according to the attribute information of the component object in the current page to be packaged.
2. The method for packaging a page according to claim 1, wherein generating a network identification code matched with a current page to be packaged according to object attribute information of a component object contained in the current page to be packaged, comprises:
determining the quantity information of the component objects and the type information of the component objects according to the object attribute information;
determining a first character string corresponding to the quantity information and a second character string corresponding to the type information; and calculating the first character string and the second character string through a message digest algorithm to generate a network identification code matched with the current page to be packaged.
3. The method for packaging a page according to claim 2, wherein before generating the network identifier matched with the current page to be packaged according to the object attribute information of the component object included in the current page to be packaged, the method further comprises:
acquiring a first script for scanning the current page to be packaged;
running the first script to determine a component object of the current page to be packaged and quantity information of the component object through a selector in the first script, wherein the selector is used for positioning the component object on the current page to be packaged;
and determining the type information of the component object according to the configuration information of the component object, wherein the configuration information is used for indicating the parameter configuration of the component object.
4. A method of packaging a page according to claim 3, wherein obtaining a first script for scanning the current page to be packaged comprises:
automatically generating a second script according to a pre-recorded use case operation, wherein the use case operation is used for indicating the operation performed on the current page to be packaged;
processing each row of codes of the second script to determine identification information of a current page to be packaged in the second script;
determining a corresponding scanning method according to the identification information as a parameter, wherein the scanning method is a method for indicating to scan the component object on the current page to be packaged;
the scanning method is inserted into the second script to generate the first script.
5. The method of claim 4, wherein automatically generating the second script based on the pre-recorded use-case operation comprises:
determining a component object predefined by a system and attribute information of the component object;
determining a selector corresponding to the current page object to be packaged according to the attribute information, wherein the selector is used for positioning the component object in the current page to be packaged;
and generating the second script according to the selector and the use case operation.
6. The method for packaging a page according to any one of claims 1 to 5, wherein after packaging the current page to be packaged, the method further comprises:
determining a page object of the current page to be packaged according to the component object of the current page to be packaged;
generating a target file according to the page object of the current page to be packaged and the application operation code corresponding to the current page to be packaged;
and sending the target file to a terminal device so that the terminal device displays the target file.
7. The method for packaging a page according to any one of claims 1 to 5, wherein packaging the current page to be packaged according to attribute information of a component object in the current page to be packaged includes:
acquiring attribute information and configuration information of a plurality of component objects in the current page to be packaged;
and packaging the plurality of component objects according to the attribute information and the configuration information to obtain a packaged current page to be packaged.
8. A page packaging device, comprising:
the generating module is used for generating a network identification code matched with the current page to be packaged according to the object attribute information of the component object contained in the current page to be packaged;
the searching module is used for searching whether a reference page similar to the current page to be packaged exists or not by utilizing the network identification code and the network address of the current page to be packaged, wherein the page similarity between the reference page and the current page to be packaged is larger than a target threshold value, and the reference page is a packaged page;
and the packaging module is used for packaging the current page to be packaged according to the attribute information of the component object in the current page to be packaged under the condition that the reference page similar to the current page to be packaged does not exist.
9. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
CN202310187348.5A 2023-02-28 2023-02-28 Page packaging method and device, storage medium and electronic device Pending CN116382766A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310187348.5A CN116382766A (en) 2023-02-28 2023-02-28 Page packaging method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310187348.5A CN116382766A (en) 2023-02-28 2023-02-28 Page packaging method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116382766A true CN116382766A (en) 2023-07-04

Family

ID=86960552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310187348.5A Pending CN116382766A (en) 2023-02-28 2023-02-28 Page packaging method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116382766A (en)

Similar Documents

Publication Publication Date Title
CN116033006A (en) Data processing method, system, storage medium and electronic device
CN117573320A (en) Task node execution method and device, storage medium and electronic device
CN116382766A (en) Page packaging method and device, storage medium and electronic device
CN116225834A (en) Alarm information sending method and device, storage medium and electronic device
CN116107975A (en) Control method and device of equipment, storage medium and electronic device
CN116361155A (en) Method and device for testing software development kit, storage medium and electronic device
CN116360584A (en) Virtual target product generation method and device, storage medium and electronic device
CN114675928A (en) Container mirror image construction method and device, storage medium and electronic device
CN115168605A (en) Map determination method and apparatus, storage medium, and electronic apparatus
CN115934523A (en) Target test data generation method and device, storage medium and electronic device
CN115499333A (en) Method, system, storage medium and electronic device for determining association relationship
CN112148623B (en) LIMS-based intelligent complete scene test method
CN115002014B (en) Method and device for determining test result, storage medium and electronic device
CN116301767A (en) Interface file generation method and device, storage medium and electronic device
CN116723232A (en) Message pushing method and device, storage medium and electronic device
CN116243944A (en) Application interface updating method and device, storage medium and electronic device
CN116932846A (en) Method and device for determining data asset, storage medium and electronic device
CN116346686A (en) Information transmission method and device, storage medium and electronic device
CN115373958A (en) Method and device for determining abnormal information, storage medium and electronic device
CN116521673A (en) Database operation method and device, storage medium and electronic device
CN116521157A (en) Project integration method and device, storage medium and electronic device
CN116225456A (en) Program deployment method, device, storage medium and terminal
CN116383042A (en) Method and device for determining module to be tested, storage medium and electronic device
CN116450229A (en) Pre-starting method and device of application software, storage medium and electronic device
CN115481167A (en) Log processing method and device, storage medium and electronic device

Legal Events

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