Web interface form filling method, device, computer equipment and storage medium
By combining the browser's BackgroundPages and Content Script components, the cumbersome operation and prevention of form filling in the operation and maintenance security management system are solved, and flexible and convenient form filling is realized, improving the efficiency of operation and maintenance work.
Patent Information
- Application Number
- CN202111626567.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-12-28
AI Technical Summary
In the operation and maintenance security management system, when the existing technology uses a browser-driven API to fill in forms, there are problems such as cumbersome operations, inflexible and anti-filling mechanisms, which affects the efficiency of operation and maintenance work.
By calling the browser's BackgroundPages extension component to obtain operation and maintenance parameters, use the Content Script component to simulate manual filling, bypass the anti-generation filling mechanism, and realize form filling in the web interface.
It realizes flexible and convenient filling of forms for preventing agent filling, avoids the problem of slow browser driver speed, and improves the efficiency of operation and maintenance work.
Smart Images

Figure CN114282146B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment operation and maintenance, and in particular to a method, device, computer equipment and storage medium for filling out a form on a Web interface. Background Art
[0002] With the continuous development of IT systems in enterprises and institutions, the scale of networks and the number of devices have expanded rapidly. The increasingly complex IT systems and the uncontrollable behaviors of operation and maintenance personnel have brought great risks to the security of information systems. In this scenario, the operation and maintenance security management system has been widely used. The operation and maintenance security management system can provide centralized authority control, authorize users' assets and accounts, and limit the use rights of assets. Operation and maintenance personnel can perform operation and maintenance operations on authorized assets through the management system.
[0003] In the use of operation and maintenance security management system, the most commonly used one is the Web proxy operation and maintenance based on application server, which uses the application server to perform operation and maintenance management of Web protocol. For the current implementation technology, the proxy filling can be realized by grabbing the DOM element id and name attributes through the browser-driven API. Due to the diversity of Web interfaces, there are also various anti-proxy filling methods. This may cause the proxy filling program to fail to correctly fill the corresponding account and password into the corresponding form. The operation and maintenance personnel cannot correctly fill in the specified account and password during management, resulting in the inability to complete the operation and maintenance management, which has a great impact on the operation and maintenance work.
[0004] On the other hand, the method of grabbing the DOM element id and name attributes through the browser-driven API to implement the filling requires adapting the browser-driven version on the browser, which has the defect of cumbersome operation. On the other hand, due to the slow call of the browser-driven, it has the defect of inflexibility. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a form filling method, device, computer equipment and storage medium for a Web interface, so as to realize form filling of a Web interface in the asset operation and maintenance process, especially to realize form filling for some special Web applications that are anti-form filling.
[0006] To this end, the first aspect of the present application discloses a method for filling out a form in a Web interface, which is applied in an operation and maintenance audit system, and includes:
[0007] When it is detected that the operation and maintenance user triggers an operation and maintenance request for the target application server, connecting to the target application server;
[0008] Starting a browser of the target application server;
[0009] Calling the BackgroundPages extension component of the browser to obtain operation and maintenance parameters;
[0010] Calling the BackgroundPages extension component to open a form page based on the operation and maintenance parameters;
[0011] The Content Script component of the browser is called so that the Content Script component completes filling in the form page based on the operation and maintenance parameters.
[0012] In the first aspect of the present application, as an optional implementation, the calling of the BackgroundPages extension component of the browser to obtain operation and maintenance parameters includes:
[0013] The target session ID is sent to the BackgroundPages extension component, so that the BackgroundPages extension component obtains the operation and maintenance parameters from the server based on the target session ID, wherein the operation and maintenance parameters at least include the target URL, the proxy account number, the proxy password, and the proxy process information.
[0014] In the first aspect of the present application, as an optional implementation, calling the BackgroundPages extension component to open a form page based on the operation and maintenance parameter includes:
[0015] The BackgroundPages extension component is called to enable the BackgroundPages extension component to open the form page based on the URL.
[0016] In the first aspect of the present application, as an optional implementation, calling the ContentScript component of the browser so that the ContentScript component completes filling in the form page based on the operation and maintenance parameters includes:
[0017] The Content Script component of the browser is called to enable the Content Script component to obtain the proxy filling account number, the proxy filling password and the proxy filling process information, and enable the Content Script component to fill in the proxy filling account number and the proxy filling password in the form page based on the proxy filling process information.
[0018] In the first aspect of the present application, as an optional implementation manner, before connecting to the target application server, the method further includes:
[0019] Receiving first configuration information for a target application server;
[0020] First configuration information is sent to the target application server, so that the target application server is configured to be remotely accessible based on the first configuration information.
[0021] In the first aspect of the present application, as an optional implementation manner, before connecting to the target application server, the method further includes:
[0022] receiving second configuration information for the operation and maintenance user, wherein the second configuration information includes an asset management account and an asset management password of the operation and maintenance user;
[0023] The permission information corresponding to the asset management account is set so that the operation and maintenance user can operate and maintain the target application server.
[0024] In the first aspect of the present application, as an optional implementation manner, before connecting to the target application server, the method further includes:
[0025] Obtain information about the filling process;
[0026] The filling process information is tested.
[0027] The second aspect of the present application discloses a form filling device for a Web interface, the device being applied to an operation and maintenance audit system, the device comprising:
[0028] A connection module, configured to connect to the target application server when it is detected that an operation and maintenance user triggers an operation and maintenance request for the target application server;
[0029] A startup module, used to start the browser of the target application server;
[0030] A first calling module is used to call the BackgroundPages extension component of the browser to obtain operation and maintenance parameters;
[0031] A second calling module calls the BackgroundPages extension component to open a form page based on the operation and maintenance parameters;
[0032] The third calling module calls the Content Script component of the browser so that the Content Script component completes filling in the form page based on the operation and maintenance parameters.
[0033] A third aspect of the present application discloses a computer device, the device comprising:
[0034] A memory storing executable program code;
[0035] a processor coupled to the memory;
[0036] The processor calls the executable program code stored in the memory to execute the form filling method of the Web interface of the first aspect of the present application.
[0037] The fourth aspect of the present application discloses a storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the form filling method of the Web interface of the first aspect of the present application.
[0038] Compared with the prior art, this application has the following beneficial technical effects:
[0039] This application connects to the target application server, and then starts the browser of the target application server, and then calls the BackgroundPages extension component of the browser to obtain operation and maintenance parameters, and then calls the BackgroundPages extension component to open the form page based on the operation and maintenance parameters, and finally calls the Content Script component of the browser, so that the Content Script component completes the filling of the form page based on the operation and maintenance parameters.
[0040] Compared with the prior art that uses the API provided by the browser driver to complete form filling, this application does not need to install the browser driver on the application server, and thus does not need to adapt the browser driver based on the version of the browser of the application server, so it has the advantages of more flexible and convenient operation. At the same time, since this application does not rely on the browser driver to complete the form filling, it does not need to start the browser driver, thus avoiding the defect of slow browser driver call speed. On the other hand, since the Content Script component of this application can simulate the real manual filling process, it can avoid the anti-substitute filling mechanism of the page, so it has better operational flexibility.
[0041] It should be noted that for other descriptions of the device of this application, please refer to the detailed description of this application one, and this application will not go into details. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 It is a flowchart of a method for filling out a form on a Web interface disclosed in an embodiment of the present application;
[0044] Figure 2 It is a structural diagram of a form filling device for a Web interface disclosed in an embodiment of the present application;
[0045] Figure 3 It is a structural schematic diagram of a computer device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0047] Embodiment 1
[0048] See also Figure 1 , Figure 1 1 is a flow chart of a method for filling out a form on a Web interface disclosed in an embodiment of the present application, wherein the method of the embodiment of the present application is applied to an operation and maintenance audit system. Figure 1 As shown, the method of the embodiment of the present application includes the following steps:
[0049] 101. When it is detected that the operation and maintenance user triggers an operation and maintenance request for the target application server, connect to the target application server;
[0050] 102. Start the browser of the target application server;
[0051] 103. Call the BackgroundPages extension component of the browser to obtain operation and maintenance parameters;
[0052] 104. Call the BackgroundPages extension component to open the form page based on the operation and maintenance parameters;
[0053] 105. Call the Content Script component of the browser so that the Content Script component completes filling in the form page based on the operation and maintenance parameters.
[0054] The embodiment of the present application can start the browser of the target application server by connecting to the target application server, and then call the BackgroundPages extension component of the browser to obtain operation and maintenance parameters, and then call the BackgroundPages extension component to open the form page based on the operation and maintenance parameters, and finally call the ContentScript component of the browser to enable the Content Script component to complete the filling of the form page based on the operation and maintenance parameters.
[0055] Compared with the prior art that uses the API provided by the browser driver to complete form filling, the embodiment of the present application does not need to install the browser driver on the application server, and thus does not need to adapt the browser driver based on the version of the browser of the application server, thereby having the advantages of more flexible and convenient operation. At the same time, since the present application does not rely on the browser driver to complete the form filling, and thus does not need to start the browser driver, the defect of slow browser driver call speed can be avoided. On the other hand, since the Content Script component of the embodiment of the present application can simulate the real manual filling process, and thus can avoid the anti-substitute filling mechanism of the page, it has better operational flexibility.
[0056] In the embodiment of the present application, the target application server in the operation and maintenance process is regarded as an operation and maintenance asset.
[0057] In the embodiment of the present application, the browser may be Google Chrome. Accordingly, Google Chrome improves the BackgroundPages extension component. For the relevant description of the BackgroundPages extension component, please refer to the prior art, which will not be elaborated in the embodiment of the present application.
[0058] In the embodiment of the present application, the Content Script component is a functional component provided by the browser. For relevant descriptions thereof, please refer to the prior art, and the embodiment of the present application will not elaborate on this.
[0059] In the embodiment of the present application, as an optional implementation, step 103: calling the BackgroundPages extension component of the browser to obtain operation and maintenance parameters includes the following sub-steps:
[0060] The target session ID is sent to the BackgroundPages extension component, so that the BackgroundPages extension component obtains operation and maintenance parameters from the server based on the target session ID, wherein the operation and maintenance parameters at least include the target URL, the proxy account, the proxy password, and the proxy process information.
[0061] In this optional implementation, the server may be an operation and maintenance audit system or other equipment.
[0062] In this optional implementation, the target URL (Uniform Resource Locator) is a link to the form to be filled in, and the form to be filled in can be accessed through the target URL.
[0063] In this optional implementation, the proxy filling process information can be used to indicate in which filling box in the form page to fill in the proxy filling account number or proxy filling password.
[0064] In the embodiment of the present application, as an optional implementation, step 103: calling the BackgroundPages extension component to open the form page based on the operation and maintenance parameters includes the following steps:
[0065] Call the BackgroundPages extension component to cause the BackgroundPages extension component to open the form page based on the URL.
[0066] This optional implementation can open the form page through the BackgroundPages extension component and the URL.
[0067] In the embodiment of the present application, as an optional implementation, step 105: calling the ContentScript component of the browser so that the ContentScript component completes filling in the form page based on the operation and maintenance parameters, includes the following sub-steps:
[0068] The Content Script component of the browser is called to enable the Content Script component to obtain the proxy filling account number, proxy filling password and proxy filling process information, and enable the Content Script component to fill in the proxy filling account number and proxy filling password in the form page based on the proxy filling process information.
[0069] In this optional implementation, by calling the Content Script component of the browser, the Content Script component can obtain the proxy account number, proxy password and proxy process information, and fill in the proxy account number and proxy password in the form page based on the proxy process information.
[0070] In the embodiment of the present application, as an optional implementation, before connecting to the target application server, the method of the embodiment of the present application further includes the following steps:
[0071] Receiving first configuration information for a target application server;
[0072] The first configuration information is sent to the target application server, so that the target application server is configured to be remotely accessible based on the first configuration information.
[0073] This optional implementation manner receives first configuration information for a target application server, and then sends the first configuration information to the target application server, and then configures the target application server to be remotely accessible based on the first configuration information, so that the target application server can be connected through the remote access function of the target application server.
[0074] In the embodiment of the present application, as an optional implementation, before connecting to the target application server, the method of the embodiment of the present application further includes the following steps:
[0075] receiving second configuration information for the operation and maintenance user, the second configuration information including an asset management account and an asset management password of the operation and maintenance user;
[0076] Set the permission information corresponding to the asset management account so that the operation and maintenance user can operate and maintain the target application server.
[0077] In this optional implementation, by receiving the second configuration information for the operation and maintenance user, the permission information corresponding to the asset management account can be set so that the operation and maintenance user can operate and maintain the target application server. For example, for operation and maintenance user A, by configuring the account and password for operation and maintenance user A, operation and maintenance user A can log in to the operation and maintenance audit system. On the other hand, by setting the permission information of operation and maintenance user A, the assets that operation and maintenance user A can maintain can be determined.
[0078] In the embodiment of the present application, as an optional implementation, before connecting to the target application server, the method of the embodiment of the present application further includes the following steps:
[0079] Obtain information about the filling process;
[0080] Test the filling process information.
[0081] This optional implementation method can test the proxy filling process information through the proxy filling process information to ensure that the browser in the target application server can correctly complete the proxy filling of the account number and password based on the proxy filling process information that has passed the test.
[0082] Embodiment 2
[0083] See also Figure 2 , Figure 2 1 is a schematic diagram of a form filling device for a Web interface disclosed in an embodiment of the present application, wherein the form filling device for the Web interface is applied to an operation and maintenance audit system. Figure 1 As shown, the method of the embodiment of the present application includes the following functional modules:
[0084] The connection module 201 is used to connect to the target application server when it is detected that the operation and maintenance user triggers an operation and maintenance request for the target application server;
[0085] A starting module 202, used to start the browser of the target application server;
[0086] The first calling module 203 is used to call the BackgroundPages extension component of the browser to obtain operation and maintenance parameters;
[0087] The second calling module 204 is used to call the BackgroundPages extension component to open the form page based on the operation and maintenance parameters;
[0088] The third calling module 205 is used to call the Content Script component of the browser, so that the Content Script component completes filling in the form page based on the operation and maintenance parameters.
[0089] The embodiment of the present application can start the browser of the target application server by connecting to the target application server, and then call the BackgroundPages extension component of the browser to obtain operation and maintenance parameters, and then call the BackgroundPages extension component to open the form page based on the operation and maintenance parameters, and finally call the ContentScript component of the browser to enable the Content Script component to complete the filling of the form page based on the operation and maintenance parameters.
[0090] Compared with the prior art that uses the API provided by the browser driver to complete form filling, the embodiment of the present application does not need to install the browser driver on the application server, and thus does not need to adapt the browser driver based on the version of the browser of the application server, thereby having the advantages of more flexible and convenient operation. At the same time, since the present application does not rely on the browser driver to complete the form filling, and thus does not need to start the browser driver, the defect of slow browser driver call speed can be avoided. On the other hand, since the Content Script component of the embodiment of the present application can simulate the real manual filling process, and thus can avoid the anti-substitute filling mechanism of the page, it has better operational flexibility.
[0091] It should be noted that for other descriptions of the device of the embodiment of the present application, please refer to the detailed description of the first embodiment of the present application, and the embodiment of the present application will not be elaborated on this.
[0092] Embodiment 3
[0093] See also Figure 3 , Figure 3 Schematic diagram of the structure of a computer device disclosed in the embodiment of the present application. Figure 3 As shown, the device of the embodiment of the present application includes:
[0094] A memory 301 storing executable program codes;
[0095] a processor 302 coupled to the memory 301;
[0096] The processor 302 calls the executable program code stored in the memory 301 to execute the form filling method of the Web interface of the first embodiment of the present application.
[0097] The embodiment of the present application can start the browser of the target application server by connecting to the target application server, and then call the BackgroundPages extension component of the browser to obtain operation and maintenance parameters, and then call the BackgroundPages extension component to open the form page based on the operation and maintenance parameters, and finally call the ContentScript component of the browser to enable the Content Script component to complete the filling of the form page based on the operation and maintenance parameters.
[0098] Compared with the prior art that uses the API provided by the browser driver to complete form filling, the embodiment of the present application does not need to install the browser driver on the application server, and thus does not need to adapt the browser driver based on the version of the browser of the application server, thereby having the advantages of more flexible and convenient operation. At the same time, since the present application does not rely on the browser driver to complete the form filling, and thus does not need to start the browser driver, the defect of slow browser driver call speed can be avoided. On the other hand, since the Content Script component of the embodiment of the present application can simulate the real manual filling process, and thus can avoid the anti-substitute filling mechanism of the page, it has better operational flexibility.
[0099] It should be noted that for other descriptions about the computer device of the embodiment of the present application, please refer to the detailed description of the first embodiment of the present application, and the embodiment of the present application will not go into details thereon.
[0100] Embodiment 4
[0101] An embodiment of the present application discloses a storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the form filling method of the Web interface of the first embodiment of the present application.
[0102] The embodiment of the present application can start the browser of the target application server by connecting to the target application server, and then call the BackgroundPages extension component of the browser to obtain operation and maintenance parameters, and then call the BackgroundPages extension component to open the form page based on the operation and maintenance parameters, and finally call the ContentScript component of the browser to enable the Content Script component to complete the filling of the form page based on the operation and maintenance parameters.
[0103] Compared with the prior art that uses the API provided by the browser driver to complete form filling, the embodiment of the present application does not need to install the browser driver on the application server, and thus does not need to adapt the browser driver based on the version of the browser of the application server, thereby having the advantages of more flexible and convenient operation. At the same time, since the present application does not rely on the browser driver to complete the form filling, and thus does not need to start the browser driver, the defect of slow browser driver call speed can be avoided. On the other hand, since the Content Script component of the embodiment of the present application can simulate the real manual filling process, and thus can avoid the anti-substitute filling mechanism of the page, it has better operational flexibility.
[0104] It should be noted that for other descriptions about the storage medium of the embodiment of the present application, please refer to the detailed description of the first embodiment of the present application, and the embodiment of the present application will not be elaborated on this.
[0105] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0106] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0108] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including a number of instructions to enable 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 application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM) random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0109] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0110] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for filling out a form on a Web interface, characterized in that: The method is applied to an operation and maintenance audit system, and the method includes: When it is detected that the operation and maintenance user triggers an operation and maintenance request for the target application server, connecting to the target application server; Starting a browser of the target application server; Calling the BackgroundPages extension component of the browser to obtain operation and maintenance parameters; Calling the BackgroundPages extension component to open a form page based on the operation and maintenance parameters; The Content Script component of the browser is called so that the Content Script component completes filling in the form page based on the operation and maintenance parameters.
2. The method according to claim 1, characterized in that The calling of the BackgroundPages extension component of the browser to obtain operation and maintenance parameters includes: The target session ID is sent to the BackgroundPages extension component, so that the BackgroundPages extension component obtains the operation and maintenance parameters from the server based on the target session ID, wherein the operation and maintenance parameters at least include the target URL, the proxy account number, the proxy password, and the proxy process information.
3. The method according to claim 2, characterized in that The calling of the BackgroundPages extension component to open the form page based on the operation and maintenance parameters includes: The BackgroundPages extension component is called to enable the BackgroundPages extension component to open the form page based on the URL.
4. The method according to claim 3, characterized in that The calling of the Content Script component of the browser so that the Content Script component completes filling in the form page based on the operation and maintenance parameters includes: The Content Script component of the browser is called to enable the Content Script component to obtain the proxy filling account number, the proxy filling password and the proxy filling process information, and enable the Content Script component to fill in the proxy filling account number and the proxy filling password in the form page based on the proxy filling process information.
5. The method according to claim 1, characterized in that Before connecting to the target application server, the method further includes: Receiving first configuration information for a target application server; First configuration information is sent to the target application server, so that the target application server is configured to be remotely accessible based on the first configuration information.
6. The method according to claim 1, characterized in that Before connecting to the target application server, the method further includes: receiving second configuration information for the operation and maintenance user, wherein the second configuration information includes an asset management account and an asset management password of the operation and maintenance user; The permission information corresponding to the asset management account is set so that the operation and maintenance user can operate and maintain the target application server.
7. The method according to claim 1, characterized in that Before connecting to the target application server, the method further includes: Obtain information about the filling process; The filling process information is tested.
8. A form filling device for a Web interface, characterized in that: The device is applied to an operation and maintenance audit system, and the device comprises: A connection module, configured to connect to the target application server when it is detected that an operation and maintenance user triggers an operation and maintenance request for the target application server; A startup module, used to start the browser of the target application server; A first calling module is used to call the BackgroundPages extension component of the browser to obtain operation and maintenance parameters; A second calling module calls the BackgroundPages extension component to open a form page based on the operation and maintenance parameters; The third calling module calls the Content Script component of the browser so that the Content Script component completes filling in the form page based on the operation and maintenance parameters.
9. A computer device, characterized in that: The device comprises: A memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the form filling method of the Web interface as described in any one of claims 1-7.
10. A storage medium, characterized in that: The storage medium stores computer instructions, which, when called, are used to execute the form filling method for the Web interface as described in any one of claims 1-7.
