Detailed Description
As shown in fig. 1, a web page exists on a mobile terminal (mobile phone), the current web page includes a plurality of hyperlinks, a user can automatically jump to a target object of the hyperlinks by clicking a certain hyperlink in the web page, the target object is displayed on a browser, and the target object is opened or operated according to the type of the target object.
However, in practical situations, although there are some hyperlinks in the web page, there are some hyperlinks with problems, so that the user may not respond all the time by clicking the hyperlink, and for the user, the reason for the problem of the hyperlink may not be known at the time, and only waiting or reselecting other hyperlinks can be selected, so that the user experience is affected. For various reasons, there is an invalid hyperlink in the existing hyperlinks, so a technical scheme capable of determining the invalid hyperlink is needed urgently so as to make corresponding processing on the invalid hyperlink subsequently and improve user experience.
In view of the above technical problems, the embodiments of the present disclosure provide a technical solution, by determining a type to which a hyperlink selected by a user belongs, generating a timer corresponding to the type to which the hyperlink selected by the user belongs, monitoring whether to jump from a current page to a target object of the hyperlink within a time interval specified by the timer, and if not, determining that the hyperlink selected by the user is an invalid hyperlink. Therefore, the purpose of determining the invalid hyperlink can be achieved, so that corresponding processing can be carried out on the invalid hyperlink later, and the user experience is improved.
Specifically, the technical scheme provided in the embodiment of the present specification is as follows:
determining the type of the hyperlink selected by the user; generating a timer corresponding to the type of the hyperlink selected by the user according to the corresponding relation between the preset hyperlink type and the timer, wherein the hyperlink type corresponds to the timer one by one; monitoring whether the current page jumps to the target object of the hyperlink in a time interval appointed by the timer; if not, determining that the hyperlink selected by the user is an invalid hyperlink.
In order for those skilled in the art to better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification shall fall within the scope of protection.
Referring to fig. 2, a flowchart of an implementation of a method for determining an invalid hyperlink according to an embodiment of the present disclosure may specifically include the following steps:
s201, determining the type of the hyperlink selected by the user;
it is first necessary to determine the hyperlink selected by the user. In this specification, as shown in fig. 1, when a user clicks on any one of the hyperlinks, it is determined that the hyperlink selected by the user is hyperlink 1, for example, when the user clicks on the operation trigger of hyperlink 1.
After determining the user-selected hyperlink, the type of hyperlink to which the user-selected hyperlink belongs is determined. In this specification, different hyperlink types may be obtained in advance according to different divisions of a hyperlink connection path. In general, hyperlinks can be classified into the following types according to their connection paths: the method comprises the steps of internally linking, externally linking and anchor linking, so that the hyperlinks can be divided into different types of hyperlinks in advance according to the dividing rule, 3 types of hyperlinks (such as an internal type, an external type and an anchor type) can be obtained, the types of hyperlinks (such as an internal type, an external type and an anchor type) to which the hyperlinks selected by the user belong can be determined according to the difference of connection paths of the hyperlinks selected by the user, the hyperlinks can be of an internal type, an external type and an anchor type, the hyperlinks can be of an external type and an anchor type, and the like, and the names of the types of the hyperlinks divided in the specification can be arbitrarily named, the types of the hyperlinks can be of an A type and a B type and the like, and the specification is not limited.
In addition, different hyperlink types can be obtained in advance according to different divisions of the target object of the hyperlink. Generally, depending on the target object of the hyperlink (this target object may be another web page, or may be a different location on the same web page, or may be a picture, an email address, a file, or even an application), the hyperlink may be classified into the following types: the method comprises the steps of dividing the hyperlinks into different types of hyperlinks according to the dividing rules, and obtaining a plurality of types of hyperlinks (such as text type, image type, email type, anchor type, multimedia type, null type and the like), so that the type of the hyperlink selected by the user can be determined according to the difference of target objects of the hyperlink selected by the user, the type of the hyperlink selected by the user can be text type, the type of the hyperlink can be image type, the type of the anchor point and the like, and the names of the types of the hyperlinks divided in the specification can be named arbitrarily, or A type, B type and the like, and the specification is not limited.
S202, generating a timer corresponding to the type of the hyperlink selected by the user according to the corresponding relation between the preset hyperlink type and the timer, wherein the hyperlink type corresponds to the timer one by one;
for the hyperlink types determined in S201, according to the correspondence between the preset hyperlink types and the timers, a Timer (Timer) corresponding to the determined hyperlink types is generated, the generated Timer designates an effective time interval, and different hyperlink types can correspond to different timers, so that different timers can be generated, which means that the effective time interval designated by the Timer is different according to the different hyperlink types.
For example, the determined hyperlink type is an internal type, according to the corresponding relation between the preset hyperlink type and the Timer, a Timer1 corresponding to the internal type can be generated, the time interval designated by the Timer1 is 1S, the determined hyperlink type is an external type, according to the corresponding relation between the preset hyperlink type and the Timer, a Timer2 corresponding to the external type can be generated, the time interval designated by the Timer2 is 1.5S, the determined hyperlink type is an anchor point type, according to the corresponding relation between the preset hyperlink type and the Timer, a Timer3 corresponding to the anchor point type can be generated, and the time interval designated by the Timer3 is 2S.
For example, the determined hyperlink type is a text type, according to the corresponding relation between the preset hyperlink type and the Timer, a Timer-A corresponding to the text type can be generated, the time interval designated by the Timer-A is 1S, the determined hyperlink type is an image type, according to the corresponding relation between the preset hyperlink type and the Timer, a Timer-B corresponding to the image type can be generated, the time interval designated by the Timer-B is 1.5S, the determined hyperlink type is an e-mail type, according to the corresponding relation between the preset hyperlink type and the Timer, a Timer-C corresponding to the e-mail type can be generated, and the time interval designated by the Timer-C is 2S.
The corresponding relation between the hyperlink types and the timers is preset, one hyperlink type corresponds to one timer, and as mentioned above, 3 hyperlink types are obtained in advance according to different divisions of the hyperlink connection paths: the method comprises the steps of obtaining a plurality of hyperlink types in advance according to different divisions of target objects of hyperlinks, wherein each hyperlink type corresponds to a timer: text type, image type, email type, anchor type, multimedia type, null type, etc., each hyperlink type corresponding to a timer. The corresponding relation between the hyperlink type and the timer can be obtained: the hyperlink types are in one-to-one correspondence with the timers.
S203, monitoring whether the current page jumps to the target object of the hyperlink in a time interval appointed by the timer;
for the Timer generated in S202, in the time interval specified by the Timer, whether the current page jumps to the target object of the hyperlink is monitored, where the target object may be another web page, or may be a different location on the same web page, or may be a picture, an email address, a file, or even an application program. For example, for Timer-B, it is monitored whether to jump from the current page to the target object (target image) of the hyperlink within 2S specified by the Timer-B.
If the current page jumps to the target object of the hyperlink, displaying the target object corresponding to the hyperlink;
and in the effective time interval designated by the Timer, jumping from the current page to the target object of the hyperlink, and displaying the target object corresponding to the hyperlink if the user can normally access the target object. For example, for Timer-B, within 2S specified by the Timer-B, the current page jumps to the target object (target image) of the hyperlink, and the target object (target image) of the hyperlink is displayed.
S204, if not, determining that the hyperlink selected by the user is an invalid hyperlink.
And in the effective time interval designated by the Timer, the user cannot access the target object of the hyperlink without jumping to the hyperlink from the current page, and the hyperlink selected by the user is indicated to be an invalid hyperlink, so that the hyperlink selected by the user can be determined to be the invalid hyperlink. For example, for Timer-B, if the current page does not jump to the target object of the hyperlink within 2S specified by the Timer-B, then the hyperlink 2 corresponding to the Timer-B may be determined to be an invalid hyperlink.
Based on the above scheme, as a preferred embodiment, in the case that the hyperlink selected by the user is determined to be an invalid hyperlink, a new hyperlink may be recommended according to a preset rule, and specifically, the following implementation manner may be adopted to recommend the new hyperlink:
in the hyperlink history selection record, at least one new hyperlink with the same hyperlink type as the invalid hyperlink belongs to is recommended randomly. Wherein the hyperlink history selection record records the hyperlinks which are selected by the user historically, and at least one new hyperlink which has the same hyperlink type as the invalid hyperlink belongs to can be randomly recommended. For example, in the case where it is determined that the hyperlink 1 selected by the user is an invalid hyperlink, the type to which the invalid hyperlink belongs is an internal type, 3 new hyperlinks are randomly recommended in the hyperlink history selection record, and the types to which the 3 new hyperlinks belong are internal types.
At least one new hyperlink associated with the target object of the invalid hyperlink is randomly recommended in the hyperlink history selection record. The correlation refers to the correlation of the type of the target object and also refers to the correlation of the content of the target object. For example, in the case where it is determined that the hyperlink 1 selected by the user is an invalid hyperlink, the target object of the invalid hyperlink is one image, 3 new hyperlinks are randomly recommended in the hyperlink history selection record, and the target objects (images) of the 3 new hyperlinks are related to the target object (image) of the invalid hyperlink. For example, in the case where it is determined that the hyperlink 2 selected by the user is an invalid hyperlink, the target object of the invalid hyperlink is a text including a key field (e.g., hyperlink), 3 new hyperlinks are randomly recommended in the hyperlink history selection record, and the target objects of the 3 hyperlinks (key fields in text) are related to the target object of the invalid hyperlink (key fields in text) (e.g., all introduction hyperlinks).
Based on the above scheme, as a preferred embodiment, in the case that it is determined that the hyperlink selected by the user is an invalid hyperlink, whether the invalid hyperlink is an illegal hyperlink may be determined according to a preset hyperlink splicing rule, if yes, the user may be prompted that the hyperlink selected by the user is an illegal hyperlink, otherwise, the user is prompted that a problem occurs in the network, or the target object of the hyperlink selected by the user is prompted to be inaccessible. In general, a hyperlink includes several fixed elements, each element has a respective attribute, and some elements at designated positions are generally the same and represent a certain meaning, where in the case that it is determined that a hyperlink selected by a user is an invalid hyperlink, whether the number of elements in the invalid hyperlink meets a preset requirement can be determined, or whether the element at the head of the invalid hyperlink is a preset element (e.g., https:///, WWW) can be determined, so as to further determine whether the invalid hyperlink is an illegal hyperlink.
Based on the above scheme, as a preferred embodiment, in the case that the hyperlink selected by the user is determined to be an invalid hyperlink, the user may be prompted to select the hyperlink as an invalid hyperlink.
Through the description of the technical scheme provided by the embodiment of the specification, the timer corresponding to the type of the hyperlink selected by the user is generated by determining the type of the hyperlink selected by the user, whether the current page jumps to the target object of the hyperlink is monitored within the time interval specified by the timer, and if not, the hyperlink selected by the user can be determined to be an invalid hyperlink. In this way, through the technical scheme provided by the specification, the purpose of determining the invalid hyperlink can be achieved, so that corresponding processing can be performed on the invalid hyperlink later, for example, a new hyperlink is recommended, a user is prompted to select the hyperlink as the invalid hyperlink, and user experience is improved.
With respect to the above method embodiment, the embodiment of the present disclosure further provides a device for determining an invalid hyperlink, as shown in fig. 3, where the device may include: a type determination module 310, a timer generation module 320, a monitoring module 330, an invalid hyperlink determination module 340.
A type determining module 310, configured to determine a type to which the hyperlink selected by the user belongs;
the timer generation module 320 is configured to generate a timer corresponding to the type to which the hyperlink selected by the user belongs according to a preset correspondence between the hyperlink type and the timer, where the hyperlink type corresponds to the timer one by one;
a monitoring module 330, configured to monitor whether the current page jumps to the target object of the hyperlink within a time interval specified by the timer;
an invalid hyperlink determining module 340 for determining that the hyperlink selected by the user is an invalid hyperlink if not.
In a specific embodiment of the present specification, the hyperlink types are obtained in advance according to different divisions of the hyperlink connection paths.
In a specific embodiment of the present specification, the hyperlink type is obtained in advance according to different divisions of the target object of the hyperlink.
In one embodiment of the present specification, the apparatus further comprises:
the hyperlink recommending module 350 is configured to recommend a new hyperlink according to a preset rule if it is determined that the hyperlink selected by the user is an invalid hyperlink.
In one embodiment of the present disclosure, the hyperlink recommendation module 350 is specifically configured to:
in the hyperlink history selection record, at least one new hyperlink with the same hyperlink type as the invalid hyperlink belongs to is recommended randomly.
In one embodiment of the present disclosure, the hyperlink recommendation module 350 is specifically configured to:
at least one new hyperlink associated with the target object of the invalid hyperlink is randomly recommended in the hyperlink history selection record.
In one embodiment of the present specification, the apparatus further comprises:
a judging module 360, configured to judge whether the invalid hyperlink is an illegal hyperlink according to a preset hyperlink splicing rule if it is determined that the hyperlink selected by the user is the invalid hyperlink;
if yes, prompting the user that the selected hyperlink is an illegal hyperlink, otherwise prompting the user that the network has a problem, or prompting the user that the target object of the selected hyperlink cannot be accessed.
In one embodiment of the present specification, the apparatus further comprises:
the prompting module 380 is configured to prompt the user that the hyperlink selected by the user is an invalid hyperlink if it is determined that the hyperlink selected by the user is an invalid hyperlink.
The implementation process of the functions and roles of each module in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
Through the description of the technical scheme provided by the embodiment of the specification, the timer corresponding to the type of the hyperlink selected by the user is generated by determining the type of the hyperlink selected by the user, whether the current page jumps to the target object of the hyperlink is monitored within the time interval specified by the timer, and if not, the hyperlink selected by the user can be determined to be an invalid hyperlink. In this way, through the technical scheme provided by the specification, the purpose of determining the invalid hyperlink can be achieved, so that corresponding processing can be performed on the invalid hyperlink later, for example, a new hyperlink is recommended, a user is prompted to select the hyperlink as the invalid hyperlink, and user experience is improved.
Embodiments of the present disclosure also provide a computer device, as shown in fig. 4, which may include: processor 410, memory 420, input/output interface 430, communication interface 440, and bus 450. Wherein processor 410, memory 420, input/output interface 430, and communication interface 440 enable communication connections within the device between each other via bus 450.
The processor 410 may be implemented by a general-purpose CPU (Central Processing Unit ), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 420 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 420 may store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present specification are implemented in software or firmware, the relevant program codes are stored in memory 420 and invoked for execution by processor 410.
The input/output interface 430 is used to connect with an input/output module to realize information input and output. The input/output module may be configured as a component in a device (not shown) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
The communication interface 440 is used to connect communication modules (not shown) to enable communication interactions of the device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 450 includes a path to transfer information between components of the device (e.g., processor 410, memory 420, input/output interface 430, and communication interface 440).
It should be noted that although the above device only shows the processor 410, the memory 420, the input/output interface 430, the communication interface 440, and the bus 450, in the implementation, the device may further include other components necessary to achieve normal operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The present embodiments also provide a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the foregoing method of determining invalid hyperlinks. The method at least comprises the following steps:
a method of determining invalid hyperlinks, the method comprising:
determining the type of the hyperlink selected by the user;
generating a timer corresponding to the type of the hyperlink selected by the user according to the corresponding relation between the preset hyperlink type and the timer, wherein the hyperlink type corresponds to the timer one by one;
monitoring whether the current page jumps to the target object of the hyperlink in a time interval appointed by the timer;
if not, determining that the hyperlink selected by the user is an invalid hyperlink.
Computer-readable media include both permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
From the foregoing description of embodiments, it will be apparent to those skilled in the art that the present embodiments may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solutions of the embodiments of the present specification may be embodied in essence or what contributes to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present specification.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The apparatus embodiments described above are merely illustrative, in which the modules illustrated as separate components may or may not be physically separate, and the functions of the modules may be implemented in the same piece or pieces of software and/or hardware when implementing the embodiments of the present disclosure. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is merely a specific implementation of the embodiments of this disclosure, and it should be noted that, for a person skilled in the art, several improvements and modifications may be made without departing from the principles of the embodiments of this disclosure, and these improvements and modifications should also be considered as protective scope of the embodiments of this disclosure.