CN107729452B - Webpage loading method and device, electronic equipment and computer readable storage medium - Google Patents

Webpage loading method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN107729452B
CN107729452B CN201710929396.1A CN201710929396A CN107729452B CN 107729452 B CN107729452 B CN 107729452B CN 201710929396 A CN201710929396 A CN 201710929396A CN 107729452 B CN107729452 B CN 107729452B
Authority
CN
China
Prior art keywords
loading
webview
parameter
classification
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710929396.1A
Other languages
Chinese (zh)
Other versions
CN107729452A (en
Inventor
汪刚
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710929396.1A priority Critical patent/CN107729452B/en
Publication of CN107729452A publication Critical patent/CN107729452A/en
Application granted granted Critical
Publication of CN107729452B publication Critical patent/CN107729452B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a webpage loading method and device, electronic equipment and a computer readable storage medium, and relates to the field of computers. The method comprises the following steps: creating a webView classification in a webView class of the electronic equipment; generating a loading protocol according to a plurality of preselected parameters for realizing loading of the page, wherein the parameters comprise a request object parameter, a corresponding request type parameter, a coding format parameter of the loaded page, a downloading progress parameter and a callback state parameter; adding a loading protocol to the webView classification; when a loading link of a webpage acquired by responding to user operation passes assertion detection, initiating a network request to a server corresponding to the loading link; and displaying the webpage data by utilizing webView classification according to the corresponding server feedback information. The access loading can be quickly and simply realized without independently customizing a loading mode for various types of access requests, and the method is efficient and practical.

Description

Webpage loading method and device, electronic equipment and computer readable storage medium
Technical Field
The invention relates to the field of computers, in particular to a webpage loading method and device, electronic equipment and a computer readable storage medium.
Background
When the application program installed in the electronic terminal is used for loading the webpage, the system with the electronic terminal is usually adopted to load the corresponding webpage link, so as to realize the display of the webpage content. The loading mode is convenient to realize and simple in display effect. But defaults to the type (type) and encoding format, etc. of the exposed web page. Therefore, a special request for loading a web page having a special type and encoding format cannot be loaded as conveniently. The loading mode is usually customized according to a special request and then loading is carried out. And such a method is very cumbersome and inefficient.
Disclosure of Invention
The present invention is directed to a method and an apparatus for loading a web page, an electronic device and a computer-readable storage medium, so as to solve the above problems.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical solutions:
in a first aspect, an embodiment of the present invention provides a web page loading method applied to an electronic device, where the method includes: creating a webView classification in the webView class of the electronic equipment; generating a loading protocol according to a plurality of preselected parameters for realizing loading of the page, wherein the parameters comprise a request object parameter, a corresponding request type parameter, a coding format parameter of the loaded page, a downloading progress parameter and a callback state parameter; adding the loading protocol into the webView classification so that the webView classification is used for displaying the webpages corresponding to the various types of access requests; when a loading link of a webpage acquired by responding to user operation passes assertion detection, initiating a network request to a server corresponding to the loading link; and displaying the webpage data by utilizing the webView classification according to the corresponding server feedback information.
In a second aspect, an embodiment of the present invention further provides a web page loading apparatus, which is applied to an electronic device, and the apparatus includes: the device comprises a creating module, a generating module, an adding module, a sending module and a displaying module. The creating module is used for creating a webView classification in the webView class of the electronic equipment; the generating module is used for generating a loading protocol according to a plurality of preselected parameters for realizing loading of the page, wherein the parameters comprise a request object parameter, a corresponding request type parameter, a coding format parameter of the loaded page, a downloading progress parameter and a callback state parameter; the adding module is used for adding the loading protocol into the webView classification so as to enable the webView classification to be used for displaying webpages corresponding to the various access requests; the sending module is used for initiating a network request to a server corresponding to a loading link after the loading link of the webpage acquired by responding to the user operation passes assertion detection; and the display module is used for displaying the webpage data by utilizing the webView classification according to the corresponding server feedback information.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes: a memory; a processor; and a web page loading device stored in the memory and including one or more software function modules executed by the processor, comprising: the creating module is used for creating a webView classification in the webView class of the electronic equipment; the generating module is used for generating a loading protocol according to a plurality of preselected parameters for realizing loading of the page, wherein the parameters comprise a request object parameter, a corresponding request type parameter, a coding format parameter of the loaded page, a downloading progress parameter and a callback state parameter; the adding module is used for adding the loading protocol into the webView classification so as to enable the webView classification to be used for displaying webpages corresponding to the various access requests; the sending module is used for initiating a network request to a server corresponding to a loading link after the loading link of the webpage acquired by responding to the user operation passes assertion detection; the display module is used for displaying the webpage data by utilizing the webView classification according to the corresponding server feedback information; the query module is used for querying the current network request process of the electronic equipment; and the processing module is used for canceling to send the network request again when the network request corresponding to the loading link exists in the network request process.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the interface testing method described above.
Compared with the prior art, the webpage loading method and device, the electronic equipment and the computer readable storage medium are provided by the invention. Firstly, creating a webView classification in a webView class of the electronic equipment; and secondly, creating a corresponding loading protocol and binding the webView classification, wherein the loading protocol is generated according to the request object parameter, the corresponding request type parameter, the encoding format parameter of the loaded webpage, the downloading progress parameter and the callback state parameter, so that the webpages corresponding to the various types of access requests can be loaded by simply using the webView classification. And when a loading link of the webpage acquired by responding to the user operation passes assertion detection, initiating a network request to a server corresponding to the loading link, and displaying webpage data by utilizing the webView classification according to the corresponding server feedback information. The access loading can be realized quickly and simply without independently customizing the loading mode for various types of access requests.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a block diagram of an electronic device according to a preferred embodiment of the invention.
FIG. 2 is a flowchart illustrating steps of a method for loading a web page according to a preferred embodiment of the present invention.
Fig. 3 is a flowchart illustrating sub-steps of step S102 in fig. 2.
Fig. 4 is a flowchart illustrating sub-steps of step S103 in fig. 2.
Fig. 5 is a flowchart illustrating sub-steps of step S108 in fig. 2.
Fig. 6 is a schematic diagram illustrating a web page loading apparatus according to a preferred embodiment of the invention.
Fig. 7 is a functional sub-module diagram of the generating module in fig. 6.
Fig. 8 is a functional sub-module diagram of the added module in fig. 6.
Fig. 9 is a schematic diagram of the functional sub-modules of the module shown in fig. 6.
Icon: 100-an electronic device; 101-a memory; 102-a memory controller; 103-a processor; 200-a web page loading device; 201-creation module; 202-a generation module; 2021-generate submodule; 2022-select submodule; 203-add module; 2031-write submodule; 2032-binding submodule; 204-a detection module; 205-a query module; 206-a processing module; 207-a transmission module; 208-a display module; 2081-an acquisition sub-module; 2082-display submodule.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Referring to fig. 1, fig. 1 is a block diagram illustrating an electronic device 100 according to an embodiment of the invention. The electronic device 100 may be, but is not limited to, a smart phone, a tablet computer, a laptop portable computer, a car computer, a Personal Digital Assistant (PDA), a wearable mobile terminal, and the like. The electronic device 100 is installed with an iOS system, which includes a web page loading apparatus 200, a memory 101, a storage controller 102, and a processor 103.
The memory 101, the memory controller 102 and the processor 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The web page loading apparatus 200 includes at least one software function module which can be stored in the memory 101 in the form of software or firmware (firmware) or solidified in an Operating System (OS) of the electronic device 100. The processor 103 is used for executing an executable module stored in the memory 101, such as a software functional module or a computer program included in the web page loading apparatus 200.
The Memory 101 may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory 101 is configured to store a program, and the processor 103 executes the program after receiving an execution instruction, and the method executed by the server defined by the process disclosed in any embodiment of the present invention may be applied to the processor 103, or implemented by the processor 103.
The processor 103 may be an integrated circuit chip having signal processing capabilities. The processor 103 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), a voice processor, a video processor, and the like; but may also be a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor 103 may be any conventional processor 103 or the like.
First embodiment
Referring to fig. 2, fig. 2 shows a web page loading method according to an embodiment of the present invention. The method is applied to the electronic device 100, and is used for enabling an application program installed in the electronic device 100 to load a webpage. As shown in fig. 2, the web page loading method includes the following steps:
step S101, a webView classification is created in the webView class of the electronic device 100.
In the embodiment, in order to achieve better seamless docking and expansion of the webView of the electronic device 100, a category of the webView is defined in the electronic device 100. The functions can be expanded on the basis of the original webView class by creating the webView class, and the coupling is small. It should be noted that the webView class may be a View for showing a web page, which is a basic class, so that an application program can simply show contents. The webView classification is also a file with a format, and the webView classification can be defined by redefining a class on the basis of the original webView class so as to realize method expansion or function expansion of the original webView class.
Step S102, generating a loading protocol according to a plurality of preselected parameters for realizing loading pages.
In this embodiment, the preselected parameters may include a Request object parameter (e.g., a Request object Request), a corresponding Request type parameter (e.g., a type for requesting to load a web page), an encoding format parameter of a loaded web page, a download progress parameter, and a callback status parameter, where it is noted that the Request object parameter may be a parameter of an NSUR L Request type, the Request type parameter cannot be null, and therefore, may be set as a nullable type parameter, the callback status parameter may include a success callback parameter and a failure callback parameter, and the failure callback parameter cannot be null, and therefore, the failure callback parameter is also defined as a nullable type parameter, and loading and displaying of multiple types of web pages may be implemented according to these parameters, as shown in fig. 3, step S102 includes the following sub-steps:
and a substep S1021, generating a protocol declaration according to a plurality of preselected parameters so as to obtain the data obtaining interface corresponding to each parameter.
In this embodiment, the protocol declaration is a very simplified description of the functionality of the webView classification. As one example, a protocol declaration may include a method that defines a method name as loadRequest. The loadRequest method corresponds to the selected plurality of parameters. The protocol declaration generates a data acquisition interface corresponding to each of the parameters according to the selected parameters.
And a substep S1022, selecting a method for assigning and a method for obtaining a value corresponding to the loading protocol.
As an embodiment, the method of assigning may be implemented by selecting the object association method obj _ setassassociatedobject. Specifically, this object association method corresponds to four parameters. The first parameter is self; the second parameter may be the key of the assignment method and the @ selector of the key selector type, i.e., the key is the name of a method; the third parameter may be the name of the parameter that needs to be assigned; the fourth parameter is an associated policy, where an associated policy object is of an object type, and the type OBJC _ ASSOCIATION _ retry _ nonatomc is used, and the value obtaining method may also use an associated object method obj _ getassocciatedobject, which is the same as the above principle and is not described herein again.
And S103, adding the loading protocol into the webView classification so as to enable the webView classification to be used for displaying the webpages corresponding to the various access requests.
In this embodiment, after the webView classification is defined, the corresponding protocol cannot be automatically acquired, and the functions that need to be implemented are implemented. Therefore, it can be realized by a sub-flow as shown in fig. 4, and the step S103 includes the following sub-steps:
and a substep S1031, writing the protocol declaration into the webView classified header file.
And a substep S1032 of binding the assignment method, the value obtaining method and the webView classification.
Step S104, the loading link of the webpage acquired by the electronic equipment 100 responding to the user operation is checked by using assertion detection.
In this embodiment, the electronic device 100 acquires a load link of a web page to be opened in response to a user operation. For example, during the application program usage process, the user clicks to make the electronic device 100 obtain a loading link of a web page that the user needs to open. And judging whether the loading link is effective or not through assertion detection, so as to avoid loading invalid loading links.
As an embodiment, the corresponding request object parameter is obtained from the load link through the data obtaining interface corresponding to the request object parameter generated in the protocol declaration. And then checking whether the acquired corresponding request object parameter is valid through an NSParameterAssert method. If the test is not passed and the electronic device 100 is in the debug mode, performing exception reminding; and performing exception reminding in a release mode. If the check is passed, the flow advances to step S105.
Step S105, querying a current network request process of the electronic device 100.
As an embodiment, by judging that the current network state stack is checked, if the current state is the running NSUR L sessiontaskerunning or the hanging NSUR L sessiontaskepending, which runs the corresponding request object parameter obtained from the load link by the webView classification, exists.
Step S106, when the network request corresponding to the loading link already exists in the network request process, the network request is cancelled to be sent again.
In this embodiment, if there is a network request in the stack of the network request process that is the same as the network request that needs to be sent this time and is running or pending, the network request is cancelled from being sent again, so that the network request is prevented from being sent repeatedly, and the process is ended.
As an embodiment, the network request to be sent again may be obtained by a method of obtaining values corresponding to webView classification, and cancel processing is performed on the request, and after the network request to be sent again is cancelled, the current network request task is set to nil.
In this embodiment, if there is no network request corresponding to the load link in the network request process, the process proceeds to step S107.
Step S107, a network request is sent to the server corresponding to the loading link.
And S108, displaying webpage data by utilizing the webView classification according to the corresponding server feedback information.
In this embodiment, if the request fails, the feedback information sent by the server to the electronic device 100 includes failure callback information, and the webView classification obtains a failure callback parameter through a data acquisition interface corresponding to the callback state parameter according to the feedback data, and performs failure reminding; if the request is successful, step S108 includes the following sub-steps, as shown in fig. 5:
and a substep S1081 of obtaining corresponding parameter values by using the data obtaining interface and the feedback information.
In this embodiment, a data obtaining interface corresponding to a request object parameter is used to obtain a request object parameter value, as an embodiment, the request object parameter value may be an attribute of an absoluteString of a load link; acquiring a request type of a webpage to be loaded by using a data acquisition interface corresponding to the corresponding request type parameter; acquiring the coding format of the webpage to be loaded by using a data acquisition interface corresponding to the coding format parameter of the loaded webpage; acquiring a downloading progress parameter of the feedback information by using a data acquisition interface corresponding to the downloading progress parameter; and acquiring the callback state parameter of the network request by using the data corresponding to the callback state parameter.
And a substep S1082 of displaying the feedback information according to the obtained parameter value.
As an implementation mode, when the request is successful, the obtained feedback information is displayed by using the method loadData of webView classified data loading, and the obtained request type and encoding format parameters are transmitted to the method loadData method of webView classification so as to load a webpage.
Second embodiment
Referring to fig. 6, fig. 6 is a schematic diagram of a web page loading device 200 according to a preferred embodiment of the invention. As shown in fig. 6, the web page loading apparatus 200 includes a creating module 201, a generating module 202, an adding module 203, a detecting module 204, a querying module 205, a processing module 206, a sending module 207, and a presenting module 208.
A creating module 201, configured to create a webView category in the webView class of the electronic device 100.
In the embodiment of the present invention, step S101 may be performed by the creation module 201.
The generating module 202 is configured to generate a loading protocol according to a plurality of preselected parameters for implementing loading of a page, where the parameters include a request object parameter, a corresponding request type parameter, an encoding format parameter of a loaded web page, a download progress parameter, and a callback state parameter.
In the embodiment of the present invention, step S102 may be performed by the generating module 202. As shown in fig. 7, the generation module 202 includes the following functional sub-modules:
the generating sub-module 2021 is configured to generate a protocol declaration according to a plurality of preselected parameters, so as to obtain a data obtaining interface corresponding to each of the parameters.
In an embodiment of the present invention, the sub-step S1021 may be performed by the generating sub-module 2021.
The selecting sub-module 2022 is configured to select an assignment method and a value obtaining method corresponding to the loading protocol.
In an embodiment of the present invention, the sub-step S1022 may be performed by the selection sub-module 2022.
And the adding module 203 is used for adding the loading protocol into the webView classification so as to enable the webView classification to be used for displaying the webpages corresponding to the various access requests.
In the embodiment of the present invention, step S103 may be performed by the adding module 203. As shown in fig. 8, the illustrated addition module 203 may include the following functional sub-modules:
a write submodule 2031, configured to write the protocol declaration into a header file of the webView classification.
In the embodiment of the present invention, the sub-step S1031 may be performed by the writing sub-module 2031.
And a binding submodule 2032, configured to use the assignment method, the value obtaining method, and the webView classification binding.
In an embodiment of the present invention, sub-step S1032 may be performed by the binding sub-module 2032.
A detection module 204, configured to check, by using assertion detection, a loading link of a web page acquired by the electronic device 100 in response to a user operation.
In an embodiment of the present invention, step S104 may be performed by the detection module 204.
The query module 205 is configured to query a current network request process of the electronic device 100.
In the embodiment of the present invention, step S105 may be performed by the query module 205.
A processing module 206, configured to cancel sending the network request again when the network request corresponding to the load link already exists in the network request process.
In an embodiment of the present invention, step S106 may be performed by the processing module 206.
The sending module 207 initiates a network request to the server corresponding to the loading link.
In the embodiment of the present invention, step S107 may be performed by the sending module 207. Specifically, step S107 is performed when the load link of the web page acquired in response to the user operation is detected by the assertion, and the network request corresponding to the load link does not exist in the network request process.
And the display module 208 is configured to display the webpage data by using the webView classification according to the corresponding server feedback information.
In an embodiment of the present invention, step S108 may be performed by the presentation module 208. As shown in fig. 9, the display module 208 includes the following functional sub-modules:
the obtaining sub-module 2081, configured to obtain a corresponding parameter value by using the data obtaining interface and the feedback information.
In the embodiment of the present invention, sub-step S1081 may be performed by the obtaining sub-module 2081.
And the display sub-module 2082 is configured to perform data display on the feedback information according to the obtained parameter value.
In an embodiment of the present invention, sub-step S1082 may be performed by presentation sub-module 2082.
An embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by the processor 103, implements the interface testing method disclosed in the foregoing embodiment of the present invention.
In summary, the web page loading method, the web page loading device, the electronic device and the computer-readable storage medium provided by the invention are applied to the electronic device. The method comprises the following steps: creating a webView classification in the webView class of the electronic equipment; generating a loading protocol according to a plurality of preselected parameters for realizing loading of the page, wherein the parameters comprise a request object parameter, a corresponding request type parameter, a coding format parameter of the loaded page, a downloading progress parameter and a callback state parameter; adding the loading protocol into the webView classification so that the webView classification is used for displaying the webpages corresponding to the various types of access requests; when a loading link of a webpage acquired by responding to user operation passes assertion detection, initiating a network request to a server corresponding to the loading link; and displaying the webpage data by utilizing the webView classification according to the corresponding server feedback information. The access loading can be realized quickly and simply without independently customizing the loading mode for various types of access requests.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A webpage loading method is applied to electronic equipment, and the method comprises the following steps:
creating a webView classification in the webView class of the electronic equipment;
generating a loading protocol according to a plurality of preselected parameters for realizing loading of a page, wherein a protocol statement is generated according to the plurality of preselected parameters so as to acquire a data acquisition interface corresponding to each parameter; selecting a method for carrying out assignment and a method for obtaining values corresponding to the loading protocol; the parameters comprise request object parameters, corresponding request type parameters, encoding format parameters of the loaded webpage, downloading progress parameters and callback state parameters;
adding the loading protocol into the webView classification so that the webView classification is used for displaying the webpages corresponding to the various types of access requests;
when a loading link of a webpage acquired by responding to user operation passes assertion detection, initiating a network request to a server corresponding to the loading link; wherein the assertion detection is assertion detection of whether a request object parameter of a load chain for the web page is valid;
and displaying the webpage data by utilizing the webView classification according to the corresponding server feedback information.
2. The method of claim 1, wherein adding the loading protocol to the webView classification comprises:
writing the protocol statement into a header file of the webView classification;
and using the assignment method, the value obtaining method and the webView classification binding.
3. The method of claim 1, wherein the step of data presentation using the webView classification according to the corresponding server feedback information comprises:
acquiring corresponding parameter values by using the data acquisition interface and the feedback information;
and displaying the feedback information according to the acquired parameter value.
4. The method of claim 1, wherein prior to initiating a network request to a server corresponding to the load link, the method further comprises:
inquiring the current network request process of the electronic equipment;
and when the network request corresponding to the loading link exists in the network request process, canceling to send the network request again.
5. A webpage loading device is applied to electronic equipment, and the device comprises:
the creating module is used for creating a webView classification in the webView class of the electronic equipment;
the generating module is used for generating a loading protocol according to a plurality of preselected parameters for realizing loading of the page, wherein the parameters comprise a request object parameter, a corresponding request type parameter, a coding format parameter of the loaded page, a downloading progress parameter and a callback state parameter; the generation module comprises: the generation submodule is used for generating a protocol statement according to a plurality of preselected parameters so as to acquire a data acquisition interface corresponding to each parameter; the selection submodule is used for selecting an assignment method and a value obtaining method corresponding to the loading protocol;
the adding module is used for adding the loading protocol into the webView classification so as to enable the webView classification to be used for displaying webpages corresponding to the various access requests;
the sending module is used for initiating a network request to a server corresponding to a loading link after the loading link of the webpage acquired by responding to the user operation passes assertion detection; wherein the assertion detection is assertion detection of whether a request object parameter of a load chain for the web page is valid;
the display module is used for displaying the webpage data by utilizing the webView classification according to the corresponding server feedback information;
the query module is used for querying the current network request process of the electronic equipment;
and the processing module is used for canceling to send the network request again when the network request corresponding to the loading link exists in the network request process.
6. The apparatus of claim 5, wherein the adding module comprises:
the writing sub-module is used for writing the protocol statement into the header file classified by the webView;
and the binding submodule is used for binding the assignment method, the value obtaining method and the webView classification.
7. An electronic device, characterized in that the electronic device comprises:
a memory;
a processor; and
a web page loading device stored in the memory and including one or more software function modules executed by the processor, comprising:
the creating module is used for creating a webView classification in the webView class of the electronic equipment;
the generating module is used for generating a loading protocol according to a plurality of preselected parameters for realizing loading of the page, wherein the parameters comprise a request object parameter, a corresponding request type parameter, a coding format parameter of the loaded page, a downloading progress parameter and a callback state parameter; the generation module comprises: the generation submodule is used for generating a protocol statement according to a plurality of preselected parameters so as to acquire a data acquisition interface corresponding to each parameter; the selection submodule is used for selecting an assignment method and a value obtaining method corresponding to the loading protocol;
the adding module is used for adding the loading protocol into the webView classification so as to enable the webView classification to be used for displaying webpages corresponding to the various access requests;
the sending module is used for initiating a network request to a server corresponding to a loading link after the loading link of the webpage acquired by responding to the user operation passes assertion detection; wherein the assertion detection is assertion detection of whether a request object parameter of a load chain for the web page is valid;
the display module is used for displaying the webpage data by utilizing the webView classification according to the corresponding server feedback information;
the query module is used for querying the current network request process of the electronic equipment;
and the processing module is used for canceling to send the network request again when the network request corresponding to the loading link exists in the network request process.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201710929396.1A 2017-10-09 2017-10-09 Webpage loading method and device, electronic equipment and computer readable storage medium Active CN107729452B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710929396.1A CN107729452B (en) 2017-10-09 2017-10-09 Webpage loading method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710929396.1A CN107729452B (en) 2017-10-09 2017-10-09 Webpage loading method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107729452A CN107729452A (en) 2018-02-23
CN107729452B true CN107729452B (en) 2020-07-10

Family

ID=61209964

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710929396.1A Active CN107729452B (en) 2017-10-09 2017-10-09 Webpage loading method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107729452B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108809763B (en) * 2018-06-14 2022-03-25 武汉斗鱼网络科技有限公司 Network performance parameter acquisition method, terminal device and storage medium
CN109032693B (en) * 2018-06-29 2021-09-24 北京金山安全软件有限公司 Method and device for loading display information, electronic equipment and readable storage medium
CN109040072B (en) * 2018-08-06 2021-03-12 武汉斗鱼网络科技有限公司 Method, system, server and storage medium for client to authorize login of webpage
CN109271213B (en) * 2018-08-20 2023-03-28 平安普惠企业管理有限公司 HTML5 page loading method and device, computer equipment and storage medium
CN109669786A (en) * 2018-09-26 2019-04-23 深圳壹账通智能科技有限公司 Interface call method, unit and computer readable storage medium
CN111190592B (en) * 2018-11-15 2022-06-21 武汉斗鱼网络科技有限公司 Page creation method, storage medium, electronic device and system
CN111857855B (en) * 2019-04-01 2021-10-29 南京星云数字技术有限公司 Webpage loading method and device and intelligent equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6256635B1 (en) * 1998-05-08 2001-07-03 Apple Computer, Inc. Method and apparatus for configuring a computer using scripting
CN101067819A (en) * 2007-06-07 2007-11-07 北京大学 Web page resource issuing method and issuing system
CN103034504A (en) * 2013-01-05 2013-04-10 湖南经桥网络科技有限公司 Application method and device of template website
CN103425794A (en) * 2013-08-29 2013-12-04 优视科技有限公司 Webpage previewing method and webpage previewing device based on bis-WebView
CN103995694A (en) * 2014-03-31 2014-08-20 中邮科通信技术股份有限公司 Mobile client browser control with telecommunication capacity and calling method thereof
CN104951326A (en) * 2014-03-31 2015-09-30 腾讯科技(深圳)有限公司 Web access method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6256635B1 (en) * 1998-05-08 2001-07-03 Apple Computer, Inc. Method and apparatus for configuring a computer using scripting
CN101067819A (en) * 2007-06-07 2007-11-07 北京大学 Web page resource issuing method and issuing system
CN103034504A (en) * 2013-01-05 2013-04-10 湖南经桥网络科技有限公司 Application method and device of template website
CN103425794A (en) * 2013-08-29 2013-12-04 优视科技有限公司 Webpage previewing method and webpage previewing device based on bis-WebView
CN103995694A (en) * 2014-03-31 2014-08-20 中邮科通信技术股份有限公司 Mobile client browser control with telecommunication capacity and calling method thereof
CN104951326A (en) * 2014-03-31 2015-09-30 腾讯科技(深圳)有限公司 Web access method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
WebView封装;Justson;《https://www.jianshu.com/p/d657580ac643》;20170530;1-7 *

Also Published As

Publication number Publication date
CN107729452A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
CN107729452B (en) Webpage loading method and device, electronic equipment and computer readable storage medium
WO2020020272A1 (en) Page control method and apparatus, and computer-readable storage medium
US8468391B2 (en) Utilizing log event ontology to deliver user role specific solutions for problem determination
CN109145238B (en) Card display method and device and mobile device
US9811605B2 (en) Methods, apparatuses and computer program products for automated learning of data models
US10908928B2 (en) Rules-based workflow messaging
CN109491763B (en) System deployment method and device and electronic equipment
US20160342449A1 (en) Data exchange across multiple computing devices through a proactive intelligent clipboard
CN108038665B (en) Business rule management method, device, equipment and computer readable storage medium
CN107908442B (en) Spring-based resource loading method and device, terminal equipment and computer-readable storage medium
US9910724B2 (en) Fast and accurate identification of message-based API calls in application binaries
US20150242389A1 (en) Techniques to identify user interface elements associated with model violation events
CN113536174A (en) Interface loading method, device and equipment
CN110688096A (en) Method, device, medium and electronic equipment for constructing application program containing plug-in
CN113778391A (en) Page processing method, device and equipment for native application program
CN115328759A (en) Form verification method and device
CN111522706A (en) Method and device for monitoring page abnormity of front-end application
CN110442636B (en) Data reading and writing method and device and data reading and writing equipment
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
CN107341038B (en) Compatibility processing method and device and electronic equipment
US20210192123A1 (en) Syndication of associations relating data and metadata
CN110851346B (en) Query statement boundary problem detection method, device, equipment and storage medium
CN111142735B (en) Software page creating method and device, terminal equipment and storage medium
CN112052054A (en) Function calling method and device, electronic equipment and storage medium
CN109408762A (en) A kind of method and device of the carrying advertisement in the page

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
GR01 Patent grant
GR01 Patent grant