Method, device, equipment and storage medium for preventing third-party scripts from controlling operations

By obtaining and analyzing the touch pressure value of the APP page, we can determine whether the operation is a real person touch, which solves the problem of affecting the normal use of mobile phone systems and APP functions in the existing technology, and achieves the effect of effectively preventing third-party scripts from controlling APP operations, while ensuring the normal operation of the barrier-free function.

CN119760699APending Publication Date: 2025-04-04GUANGZHOU XINYU NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411760583.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The prior art prevents third-party scripts from controlling APP operations, which affects the normal use of mobile phone systems and APP functions, and cannot effectively ensure the normal operation of barrier-free functions.

Method used

By responding to the press event of the target page, multiple touch pressure values ​​are obtained and based on these values, determine whether it is a real touch. If it is touched by a real person, the press event will be responded normally; otherwise, the press event will be intercepted and no response will be handled.

Benefits of technology

Effectively detect whether it is a real operation, prevent third parties from using scripts to operate the APP, and ensure the normal use of the barrier-free function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760699A_ABST
    Figure CN119760699A_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, equipment and storage medium for preventing third-party scripts from controlling operations, and relates to the field of mobile Internet technology. The method comprises: in response to a press event of a target page, obtaining multiple touch pressure values ​​of the press event; judging whether it is a real person touch based on the touch pressure value; if so, responding to and processing the press event; otherwise, intercepting the press event and not responding to and processing the press event. By obtaining multiple touch pressure values ​​of the press event, it is judged whether it is a real person touch. If it is a real person touch, the press event is responded normally. If it is not a real person touch, it is determined to be a press event triggered by a third-party script, the press event is intercepted, and no response is processed. In this way, it can effectively detect whether it is a real operation, can effectively prevent third parties from using scripts to operate APP, and can also ensure the normal use of barrier-free functions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile Internet technology, and in particular to a method, device, equipment and storage medium for preventing third-party scripts from controlling operations. Background Art

[0002] At present, the purpose of third parties controlling APP operations through scripts is generally to simulate human operations through scripts to complete certain tasks and activities in order to obtain corresponding rewards or grab certain coupons. This behavior is unfair to real users' operations.

[0003] The current mainstream technology to prevent third-party scripts from controlling apps is to prevent simulation of real-person operations by disabling accessibility features, or to prohibit scripts from capturing app page control elements. However, accessibility features are designed to improve the accessibility of mobile phones, so that users with visual, auditory, motor or cognitive disabilities can use the device more easily. If this feature is disabled, it will affect the use of apps by some users. Disabling scripts from capturing app page elements will cause the UI automated test scripts to fail to run normally, affecting the coverage of app function tests and the quality of online launch. Summary of the invention

[0004] The present invention provides a method, device, equipment and storage medium for preventing third-party scripts from controlling operations, so as to solve the defects in the prior art that affect the normal use of mobile phone systems and APP functions, effectively prevent third parties from using scripts to operate APPs, and ensure the normal use of barrier-free functions.

[0005] The present invention provides a method for preventing a third-party script from controlling an operation, comprising:

[0006] In response to a press event of a target page, acquiring a plurality of touch pressure values ​​of the press event;

[0007] Determining whether it is a real person touch based on the touch pressure value;

[0008] If so, respond and process the press event; otherwise, intercept the press event and do not respond and process the press event.

[0009] According to a method for preventing a third-party script from controlling an operation provided by the present invention, the step of judging whether the touch is a real person touch based on the touch pressure value comprises:

[0010] Acquire a pressure change rate according to the plurality of touch pressure values;

[0011] It is determined whether the pressure change rate is close to a preset pressure change curvature.

[0012] According to a method for preventing a third-party script from controlling an operation provided by the present invention, the preset pressure change curvature is set according to a pressure change rate of at least one pressing event entered by a user.

[0013] According to a method for preventing a third-party script from controlling an operation provided by the present invention, the step of judging whether the touch is a real person touch based on the touch pressure value comprises:

[0014] It is determined whether each of the touch pressure values ​​is within a preset touch pressure range.

[0015] According to a method for preventing a third-party script from controlling an operation provided by the present invention, the preset touch pressure range is set according to a touch pressure threshold of at least one pressing event entered by a user.

[0016] According to a method for preventing a third-party script from controlling an operation provided by the present invention, in response to a press event of a target page, obtaining multiple touch pressure values ​​of the press event includes:

[0017] In response to the pressing event, obtaining the screen contact area of ​​multiple fingers;

[0018] The touch pressure value is obtained based on the area of ​​the screen contacted by the finger; wherein the area of ​​the screen contacted by the finger is positively correlated with the touch pressure value.

[0019] According to a method for preventing a third-party script from controlling an operation provided by the present invention, before obtaining the touch pressure value of the press event in response to the press event of the target page, the method comprises:

[0020] Initialize and set touch monitoring events on the target page;

[0021] Determine whether the press event is monitored;

[0022] If yes, the step of obtaining the touch pressure value of the press event in response to the press event of the target page is executed.

[0023] The present invention also provides a device for preventing a third-party script from controlling an operation, comprising:

[0024] An acquisition module, configured to acquire, in response to a press event of a target page, a plurality of touch pressure values ​​of the press event;

[0025] A judging module, used for judging whether the touch is made by a real person based on the touch pressure value;

[0026] The processing module is used for responding to and processing the press event if yes; otherwise, intercepting the press event and not responding to and processing the press event.

[0027] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for preventing a third-party script from controlling an operation as described above is implemented.

[0028] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned methods for preventing third-party scripts from controlling operations.

[0029] The method, device, equipment and storage medium for preventing third-party scripts from controlling operations provided by the present invention determine whether it is a real person touch by obtaining multiple touch pressure values ​​of the press event. If it is a real person touch, the press event is responded to normally. If it is not a real person touch, it is determined to be a press event triggered by a third-party script, the press event is intercepted and no response is made. In this way, it can effectively detect whether it is a real operation, effectively prevent a third party from using scripts to operate the APP, and ensure the normal use of barrier-free functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 This is one of the flow charts of the method for preventing a third-party script from controlling an operation provided by the present invention;

[0032] Figure 2 is a schematic diagram of a preset pressure change curvature according to an exemplary embodiment of the present invention;

[0033] Figure 3 It is a structural schematic diagram of a device for preventing a third-party script from controlling an operation provided by the present invention;

[0034] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] It should be noted that, in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "include one..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0037] Combine the following Figure 1-Figure 4 The invention describes a method, device, equipment and storage medium for preventing third-party scripts from controlling operations.

[0038] like Figure 1 As shown, a method for preventing a third-party script from controlling an operation provided by the present invention can be applied to a touch-controlled device, such as a mobile phone, a tablet computer, a wearable device, etc. The method specifically comprises the following steps:

[0039] Step 110 : In response to a press event of a target page, a plurality of touch pressure values ​​of the press event are acquired.

[0040] Step 120: determine whether the touch is real person touch based on the touch pressure value.

[0041] Step 130, if yes, respond and process the press event; otherwise, intercept the press event and do not respond and process the press event.

[0042] Specifically, the target page is a page that needs to prevent third-party scripts from simulating human click operations, such as a task activity page that can obtain rewards, an activity page for grabbing coupons, etc. A press event refers to an event generated by a user's press and click operation on the target page. When a press event is generated on the target page, multiple touch pressure values ​​of the press event are obtained.

[0043] When a real person presses and clicks on a touch device, the pressure of contacting the screen varies. According to the pressure sensor of the touch device, multiple touch pressure values ​​of the press event can be obtained, and whether it is a real person touch is determined according to the touch pressure value. If it is a real person touch, the processing logic corresponding to the press event is responded to. If it is not a real person touch, the press event is intercepted and no response processing is performed.

[0044] In some embodiments, before step 110, the following may be included:

[0045] Initialize and set touch monitoring events on the target page;

[0046] Determine whether the press event is monitored;

[0047] If yes, step 110 is executed.

[0048] In this embodiment, when a target page that needs to be protected from third-party script operations is initialized, it is configured to monitor touch operations on the target page to enable a function of intercepting third-party scripts.

[0049] Since some touch devices are capacitive screens, which have no pressure sensors, in some embodiments, step 110 may include:

[0050] In response to the pressing event, obtaining the screen contact area of ​​multiple fingers;

[0051] The touch pressure value is obtained based on the area of ​​the screen contacted by the finger; wherein the area of ​​the screen contacted by the finger is positively correlated with the touch pressure value.

[0052] In this embodiment, the screen contact areas of multiple fingers in a press event can be obtained, and the touch pressure values ​​can be converted according to the screen contact areas of the fingers, and then whether it is a real person touch can be determined according to the touch pressure values.

[0053] It is understandable that when a real person performs a click operation on a touch device, the area of ​​the finger contacting the screen and the pressure of the finger contacting the screen are changed, while the area and pressure generated by the click operation performed by a third party using a script do not change with the real person's operation. Therefore, the present invention determines whether it is a real person touch by the area of ​​the finger contacting the screen and the touch pressure value. The area of ​​the finger contacting the screen can be calculated based on multiple click coordinates of the press event.

[0054] In some embodiments, step 120 may specifically include:

[0055] Acquire a pressure change rate according to the plurality of touch pressure values;

[0056] It is determined whether the pressure change rate is close to a preset pressure change curvature.

[0057] Figure 2 FIG. 1 is a schematic diagram of a preset pressure change curvature of an exemplary embodiment. Figure 2 As shown, the pressure change of a press event will gradually increase, and will gradually decrease after reaching a certain maximum value. Therefore, a similar pressure change rate curve can be obtained based on multiple touch pressure values ​​of the press event to determine whether it is close to the preset pressure change curvature. If so, the press event is determined to be a real person touch, and the processing logic corresponding to the press event is responded to. If it is not close to the preset pressure change curvature (for example, the pressure change is smooth), the press event is not a real person touch, and the press event is intercepted without response processing.

[0058] In some embodiments, the preset pressure change curvature is set according to the pressure change rate of at least one pressing event entered by the user. It is understandable that different users may obtain different pressure change curvatures according to their personal clicking operation habits. In this embodiment, the pressure change rate of one or more user pressing events can be collected to obtain the preset pressure change curvature of the user, so that the accuracy of real person touch detection can be improved.

[0059] In some embodiments, step 120 may specifically include:

[0060] It is determined whether each of the touch pressure values ​​is within a preset touch pressure range.

[0061] Specifically, the preset touch pressure range may be set according to the touch pressure threshold of at least one press event entered by the user. Similarly, different users may have different touch pressure thresholds according to their personal click operation habits. In this embodiment, the touch pressure thresholds of one or more user press events may be collected to obtain the preset touch pressure range of the user, thereby improving the accuracy of real person touch detection.

[0062] In some embodiments, the pressure change rate and the touch pressure threshold may be combined to determine whether a certain pressing event is a real person touch.

[0063] It should be noted that, in the case of a touch device without a pressure sensor, the finger touch area change rate can be used to replace the pressure change rate, so as to determine whether it is a real touch based on the preset touch area change curvature. The finger touch area threshold can also be used to replace the touch pressure threshold, so as to determine whether it is a real touch based on the preset touch area range.

[0064] The method for preventing third-party scripts from controlling operations provided by the present invention determines whether it is a real person touch by obtaining multiple touch pressure values ​​of the press event. If it is a real person touch, the press event is responded to normally. If it is not a real person touch, it is determined to be a press event triggered by a third-party script, the press event is intercepted, and no response is made. In this way, it can effectively detect whether it is a real operation, effectively prevent a third party from using scripts to operate the APP, and ensure the normal use of barrier-free functions.

[0065] The device for preventing a third-party script from controlling an operation provided by the present invention is described below. The device for preventing a third-party script from controlling an operation described below and the method for preventing a third-party script from controlling an operation described above can be referred to each other.

[0066] like Figure 3 As shown, the present invention also provides a device for preventing a third-party script from controlling an operation, specifically comprising:

[0067] An acquisition module 310 is used to acquire multiple touch pressure values ​​of a press event in response to a press event of a target page;

[0068] A determination module 320, configured to determine whether the touch is a real person touch based on the touch pressure value;

[0069] The processing module 330 is used to respond to and process the press event if yes; otherwise, intercept the press event and do not respond to and process the press event.

[0070] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute a method for preventing a third-party script from controlling an operation, the method comprising: in response to a press event of a target page, obtaining multiple touch pressure values ​​of the press event; judging whether it is a real person touch based on the touch pressure value; if so, responding to and processing the press event; otherwise, intercepting the press event and not responding to and processing the press event.

[0071] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0072] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method for preventing third-party scripts from controlling operations provided by the above methods. The method includes: responding to a press event of a target page, obtaining multiple touch pressure values ​​of the press event; judging whether it is a real person touch based on the touch pressure value; if so, responding to and processing the press event; otherwise, intercepting the press event and not responding to and processing the press event.

[0073] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the method for preventing third-party script control operations provided by the above-mentioned methods. The method includes: responding to a press event of a target page, obtaining multiple touch pressure values ​​of the press event; judging whether it is a real person touch based on the touch pressure value; if so, responding to and processing the press event; otherwise, intercepting the press event and not responding to and processing the press event.

[0074] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0075] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0076] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for preventing third-party scripts from controlling operations, characterized in that: include: In response to a press event of a target page, acquiring a plurality of touch pressure values ​​of the press event; Determining whether it is a real person touch based on the touch pressure value; If yes, respond and process the press event; Otherwise, the press event is intercepted and no response is made to the press event.

2. The method for preventing third-party scripts from controlling operations according to claim 1, characterized in that: The determining whether the touch is a real person touch based on the touch pressure value includes: Acquire a pressure change rate according to the plurality of touch pressure values; It is determined whether the pressure change rate is close to a preset pressure change curvature.

3. The method for preventing third-party scripts from controlling operations according to claim 2, characterized in that: The preset pressure change curvature is set according to the pressure change rate of at least one pressing event entered by the user.

4. The method for preventing third-party scripts from controlling operations according to claim 1, characterized in that: The determining whether the touch is a real person touch based on the touch pressure value includes: It is determined whether each of the touch pressure values ​​is within a preset touch pressure range.

5. The method for preventing third-party scripts from controlling operations according to claim 4, characterized in that: The preset touch pressure range is set according to a touch pressure threshold of at least one pressing event entered by a user.

6. The method for preventing third-party scripts from controlling operations according to any one of claims 1 to 5, characterized in that: The step of obtaining, in response to a press event of a target page, a plurality of touch pressure values ​​of the press event comprises: In response to the pressing event, obtaining the screen contact area of ​​multiple fingers; The touch pressure value is obtained based on the area of ​​the screen contacted by the finger; wherein the area of ​​the screen contacted by the finger is positively correlated with the touch pressure value.

7. The method for preventing third-party scripts from controlling operations according to claim 1, characterized in that: Before obtaining the touch pressure value of the press event in response to the press event of the target page, the method includes: Initialize and set touch monitoring events on the target page; Determine whether the press event is monitored; If yes, the step of obtaining the touch pressure value of the press event in response to the press event of the target page is executed.

8. A device for preventing a third-party script from controlling an operation, characterized in that: include: An acquisition module, configured to acquire, in response to a press event of a target page, a plurality of touch pressure values ​​of the press event; A judging module, used for judging whether the touch is made by a real person based on the touch pressure value; A processing module, for responding to and processing the pressing event if yes; Otherwise, the press event is intercepted and no response is made to the press event.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method for preventing third-party scripts from controlling operations as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for preventing a third-party script from controlling an operation as claimed in any one of claims 1 to 7 is implemented.