Link detection methods, devices, electronic equipment, and storage media
By simulating link clicks on terminal devices and listening to the time information of access requests, the problem of inaccurate detection of restricted link access in existing technologies is solved, and accurate detection is achieved in low-traffic scenarios.
Patent Information
- Application Number
- CN202111164526.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-09-30
AI Technical Summary
In existing technologies, when web page links are restricted in applications, they cannot be accurately detected in low-traffic scenarios, leading to false positives and false negatives.
By sending the link to be detected and simulated click commands to the terminal device, listening to the time information of the access request, determining the origin retrieval time, and judging whether the link is restricted from access based on preset conditions.
It can accurately detect whether a link is restricted by the target application in any application scenario, avoiding false positives and false negatives in high-traffic scenarios.
Smart Images

Figure CN113901451B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and more particularly to the field of data processing technology. Background Technology
[0002] Currently, sending web links within an application can result in access restrictions on those links. By collecting the access logs of the link's domain return traffic, the access traffic (i.e., return traffic) can be determined. If the return traffic drops sharply within a unit of time, it indicates that the domain may be subject to access restrictions. Summary of the Invention
[0003] This disclosure provides a link detection method, apparatus, electronic device, and storage medium.
[0004] According to one aspect of this disclosure, a link detection method is provided, comprising:
[0005] Send the link to be detected and a simulated click instruction to the target application running on the terminal device; wherein, the simulated click instruction is used to instruct the terminal device to access the link to be detected in the target application;
[0006] Upon detecting an access request sent by a terminal device for a link to be detected, the origin retrieval time of the link to be detected is determined based on the time information of the access request.
[0007] If the origin retrieval time meets the preset conditions, it is determined that the link to be detected is restricted from access by the target application.
[0008] According to another aspect of this disclosure, a link detection device is provided, comprising:
[0009] The simulated access module is used to send the link to be detected and the simulated click instruction to the target application running on the terminal device; wherein, the simulated click instruction is used to instruct the terminal device to access the link to be detected in the target application.
[0010] The determination module is used to determine the origin retrieval time of the link to be detected based on the time information of the access request when an access request for the link to be detected is sent by the terminal device.
[0011] The detection module is used to determine if the link to be detected is restricted from access by the target application when the origin retrieval time meets preset conditions.
[0012] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0013] At least one processor; and
[0014] A memory that is communicatively connected to at least one processor; wherein,
[0015] The memory stores instructions that can be executed by at least one processor, such that the at least one processor can perform any of the domain name detection methods described in this disclosure.
[0016] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute any of the link detection methods in the embodiments of this disclosure.
[0017] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the link detection methods described in the embodiments of this disclosure.
[0018] One embodiment of the above application has the following advantages or beneficial effects: After simulating a click on the link to be detected in the target application of the terminal device, the origin-fetching time of the link to be detected is determined by listening to the time information of the access requests for the link to be detected. Based on the origin-fetching time, the return flow status of the link to be detected is determined, and it is determined whether the link to be detected is restricted by the target application. Since it is not necessary to rely on traffic to determine whether the link to be detected is restricted by the target application, it is possible to determine whether the link to be detected is restricted by the target application in any application scenario.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0020] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0021] Figure 1 This is a flowchart of a link detection method according to an embodiment of the present disclosure;
[0022] Figure 2 This is a flowchart of a link detection method according to an embodiment of the present disclosure;
[0023] Figure 3 This is a detailed flowchart of a link detection method according to an embodiment of the present disclosure;
[0024] Figure 4 This is a block diagram of a link detection device according to an embodiment of the present disclosure;
[0025] Figure 5 This is a block diagram of a link detection device according to an embodiment of the present disclosure;
[0026] Figure 6 This is a block diagram of an electronic device used to implement the link detection method of the embodiments of this disclosure. Detailed Implementation
[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0028] Figure 1 This is a flowchart of a link detection method according to an embodiment of this application. Figure 1 As shown, the method may include:
[0029] S101, Send the link to be detected and a simulated click instruction to the target application running on the terminal device; wherein, the simulated click instruction is used to instruct the terminal device to access the link to be detected in the target application;
[0030] S102. Upon detecting an access request sent by a terminal device for a link to be detected, determine the origin retrieval time of the link to be detected based on the time information of the access request.
[0031] S103. If the origin retrieval time meets the preset conditions, determine that the link to be detected is restricted from access by the target application.
[0032] For example, the terminal device can be a smartphone, tablet, handheld device with wireless communication capabilities, computing device, etc. The system running on the terminal device can be iOS (Input Output System), Android, Symbian, or a Microsoft platform. The target application can be any application (App) on the terminal device, or a specific application to be detected, i.e., an application to be detected that restricts access to links. The target application can include instant messaging apps, messaging apps, etc. It is understood that the version of the target application matches the type of system running on the terminal device. In this embodiment, an Android device is used as an example for explanation.
[0033] In step S101, for example, the simulated click instruction can be an adb (Android Debug Bridge) command. For instance, operations such as clicking, double-clicking, or swiping on the terminal device can be achieved by sending an adb command.
[0034] In this embodiment, simulated clicking of the link to be detected can be achieved through interaction between an electronic device used to perform the above method and a terminal device. Specifically, the electronic device sends a simulated click instruction to the terminal device, which instructs the terminal device to access the link to be detected to simulate a user clicking the link on a target application.
[0035] In some exemplary embodiments of this application, a Node.js environment can be deployed on the electronic device to render the page based on a preset format, thereby rendering the link to be detected onto the target application of the terminal device. The preset format can be an HTML5 standard format, etc., and is not limited thereto. Then, an intelligent application (e.g., an automator application) sends an ADB command corresponding to the click operation to the terminal device, thereby simulating a click on the link to be detected.
[0036] In practical applications, after a terminal device simulates a click on the link to be detected within the target application, it sends an access request to the server. If the terminal device successfully accesses the server, it updates the origin retrieval time (RTG) of the link to be detected based on the time information of the access request. If the terminal device does not access the server, it will not update the RTG of the link to be detected. In this case, the time information of the access request is empty, or it remains unchanged, i.e., the previously updated RTG is retained.
[0037] In step S103, for example, the preset condition may be that the retrieval time exceeds a preset time node, or that the time interval between the retrieval time of the link to be detected and the sending time of the link to be detected is greater than a second duration, or that the time interval between the retrieval time and the current time is greater than a first duration, etc.
[0038] For example, if an electronic device sends a link and simulated click command at a first preset time node, and the homing time exceeds a second preset time node, it is considered that the terminal device has not accessed the link to be tested normally, and it is determined that the link to be tested is restricted from access.
[0039] For example, electronic devices record the time when the link to be tested is sent. If the time interval between the return time determined after sending the link and the simulated click command and the time when the link to be tested is sent exceeds a second duration, it is considered that the terminal device has not accessed the link to be tested normally, and it is determined that the link to be tested is restricted from access.
[0040] For example, if an electronic device continuously sends the link to be tested and simulates click commands multiple times, and updates the origin time whenever it detects an access request for the link to be tested, if the time interval between the origin time and the current time is greater than the first duration, that is, if the origin time has not been updated for a long time, it can be considered that the terminal device has not accessed the link to be tested normally, and it can be determined that the link to be tested is restricted from access.
[0041] In the technical solution disclosed herein, after simulating a click on the link to be detected in the target application of the terminal device, the time information of the access request to the link to be detected is listened to to determine the origin return time of the link to be detected. Based on the origin return time, the return flow status of the link to be detected is determined, so as to determine whether the link to be detected is restricted by the target application. This effectively avoids the situation where it can only be determined that the link is restricted in high-traffic scenarios, and can cover all application scenarios.
[0042] In one implementation, step S101 involves sending a link to be detected and a simulated click instruction to a target application running on a terminal device, including:
[0043] Based on a preset cycle length, it periodically sends the link to be detected and simulated click commands to the target application running on the terminal device.
[0044] The preset cycle length can be set according to actual application requirements and is not limited here.
[0045] For example, multiple links can be sent within each cycle, such as one link per second. At the end of each cycle, it can be determined whether each link is restricted by the target application based on its latest origin pull time. For instance, with a preset cycle length of 60 seconds, the electronic device will send the link and a simulated click command every 60 seconds for any one of the multiple links. After sending 60 links in each cycle, the restricted links can be identified based on their respective origin pull times, and the service provider corresponding to those links can be notified.
[0046] Furthermore, if the origin server response time meets preset conditions, it is determined that the link to be detected is restricted from access by the target application, including:
[0047] If the time interval between the origin retrieval time and the current time is greater than a first duration, it is determined that the link to be detected is restricted from access by the target application; wherein, the first duration is greater than or equal to the preset period length.
[0048] For example, if the preset period length is 60 seconds, the first duration can be set to 60 seconds. This first duration can also be extended as needed; there is no limitation here. The time difference between the origin retrieval time and the current time is calculated and compared to 60 seconds. If the time difference is greater than 60 seconds, it means that no access requests were detected within a period, and the link under test is restricted by the target application. If the time difference is not greater than 60 seconds, it means that access requests were detected in the most recent period, and the link under test is not restricted by the target application. This allows for accurate identification of restricted links, further avoiding false positives. Using this method, the system can continuously monitor whether the link under test is restricted by the target application, and promptly detect any anomalies when access is restricted.
[0049] Following the previous example, the electronic device can monitor multiple links within a single period. If, after the i-th period, all monitored links reach the server (the corresponding access requests are detected), then each monitored link has updated its origin pull time, confirming that none of the monitored links are restricted. If, within the i-th period, a link fails to update its origin pull time, then after the end of the i-th period, the origin pull time of that link will exceed the first duration. Thus, based on the interval between the origin pull time and the current time for each link, the restricted links can be identified.
[0050] In one implementation, determining that the link to be detected is restricted from access by the target application when the origin retrieval time meets preset conditions includes:
[0051] If the origin retrieval time is empty, it is determined that the link to be detected is restricted from access by the target application.
[0052] For example, if no access request is detected, the time information of the access request cannot be received. In this case, the origin time can be set to an empty value, thereby directly determining that the link to be detected is restricted from access by the target application.
[0053] For example, the above methods can be combined, that is, if either of the following two conditions is met, namely, the time interval between the origin time and the current time is greater than a first duration and the origin time is an empty value, it can be determined that the link to be detected is restricted from access by the target application.
[0054] For example, if no access request is detected in the first round of detection, the origin pull time for the corresponding link to be detected is set to an empty value, indicating that the link to be detected is restricted by the target application. As another example, if access requests are detected in the first N rounds of detection (the first N periods), and the origin pull time is continuously updated, and the origin pull time for the link to be detected is updated to t1 in the Nth round of detection, and no access request is detected in the N+1th round, then the origin pull time remains at t1. At the end of the N+1th round of detection, if the origin pull time is greater than the period length, then it is determined that the link to be detected is restricted by the target application.
[0055] In one implementation, such as Figure 2 As shown, the method further includes:
[0056] S201. After listening to the access request, increment the link number stored in the first database to obtain the target link number.
[0057] S202. Based on the target link number, extract the link corresponding to the target link number from the second database as the new link to be detected, and update the link number stored in the first database to the target link number; wherein, the database contains multiple links and link numbers corresponding one-to-one with the multiple links.
[0058] For example, the first database can be a Redis sorted set, and the second database can be a MySQL database. All links to be tested are stored in the MySQL database, and each link is numbered. If a MySQL database were used directly, it would be overloaded with both data interaction and storage when there are many requests for the links to be tested. Therefore, the current link being tested and its corresponding link number in the MySQL database are stored in the Redis sorted set. This allows data interaction to be performed through the Redis sorted set, so the MySQL database is only used for storage, thus alleviating its load. The number (e.g., i) in the MySQL database is saved to the Redis sorted set. After the current link to be tested is tested (i.e., the origin retrieval time is determined), the Redis sorted set retrieves the next link to be tested with the number (i+1) from the MySQL database without making another request to the server, thus reducing server load. Once all the links to be checked in the MySQL database have been checked, the Redis sorted set will start checking from the first link to be checked stored in the MySQL database. This allows for a circular polling check of the MySQL database using the Redis sorted set, which can promptly identify restricted links to be checked.
[0059] For example, if the current link to be checked is the tenth link in the MySQL database, and the unique ID of this link is stored in a Redis sorted set, after checking the current link, it's necessary to request the next link in the MySQL database as the new link to be checked. First, the Redis sorted set is checked to confirm that the checked link is the tenth link in the MySQL database. Based on this, the link ID of the new link to be checked is determined to be the eleventh. Then, using the condition `selectwhere>10` and `limit=1`, the eleventh link to be checked is found in the MySQL database.
[0060] For example, the key in the Redis sorted set is the link, and the score corresponds to the timestamp of the latest backlink (i.e., the backlink time). Thus, after the backlink time of each link to be checked is determined, this time is recorded in the Redis sorted set. After one round of checks (of a preset period length), calculations are performed based on the backlink time in the Redis sorted set and the current time to accurately identify the links restricted by the target application.
[0061] Furthermore, an expiration time can be set for the cache, and the data recorded in the Redis sorted set can be written to a MySQL database. This allows for timely retrieval of all information about the link to be checked from the MySQL database during the next check.
[0062] In one embodiment, the method further includes:
[0063] If the target application restricts access to the link to be detected, obtain the domain name corresponding to the link to be detected from the header information of the access request;
[0064] An alert is triggered based on the domain name corresponding to the link to be detected.
[0065] For example, by using the host request header information, the domain name corresponding to the link to be detected (corresponding to the server of the link to be detected) can be identified, indicating that access to this server is restricted. Therefore, the server can be replaced promptly, reducing resource consumption. Furthermore, based on the domain name corresponding to the link to be detected, corresponding information is generated to continuously provide alerts, thereby avoiding missed alerts.
[0066] For example, if you click on a.baidu.com, b.baidu.com, and c.baidu.com on WeChat, and only receive access requests for a.baidu.com and b.baidu.com, it means that c.baidu.com is restricted. The restricted server can be determined based on the host request header information.
[0067] To make it easier to understand, the following examples are provided:
[0068] like Figure 3 As shown, a request is sent to the server to retrieve links to be tested. All links to be tested are stored in a MySQL database and sorted. The current link to be tested and its link number in the MySQL database are stored in a Redis sorted set, thus establishing a relationship between the Redis sorted set and the MySQL database. This way, once the current link to be tested has been tested, the link number stored in the Redis sorted set can be used to find the next link with that link number in the MySQL database and identify that link as the new link to be tested.
[0069] The currently monitored link is sent to the Android device and rendered in an H5 page opened in WeChat. The smartapp-automator framework sends ADB commands to the Android device to simulate a click on the link. After the Android device simulates a click on the link in the target application, it sends an access request to that link to determine the origin server time. The domain name corresponding to the link is identified based on the host request header information, and the origin server time is recorded in a Redis sorted set. The time difference between the origin server time in the Redis sorted set and the current time is calculated. Based on this time difference, it is determined whether the link is restricted by WeChat. An alarm is generated based on the restricted links and their corresponding servers.
[0070] Figure 4 This is a block diagram of a link detection device according to an embodiment of this application. Figure 4 As shown, the device may include:
[0071] The simulated access module 401 is used to send a link to be detected and a simulated click instruction to a target application running on a terminal device; wherein, the simulated click instruction is used to instruct the terminal device to access the link to be detected in the target application.
[0072] The determination module 402 is used to determine the origin retrieval time of the link to be detected based on the time information of the access request when an access request for the link to be detected is sent by the terminal device.
[0073] The detection module 403 is used to determine that the link to be detected is restricted from access by the target application if the origin return time meets the preset conditions.
[0074] In one embodiment, the simulated access module 401 is further configured to periodically send the link to be detected and the simulated click instruction to the target application running on the terminal device based on a preset period length.
[0075] The detection module 403 is also used to determine that the link to be detected is restricted from access by the target application if the time interval between the return time and the current time is greater than a first duration; wherein the first duration is greater than or equal to a preset period length.
[0076] In one implementation, the detection module 403 is further configured to determine that the link to be detected is restricted from access by the target application when the origin retrieval time is null.
[0077] In one implementation, such as Figure 5 As shown, the device further includes: a number determination module 501, used to increment the link number stored in the first database to obtain the target link number after listening to the access request.
[0078] Module 502 is invoked to extract the link corresponding to the target link number from the second database based on the target link number, and use it as a new link to be detected, and to update the link number stored in the first database to the target link number; wherein, the database contains multiple links and link numbers corresponding to each of the multiple links.
[0079] In one implementation, such as Figure 5 As shown, the device also includes:
[0080] Processing module 506 is used to obtain the domain name corresponding to the link to be detected from the header information of the access request when the link to be detected is restricted from access by the target application.
[0081] Alarm module 507 is used to issue an alarm based on the domain name corresponding to the link to be detected.
[0082] In the technical solution of the link detection device disclosed herein, after simulating a click on a link to be detected in the target application of the terminal device, the time information of access requests to the link to be detected is monitored to determine the origin response time of the link to be detected. Based on the origin response time, the return flow status of the link to be detected is determined, thus determining whether the link to be detected is restricted by the target application. Since it does not rely on traffic to determine whether the link to be detected is restricted by the target application, it can determine whether the link to be detected is restricted by the target application in any application scenario.
[0083] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0084] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and an electronic device program product.
[0085] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital electronic devices, such as laptop electronic devices, desktop electronic devices, workstations, personal digital assistants, servers, blade servers, mainframe electronic devices, and other suitable electronic devices. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0086] like Figure 6 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on an electronic device program stored in read-only memory (ROM) 602 or loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0087] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through electronic device networks such as the Internet and / or various telecommunications networks.
[0088] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as the link detection method. For example, in some embodiments, the link detection method may be implemented as an electronic device software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the electronic device program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the electronic device program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the link detection method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the link detection method by any other suitable means (e.g., by means of firmware).
[0089] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), electronic device hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more electronic device programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0090] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose electronic device, a special-purpose electronic device, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0091] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable electronic device disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0092] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0093] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user electronic device with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., a communication network) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0094] Electronic device systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by electronic device programs running on the respective devices and having a client-server relationship with each other. The server can be a cloud server, a server for a distributed system, or a server incorporating blockchain technology.
[0095] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0096] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A link detection method, applied to an electronic device, comprising: Send a link to be detected and a simulated click instruction to a target application running on a terminal device, so that the terminal device sends an access request for the link to be detected to a server based on the simulated click instruction; wherein, the simulated click instruction is used to instruct the terminal device to access the link to be detected in the target application. If no access request is detected, the origin retrieval time of the link to be detected is set to an empty value; if the access request is detected, the origin retrieval time of the link to be detected is determined based on the time information of the access request. If the origin retrieval time meets preset conditions, it is determined that the link to be detected is restricted from access by the target application; The preset conditions include any one of the following: The homing time exceeds a preset time node; The time interval between the origin retrieval time and the delivery time of the link to be detected is greater than the second duration; The time interval between the source retrieval time and the current time is greater than the first duration.
2. The method according to claim 1, wherein, Sending the link to be detected and the simulated click instruction to the target application running on the terminal device includes: Based on a preset cycle length, the link to be detected and the simulated click command are periodically sent to the target application running on the terminal device; The step of determining that the link to be detected is restricted from access by the target application when the origin retrieval time meets preset conditions includes: If the time interval between the origin retrieval time and the current time is greater than a first duration, it is determined that the link to be detected is restricted from access by the target application; wherein the first duration is greater than or equal to the preset period length.
3. The method according to claim 1 or 2, wherein, The preset conditions also include an origin pull time that is null. The step of determining that the link to be detected is restricted from access by the target application when the origin pull time meets the preset conditions includes: If the origin retrieval time is null, it is determined that the link to be detected is restricted from access by the target application.
4. The method according to any one of claims 1-3, further comprising: Upon completion of listening to the access request, the link number stored in the first database is incremented to obtain the target link number; Based on the target link number, the link corresponding to the target link number is extracted from the second database and used as a new link to be detected. The link number stored in the first database is then updated to the target link number. The database contains multiple links and link numbers that correspond one-to-one with each of the multiple links.
5. The method according to any one of claims 1-4, further comprising: If the link to be detected is restricted from access by the target application, the domain name corresponding to the link to be detected is obtained from the header information of the access request. An alarm will be triggered based on the domain name corresponding to the link to be detected.
6. A link detection device, comprising: The simulated access module is used to send a link to be detected and a simulated click instruction to a target application running on a terminal device, so that the terminal device sends an access request for the link to be detected to a server based on the simulated click instruction; wherein, the simulated click instruction is used to instruct the terminal device to access the link to be detected in the target application. The determination module is used to set the origin retrieval time of the link to be detected to an empty value when no access request is detected; and to determine the origin retrieval time of the link to be detected based on the time information of the access request when an access request for the link to be detected is detected by the terminal device. The detection module is used to determine that the link to be detected is restricted from access by the target application if the origin retrieval time meets the preset conditions; The preset conditions include any one of the following: The homing time exceeds a preset time node; The time interval between the origin retrieval time and the delivery time of the link to be detected is greater than the second duration; The time interval between the source retrieval time and the current time is greater than the first duration.
7. The apparatus according to claim 6, wherein, The simulated access module is also used to periodically send the link to be detected and the simulated click instruction to the target application running on the terminal device based on a preset period length. The detection module is further configured to determine that the link to be detected is restricted from access by the target application if the time interval between the source return time and the current time is greater than a first duration; wherein the first duration is greater than or equal to the preset period length.
8. The apparatus according to claim 6 or 7, wherein, The preset conditions also include that the origin retrieval time is null. The detection module is further used to determine that the link to be detected is restricted from access by the target application when the origin retrieval time is null.
9. The apparatus according to any one of claims 6-8, wherein, The device further includes: The number determination module is used to increment the link number stored in the first database to obtain the target link number after listening to the access request. The calling module is used to extract the link corresponding to the target link number from the second database based on the target link number, and use it as a new link to be detected, and update the link number stored in the first database with the target link number; wherein, the database contains multiple links and link numbers corresponding one-to-one with the multiple links.
10. The apparatus according to any one of claims 6-9, further comprising: The processing module is configured to obtain the domain name corresponding to the link to be detected from the header information of the access request when the link to be detected is restricted from access by the target application. The alarm module is used to issue an alarm based on the domain name corresponding to the link to be detected.
11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-5.
13. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-5.
Citation Information
Patent Citations
Website availability monitoring method and device, storage medium and computer equipment
CN111464376A