CN112615908A - Webpage processing method, electronic equipment and related product - Google Patents

Webpage processing method, electronic equipment and related product Download PDF

Info

Publication number
CN112615908A
CN112615908A CN202011424599.3A CN202011424599A CN112615908A CN 112615908 A CN112615908 A CN 112615908A CN 202011424599 A CN202011424599 A CN 202011424599A CN 112615908 A CN112615908 A CN 112615908A
Authority
CN
China
Prior art keywords
target
keyword
importance
keywords
network environment
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.)
Granted
Application number
CN202011424599.3A
Other languages
Chinese (zh)
Other versions
CN112615908B (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.)
Guangdong Rongwen Technology Group Co ltd
Original Assignee
Guangdong Rongwen Technology Group 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 Guangdong Rongwen Technology Group Co ltd filed Critical Guangdong Rongwen Technology Group Co ltd
Priority to CN202011424599.3A priority Critical patent/CN112615908B/en
Publication of CN112615908A publication Critical patent/CN112615908A/en
Application granted granted Critical
Publication of CN112615908B publication Critical patent/CN112615908B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/61Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources taking into account QoS or priority requirements
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application discloses a webpage processing method, electronic equipment and related products, which are applied to the electronic equipment, wherein the method comprises the following steps: acquiring a target code; extracting keywords from the target code to obtain target keywords; identifying a target network environment of the Content Delivery Network (CDN) according to the target keywords; and realizing content loading operation according to the target network environment. By adopting the embodiment of the application, the CDN loading efficiency can be improved.

Description

Webpage processing method, electronic equipment and related product
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a web page processing method, an electronic device, and a related product.
Background
At present, resources can be loaded through a Content Delivery Network (CDN) in a domestic (chinese) front-end development process, and a file does not need to be packaged inside a webpage, but if the CDN is abroad, the CDN may not be used, and furthermore, an extranet cannot use the CDN to perform efficient static Content loading, and only packages the file inside the webpage, which causes Network delay, and therefore, the problem of how to improve the CDN loading efficiency needs to be solved urgently.
Disclosure of Invention
The embodiment of the application provides a webpage processing method and a related product, and CDN loading efficiency can be improved.
In a first aspect, an embodiment of the present application provides a web page processing method, which is applied to an electronic device, and the method includes:
acquiring a target code;
extracting keywords from the target code to obtain target keywords;
identifying a target network environment of the Content Delivery Network (CDN) according to the target keywords;
and realizing content loading operation according to the target network environment.
In a second aspect, an embodiment of the present application provides a web page processing apparatus, which is applied to an electronic device, and the apparatus includes: an acquisition unit, an extraction unit, an identification unit and a loading unit, wherein,
the acquisition unit is used for acquiring a target code;
the extraction unit is used for extracting keywords from the target code to obtain target keywords;
the identification unit is used for identifying a target network environment of the content delivery network CDN according to the target keyword;
and the loading unit is used for realizing content loading operation according to the target network environment.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing the steps in the first aspect of the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program enables a computer to perform some or all of the steps described in the first aspect of the embodiment of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application has the following beneficial effects:
it can be seen that the web page processing method, the electronic device and the related products described in the embodiments of the present application are applied to an electronic device, obtain a target code, perform keyword extraction on the target code to obtain a target keyword, identify a target network environment of a content delivery network CDN according to the target keyword, implement a content loading operation according to the target network environment, can identify a network environment of the CDN according to the keyword in the code, and perform content loading according to the network environment, and are beneficial to improving the CDN loading efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1A is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 1B is a schematic flowchart of a web page processing method according to an embodiment of the present application;
FIG. 2 is a schematic flowchart of another web page processing method provided in the embodiment of the present application;
fig. 3 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
fig. 4 is a block diagram illustrating functional units of a web page processing apparatus according to an embodiment of the present disclosure.
Detailed Description
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The electronic device according to the embodiment of the present application may be various handheld devices with communication functions, smart robots, smart headsets, smart dictionaries, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to wireless modems, and various forms of User Equipment (UE), Mobile Stations (MS), terminal devices (terminal device), and the like, and the electronic device may also be a server or a smart home device.
In the embodiment of the application, the smart home device may be at least one of the following: refrigerator, washing machine, electricity rice cooker, intelligent (window) curtain, intelligent lamp, intelligent bed, intelligent garbage bin, microwave oven, steam ager, air conditioner, lampblack absorber, server, intelligent door, smart window, door wardrobe, intelligent audio amplifier, intelligent house, intelligent chair, intelligent clothes hanger, intelligent shower, water dispenser, water purifier, air purifier, doorbell, monitored control system, intelligent garage, TV set, projecting apparatus, intelligent dining table, intelligent sofa, massage armchair, treadmill etc. of course, can also include other equipment.
As shown in fig. 1A, fig. 1A is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device includes a processor, a Memory, a signal processor, a transceiver, a display screen, a speaker, a microphone, a Random Access Memory (RAM), a camera, a sensor, a network module, and the like. The memory, the DSP, the loudspeaker, the microphone, the RAM, the camera, the sensor and the network module are connected with the processor, and the transceiver is connected with the signal processor.
The Processor is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, executes various functions and processes data of the electronic device by running or executing software programs and/or modules stored in the memory and calling the data stored in the memory, thereby performing overall monitoring on the electronic device, and may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU) or a Network Processing Unit (NPU).
Further, the processor may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor.
The memory is used for storing software programs and/or modules, and the processor executes various functional applications and web page processing of the electronic equipment by running the software programs and/or modules stored in the memory. The memory mainly comprises a program storage area and a data storage area, wherein the program storage area can store an operating system, a software program required by at least one function and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
Wherein the sensor comprises at least one of: light-sensitive sensors, gyroscopes, infrared proximity sensors, vibration detection sensors, pressure sensors, etc. Among them, the light sensor, also called an ambient light sensor, is used to detect the ambient light brightness. The light sensor may include a light sensitive element and an analog to digital converter. The photosensitive element is used for converting collected optical signals into electric signals, and the analog-to-digital converter is used for converting the electric signals into digital signals. Optionally, the light sensor may further include a signal amplifier, and the signal amplifier may amplify the electrical signal converted by the photosensitive element and output the amplified electrical signal to the analog-to-digital converter. The photosensitive element may include at least one of a photodiode, a phototransistor, a photoresistor, and a silicon photocell.
The camera may be a visible light camera (general view angle camera, wide angle camera), an infrared camera, or a dual camera (having a distance measurement function), which is not limited herein.
The network module may be at least one of: a bluetooth module, a wireless fidelity (Wi-Fi), etc., which are not limited herein.
Based on the electronic device described in fig. 1A, the following web page processing method can be executed, and the specific steps are as follows:
acquiring a target code;
extracting keywords from the target code to obtain target keywords;
identifying a target network environment of the Content Delivery Network (CDN) according to the target keywords;
and realizing content loading operation according to the target network environment.
It can be seen that, in the electronic device described in the embodiment of the present application, the target code is obtained, the keyword is extracted from the target code, the target keyword is obtained, the target network environment of the content delivery network CDN is identified according to the target keyword, the content loading operation is implemented according to the target network environment, the network environment of the CDN can be identified according to the keyword in the code, and the content loading is performed according to the network environment, which is beneficial to improving the loading efficiency of the CDN.
Referring to fig. 1B, fig. 1B is a schematic flowchart of a web page processing method according to an embodiment of the present application, and as shown in the drawing, the web page processing method is applied to the electronic device shown in fig. 1A, and includes:
101. and acquiring the target code.
The object code may be a piece of code or an executable program. In a specific implementation, the electronic device may display a plurality of controls, each control may correspond to a segment of code, and the object code is used to implement a web page loading function, which may be a code related to the CDN.
Optionally, the step 101 may include the following steps:
a1, sending a code acquisition request to a server, and sending first information to the electronic equipment by the server in response to the code acquisition request;
a2, receiving the first information;
a3, acquiring second information;
a4, comparing the first information with the second information;
a5, when the first information is successfully compared with the second information, carrying out decryption operation on the second information to obtain a code storage address identifier carried in the second information;
a6, obtaining the target code from the server according to the code storage address identification.
The first information may be information to be verified, and the first information may be at least one of the following: fingerprint images, face images, iris images, vein images, character strings, MAC addresses, IP addresses, and the like, without limitation. The second information may be at least one of: fingerprint images, face images, iris images, vein images, character strings, MAC addresses, IP addresses, and the like, without limitation.
In specific implementation, the electronic device may send a code obtaining request to the server, the server responds to the code obtaining request, and sends the first information to the electronic device, the electronic device may receive the first information and obtain the second information, compare the first information with the second information, and when the comparison of the first information with the second information is successful, perform a decryption operation on the second information to obtain a code storage address identifier carried in the second information, and further, may obtain the target code from the server according to the code storage address identifier, otherwise, when the comparison of the first information with the second information is failed, the second information needs to be re-obtained to perform information verification again, so that security may be improved.
Further, optionally, when the second information includes an iris template and the first information is an iris image, the step a4 of comparing the first information with the second information may include the following steps:
a41, acquiring a target importance level corresponding to the target code;
a42, determining a first iris recognition threshold corresponding to the target importance level according to the mapping relation between the preset importance level and a reference iris recognition threshold;
a43, obtaining target environment parameters;
a44, determining a first target adjusting parameter corresponding to the target environment parameter according to a mapping relation between a preset environment parameter and the first adjusting parameter;
a45, dividing the iris image into a plurality of regions, and determining the distribution density of the characteristic points of each region in the plurality of regions to obtain a plurality of distribution densities of the characteristic points;
a46, determining a target mean square error according to the distribution densities of the plurality of feature points;
a47, determining a target second adjusting parameter corresponding to the target mean square error according to a mapping relation between a preset mean square error and the second adjusting parameter;
a48, adjusting the first iris identification threshold value according to the first target adjustment parameter and the second target adjustment parameter to obtain a second iris identification threshold value;
a49, matching the iris image with the iris template;
a50, when the matching value between the iris image and the iris template is larger than the second iris recognition threshold value, determining that the first information and the second information are successfully compared.
The electronic device may pre-store a mapping relationship between a preset importance level and a reference iris recognition threshold, a mapping relationship between a preset environmental parameter and a first adjustment parameter, and a mapping relationship between a preset mean square error and a second adjustment parameter. In addition, in the embodiment of the present application, the environmental parameter may be at least one of: the electronic device may include various sensors through which ambient parameter collection may be implemented, without limitation, ambient brightness, ambient color temperature, ambient humidity, magnetic field interference intensity, atmospheric pressure, geographic location, weather, and the like. The value range of the first adjusting parameter can be-1 to 1, for example, the value range of the first adjusting parameter is-0.142 to 0.142. The value range of the second adjusting parameter can also be-1 to-1, for example, the value range of the second adjusting parameter is-0.0913 to 0.0913.
In specific implementation, different codes have different importance, that is, the mapping relationship between the code identifier and the importance level may be stored in advance, and further, the electronic device may obtain the object code identifier of the object code and determine the object importance level corresponding to the object code by using the mapping relationship.
Further, the electronic device may determine the first iris recognition threshold corresponding to the target importance level according to a mapping relationship between a preset importance level and a reference iris recognition threshold, where the reference iris recognition threshold may be preset, and if the reference iris recognition threshold corresponding to the different importance levels is different, the reference iris recognition threshold corresponding to the different importance levels is larger if the importance levels are higher, and if the iris matching value is larger than the reference iris recognition threshold, the iris recognition is successful.
Further, the electronic device may obtain a target environment parameter, and determine a first target adjustment parameter corresponding to the target environment parameter according to a mapping relationship between a preset environment parameter and the first adjustment parameter. The electronic device may further divide the iris image into a plurality of regions, the area size of each region may be the same or different, determine the distribution density of the feature points of each of the plurality of regions, to obtain a plurality of distribution densities of the feature points, specifically, may perform feature point extraction on each of the plurality of regions to determine the number of feature points of each region, and then determine the number of feature points and the area of the region, to obtain the distribution density of the feature points.
Further, the electronic device may determine the target mean square error according to a mean square error calculation formula and according to the distribution density of the plurality of feature points. Furthermore, the electronic device may determine a target second adjustment parameter corresponding to the target mean square error according to a mapping relationship between a preset mean square error and the second adjustment parameter. Then, the electronic device may adjust the first iris recognition threshold according to the first target adjustment parameter and the second target adjustment parameter to obtain a second iris recognition threshold, where the specific calculation formula is as follows:
second iris recognition threshold (first iris recognition threshold (1+ first target modulation parameter) (1+ second target modulation parameter))
Furthermore, the electronic device can match the iris image with the iris template based on the second iris identification threshold, namely when the matching value between the iris image and the iris template is greater than the second iris identification threshold, the comparison between the first information and the second information is determined to be successful, otherwise, the comparison between the first information and the second information is determined to be failed, so that the iris identification threshold can be dynamically adjusted according to the importance, environment and image quality of the code, and the iris identification efficiency is improved while the code safety is ensured.
102. And extracting keywords from the target code to obtain target keywords.
In a specific implementation, the target keyword may be one or more, the electronic device may extract the keyword from the target code, and further, the target keyword may be obtained, and the extraction manner may be semantic recognition, semantic segmentation, a neural network model, and the like, which is not limited herein. The neural network model may be at least one of: convolutional neural network models, impulse neural network models, fully-connected neural network models, recurrent neural network models, and the like, without limitation.
103. Identifying a target network environment of the Content Delivery Network (CDN) according to the target keywords;
in the embodiment of the present application, the target network environment may be a domestic (chinese) network environment or a foreign (country other than chinese) network environment, and of course, the network environment may be further refined, and different countries or different continents correspond to different network environments.
Optionally, when the target keyword includes a plurality of keywords, the step 103 of identifying the target network environment of the content delivery network CDN according to the target keyword may include the following steps:
31. determining the importance of each keyword in the plurality of keywords to obtain a plurality of importance;
32. determining a maximum value of the importance degrees, and acquiring a first keyword corresponding to the maximum value;
33. and determining the target network environment corresponding to the first keyword according to a mapping relation between a preset keyword and the network environment.
The electronic device may further pre-store a mapping relationship between a preset keyword and a network environment. Different keywords can correspond to different importance degrees, the mapping relation between the keywords and the importance degrees can be stored in the electronic equipment in advance, and the higher the importance degree is, the higher the importance degree is. Furthermore, the electronic device may determine the importance of each keyword in the plurality of keywords to obtain a plurality of importance, may also determine a maximum value in the plurality of importance, obtain a first keyword corresponding to the maximum value, and determine the target network environment corresponding to the first keyword according to a preset mapping relationship between the keyword and the network environment, so that the network environment may be accurately identified through the code.
Further, optionally, in the step 31, determining the importance of each of the plurality of keywords to obtain a plurality of importance, may include the following steps:
311. determining a target position of a keyword a in the target code and a reference importance level of the keyword a, wherein the keyword a is any keyword in the keywords;
312. determining the reference importance degree corresponding to the reference importance level according to a mapping relation between a preset importance level and the importance degree;
313. determining a target first adjusting coefficient corresponding to the target position according to a mapping relation between a preset position and the first adjusting coefficient;
314. acquiring the number of keywords of the plurality of keywords;
315. determining the target occurrence frequency of the keyword a according to the number of the keywords;
316. when the target occurrence frequency is greater than a preset threshold value, determining a target second adjusting coefficient corresponding to the target occurrence frequency according to a mapping relation between the preset occurrence frequency and a second adjusting coefficient;
317. and adjusting the reference importance according to the target first adjusting coefficient and the target second adjusting coefficient to obtain the importance of the keyword a.
The preset threshold may be set by the user or default by the system, and may be an empirical value. The electronic device may store a mapping relationship between a preset importance level and the importance degree, and a mapping relationship between a preset position and the first adjustment coefficient in advance.
In specific implementation, taking a keyword a as an example, the keyword a is any keyword of a plurality of keywords, the electronic device may determine a target position of the keyword a in the target code and a reference importance level of the keyword a, determine a reference importance level corresponding to the reference importance level according to a mapping relationship between a preset importance level and the importance level, determine a target first adjustment coefficient corresponding to the target position according to a mapping relationship between a preset position and the first adjustment coefficient, where a value range of the first adjustment coefficient may be-1 to 1, and for example, the first adjustment coefficient may be-0.08 to 0.08.
Further, since the keywords may repeatedly appear, the electronic device may obtain the number of the keywords of the multiple keywords, determine the target occurrence frequency of the keyword a according to the number of the keywords, determine a target second adjustment coefficient corresponding to the target occurrence frequency according to a mapping relationship between the preset occurrence frequency and the second adjustment coefficient when the target occurrence frequency is greater than a preset threshold, where a value range of the second adjustment coefficient may be-1 to 1, for example, the second adjustment coefficient may be-0.052 to 0.052, and adjust the reference importance according to the target first adjustment coefficient and the target second adjustment coefficient to obtain the importance of the keyword a, where the specific calculation formula is as follows:
the importance of the keyword a (the reference importance of the keyword a) (1+ the first adjustment coefficient of the target) ((1 + the second adjustment coefficient of the target))
Furthermore, the importance degree of the keywords can be accurately determined according to the positions and the occurrence frequencies of the keywords, and the network environment can be accurately identified.
Further, optionally, the method may further include the steps of:
and when the target appears to be smaller than or equal to the preset threshold, adjusting the reference importance according to the first adjustment coefficient of the target to obtain the importance of the keyword a.
The electronic device may adjust the reference importance according to the first adjustment coefficient of the target when the target appears less than or equal to the preset threshold, to obtain the importance of the keyword a, where the specific calculation formula is as follows:
the importance of the keyword a (the reference importance of the keyword a) (1+ the first adjustment coefficient of the target)
In specific implementation, when the occurrence frequency of the keyword is low, the corresponding importance of the keyword can be directly adjusted according to the position of the keyword, which is helpful for accurately grasping the importance of the keyword and for realizing accurate identification of a network environment.
104. And realizing content loading operation according to the target network environment.
Wherein, different network environments determine whether the CDN is available. When the CDN is available, the content loading may be implemented according to the CDN, and otherwise, the content loading needs to be completed by the server.
Optionally, the step 104, implementing the content loading operation according to the target network environment, may include the following steps:
41. confirming that the CND is available when the target network environment is a first network environment;
42. implementing static content loading through the CDN;
alternatively, the first and second electrodes may be,
43. when the target network environment is a second network environment, determining that the CDN is unavailable;
44. and informing a target server corresponding to the target code to realize static content loading.
In specific implementation, the electronic device may determine that the CND is available when the target network environment is the first network environment, and then implement static content loading through the CDN. Otherwise, the electronic device may determine that the CDN is unavailable when the target network environment is the second network environment, and notify the target server corresponding to the target code to implement static content loading.
Furthermore, the electronic equipment can delete the code according to the keywords in the code, so that the code is simplified, and the loading speed is increased. Specifically, the electronic device may introduce the head of the keyword, end with a space, a carriage return, a semicolon, or the like, and delete a code therebetween (a regular matching plug-in), and the principle is to identify a domestic environment or a foreign environment by the keyword, determine that the CDN is available if the domestic environment is the domestic environment, load static content by the CDN at the front end, and otherwise determine that the CDN is unavailable if the foreign environment is the foreign environment, for example, notify a video source server to load the static content, and package the loaded data and send the packaged data to the front end through a transmission network for display.
It can be seen that the web page processing method described in the embodiment of the present application is applied to an electronic device, obtains a target code, performs keyword extraction on the target code to obtain a target keyword, identifies a target network environment of a content delivery network CDN according to the target keyword, implements a content loading operation according to the target network environment, can identify the network environment of the CDN according to the keyword in the code, and loads content according to the network environment, and is beneficial to improving the loading efficiency of the CDN.
Referring to fig. 2, fig. 2 is a schematic flowchart of a web page processing method according to an embodiment of the present application, applied to the electronic device shown in fig. 1A, where the web page processing method includes:
201. and acquiring the target code.
202. And extracting keywords from the target code to obtain target keywords.
203. And identifying a target network environment of the content delivery network CDN according to the target keyword.
204. Confirming that the CND is available when the target network environment is a first network environment.
205. And realizing static content loading through the CDN.
206. When the target network environment is a second network environment, determining that the CDN is unavailable;
207. and informing a target server corresponding to the target code to realize static content loading.
For the detailed description of the steps 201 to 207, reference may be made to the corresponding steps of the web page processing method described in the foregoing fig. 1B, and details are not repeated here.
It can be seen that the web page processing method described in the embodiment of the present application is applied to an electronic device, obtains a target code, performs keyword extraction on the target code to obtain a target keyword, identifies a target network environment of a content delivery network CDN according to the target keyword, determines that a CND is available when the target network environment is a first network environment, implements static content loading through the CDN, determines that the CDN is unavailable when the target network environment is a second network environment, notifies a target server corresponding to the target code to implement static content loading, can identify the network environment of the CDN according to the keyword in the target code, and performs content loading according to the network environment, and is beneficial to improving CDN loading efficiency.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and as shown in the drawing, the electronic device includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and in an embodiment of the present application, the programs include instructions for performing the following steps:
acquiring a target code;
extracting keywords from the target code to obtain target keywords;
identifying a target network environment of the Content Delivery Network (CDN) according to the target keywords;
and realizing content loading operation according to the target network environment.
It can be seen that, in the electronic device described in the embodiment of the present application, the target code is obtained, the keyword is extracted from the target code, the target keyword is obtained, the target network environment of the content delivery network CDN is identified according to the target keyword, the content loading operation is implemented according to the target network environment, the network environment of the CDN can be identified according to the keyword in the code, and the content loading is performed according to the network environment, which is beneficial to improving the loading efficiency of the CDN.
Optionally, when the target keyword includes a plurality of keywords, in terms of the identifying the target network environment of the content delivery network CDN according to the target keyword, the program includes instructions for performing the following steps:
determining the importance of each keyword in the plurality of keywords to obtain a plurality of importance;
determining a maximum value of the importance degrees, and acquiring a first keyword corresponding to the maximum value;
and determining the target network environment corresponding to the first keyword according to a mapping relation between a preset keyword and the network environment.
Optionally, in the determining the importance of each of the plurality of keywords to obtain a plurality of importance, the program includes instructions for:
determining a target position of a keyword a in the target code and a reference importance level of the keyword a, wherein the keyword a is any keyword in the keywords;
determining the reference importance degree corresponding to the reference importance level according to a mapping relation between a preset importance level and the importance degree;
determining a target first adjusting coefficient corresponding to the target position according to a mapping relation between a preset position and the first adjusting coefficient;
acquiring the number of keywords of the plurality of keywords;
determining the target occurrence frequency of the keyword a according to the number of the keywords;
when the target occurrence frequency is greater than a preset threshold value, determining a target second adjusting coefficient corresponding to the target occurrence frequency according to a mapping relation between the preset occurrence frequency and a second adjusting coefficient;
and adjusting the reference importance according to the target first adjusting coefficient and the target second adjusting coefficient to obtain the importance of the keyword a.
Optionally, the program further comprises instructions for performing the steps of:
and when the target appears to be smaller than or equal to the preset threshold, adjusting the reference importance according to the first adjustment coefficient of the target to obtain the importance of the keyword a.
Optionally, in terms of the implementing the content loading operation according to the target network environment, the program includes instructions for performing the following steps:
confirming that the CND is available when the target network environment is a first network environment;
implementing static content loading through the CDN;
alternatively, the first and second electrodes may be,
when the target network environment is a second network environment, determining that the CDN is unavailable;
and informing a target server corresponding to the target code to realize static content loading.
The above description has introduced the solution of the embodiment of the present application mainly from the perspective of the method-side implementation process. It is understood that in order to implement the above functions, it includes corresponding hardware structures and/or software modules for performing the respective functions. Those of skill in the art will readily appreciate that the present application is capable of hardware or a combination of hardware and computer software implementing the various illustrative elements and algorithm steps described in connection with the embodiments provided herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the functional units may be divided according to the above method example, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 4 is a block diagram of functional units of a web page processing apparatus 400 according to an embodiment of the present application, where the apparatus 400 is applied to an electronic device, and the apparatus 400 includes: an acquisition unit 401, an extraction unit 402, an identification unit 403, and a loading unit 404, wherein,
the obtaining unit 401 is configured to obtain a target code;
the extracting unit 402 is configured to perform keyword extraction on the target code to obtain a target keyword;
the identifying unit 403 is configured to identify a target network environment of the content delivery network CDN according to the target keyword;
the loading unit 404 is configured to implement a content loading operation according to the target network environment.
It can be seen that the web page processing apparatus described in the embodiment of the present application is applied to an electronic device, obtains a target code, performs keyword extraction on the target code to obtain a target keyword, identifies a target network environment of a content delivery network CDN according to the target keyword, implements a content loading operation according to the target network environment, can identify the network environment of the CDN according to the keyword in the code, and loads content according to the network environment, and is beneficial to improving the loading efficiency of the CDN.
Optionally, when the target keyword includes a plurality of keywords, in terms of identifying the target network environment of the content delivery network CDN according to the target keyword, the identifying unit 403 is specifically configured to:
determining the importance of each keyword in the plurality of keywords to obtain a plurality of importance;
determining a maximum value of the importance degrees, and acquiring a first keyword corresponding to the maximum value;
and determining the target network environment corresponding to the first keyword according to a mapping relation between a preset keyword and the network environment.
Optionally, in the aspect of determining the importance of each keyword in the plurality of keywords to obtain a plurality of importance, the identifying unit 403 is specifically configured to:
determining a target position of a keyword a in the target code and a reference importance level of the keyword a, wherein the keyword a is any keyword in the keywords;
determining the reference importance degree corresponding to the reference importance level according to a mapping relation between a preset importance level and the importance degree;
determining a target first adjusting coefficient corresponding to the target position according to a mapping relation between a preset position and the first adjusting coefficient;
acquiring the number of keywords of the plurality of keywords;
determining the target occurrence frequency of the keyword a according to the number of the keywords;
when the target occurrence frequency is greater than a preset threshold value, determining a target second adjusting coefficient corresponding to the target occurrence frequency according to a mapping relation between the preset occurrence frequency and a second adjusting coefficient;
and adjusting the reference importance according to the target first adjusting coefficient and the target second adjusting coefficient to obtain the importance of the keyword a.
Further, optionally, the identifying unit 403 is further specifically configured to:
and when the target appears to be smaller than or equal to the preset threshold, adjusting the reference importance according to the first adjustment coefficient of the target to obtain the importance of the keyword a.
Optionally, in terms of implementing the content loading operation according to the target network environment, the loading unit 404 is specifically configured to:
confirming that the CND is available when the target network environment is a first network environment;
implementing static content loading through the CDN;
alternatively, the first and second electrodes may be,
when the target network environment is a second network environment, determining that the CDN is unavailable;
and informing a target server corresponding to the target code to realize static content loading.
It can be understood that the functions of each program module of the web page processing apparatus in this embodiment may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the relevant description of the foregoing method embodiment, which is not described herein again.
Embodiments of the present application also provide a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, the computer program enables a computer to execute part or all of the steps of any one of the methods as described in the above method embodiments, and the computer includes a control platform.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising the control platform.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several 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 above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A webpage processing method is applied to electronic equipment, and the method comprises the following steps:
acquiring a target code;
extracting keywords from the target code to obtain target keywords;
identifying a target network environment of the Content Delivery Network (CDN) according to the target keywords;
and realizing content loading operation according to the target network environment.
2. The method of claim 1, wherein when the target keyword comprises a plurality of keywords, the identifying a target network environment of a Content Delivery Network (CDN) according to the target keyword comprises:
determining the importance of each keyword in the plurality of keywords to obtain a plurality of importance;
determining a maximum value of the importance degrees, and acquiring a first keyword corresponding to the maximum value;
and determining the target network environment corresponding to the first keyword according to a mapping relation between a preset keyword and the network environment.
3. The method of claim 2, wherein determining the importance of each of the plurality of keywords results in a plurality of importance levels, comprising:
determining a target position of a keyword a in the target code and a reference importance level of the keyword a, wherein the keyword a is any keyword in the keywords;
determining the reference importance degree corresponding to the reference importance level according to a mapping relation between a preset importance level and the importance degree;
determining a target first adjusting coefficient corresponding to the target position according to a mapping relation between a preset position and the first adjusting coefficient;
acquiring the number of keywords of the plurality of keywords;
determining the target occurrence frequency of the keyword a according to the number of the keywords;
when the target occurrence frequency is greater than a preset threshold value, determining a target second adjusting coefficient corresponding to the target occurrence frequency according to a mapping relation between the preset occurrence frequency and a second adjusting coefficient;
and adjusting the reference importance according to the target first adjusting coefficient and the target second adjusting coefficient to obtain the importance of the keyword a.
4. The method of claim 3, further comprising:
and when the target appears to be smaller than or equal to the preset threshold, adjusting the reference importance according to the first adjustment coefficient of the target to obtain the importance of the keyword a.
5. The method according to any one of claims 1-4, wherein the implementing a content loading operation according to the target network environment comprises:
confirming that the CND is available when the target network environment is a first network environment;
implementing static content loading through the CDN;
alternatively, the first and second electrodes may be,
when the target network environment is a second network environment, determining that the CDN is unavailable;
and informing a target server corresponding to the target code to realize static content loading.
6. A web page processing apparatus applied to an electronic device, the apparatus comprising: an acquisition unit, an extraction unit, an identification unit and a loading unit, wherein,
the acquisition unit is used for acquiring a target code;
the extraction unit is used for extracting keywords from the target code to obtain target keywords;
the identification unit is used for identifying a target network environment of the content delivery network CDN according to the target keyword;
and the loading unit is used for realizing content loading operation according to the target network environment.
7. The apparatus of claim 6, wherein when the target keyword comprises a plurality of keywords, in terms of the identifying the target network environment of the content delivery network CDN according to the target keyword, the identifying unit is specifically configured to:
determining the importance of each keyword in the plurality of keywords to obtain a plurality of importance;
determining a maximum value of the importance degrees, and acquiring a first keyword corresponding to the maximum value;
and determining the target network environment corresponding to the first keyword according to a mapping relation between a preset keyword and the network environment.
8. The apparatus according to claim 7, wherein in said determining the importance of each of the plurality of keywords, resulting in a plurality of importance, the identifying unit is specifically configured to:
determining a target position of a keyword a in the target code and a reference importance level of the keyword a, wherein the keyword a is any keyword in the keywords;
determining the reference importance degree corresponding to the reference importance level according to a mapping relation between a preset importance level and the importance degree;
determining a target first adjusting coefficient corresponding to the target position according to a mapping relation between a preset position and the first adjusting coefficient;
acquiring the number of keywords of the plurality of keywords;
determining the target occurrence frequency of the keyword a according to the number of the keywords;
when the target occurrence frequency is greater than a preset threshold value, determining a target second adjusting coefficient corresponding to the target occurrence frequency according to a mapping relation between the preset occurrence frequency and a second adjusting coefficient;
and adjusting the reference importance according to the target first adjusting coefficient and the target second adjusting coefficient to obtain the importance of the keyword a.
9. An electronic device comprising a processor, a memory for storing one or more programs and configured for execution by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-5.
10. A computer-readable storage medium, characterized in that a computer program for electronic data exchange is stored, wherein the computer program causes a computer to perform the method according to any one of claims 1-5.
CN202011424599.3A 2020-12-08 2020-12-08 Webpage processing method, electronic equipment and related product Active CN112615908B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011424599.3A CN112615908B (en) 2020-12-08 2020-12-08 Webpage processing method, electronic equipment and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011424599.3A CN112615908B (en) 2020-12-08 2020-12-08 Webpage processing method, electronic equipment and related product

Publications (2)

Publication Number Publication Date
CN112615908A true CN112615908A (en) 2021-04-06
CN112615908B CN112615908B (en) 2023-04-18

Family

ID=75229407

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011424599.3A Active CN112615908B (en) 2020-12-08 2020-12-08 Webpage processing method, electronic equipment and related product

Country Status (1)

Country Link
CN (1) CN112615908B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101137095A (en) * 2006-08-30 2008-03-05 株式会社Ntt都科摩 Method of distributing content data, communication system, and distribution device
CN104426845A (en) * 2013-08-21 2015-03-18 博雅网络游戏开发(深圳)有限公司 Webpage accessing method and apparatus based on content distribution network
CN104573025A (en) * 2015-01-12 2015-04-29 北京京东尚科信息技术有限公司 Method and system for increasing page loading rate
US20180219932A1 (en) * 2017-01-31 2018-08-02 Wipro Limited Method and system for proactively selecting a content distribution network (cdn) for delivering content
CN108932277A (en) * 2018-04-25 2018-12-04 网宿科技股份有限公司 A kind of webpage loading method, webpage loading system and server
CN109284472A (en) * 2018-11-15 2019-01-29 福建省华渔教育科技有限公司 Front end webpage loading method, storage medium based on webpack
CN109474668A (en) * 2018-10-16 2019-03-15 平安科技(深圳)有限公司 CDN service switching method, device, computer equipment and storage medium
CN109670126A (en) * 2018-11-27 2019-04-23 广东耐思智慧科技有限公司 A kind of cross-border access accelerating method and device
CN110392069A (en) * 2018-04-17 2019-10-29 华为技术有限公司 CDN traffic scheduling processing method and CDN server

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101137095A (en) * 2006-08-30 2008-03-05 株式会社Ntt都科摩 Method of distributing content data, communication system, and distribution device
CN104426845A (en) * 2013-08-21 2015-03-18 博雅网络游戏开发(深圳)有限公司 Webpage accessing method and apparatus based on content distribution network
CN104573025A (en) * 2015-01-12 2015-04-29 北京京东尚科信息技术有限公司 Method and system for increasing page loading rate
US20180219932A1 (en) * 2017-01-31 2018-08-02 Wipro Limited Method and system for proactively selecting a content distribution network (cdn) for delivering content
CN110392069A (en) * 2018-04-17 2019-10-29 华为技术有限公司 CDN traffic scheduling processing method and CDN server
CN108932277A (en) * 2018-04-25 2018-12-04 网宿科技股份有限公司 A kind of webpage loading method, webpage loading system and server
US20200320154A1 (en) * 2018-04-25 2020-10-08 Wangsu Science & Technology Co., Ltd. A webpage loading method, webpage loading system and server
CN109474668A (en) * 2018-10-16 2019-03-15 平安科技(深圳)有限公司 CDN service switching method, device, computer equipment and storage medium
CN109284472A (en) * 2018-11-15 2019-01-29 福建省华渔教育科技有限公司 Front end webpage loading method, storage medium based on webpack
CN109670126A (en) * 2018-11-27 2019-04-23 广东耐思智慧科技有限公司 A kind of cross-border access accelerating method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
宋江旺等: "环境感知的内容传递技术", 《重庆邮电学院学报(自然科学版)》 *

Also Published As

Publication number Publication date
CN112615908B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
US20200167581A1 (en) Anti-counterfeiting processing method and related products
CN111476780B (en) Image detection method and device, electronic equipment and storage medium
CN107256555B (en) Image processing method, device and storage medium
CN109711259B (en) Fingerprint input method and related equipment
CN109346061B (en) Audio detection method, device and storage medium
EP3905085A1 (en) Data abnormality detection method and apparatus, and terminal device
EP3637290B1 (en) Unlocking control method and related product
CN107977652B (en) Method for extracting screen display content and mobile terminal
CN104281833B (en) Pornographic image recognizing method and device
CN108427873B (en) Biological feature identification method and mobile terminal
EP3623973B1 (en) Unlocking control method and related product
CN110609485B (en) Curtain control method, intelligent projector, curtain and related product
CN109903773B (en) Audio processing method, device and storage medium
CN108234882B (en) Image blurring method and mobile terminal
CN110808041B (en) Voice recognition method, intelligent projector and related product
CN107644396B (en) Lip color adjusting method and device
CN106874936B (en) Image propagation monitoring method and device
CN112699808A (en) Dense target detection method, electronic equipment and related product
CN110555171B (en) Information processing method, device, storage medium and system
CN111818599A (en) Network connection control method, device and storage medium
CN107832714B (en) Living body identification method and device and storage equipment
CN112615908B (en) Webpage processing method, electronic equipment and related product
CN116959059A (en) Living body detection method, living body detection device and storage medium
CN110825475A (en) Input method and electronic equipment
CN114143521A (en) Game projection method, projector 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
GR01 Patent grant
GR01 Patent grant