CN116414635A - Page processing method, device, equipment, storage medium and computer program product - Google Patents

Page processing method, device, equipment, storage medium and computer program product Download PDF

Info

Publication number
CN116414635A
CN116414635A CN202111682924.0A CN202111682924A CN116414635A CN 116414635 A CN116414635 A CN 116414635A CN 202111682924 A CN202111682924 A CN 202111682924A CN 116414635 A CN116414635 A CN 116414635A
Authority
CN
China
Prior art keywords
view
page
layout
target
data
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
CN202111682924.0A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111682924.0A priority Critical patent/CN116414635A/en
Publication of CN116414635A publication Critical patent/CN116414635A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

A page processing method, a device, equipment, a storage medium and a computer program product are applied to various fields or scenes such as cloud technology, artificial intelligence, block chain, internet of vehicles, intelligent transportation, intelligent home and the like, and the method comprises the following steps: after loading of each view included in the first view set corresponding to the page to be processed is completed, matching actual display data of each view included in the first view set with reference display data; if the actual display data of the target view is not matched with the corresponding reference display data, sending a page processing request to a server; and receiving adjusted layout control data corresponding to the page to be processed, which is sent by the server in response to the page processing request, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view. According to the embodiment of the application, the abnormal display view can be accurately positioned, and the high efficiency and accuracy of the reduction test on the user interface are improved.

Description

Page processing method, device, equipment, storage medium and computer program product
Technical Field
The present invention relates to the field of computer technology, and in particular, to a page processing method, a page processing apparatus, a computer device, a computer readable storage medium, and a computer program product.
Background
The User Interface (UI) means an Interface between a person and a system, which refers to a set of methods for a User to interact with some systems, and a designer may design information such as each view, its position, its size, and the like included in the User Interface, and then implement the designed User Interface into an application program by a developer. The UI test comprises a UI reduction test, and whether the actually displayed user interface restores the designed user interface or not can be verified by comparing the actually displayed user interface with the designed user interface in human eyes, but the test mode is subjective, and a developer needs to spend a great deal of time to change the bottom code, when the bottom code is changed, the code needs to be recompiled and operated, and for some large-scale applications, the recompilation time is too long and is easy to cause clamping.
Disclosure of Invention
The embodiment of the application provides a page processing method, device, equipment, storage medium and computer program product, which can accurately position a view showing abnormality and improve the efficiency and accuracy of a reduction test on a user interface.
In one aspect, an embodiment of the present application provides a page processing method, which is applied to a page controller of a client, where the method includes:
after loading of each view included in a first view set corresponding to a page to be processed is completed, matching actual display data of each view included in the first view set with reference display data, wherein the first view set includes one or more views;
if the actual display data of the target view is not matched with the corresponding reference display data, sending a page processing request to a server, wherein the target view is any view included in the first view set;
and receiving adjusted layout control data corresponding to the page to be processed, which is sent by the server in response to the page processing request, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
In one aspect, an embodiment of the present application provides a method for processing a page, where the method includes:
receiving a page processing request sent by a client, wherein the page processing request is generated when the client determines that the actual display data of a target view in a first view set corresponding to a page to be processed is not matched with corresponding reference display data, and the first view set comprises one or more views;
Responding to the page processing request, and determining adjusted layout control data corresponding to the page to be processed;
and sending the adjusted layout control data to the client, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
In one aspect, an embodiment of the present application provides a page processing apparatus, which is applied to a page controller of a client, and includes:
the processing unit is used for matching actual display data of each view included in a first view set corresponding to a page to be processed with reference display data after loading of each view included in the first view set is completed, wherein the first view set comprises one or more views;
a sending unit, configured to send a page processing request to a server if actual display data of a target view is not matched with corresponding reference display data, where the target view is any view included in the first view set;
the receiving unit is used for receiving the adjusted layout control data corresponding to the page to be processed, which is sent by the server in response to the page processing request, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
In one aspect, an embodiment of the present application provides a page processing apparatus, where the apparatus includes:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a page processing request sent by a client, the page processing request is generated by the client when determining that the actual display data of a target view in a first view set corresponding to a page to be processed is not matched with corresponding reference display data, and the first view set comprises one or more views;
the processing unit is used for responding to the page processing request, determining adjusted layout control data corresponding to the page to be processed, wherein the layout control data comprises one or two of first layout data of the target view and second layout data of an associated view of the target view;
and the sending unit is used for sending the adjusted layout control data to the client, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
In one aspect, an embodiment of the present application provides a computer device, where the computer device includes a processor, a communication interface, and a memory, where the processor, the communication interface, and the memory are connected to each other, and the memory stores a computer program, and the processor is configured to invoke the computer program to execute a page processing method in any possible implementation manner.
In one aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a page processing method of any one of the possible implementations.
In one aspect, embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and executes the computer instructions to cause the computer device to perform the page processing method of any of the possible implementations described above.
In the embodiment of the present application, after loading of each view included in a first view set corresponding to a page to be processed is completed, matching actual display data of each view included in the first view set with reference display data, if the actual display data of a target view is not matched with the corresponding reference display data, sending a page processing request to a server, receiving adjusted layout control data corresponding to the page to be processed, which is sent by the server in response to the page processing request, where the adjusted layout control data is used for reloading one or more of associated views of the target view and the target view; according to the method, the abnormal display view can be accurately positioned, meanwhile, the target view and the associated view are reloaded through the adjusted layout control data, so that a developer can verify whether the page is restored again without changing the original bottom code of the view, and the efficiency and the accuracy of restoring test on the user interface can be improved.
Drawings
In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a system architecture of a page processing system according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of a page processing method according to an embodiment of the present application;
fig. 3 is a second schematic flow chart of a page processing method according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a page processing method according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a relationship between a page controller and a page according to an embodiment of the present disclosure;
fig. 6 is a flow chart diagram of a page processing method according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a page processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram ii of a page processing apparatus according to an embodiment of the present application;
Fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical methods in the embodiments of the present application will be clearly and fully described in the following description with reference to the accompanying drawings in the embodiments of the present application, and 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, are intended to be within the scope of the present application.
Description of terms related to embodiments of the present application:
1. cloud technology
Cloud Technology (Cloud Technology) is a generic term of network Technology, information Technology, integration Technology, management platform Technology, application Technology and the like based on Cloud computing business model application, and can form a resource pool, so that the Cloud computing business model application system is flexible and convenient as required. Cloud computing technology will become an important support. Background services of technical networking systems require a large amount of computing, storage resources, such as video websites, picture-like websites, and more portals. Along with the high development and application of the internet industry, each article possibly has an own identification mark in the future, the identification mark needs to be transmitted to a background system for logic processing, data with different levels can be processed separately, and various industry data needs strong system rear shield support and can be realized only through cloud computing.
2. Artificial intelligence
Artificial intelligence (Artificial Intelligence, AI) is the theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and extend human intelligence, sense the environment, acquire knowledge and use the knowledge to obtain optimal results. In other words, artificial intelligence is an integrated technology of computer science that attempts to understand the essence of intelligence and to produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence, i.e. research on design principles and implementation methods of various intelligent machines, enables the machines to have functions of sensing, reasoning and decision.
3. Block chain
Blockchains are novel application modes of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
4. View(s)
Views (views) are the base classes of all controls in the operating system, whether simple Text views (Text views), buttons (buttons) or complex Linear Layout (Linear Layout) and List views (List views), the common base classes of which are views; a view is an abstraction of a control of an interface layer, representing a control.
The page processing method provided by the embodiment of the application can be applied to various fields or scenes such as cloud technology, artificial intelligence, block chain, internet of vehicles, intelligent transportation, intelligent home and the like. In one embodiment, the page processing method may be applied in Cloud technology (Cloud technology) scenarios. The page processing method can be specifically realized by applying cloud technology related to a cloud technology scene; for example: in the page processing method of the embodiment of the application, the cloud server can respond to the page processing request.
In another implementation, the page processing method provided in the embodiments of the present application may be applied to an artificial intelligence (Artificial Intelligence, AI) scenario. The page processing method can be realized by one or more of distributed storage and big data processing technologies in an artificial intelligence basic technology related to an artificial intelligence scene; for example: in the page processing method of the embodiment of the application, layout control data, reference display data and the like can be stored in a distributed storage mode.
In a possible implementation manner, the page processing method provided in the embodiment of the present application may be applied to a blockchain scenario, for example: in the page processing method of the embodiment of the present application, data required for executing the page processing method may be stored in a block form on a blockchain; data (e.g., layout control data, etc.) resulting from performing the page processing method may be stored in blocks on the blockchain; in addition, the computer device performing the page processing method may be a node device in a blockchain network.
Referring to fig. 1, fig. 1 is a schematic system architecture diagram of a page processing system according to an embodiment of the present application; the system architecture shown in fig. 1 can be used to implement the page processing method proposed in the embodiment of the present application. As shown in fig. 1, the system architecture includes: a server 10 and a plurality of clients 11 (3 are shown as an example).
The server 10 may be a server with a data processing function, may be an independent physical server, may be a server cluster or a distributed system formed by a plurality of physical servers, and may be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The client 11 may refer to a program corresponding to a server, which provides a local service for a client, and may be deployed on a terminal device, which may be a smart phone, a tablet computer, a notebook computer, a desktop computer, an intelligent voice interaction device, an intelligent home appliance, a vehicle-mounted terminal, or the like. The clients 11 and the servers 10 shown in fig. 1 are connected through a network, and the number of the clients 11 may be several or tens, or more, and the number of the clients is not limited in this application.
The system architecture shown in fig. 1 may implement the page processing method provided in the embodiment of the present application, where an implementation flow of the method approximately includes:
(1) after loading of each view included in the first view set corresponding to the page to be processed is completed, the client 11 matches actual display data of each view included in the first view set with reference display data, where the first view set includes one or more views.
(2) If the actual display data of the target view does not match the corresponding reference display data, the client 11 sends a page processing request to the server 10, where the target view is any view included in the first view set.
(3) The server 10 determines, in response to the page processing request sent by the client 11, adjusted layout control data corresponding to the page to be processed, where the adjusted layout control data includes one or both of first layout data of the target view and second layout data of an associated view of the target view.
(4) The server 10 transmits the adjusted layout control data to the client 11.
(5) The client 11 receives the adjusted layout control data transmitted from the server 10, and reloads one or more of the target view and the associated view according to the adjusted layout control data.
In the method, the actual display data and the reference display data are matched, so that the abnormal display view can be accurately positioned, and meanwhile, the target view and the associated view are reloaded by directly utilizing the adjusted layout control data, so that a developer can verify whether the page is restored again without changing the original bottom code of the view, and the efficiency and the accuracy of restoring the user interface can be improved.
It may be understood that the schematic diagram of the system architecture described in the embodiments of the present application is for more clearly describing the technical method of the embodiments of the present application, and does not constitute a limitation on the technical method provided in the embodiments of the present application, and those skilled in the art will recognize that, as the system architecture evolves and new service scenarios occur, the technical method provided in the embodiments of the present application is applicable to similar technical problems.
The page processing method provided by the embodiment of the application is briefly described above, and a specific implementation manner of the page processing method is described in detail below.
Referring to fig. 2, fig. 2 is a schematic flow chart of a page processing method according to an embodiment of the present application. The page processing method may be performed by the client 11 in fig. 1, and in particular may be performed by a page controller of the client. The method comprises the following steps S201-S203:
S201, after loading of each view included in a first view set corresponding to a page to be processed is completed, actual display data of each view included in the first view set is matched with reference display data, and the first view set includes one or more views.
The page to be processed is a user interface for performing a restore test, and may be one or more, and the following steps are described by taking one page to be processed as an example. There are one or more views in the page to be processed, and the first set of views may include all or part of the views in the page to be processed; for example: the page to be processed is a video playing page, and the first view set can comprise all views of the video playing page, all views of a video playing module in the video playing page, and all views of a popup window in the video playing page. Popup window refers to a window that pops up automatically when a web page, an application program, etc. are opened, and is usually triggered by some logic, and a floating layer covered on a screen page, a prompt box, a control, etc. are called popup window.
Before developing the page to be processed, a design specification of the page to be processed is defined in advance. The design specification includes attribute data corresponding to attributes defined for the page to be processed. The attributes may include: the position, width, height, color, transparency, shape of the view in the screen, the content of text in the view, font size, color, alignment, child view of the view, parent view, etc. A developer designs drawing logic of a page to be processed according to design specifications, attribute data of the view can be used for determining actual display data of the view when the page to be processed is displayed in a client according to the drawing logic, and the attribute data defined in the design specifications of the page to be processed can be used for determining reference display data of the view; for example: attribute data such as the color, transparency and shape of the view, the content of text in the view, fonts and the like which are not affected by the resolution of the terminal equipment can be directly used as actual display data and reference display data; attribute data such as the position, width, height, word size of text in view, etc. of the view, which is affected by the resolution of the terminal device, requires a certain transformation of the attribute data in order to obtain the actual display data and the reference display data. For example, the resolution of the design specification is 1024 (lateral resolution) ×768 (longitudinal resolution), the terminal device is reduced by 0.7 times relative to the lateral resolution 1024, the width of the design for the view is multiplied by 0.7 and then is used as the reference display data of the view, and the width of the view displayed in the client is used as the actual display data of the view; for another example, the location designed for the view is (x, y), then y/x may be used as the reference display data of the view, and then the location of the view displayed in the client may be converted to the form of y/x as the actual display data of the view.
In an embodiment, after loading the views included in the first view set, the page controller may match the actual display data of the views with the reference display data, and it should be understood that each view has corresponding reference display data.
S202, if the actual display data of the target view is not matched with the corresponding reference display data, sending a page processing request to a server, wherein the target view is any view included in the first view set.
The target view is a view in which the actual display data does not match the corresponding reference display data, indicating that the target view does not meet the layout requirements defined by the design specification. In an implementation manner, if the actual display data of the first view is inconsistent with the corresponding reference display data in each view included in the first view set, determining the first view as the target view; or if the ratio of the actual display data of the second view to the corresponding reference display data in each view included in the first view set is greater than the ratio threshold (which can be set manually), determining the second view as the target view. For example, setting the scale threshold to 2%, when the attributes including position, width, height, color, transparency, and shape of the view and the actual display data of the view 1 are matched with the corresponding reference display data, it is determined that the width of the view is inconsistent, and when other attributes are consistent, the inconsistent scale is 16.7% (1/16), and then the view 1 is regarded as the target view. When the actual display data of the target view is not matched with the corresponding reference display data, the page controller can send a page processing request to the server, wherein the page processing request can be used for requesting the server to redetermine the drawing logic of the target view and the associated view in the page to be processed.
S203, receiving adjusted layout control data corresponding to the page to be processed, which is sent by the server in response to the page processing request, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
An associated view is a view that has a relative layout relationship with the target view, which may relate to position (e.g., view 1 to the left of view 2), transparency (e.g., transparency of view 2 is 0 when transparency of view 1 is 1), layer relationship (e.g., view 1 is on top of view 2), etc. The relative layout relationship includes two cases: one is that the layout of the associated view is directly referenced to the target view. For example, if view 1 is specified to be close to the upper boundary of the target view, when the target view is moved, view 1 will also move along with the target view, and the layout of view 1 is considered to be directly based on the target view; for another example, it is specified that view 1 is located at the upper layer of the target view, and when the target view is changed from view 2 to be located at the upper layer of view 3, view 1 is also changed from view 2 to be located at the upper layer of view 3, and the layout of view 1 is considered to be directly based on the target view. The other is that the layout of the associated view is indirectly referenced to the target view (or that the layout of the associated view is directly referenced to the other associated view). For example: when the upper boundary of view 1 close to the target view is specified and the upper boundary of view 2 close to view 1, then when the target view is moved, view 1 will move with the target view, view 2 will move with view 1, and the layout of view 2 is considered to be indirectly based on the target view.
When loading a target view and an associated view included in a page to be processed, the page controller uses original layout control data of the target view and the associated view, and the server responds to a page processing request to return the adjusted layout control data which is redefined for the target view and/or the associated view. The adjusted layout control data includes at least one of: (1) layout rules (for describing the relative layout relationship between views), such as a layout rule that the rightward shift amount of the position of the target view relative to the parent view is 50px; (2) layout data equivalent to but not exactly identical to attribute data possessed by the view at the time of client display, for example, colors in the layout data are in RGB format, colors in the attribute data are in HEX format, because the layout data may be obtained according to a layout rule which is a calculation using color values in RGB format, RGB format is converted into HEX format at the time of display, and the layout data and attribute data are identical for attribute data such as position; the page controller can load the target view and the associated view again by using the adjusted layout control data to obtain the adjusted target view and the associated view.
It will be appreciated that layout data may be obtained by layout rules. If the distance from the left boundary of the target view to the left boundary of the parent view is 50px and the distance from the left boundary of the parent view to the left boundary of the page is 10px, the distance from the left boundary of the target view to the left boundary of the page is 60px.
In one embodiment, steps S201-S203 may be performed again after the adjusted target view and associated view loading is completed. At this time, the first view set may include only the adjusted target view and the associated view; and the method can also comprise the adjusted target view and the adjusted associated view, and views except the target view and the associated view in the original first view set, so that the efficiency and the accuracy of the reduction test on the user interface can be improved.
In the embodiment of the application, after loading of each view included in a first view set corresponding to a page to be processed is completed, actual display data of each view included in the first view set is matched with reference display data; if the actual display data of the target view is not matched with the corresponding reference display data, sending a page processing request to a server; receiving adjusted layout control data corresponding to a page to be processed, which is sent by a server in response to a page processing request, wherein the adjusted layout control data is used for reloading one or more of the target view and associated views of the target view; according to the method, the actual display data and the reference display data are matched, so that the abnormal display view can be accurately positioned, meanwhile, the target view and the associated view are reloaded by directly utilizing the adjusted layout control data, a developer can verify whether the page is restored again without changing the original bottom code of the view, and the efficiency and the accuracy of restoring test on the user interface can be improved.
Referring to fig. 3, fig. 3 is a second flowchart of a page processing method according to an embodiment of the present application. The page processing method may be performed by the server 10 in fig. 1. The method comprises the following steps S301-S303:
s301, receiving a page processing request sent by a client, wherein the page processing request is generated when the client determines that actual display data of a target view in a first view set corresponding to a page to be processed is not matched with corresponding reference display data, and the first view set comprises one or more views.
The detailed implementation process of S301 may refer to steps S201-S202, which are not described in detail in this embodiment.
S302, responding to the page processing request, and determining adjusted layout control data corresponding to the page to be processed.
In an embodiment, the adjusted layout control data includes one or both of first layout data of the target view and second layout data of an associated view of the target view. The first layout data is for reloading the target view, the first layout data including at least one of: (1) the layout rule of the target view, for example, the first layout data may be that the distance from the left boundary of the target view to the left boundary of the page is 50px; (2) layout data, such as first layout data, for the target view is the absolute position (60, 50) of the target view in the screen. The second layout data is for reloading the associated view of the target view, the second layout data comprising at least one of: (1) the layout rule of the associated view, for example, the second layout data may be that the left boundary of the associated view is 10px from the left boundary of the target view; (2) layout data of the associated view, such as the second layout data, is 60px from the left boundary of the associated view from the left boundary of the page.
S303, sending the adjusted layout control data to the client, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
In an implementation manner, the adjusted layout control data may include first layout data of the target view, and the page controller of the client may obtain the first layout data of the target view and an original layout rule of an associated view of the target view, where the original layout rule of the associated view is an original layout rule of the associated view when the page to be processed is loaded. When the first layout data is the layout data of the target view, the page controller can reload the target view and the associated view according to the layout data of the target view and the original layout rule of the associated view, and when the first layout data is the layout rule of the target view, the layout data of the target view can be obtained according to the layout rule of the target view, and then the target view and the associated view can be reloaded according to the layout data of the target view and the original layout rule of the associated view. For example: if the first layout data includes that the distance from the left boundary of the target view to the left boundary of the parent view is 50px, the distance from the left boundary of the parent view to the left boundary of the page is 10px, the distance from the left boundary of the target view to the left boundary of the page is 60px, the drawing logic about the left boundary of the target view can be obtained according to 60px, and the original layout rule of the associated view includes that the distance from the left boundary of the associated view to the left boundary of the target view is 10px, when the left boundary of the target view is obtained, the distance from the left boundary of the associated view to the left boundary of the page is 60px, and the distance from the left boundary of the associated view to the left boundary of the page is 60px as the drawing logic about the left boundary of the associated view.
In an implementation, the adjusted layout control data may include first layout data of the target view and second layout data of an associated view of the target view, and the page controller of the client may reload the target view and the associated view according to the first layout data of the target view and the second layout data of the associated view of the target view. For example: if the first layout data is that the distance from the left boundary of the target view to the left boundary of the parent view is 50px, the distance from the left boundary of the parent view to the left boundary of the page is 10px, and the distance from the left boundary of the target view to the left boundary of the page is 60px, and according to 60px, the drawing logic about the left boundary of the target view can be obtained, and the second layout data is that the distance from the left boundary of the associated view to the left boundary of the page is 70px, and then one drawing logic about the left boundary of the associated view can be obtained. The first layout data may be the layout data of the target view, and the second layout data may be the layout data of the associated view, so that the page controller of the client does not need to calculate according to the layout rule any more, and the layout efficiency may be improved.
In an embodiment, the adjusted layout control data may include second layout data for an associated view of the target view. (1) When the second layout data includes layout data of the associated view, the page controller of the client may acquire the layout data of the associated view and an original layout rule of the associated view of the target view, and reload the target view and the associated view according to the layout data of the associated view and the original layout rule of the associated view. For example: the second layout data is that the distance from the left boundary of the associated view to the left boundary of the page is 60px, which is used as one drawing logic related to the left boundary of the associated view, meanwhile, the original layout rule of the associated view is that the distance from the left boundary of the associated view to the left boundary of the target view is 10px, the distance from the left boundary of the associated view to the left boundary of the page is 60px, the distance from the left boundary of the target view to the left boundary of the page is 50px, and the distance from the left boundary of the target view to the left boundary of the page is 50px, which is used as one drawing logic related to the left boundary of the target view. (2) When the second layout data includes the layout data of the associated view and the layout rule of the associated view, the page controller of the client may reload the associated view according to the layout data of the associated view, and obtain the layout data of the target view according to the layout data of the associated view and the layout rule of the associated view, and reload the target view with the layout data of the target view. (3) When the second layout data includes the layout rule of the associated view, the page controller of the client can reload the target view and the associated view according to the original layout data of the target view and the layout rule of the associated view, wherein the original layout data of the target view is the original layout data of the target view when the page to be processed is loaded.
It should be noted that, the number of the associated views may be one or more, and all the associated views may be reloaded by using the second layout data according to actual application requirements, or only a part of the associated views may be reloaded.
In this embodiment of the present invention, the server may determine that the adjusted layout control data includes one or two of the first layout data of the target view and the second layout data of the associated view of the target view, so that the client may reload one or more of the target view and the associated view of the target view according to the adjusted layout control data, so that a developer may verify whether the page is restored again without changing the original underlying code of the view, thereby improving the efficiency and accuracy of the restoration test for the user interface, and simultaneously, by matching the actual display data with the reference display data, may accurately locate the view with abnormal display, and may improve the accuracy of the restoration test for the user interface.
Referring to fig. 4, fig. 4 is a flowchart illustrating a page processing method according to an embodiment of the present application. The page processing method may be performed jointly by the server 10 and the client 11 in fig. 1, and in particular may be performed jointly by the page controllers of the server and the client. The method comprises the following steps S401-S405:
S401, after loading of each view included in the first view set corresponding to the page to be processed is completed, the client matches actual display data of each view included in the first view set with reference display data.
In one embodiment, when the client detects a page load event for each view included in the first view set, the client's page controller may obtain a lifecycle code template having a code structure of a lifecycle function, which may be one or more, and may include initialization/creation (init), destruction (dealloy), addition (didaddbview), movement (didMoveToSuperview/didMoveToWindow), removal (didMoveToSuperview/didMoveToWindow), layout sub-views (layoutsub-views), drawing (drawRect), and the like. Further, the life cycle rule parameters of all the views included in the first view set are obtained, the life cycle rule parameters of all the views are filled into a life cycle code template to determine the life cycle functions of all the views, and accordingly the life cycle functions of all the views are called to load all the views. The lifecycle template code and lifecycle rule parameters can be loaded in the memory of the client to reduce the time to request from the server.
Each view is a container, other views may be loaded, there is a parent-child relationship between the loaded view in the container and the view corresponding to the container, the view may have a parent view, and there may be one or more child views. For example, in pending page 0 of fig. 5, view 0 is the parent view of view 1 and view 2, view 1 is the parent view of view 3, and view 2 is the parent view of view 4 and view 5. In an implementation manner, the client may acquire a parent-child relationship between each view included in the first view set, and sequentially determine whether actual display data of each view matches corresponding reference display data according to the parent-child relationship between each view. For example: the tree structure data of the first view set can be established according to father-son relations among the views, and the tree structure data comprises nodes corresponding to the views; the nodes corresponding to the father view and the son view can be connected through a directed edge, the head of the directed edge is the father view, and the tail of the directed edge is the son view of the father view; the node for which the parent view does not exist is referred to as the root node. Each node can be checked layer by layer from the root node of the tree structure data, the actual display data of the view corresponding to the checked node is matched with the corresponding reference display data, if the actual display data of the view corresponding to the checked node is not matched with the corresponding reference display data, the view corresponding to the checked node is determined to be the view of which the actual display data is not matched with the corresponding reference display data, the view of which the actual display data is not matched with the corresponding reference display data is obtained, the view is determined to be the target view, and the checking is stopped.
In an implementation, the page controller may load each view in the first view set according to the tree structure data of the first view set, and the loading order and the drawing order of each view may be determined according to a parent-child relationship between views, for example, a parent view is loaded first, a child view is loaded later, and child views of the child view are loaded later.
The page to be processed corresponds to a reference page, wherein the reference page is a standard page obtained according to the design specification of the page to be processed, and has attribute data defined by the design specification. The display profile of the reference page includes attribute data defined by the design specification, e.g., the display profile may include the position, width, height, color, transparency, shape of the view in the screen, the content of text in the view, font size, color, alignment, child view, parent view of the view, and so forth. In an embodiment, for any view in the first view set, the client may obtain, from a display configuration file of a reference page corresponding to the page to be processed, reference display data corresponding to a key attribute of the any view; the key attributes are the attributes necessary for generating any view, and can be understood as the attributes which are included in the view and are irrelevant to the child view, such as the child view, the parent view, and the position, width, height, color, etc. of the child view in the screen, which are not key attributes. Further, acquiring actual display data corresponding to the key attribute of any view; determining whether the reference display data corresponding to the key attribute is matched with the actual display data corresponding to the key attribute; when the reference display data corresponding to the key attribute is matched with the actual display data corresponding to the key attribute, determining that the actual display data of any view is matched with the corresponding reference display data; and when the reference display data corresponding to the key attribute is not matched with the actual display data corresponding to the key attribute, determining that the actual display data of any view is not matched with the corresponding reference display data, and taking any view as a target view.
S402, if the actual display data of the target view is not matched with the corresponding reference display data, the client sends a page processing request to the server.
S403, the server responds to a page processing request sent by the client, and determines adjusted layout control data corresponding to the page to be processed, wherein the adjusted layout control data comprises one or two of first layout data of the target view and second layout data of an associated view of the target view.
In an embodiment, when a page load event of a page to be processed occurs, a page controller of the client may invoke a view monitor (view monitor) module to monitor a lifecycle state of each view included in the first view set, where the view monitor module may be created by the page controller of the client, and the lifecycle state is determined by an invoked lifecycle function, for example, the currently invoked lifecycle function is init, which indicates that the lifecycle state of the view is creation/initialization; meanwhile, when the page to be processed is loaded, the Viewmonitor module can monitor the interaction between the page to be processed and the server, like some instant contents (such as news) are required to be sent by the server; when the page controller determines that the lifecycle state of each view indicates that loading of each view is completed, or, when the page controller determines that loading of each view is completed according to the message notified by the viewdlayoutsubviews method, the page controller invokes the view monitoring module to send view information of the page to be processed to the server, where the view information includes a first view set and parent-child relationships between each view included in the first view set, and the view information may specifically be tree structure data of the first view set.
Further, the server may store view information of the page to be processed sent by the client, and when the server receives a page processing request sent by the client, determine, according to the first view set and a parent-child relationship between each view in the first view set, a second view set corresponding to the target view, where the second view set includes a view taking a parent view of the target view as an ancestor view in the first view set. Ancestral views can be understood as: if view 1 is the parent view of view 2, view 2 is the parent view of view 3, view 3 is the parent view of view 4, then view 1 is the ancestor views of view 2, view 3, and view 4, view 2 is the ancestor views of view 3 and view 4, and view 3 is also the ancestor view of view 4. In an implementation manner, the page processing request carries an identifier of a parent view of the target view (the identifier is used for uniquely identifying the parent view), the server can determine a node corresponding to the parent view from tree structure data of the first view set according to the identifier of the parent view of the target view, the node corresponding to the parent view will be below a horizon where the node corresponding to the parent view is located, and a view directly or indirectly connected with the parent view exists as a view included in the second view set. Further, an associated view of the target view is determined from the views included in the second view set, and the associated view may be a sibling view of the target view (the sibling view has the same parent view as the target view), a descendant view of the sibling view of the target view (a view with the sibling view as an ancestor view), or a descendant view of the target view (a view with the target view as an ancestor view).
In an embodiment, when determining that the actual display data of the target view does not match the corresponding reference display data, the page controller of the client may acquire the abnormal data, where the abnormal data is the layout data in which the actual display data does not match the corresponding reference display data, and feed back the abnormal data to the developer, where the developer reconfigures the layout rule and/or the layout data for the target view, and the server may use the layout rule reconfigured for the target view as the first layout data of the target view, or use the layout data reconfigured for the target view and the layout rule as the first layout data of the target view; further, the server acquires a relative layout relation between the associated view and the target view, and determines second layout data of the associated view according to the relative layout relation between the associated view and the target view and the first layout data of the target view.
In an embodiment, if the first layout data is a layout rule configured for the target view, the layout data of the target view may be determined according to the layout rule of the target view. For example, if the layout rule is that the distance from the left boundary of the target view to the left boundary of the parent view is 50px, the distance from the left boundary of the parent view to the left boundary of the page is 10px, and the distance from the left boundary of the target view to the left boundary of the page is 60px (i.e., the layout data of the target view); since the relative layout relationship includes two cases, an associated view with the layout directly taking the target view as a reference is taken as a first type of associated view, an associated view with the layout indirectly taking the target view as a reference is taken as a second type of associated view, when the associated view is the first type of associated view, the layout data of the first type of associated view can be determined according to the layout data of the target view and the layout rule of the first type of associated view, and the layout data of the first type of associated view is taken as second layout data of the first type of associated view, for example: if the distance between the left boundary of the associated view 1 and the left boundary of the target view is 10px, the distance between the left boundary of the associated view 1 and the left boundary of the target view may be 50px, and the distance between the left boundary of the associated view 1 and the left boundary of the page may be 60px, and the 60px may be used as the second layout data of the associated view 1; when the associated view is the second type of associated view, determining a target associated view corresponding to the second type of associated view (the layout of the second type of associated view is directly based on the target associated view), and determining layout data of the second type of associated view according to the layout data of the target associated view and the layout rule of the second type of associated view, for example: if the distance from the left boundary of the associated view 1 to the left boundary of the page is 70px, the distance from the left boundary of the associated view 2 to the left boundary of the associated view 1 is 10px, and the distance from the left boundary of the associated view 2 to the left boundary of the page is 80px.
In a specific implementation manner, when receiving view information of a page to be processed sent by a client, a server may generate an actor object for each view according to a distributed parallel computing model (abbreviated as an actor object model). Each actor object in the actor object model is a most basic calculation unit performing task processing, which can receive one message and perform calculation based thereon, and can set the state (status) of the actor object corresponding to each view in view information to wait (wait). In addition, status of the existence of the actor object 0 in the actor object model is waiting for execution (loop); when a page processing request sent by a client is received, an actor object corresponding to a target view is an actor object 0; when layout rules or layout data are configured for the target view, the state of actor object 0 may be set to executing (active), indicating that the child thread is turned on. The actor object 0 associates the actor object corresponding to the association view with the actor object 0, and obtains layout data included in the sub-actor object according to the layout data of the target view and the layout rules between the actor object 0 and the sub-actor object. The sub-actor objects correspond to the first type of associated views, the layout data included in the sub-actor objects are the layout data of the first type of associated views, and the layout rules between the actor objects 0 and the sub-actor objects are the layout rules of the first type of associated views. And when the calculation of the sub-actor object is finished, taking the sub-actor object as a new actor object 0, and taking a reference associated view corresponding to the first associated view (the layout of the reference associated view is directly based on the first associated view) as the new sub-actor object to continue to be executed, and when the calculation of the new sub-actor object is finished, and so on, continuing to execute the sub-actor object aiming at the next new sub-actor object until the new sub-actor object does not exist. When the sub-thread stops, the status of actor object 0 is reset to loop, and at this time, each associated view gets layout data.
In an embodiment, when the server processes the page processing request, status of the actor object 0 is set as active from loop, so the server may obtain the number of loops when receiving other page processing requests, if the number of loops is 0, it indicates that the server needs to create a new actor object and a new thread.
S404, the server sends the adjusted layout control data to the client.
In an implementation, the server may send first layout data to the client, where the first layout data may be layout rules and/or layout data configured for the target view; or may send second layout data to the client, which may be layout rules and/or layout data for the associated view of the target view; or the first layout data and the second layout data may be sent to the client.
S405, the client receives the adjusted layout control data sent by the server, and reloads the target view and the associated view according to the adjusted layout control data.
In an embodiment, if the adjusted layout control data includes the first layout data of the target view, the client may invoke the view monitoring module to determine the first loading control parameter of the target view according to the first layout data. If the first layout data comprises the layout data of the target view, taking the layout data of the target view as a first loading control parameter; if the first layout data comprises the layout rule of the target view, determining the layout data of the target view according to the layout rule of the target view, and taking the layout data of the target view as a first loading control parameter; if the first layout data includes the layout rule of the target view and the layout data of the target view, the layout data of the target view is used as the first loading control parameter, or the layout data of the target view is determined according to the layout rule of the target view, and then the layout data of the target view is used as the first loading control parameter. Determining layout data of the associated view by utilizing the first loading control parameters and the original layout rules of the associated view of the target view, and taking the layout data of the associated view as second loading control parameters of the associated view. The page controller may utilize a run time mechanism to import the first load control parameter of the target view and the second load control parameter of the associated view into the corresponding view to reload the target view and the associated view. The run time mechanism can directly modify or replace the layout rules and layout data of the view under the condition that the view is not destroyed, so that view recompilation can be avoided, and the high efficiency and accuracy of restoring test on the user interface are improved.
In an embodiment, if the adjusted layout control data includes the second layout data of the associated view of the target view, when the second layout data includes the layout data of the associated view, the layout data of the associated view is used as the second loading control parameter, the layout data of the target view is obtained according to the original layout rule of the associated view and the layout data of the associated view, and the layout data of the target view is used as the first loading control parameter of the target view; when the second layout data comprises the layout rule of the associated view, determining the layout data of the associated view according to the layout rule of the associated view and the original layout data of the target view, wherein the layout data of the associated view is used as a second loading control parameter, and the original layout data of the target view is used as a first loading control parameter of the target view; when the second layout data comprises the layout data of the associated view and the layout rule of the associated view, the layout data of the associated view is used as a second loading control parameter of the associated view, the layout data of the target view is obtained according to the layout data of the associated view and the layout rule of the associated view, and the layout data of the target view is used as a first loading control parameter of the target view. The page controller may utilize a run time mechanism to import the first load control parameter of the target view and the second load control parameter of the associated view into the corresponding view to reload the target view and the associated view. The run time mechanism can directly modify or replace the layout rules and layout data of the view under the condition that the view is not destroyed, so that view recompilation can be avoided, and the high efficiency and accuracy of restoring test on the user interface are improved.
In an embodiment, the adjusted layout control data includes first layout data for the target view and second layout data for an associated view of the target view. The first layout data may be one or both of layout data and layout rules of the target view, and when the first layout data is the layout rules of the target view, the client obtains the layout data of the target view according to the layout rules of the target view, and uses the layout data of the target view as the first loading control parameter of the target view. The second layout data may be one or both of a layout rule of the associated view and layout data of the associated view, and when the second layout data is the layout rule of the associated view, the layout data of the associated view may be obtained according to the layout rule of the associated view and the layout data of the target view, and the layout data of the associated view may be used as the second loading control parameter of the associated view. And the first loading control parameter of the target view and the second loading control parameter of the associated view are transmitted to the corresponding view by utilizing a runtime mechanism so as to reload the target view and the associated view, so that the efficiency and the accuracy of the restoration test on the user interface can be improved.
Referring to fig. 5, each page to be processed corresponds to a page controller, and a developer may determine a configuration file (which may include a lifecycle rule parameter, a display configuration file of a reference page, an original layout rule or layout data of a view, etc.) of each page to be processed and write the configuration file into the page controller, and the page controller performs each step instead of the client.
According to the embodiment of the application, the actual display data of the view and the reference display data are matched, the view with abnormal display can be accurately positioned, and meanwhile, the target view and the associated view are reloaded by directly utilizing one or two of the first layout data and the second layout data included in the adjusted layout control data, so that a developer does not need to change the original bottom code of the view, whether the page is restored or not can be verified again, and the efficiency and the accuracy of restoring test on the user interface can be improved.
Referring to fig. 6, fig. 6 is a flowchart illustrating a page processing method according to an embodiment of the present application. The method comprises the following steps: after the page to be processed is loaded, the actual display data of the target view in the page to be processed can be matched with the reference display data (specifically, the actual display data corresponding to the key attribute of the target view is matched with the reference display data corresponding to the key attribute), and if the actual display data of the target view is matched with the reference display data, the next view is obtained to be matched continuously; if the actual display data of the target view is not matched with the reference display data, the actor object corresponding to the target view is actor object 0, and when the layout rule or the layout data is configured for the target view, the state of the actor object 0 can be set to be executing (active), which indicates that the sub-thread is started. The actor object 0 associates the actor object corresponding to the association view with the actor object 0, and obtains layout data included in the sub-actor object according to the layout data of the target view and the layout rules between the actor object 0 and the sub-actor object. The sub-actor objects correspond to the first type of associated views, the layout data included in the sub-actor objects are the layout data of the first type of associated views, and the layout rules between the actor objects 0 and the sub-actor objects are the layout rules of the first type of associated views. And when the calculation of the sub-actor object is finished, taking the sub-actor object as a new actor object 0, and taking a reference associated view corresponding to the first associated view (the layout of the reference associated view is directly based on the first associated view) as the new sub-actor object to continue to be executed, and when the calculation of the new sub-actor object is finished, and so on, continuing to execute the sub-actor object aiming at the next new sub-actor object until the new sub-actor object does not exist. At this time, each associated view obtains layout data, the layout data of the target view and the layout data of the associated view are sent to the page controller, the page controller reloads the target view and the associated view, the actual display data of each view in the page to be processed is matched with the reference display data again, if the actual display data of each view in the final page to be processed is matched with the reference display data, the page to be processed meeting the layout requirement of the design specification is obtained, and the efficiency and the accuracy of the restoration test on the user interface can be improved.
The foregoing details of the method of the embodiments of the present application are set forth in order to provide a better understanding of the method of the embodiments of the present application, and accordingly, an apparatus of the embodiments of the present application is provided below. Referring to fig. 7, fig. 7 is a schematic structural diagram of a page processing apparatus provided in an embodiment of the present application, where the page processing apparatus may be applied to a page controller of a client, and the page processing apparatus 70 may include:
a processing unit 701, configured to match actual display data of each view included in a first view set corresponding to a page to be processed with reference display data after loading of each view included in the first view set is completed, where the first view set includes one or more views;
a sending unit 702, configured to send a page processing request to a server if actual display data of a target view is not matched with corresponding reference display data, where the target view is any view included in the first view set;
and a receiving unit 703, configured to receive adjusted layout control data corresponding to the page to be processed, where the adjusted layout control data is sent by the server in response to the page processing request, where the adjusted layout control data is used to reload one or more of the target view and an associated view of the target view.
In an embodiment, the page processing apparatus includes an acquisition unit 704, where the acquisition unit 704 is configured to: obtaining father-son relations among all views included in the first view set;
the processing unit 701 is specifically configured to: according to the father-son relationship among the views, determining whether the actual display data of the views are matched with the corresponding reference display data or not in sequence; and acquiring a view of which the actual display data is not matched with the corresponding reference display data, and determining the view as a target view.
In an embodiment, the view includes a key attribute, and the obtaining unit 704 is specifically configured to: for any view in the first view set, acquiring reference display data corresponding to key attributes of any view from a display configuration file of a reference page corresponding to the page to be processed; acquiring actual display data corresponding to the key attribute of any view;
the processing unit 701 is specifically configured to: and determining whether the reference display data corresponding to the key attribute is matched with the actual display data corresponding to the key attribute.
In an embodiment, the processing unit 701 is specifically configured to: when a page loading event of the page to be processed occurs, a view monitoring module is called to determine the life cycle state of each view included in the first view set; and if the life cycle state of each view indicates that loading of each view is completed, calling the view monitoring module to send view information of the page to be processed to the server, wherein the view information comprises the first view set and father-son relations among each view included in the first view set, and the view information is used for determining an associated view of the target view.
In an embodiment, the adjusted layout control data includes one or two of first layout data of the target view and second layout data of an associated view of the target view, and the processing unit 701 is specifically configured to: determining one or two of a first loading control parameter of the target view and a second loading control parameter of the associated view according to one or two of the first layout data and the second layout data; and reloading the target view by using the first loading control parameter, and reloading the associated view by using the second loading control parameter.
It may be understood that the functions of each functional unit of the page processing apparatus described in the embodiments of the present application may be specifically implemented according to the method in the foregoing method embodiments, and the specific implementation process may refer to the relevant description of the foregoing method embodiments, which is not repeated herein.
In the embodiment of the application, after loading of each view included in the first view set corresponding to the page to be processed is completed, the actual display data of each view included in the first view set is matched with the reference display data, if the actual display data of the target view is not matched with the corresponding reference display data, a page processing request is sent to the server, the adjusted layout control data corresponding to the page to be processed and sent by the server in response to the page processing request is received, and the adjusted layout control data is used for reloading one or more of the target view and the associated views of the target view, so that the efficiency and accuracy of the restoration test on the user interface can be improved.
Referring to fig. 8, fig. 8 is a schematic diagram ii of a page processing apparatus according to an embodiment of the present application, where the page processing apparatus 80 may include:
a receiving unit 801, configured to receive a page processing request sent by a client, where the page processing request is generated when the client determines that actual display data of a target view in a first view set corresponding to a page to be processed does not match corresponding reference display data, and the first view set includes one or more views;
a processing unit 802, configured to determine adjusted layout control data corresponding to the page to be processed in response to the page processing request;
a sending unit 803, configured to send the adjusted layout control data to the client, where the adjusted layout control data is used to reload one or more of the target view and the associated view.
In an embodiment, the receiving unit 801 is specifically configured to: receiving view information of the page to be processed, which is sent by the client; the view information is sent by the client after the lifecycle states of the views included in the first view set indicate that loading of the views is completed; the view information comprises the first view set and father-son relations among various views included in the first view set, and the view information is used for determining an associated view of the target view.
In one embodiment, the processing unit 802 is specifically configured to: determining a second view set corresponding to the target view according to the first view set and father-son relations among various views included in the first view set, wherein the second view set comprises views taking the father view of the target view as ancestor views in the first view set; and determining the associated view of the target view from the second view set corresponding to the target view.
In an embodiment, the adjusted layout control data includes one or both of first layout data of the target view and second layout data of an associated view of the target view, and the processing unit 802 is specifically configured to: determining first layout data of the target view, the first layout data being determined according to a layout rule configured for the target view, the layout rule describing a relative layout relationship between views; alternatively, the first layout data is determined from layout data configured for the target view; and determining second layout data of the associated view according to the relative layout relation between the associated view and the target view and the first layout data of the target view.
It may be understood that the functions of each functional unit of the page processing apparatus described in the embodiments of the present application may be specifically implemented according to the method in the foregoing method embodiments, and the specific implementation process may refer to the relevant description of the foregoing method embodiments, which is not repeated herein.
In the embodiment of the application, after loading of each view included in the first view set corresponding to the page to be processed is completed, the actual display data of each view included in the first view set is matched with the reference display data, if the actual display data of the target view is not matched with the corresponding reference display data, a page processing request is sent to the server, the adjusted layout control data corresponding to the page to be processed and sent by the server in response to the page processing request is received, and the adjusted layout control data is used for reloading one or more of the target view and the associated views of the target view, so that the efficiency and accuracy of the restoration test on the user interface can be improved.
As shown in fig. 9, fig. 9 is a schematic structural diagram of a computer device provided in an embodiment of the present application, and an internal structure of the computer device 90 is shown in fig. 9, including: one or more processors 901, memory 902, a communication interface 903. The processor 901, the memory 902, and the communication interface 903 may be connected by a bus 904 or otherwise, and embodiments of the present application are exemplified by connection via the bus 904.
Among them, the processor 901 (or CPU (Central Processing Unit, central processing unit)) is a computing core and a control core of the computer device 90, which can parse various instructions in the computer device 90 and process various data of the computer device 90, for example: the CPU may be configured to parse a power-on instruction sent by a user to the computer device 90, and control the computer device 90 to perform a power-on operation; and the following steps: the CPU may transfer various types of interaction data between the internal structures of the computer device 90, and so on. The communication interface 903 may optionally include a standard wired interface, a wireless interface (e.g., wi-Fi, mobile communication interface, etc.), and is controlled by the processor 901 to transmit and receive data. Memory 902 (Memory) is a Memory device in computer device 90 for storing computer programs and data. It will be appreciated that the memory 902 herein may include both built-in memory of the computer device 90 and extended memory supported by the computer device 90. The memory 902 provides storage space that stores an operating system of the computer device 90, which may include, but is not limited to: windows system, linux system, android system, iOS system, etc., which are not limiting in this application. In one embodiment, the computer device 90 is a page controller of a client, and the processor 901 performs the following operations by executing a computer program stored in the memory 902:
After loading of each view included in a first view set corresponding to a page to be processed is completed, matching actual display data of each view included in the first view set with reference display data, wherein the first view set includes one or more views;
if the actual display data of the target view is not matched with the corresponding reference display data, sending a page processing request to a server, wherein the target view is any view included in the first view set;
and receiving adjusted layout control data corresponding to the page to be processed, which is sent by the server in response to the page processing request, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
In one embodiment, the processor 901 is specifically configured to: obtaining father-son relations among all views included in the first view set; according to the father-son relationship among the views, determining whether the actual display data of the views are matched with the corresponding reference display data or not in sequence; and acquiring a view of which the actual display data is not matched with the corresponding reference display data, and determining the view as a target view.
In an embodiment, the view includes key attributes, and the processor 901 is specifically configured to: for any view in the first view set, acquiring reference display data corresponding to key attributes of any view from a display configuration file of a reference page corresponding to the page to be processed; acquiring actual display data corresponding to the key attribute of any view; and determining whether the reference display data corresponding to the key attribute is matched with the actual display data corresponding to the key attribute.
In one embodiment, the processor 901 is specifically configured to: when a page loading event of the page to be processed occurs, a view monitoring module is called to determine the life cycle state of each view included in the first view set; and if the life cycle state of each view indicates that loading of each view is completed, calling the view monitoring module to send view information of the page to be processed to the server, wherein the view information comprises the first view set and father-son relations among each view included in the first view set, and the view information is used for determining an associated view of the target view.
In an embodiment, the adjusted layout control data includes one or both of first layout data of the target view and second layout data of an associated view of the target view, and the processor 901 is specifically configured to: determining one or two of a first loading control parameter of the target view and a second loading control parameter of the associated view according to one or two of the first layout data and the second layout data; and reloading the target view by using the first loading control parameter, and reloading the associated view by using the second loading control parameter.
In one embodiment, the computer device 90 is a server, and the processor 901 performs the following operations by running a computer program stored in the memory 902:
receiving a page processing request sent by a client, wherein the page processing request is generated when the client determines that the actual display data of a target view in a first view set corresponding to a page to be processed is not matched with corresponding reference display data, and the first view set comprises one or more views;
responding to the page processing request, and determining adjusted layout control data corresponding to the page to be processed;
And sending the adjusted layout control data to the client, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view.
In one embodiment, the processor 901 is specifically configured to: receiving view information of the page to be processed, which is sent by the client; the view information is sent by the client after the lifecycle states of the views included in the first view set indicate that loading of the views is completed; the view information comprises the first view set and father-son relations among various views included in the first view set, and the view information is used for determining an associated view of the target view.
In one embodiment, the processor 901 is specifically configured to: determining a second view set corresponding to the target view according to the first view set and father-son relations among various views included in the first view set, wherein the second view set comprises views taking the father view of the target view as ancestor views in the first view set; and determining the associated view of the target view from the second view set corresponding to the target view.
In an embodiment, the adjusted layout control data includes one or both of first layout data of the target view and second layout data of an associated view of the target view, and the processor 901 is specifically configured to: determining first layout data of the target view, the first layout data being determined according to a layout rule configured for the target view, the layout rule describing a relative layout relationship between views; alternatively, the first layout data is determined from layout data configured for the target view; acquiring a relative layout relation between the associated view and the target view; and determining second layout data of the associated view according to the relative layout relation between the associated view and the target view and the first layout data of the target view.
In a specific implementation, the processor 901, the memory 902 and the communication interface 903 described in the embodiments of the present application may execute an implementation described in a page processing method provided in the embodiments of the present application, or may execute an implementation described in a page processing device provided in the embodiments of the present application, which is not described herein again.
In the embodiment of the application, after loading of each view included in the first view set corresponding to the page to be processed is completed, the actual display data of each view included in the first view set is matched with the reference display data, if the actual display data of the target view is not matched with the corresponding reference display data, a page processing request is sent to the server, the adjusted layout control data corresponding to the page to be processed and sent by the server in response to the page processing request is received, and the adjusted layout control data is used for reloading one or more of the target view and the associated views of the target view, so that the efficiency and accuracy of the restoration test on the user interface can be improved.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, which when run on a computer device, causes the computer device to perform a page processing method of any one of the possible implementations described above. The specific implementation manner may refer to the foregoing description, and will not be repeated here.
Embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and executes the computer instructions to cause the computer device to perform the page processing method of any of the possible implementations described above. The specific implementation manner may refer to the foregoing description, and will not be repeated here.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the described order of action, as some steps may take other order or be performed simultaneously according to the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be implemented by a program to instruct related hardware, the program may be stored in a computer readable storage medium, and the storage medium may include: flash disk, read-Only Memory (ROM), random-access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
The foregoing disclosure is only illustrative of some of the embodiments of the present application and is not, of course, to be construed as limiting the scope of the appended claims, and therefore, all changes that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

Claims (14)

1. A method of page processing, characterized by a page controller applied to a client, the method comprising:
after loading of each view included in a first view set corresponding to a page to be processed is completed, matching actual display data of each view included in the first view set with reference display data, wherein the first view set includes one or more views;
if the actual display data of the target view is not matched with the corresponding reference display data, sending a page processing request to a server, wherein the target view is any view included in the first view set;
and receiving adjusted layout control data corresponding to the page to be processed, which is sent by the server in response to the page processing request, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
2. The method of claim 1, wherein said matching actual display data of each view included in the first set of views with reference display data comprises:
obtaining father-son relations among all views included in the first view set;
According to the father-son relationship among the views, determining whether the actual display data of the views are matched with the corresponding reference display data or not in sequence;
and acquiring a view of which the actual display data is not matched with the corresponding reference display data, and determining the view as a target view.
3. The method of claim 2, wherein the views include key attributes, the sequentially determining whether actual display data of the respective views matches corresponding reference display data comprising:
for any view in the first view set, acquiring reference display data corresponding to key attributes of any view from a display configuration file of a reference page corresponding to the page to be processed;
acquiring actual display data corresponding to the key attribute of any view;
and determining whether the reference display data corresponding to the key attribute is matched with the actual display data corresponding to the key attribute.
4. A method according to any one of claims 1-3, characterized in that the method further comprises:
when a page loading event of the page to be processed occurs, a view monitoring module is called to determine the life cycle state of each view included in the first view set;
And if the life cycle state of each view indicates that loading of each view is completed, calling the view monitoring module to send view information of the page to be processed to the server, wherein the view information comprises the first view set and father-son relations among each view included in the first view set, and the view information is used for determining an associated view of the target view.
5. A method according to any of claims 1-3, wherein the adjusted layout control data comprises one or both of first layout data for the target view and second layout data for an associated view of the target view, the method further comprising:
determining one or two of a first loading control parameter of the target view and a second loading control parameter of the associated view according to one or two of the first layout data and the second layout data;
reloading the target view with the first load control parameter, and reloading the associated view with the second load control parameter.
6. A method of page processing, the method comprising:
Receiving a page processing request sent by a client, wherein the page processing request is generated when the client determines that the actual display data of a target view in a first view set corresponding to a page to be processed is not matched with corresponding reference display data, and the first view set comprises one or more views;
responding to the page processing request, and determining adjusted layout control data corresponding to the page to be processed;
and sending the adjusted layout control data to the client, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
7. The method of claim 6, wherein the method further comprises:
receiving view information of the page to be processed, which is sent by the client; the view information is sent by the client after the lifecycle states of the views included in the first view set indicate that loading of the views is completed; the view information comprises the first view set and father-son relations among various views included in the first view set, and the view information is used for determining an associated view of the target view.
8. The method of claim 6 or 7, wherein before determining the adjusted layout control data corresponding to the page to be processed in response to the page processing request, the method further comprises:
determining a second view set corresponding to the target view according to the first view set and father-son relations among various views included in the first view set, wherein the second view set comprises views taking the father view of the target view as ancestor views in the first view set;
and determining the associated view of the target view from the second view set corresponding to the target view.
9. The method according to claim 6 or 7, wherein the adjusted layout control data includes one or both of first layout data of the target view and second layout data of an associated view of the target view, and the determining the adjusted layout control data corresponding to the page to be processed includes:
determining first layout data of the target view, the first layout data being determined according to a layout rule configured for the target view, the layout rule describing a relative layout relationship between views; alternatively, the first layout data is determined from layout data configured for the target view;
Acquiring a relative layout relation between the associated view and the target view;
and determining second layout data of the associated view according to the relative layout relation between the associated view and the target view and the first layout data of the target view.
10. A page processing apparatus, characterized by a page controller applied to a client, the apparatus comprising:
the processing unit is used for matching actual display data of each view included in a first view set corresponding to a page to be processed with reference display data after loading of each view included in the first view set is completed, wherein the first view set comprises one or more views;
a sending unit, configured to send a page processing request to a server if actual display data of a target view is not matched with corresponding reference display data, where the target view is any view included in the first view set;
the receiving unit is used for receiving the adjusted layout control data corresponding to the page to be processed, which is sent by the server in response to the page processing request, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
11. A page processing apparatus, the apparatus comprising:
the device comprises a receiving unit, a processing unit and a processing unit, wherein the receiving unit is used for receiving a page processing request sent by a client, the page processing request is generated by the client when determining that the actual display data of a target view in a first view set corresponding to a page to be processed is not matched with corresponding reference display data, and the first view set comprises one or more views;
the processing unit is used for responding to the page processing request and determining adjusted layout control data corresponding to the page to be processed;
and the sending unit is used for sending the adjusted layout control data to the client, wherein the adjusted layout control data is used for reloading one or more of the target view and the associated view of the target view.
12. A computer device comprising a memory, a communication interface, and a processor, the memory, the communication interface, and the processor being interconnected; the memory stores a computer program, and the processor calls the computer program stored in the memory for realizing the page processing method according to any one of claims 1 to 5 or the page processing method according to any one of claims 6 to 9.
13. A computer-readable storage medium, in which a computer program is stored, which when executed by a processor implements the page processing method of any one of claims 1 to 5, or the page processing method of any one of claims 6 to 9.
14. A computer program product, characterized in that it comprises a computer program or computer instructions which, when executed by a processor, implement the page processing method of any one of claims 1 to 5, or the page processing method of any one of claims 6 to 9.
CN202111682924.0A 2021-12-31 2021-12-31 Page processing method, device, equipment, storage medium and computer program product Pending CN116414635A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111682924.0A CN116414635A (en) 2021-12-31 2021-12-31 Page processing method, device, equipment, storage medium and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111682924.0A CN116414635A (en) 2021-12-31 2021-12-31 Page processing method, device, equipment, storage medium and computer program product

Publications (1)

Publication Number Publication Date
CN116414635A true CN116414635A (en) 2023-07-11

Family

ID=87056991

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111682924.0A Pending CN116414635A (en) 2021-12-31 2021-12-31 Page processing method, device, equipment, storage medium and computer program product

Country Status (1)

Country Link
CN (1) CN116414635A (en)

Similar Documents

Publication Publication Date Title
US11227221B2 (en) Framework management method and apparatus
CN111639287A (en) Page processing method and device, terminal equipment and readable storage medium
US20210208854A1 (en) System and method for enhancing component based development models with auto-wiring
CN111190586A (en) Software development framework building and using method, computing device and storage medium
CN110276074B (en) Distributed training method, device, equipment and storage medium for natural language processing
CN111459610B (en) Model deployment method and device
CN113448862B (en) Software version testing method and device and computer equipment
WO2023065746A1 (en) Algorithm application element generation method and apparatus, electronic device, computer program product and computer readable storage medium
CN109614271B (en) Method, device, equipment and storage medium for controlling consistency of multiple cluster data
CN114531477B (en) Method and device for configuring functional components, computer equipment and storage medium
CN111736762A (en) Synchronous updating method, device, equipment and storage medium of data storage network
CN111414350A (en) Service generation method and device
CN113157315A (en) Method, device, equipment and medium for identifying difference information of different versions of software
CN116257438A (en) Updating method of interface test case and related equipment
KR20150133902A (en) System and method for developing of service based on software product line
CN113971191A (en) Data import method and device and computer readable storage medium
CN116414635A (en) Page processing method, device, equipment, storage medium and computer program product
CN116248526A (en) Method and device for deploying container platform and electronic equipment
CN112667491B (en) Function test method and device for virtual machine
CN113934405A (en) Plug-in processing method, device, equipment, storage medium and computer program product
CN114756362A (en) Resource quota management method and system, intelligent terminal and storage medium
CN114237824A (en) Fault positioning method and device, computer readable medium and electronic equipment
CN112685023A (en) Front-end development processing method, device, equipment and storage medium based on basic library
CN112231231A (en) Method, system and device for debugging cloud service
CN112929398B (en) Data sharing method, device, server and storage medium

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