Method and apparatus for sending information through instant messaging tool, medium and device

By simulating users loading government webpage content in their browsers and sending it to instant messaging tools, the inefficiency and security issues of government information transmission were solved, achieving automated information transmission and mobile reading, and reducing costs.

CN118474060BActive Publication Date: 2026-01-13SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410599333.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2026-01-13
Estimated Expiration
2044-05-15

Smart Images

  • Figure CN118474060B_ABST
    Figure CN118474060B_ABST
Patent Text Reader

Abstract

The application provides a method and device for sending information through an instant messaging tool, a medium and a device. The method comprises the following steps: simulating a user to log in a target system on a browser and jump to a target webpage address in the target system; simulating the user to drag a scroll bar on a page of the target webpage address on the browser, so that the browser loads overall webpage content displayed on a cockpit command large screen; obtaining an information selection type; obtaining corresponding to-be-sent information from the loaded overall webpage content, and saving the obtained to-be-sent information to a preset directory; opening an information input area of a preset contact person in the instant messaging tool through simulation technology, reading the to-be-sent information from the preset directory, transmitting the read to-be-sent information into the information input area, and triggering a sending action. The embodiment of the application can send information to a user through the instant messaging tool, so that a staff member can instantly know the latest information without an office computer and a special network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information transmission technology, and in particular to a method, apparatus, medium, and device for sending information via instant messaging tools. Background Technology

[0002] In sensitive areas such as government affairs, application systems are often deployed on industry intranets or extranets, making them inaccessible via the internet. Furthermore, information transmission involves multiple clients, such as WeChat and government communication platforms, requiring individual interface connections, which is challenging, time-consuming, and costly. In scenarios involving emergencies, routine management, and news releases, relevant personnel need real-time access to data and updates. However, manually synchronizing information with relevant personnel periodically is inefficient, inaccurate, and requires dedicated personnel to monitor outside of working hours. Summary of the Invention

[0003] To address at least one of the above-mentioned technical problems, embodiments of the present invention provide a method, apparatus, medium, and device for sending information via instant messaging tools.

[0004] According to a first aspect, the method for sending information via an instant messaging tool provided in the embodiments of the present invention is executed by a relay bastion host, the method comprising:

[0005] The simulation technology simulates a user logging into the target system in a browser and redirecting the user to the target webpage address in the target system; wherein, the target webpage address is the address of the webpage displayed on the cockpit command screen, the target system is deployed on a government network that is not connected to the Internet, and the relay bastion host is deployed between the Internet and the government network;

[0006] The simulation technology simulates a user dragging a scroll bar on the target webpage address in the browser, so that the browser loads the overall webpage content displayed on the cockpit command screen.

[0007] Retrieve the pre-configured information from the preset configuration file and select the type;

[0008] Obtain the corresponding information to be sent from the loaded overall webpage content, and save the obtained information to be sent to a preset directory;

[0009] The system uses simulation technology to open the information input area of ​​a preset contact in an instant messaging tool, reads the message to be sent from the preset directory, inputs the read message to be sent into the information input area, and triggers a sending action; wherein, the sending action is used to send the message to be sent to the preset contact.

[0010] In one embodiment, obtaining the corresponding information to be sent from the loaded overall webpage content includes:

[0011] If the information selection type is text, then the required text object is obtained by searching the entire webpage content loaded by the browser using XPath expressions;

[0012] Obtain a text template from the preset configuration file; wherein the text template is a text information template including multiple placeholders;

[0013] The text object replaces the corresponding placeholder in the text template to form the message to be sent.

[0014] In one embodiment, obtaining the corresponding information to be sent from the loaded overall webpage content includes:

[0015] If the selected information type is an image, then the entire webpage content loaded by the browser is captured and saved as a first captured image in a preset image format;

[0016] Get the pre-defined capture range;

[0017] Based on the specified cropping range, a second cropping image of the preset image format is obtained by cropping from the first cropping image.

[0018] In one embodiment, the step of opening the information input area of ​​a preset contact in an instant messaging tool using simulation technology, reading the message to be sent from the preset directory, passing the read message to be sent into the information input area, and triggering a sending action includes:

[0019] The instant messaging tool is invoked to the front end of the relay bastion host via an interface call or by simulating user key presses.

[0020] By simulating user keystrokes, the user is directed to the contact search page of the instant messaging tool;

[0021] Send the preset contact to the clipboard;

[0022] By simulating user key presses, preset contacts on the clipboard are entered into the contact search page, so that the instant messaging tool can find and enter the information input area of ​​the preset contacts;

[0023] Read the information to be sent from the preset directory and send the information to be sent to the clipboard;

[0024] By simulating user key presses, the information to be sent from the clipboard is input into the information input area;

[0025] The sending action is triggered by simulating the user's key presses.

[0026] In one embodiment, the step of simulating a user dragging a scroll bar on the target webpage address page in the browser to cause the browser to load the overall webpage content displayed on the cockpit command screen includes:

[0027] By simulating a user's window adjustment operation, the browser window is maximized;

[0028] By simulating a user's dragging action on the browser's scrollbar, the browser's scrollbar is dragged to the bottom;

[0029] By simulating a user's dragging action on the browser's scrollbar, the browser's scrollbar is dragged to the far right.

[0030] The browser window is smaller than the cockpit command screen, and only a portion of the cockpit command screen's content can be displayed in the browser window. As the scroll bar scrolls, the browser loads the content of the corresponding area on the cockpit command screen.

[0031] In one embodiment, before simulating a user logging into the target system in a browser and redirecting to the target webpage address in the target system, the method further includes:

[0032] Obtain the timing configuration information from the preset configuration file and represent the timing configuration information as a cron expression format;

[0033] Based on the timing configuration information in the cron expression format, determine whether the triggering time has arrived;

[0034] When the triggering time arrives, the step of simulating a user logging into the target system in a browser using simulation technology and redirecting to the target webpage address in the target system is executed.

[0035] In one embodiment, Selenium technology is used to simulate various user actions on the browser.

[0036] According to a second aspect, the device for sending information via an instant messaging tool provided in the embodiments of the present invention is deployed on a relay bastion host, the device comprising:

[0037] The address login module is used to simulate a user logging into the target system in a browser using simulation technology and redirecting the user to the target webpage address in the target system; wherein, the target webpage address is the address of the webpage displayed on the cockpit command screen, the target system is deployed on a government network that is not connected to the Internet, and the relay bastion host is deployed between the Internet and the government network;

[0038] The content loading module is used to simulate a user dragging a scroll bar on the target webpage address in the browser, so that the browser loads the overall webpage content displayed on the cockpit command screen.

[0039] The type acquisition module is used to retrieve the type selection information pre-configured in the preset configuration file.

[0040] The information acquisition module is used to obtain the corresponding information to be sent from the loaded overall web page content and save the obtained information to be sent to a preset directory.

[0041] The information sending module is used to open the information input area of ​​a preset contact in an instant messaging tool using simulation technology, read the information to be sent from the preset directory, pass the read message to be sent into the information input area, and trigger a sending action; wherein, the sending action is used to send the information to be sent to the preset contact.

[0042] According to a third aspect, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method provided in the first aspect.

[0043] According to a fourth aspect, the computing device provided in the embodiments of the present invention includes a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method provided in the first aspect.

[0044] The present invention provides a method, apparatus, medium, and device for sending information via instant messaging tools. It simulates a user logging into a target system in a browser and being redirected to a target webpage address within that system. The user then scrolls the target webpage in the browser, loading the entire webpage content displayed on the control panel. The browser then retrieves the corresponding message to be sent from the loaded webpage content and saves it to a preset directory. Next, the user opens the information input area of ​​a preset contact in the instant messaging tool, reads the message to be sent from the preset directory, inputs the message into the information input area, and triggers a sending action, thereby sending the message to the preset contact. Thus, the present invention, by using a relay bastion host to intercept the control panel on the browser, sends the content of a target system located on an isolated network segment to office personnel via WeChat or other means, achieving automatic information transmission without direct access to internal network applications from the external network, thereby improving security. Furthermore, by simulating scrolling on the browser's scrollbar, the entire webpage content is loaded onto the browser, meeting the need to read large-screen content on mobile devices without requiring mobile webpage adaptation, thus saving costs and serving as a temporary emergency display method. The method provided in this embodiment is decoupled from specific business systems, allowing for the capture of pages from any business system to meet office needs. The method provided in this embodiment is compatible with various instant messaging tools; by employing simulated keystrokes, messages can be sent through various instant messaging software. Based on the method provided in this embodiment, information can be sent to users via instant messaging tools, allowing staff to access the latest information instantly even without an office computer or dedicated network. Attached Figure Description

[0045] Figure 1 This is a flowchart illustrating a method for sending information via an instant messaging tool according to an embodiment of the present invention.

[0046] Figure 2 This is a schematic diagram illustrating two methods for obtaining a message to be sent in one embodiment of the present invention;

[0047] Figure 3 This is a schematic diagram of a portion of the process in a method for sending information via an instant messaging tool according to an embodiment of the present invention;

[0048] Figure 4 This is a structural block diagram of a device for sending information via an instant messaging tool according to an embodiment of the present invention. Detailed Implementation

[0049] In a first aspect, embodiments of the present invention provide a method for sending information via an instant messaging tool, wherein the method is executed by a relay bastion host, see [link to previous document]. Figures 1-3 The method includes the following steps S110 to S150:

[0050] S110. Simulate a user logging into the target system in a browser using simulation technology and redirect to the target webpage address in the target system; wherein, the target webpage address is the address of the webpage displayed on the cockpit command screen, the target system is deployed on a government network that is not connected to the Internet, and the relay bastion host is deployed between the Internet and the government network;

[0051] Specifically, Selenium technology can be used to simulate various user actions on the browser. Selenium is a tool for testing web applications that uses JavaScript to simulate real user interactions with the browser. When the script executes, the browser automatically performs actions such as clicking, typing, opening, and verifying according to the script code, just like a real user.

[0052] For example, Selenium can be used to control the Chrome browser to run in headless mode in the background, and various parameters can be used to optimize the simulation environment, such as --headless, --disable-gpu, --no-sandbox, --disable-dev-shm-usage, lang=zh_CN.UTF-8, and window-size=1920x108.

[0053] In a real-world scenario, information such as username, password, target webpage address, and even authentication address are pre-set. Then, a simulated real user enters the target webpage address in a browser, followed by their username and password on the login page. After logging into the target system, the browser redirects to the target webpage address. The authentication address is the address of the authentication system; authentication is required before logging into the target system, and access is granted only after successful authentication.

[0054] The target webpage address is the address of the webpage displayed on the cockpit command screen. As can be seen, after the browser jumps to the target webpage address, the content of the webpage displayed on the cockpit command screen can be seen through the browser window. However, since the screen size of the cockpit command screen is very large and the browser window size is very small, only a part of the content displayed on the cockpit command screen can be displayed.

[0055] The target system is deployed on a government network that is not connected to the Internet, so it cannot directly access the cockpit command screen via the Internet. The relay bastion host is deployed between the Internet and the government network, so it can access the cockpit command screen, obtain the desired information from the cockpit command screen, and then send the obtained information to a designated contact via the Internet and instant messaging tools.

[0056] In one embodiment, prior to S110, the method may further include:

[0057] S001. Obtain timing configuration information from the preset configuration file and represent the timing configuration information as a cron expression format;

[0058] For example, the timer configuration information can be set as: taskCron=0 0 10,12,14,16,18,20,22**?.

[0059] S002. Determine whether the triggering time has arrived based on the timing configuration information in the cron expression format;

[0060] S003. When the triggering time arrives, execute the step of simulating a user logging into the target system in a browser using simulation technology and redirecting to the target webpage address in the target system.

[0061] As can be seen, the timing configuration information is used to determine whether the triggering time has been reached, and S110 to S150 are executed only when the triggering time has been reached.

[0062] S120. Simulate the user dragging the scroll bar on the target webpage address page in the browser using simulation technology, so that the browser loads the overall webpage content displayed on the cockpit command screen.

[0063] In one embodiment, S120 may specifically include S121 to S123:

[0064] S121. By simulating a user's window adjustment operation on the browser, the browser window is maximized;

[0065] S122. By simulating the user's dragging action on the scroll bar of the browser, the scroll bar of the browser is dragged to the bottom;

[0066] S123. By simulating the user's dragging action on the scroll bar of the browser, the scroll bar of the browser is dragged to the far right.

[0067] The browser window is smaller than the cockpit command screen, and only a portion of the cockpit command screen's content can be displayed in the browser window. As the scroll bar scrolls, the browser loads the content of the corresponding area on the cockpit command screen.

[0068] Understandably, since the browser window can only display a portion of the overall webpage content shown on the cockpit command screen, simulation technology is used to simulate a real user dragging the scroll bar on the browser, allowing the scroll bar to scroll to the bottom and the far right. During the scrolling process, the browser continuously loads the content of the corresponding area on the cockpit command screen until the scrolling stops, at which point the browser has finished loading the entire webpage content on the cockpit command screen.

[0069] S130, Obtain the pre-configured information in the preset configuration file and select the type;

[0070] The information selection type can be either text or image, and the specific type will be set in the preset configuration file in advance.

[0071] S140. Obtain the corresponding information to be sent from the loaded overall webpage content, and save the obtained information to be sent to a preset directory;

[0072] In one embodiment, obtaining the corresponding information to be sent from the loaded overall webpage content in step S140 may include steps S141 to S143:

[0073] S141. If the information selection type is text, then the required text object is obtained by searching the entire webpage content loaded by the browser using XPath expressions.

[0074] S142. Obtain a text template from the preset configuration file; wherein, the text template is a text information template including multiple placeholders;

[0075] S143. Replace the corresponding placeholder in the text template with the text object to form the message to be sent.

[0076] In other words, if the information type configured in the preset configuration file is text, XPath can be used. Specifically, XPath expressions are used to search through each document object of the overall webpage content loaded by the browser to find the required text objects, such as text indicators and numbers. Next, a pre-defined text template is retrieved from the preset configuration file. The text template includes multiple placeholders, including but not limited to: {{text01}}, {{text02}}, and also provides built-in placeholders, such as for date and datetime fields: {{date}}, {{dateTime}}. After replacing the placeholders in the text template with the text objects, the file template becomes the information to be sent.

[0077] XPath, or XML Path Language, is based on the tree structure of XML and provides the ability to find nodes in the data structure tree. It can be used to determine the location of a part in an XML document.

[0078] After generating the text message to be sent, it can be written to a file on the computer's disk. The specific steps are as follows: Check if an existing file exists in the . / text directory. If it exists, rename it to msg_yyyyMMddHHmmss.txt and move it to the . / texthistory folder; otherwise, save the new file named msg.txt to the . / text directory.

[0079] In one embodiment, obtaining the corresponding information to be sent from the loaded overall webpage content in step S140 may include:

[0080] S144. If the information selection type is image type, then capture the entire webpage content loaded by the browser and save it as a first captured image in a preset image format.

[0081] The preset image format is, for example, PNG format.

[0082] S145. Obtain the preset capture range;

[0083] S146. According to the cropping range, crop from the first cropping image to obtain a second cropping image in the preset image format.

[0084] In other words, the entire webpage content is captured to obtain the first screenshot. Then, based on a pre-defined cropping range, a second screenshot is obtained by cropping from the first screenshot, thus achieving a two-stage cropping process.

[0085] After obtaining the second screenshot, use it as the message to be sent. Then, save the second screenshot as a PNG file to the computer's disk. The specific steps are as follows: Check if the file already exists in the . / pic directory. If it exists, rename it to pic_yyyyMMddHHmmss.png and move it to the . / pichistory folder; otherwise, save the new file named pic.png to the . / pic directory.

[0086] In one embodiment, anomaly analysis can also be performed on the information obtained from the overall webpage content. If an anomaly is found, false is returned and the program is put into a sleep state. After the sleep state, the program attempts to capture the information again. If the number of consecutive failed attempts exceeds a specified threshold, the program terminates.

[0087] S150. Using simulation technology, open the information input area of ​​a preset contact in the instant messaging tool, read the message to be sent from the preset directory, pass the read message to be sent into the information input area, and trigger a sending action; wherein, the sending action is used to send the message to be sent to the preset contact.

[0088] Instant messaging tools, such as WeChat for Business or other communication tools.

[0089] In other words, through simulation technology, the system simulates a real user opening the information input area of ​​a preset contact in an instant messaging tool, then reading the information to be sent from the preset directory, inputting the read information into the information input area, triggering the send action, and then sending the information to the preset contact.

[0090] In one embodiment, S150 may specifically include S151 to S157:

[0091] S151. The instant messaging tool is called up to the front end of the relay bastion host via an interface call or by simulating user key operations;

[0092] There are two modes: Mode 1: Calls the Win32 API, passing in the "WeChat" handle name, to bring up the WeChat interface on the Windows foreground. Mode 2: Simulates the user pressing Ctrl, Alt, and W keys in sequence, then releasing them in sequence, thus bringing up the WeChat interface on the Windows foreground. Mode 2 is used by default to open the WeChat program. Of course, the WeChat program in the foreground needs to be launched and logged in.

[0093] Windows API is Microsoft's name for the kernel application programming interface available in the Windows operating system. It is the most direct way for application software to interact with the Windows system. By calling the Windows API, keyboard and mouse actions can be simulated to achieve the purpose of simulating human operation.

[0094] S152. By simulating the user's key press operation, enter the contact search page of the instant messaging tool;

[0095] S153. Send the preset contact to the clipboard;

[0096] S154. By simulating the user's key operation, the preset contact on the clipboard is entered into the contact search page, so that the instant messaging tool can find and enter the information input area of ​​the preset contact;

[0097] For example, simulating a user pressing and releasing the Ctrl and F keys sequentially allows access to the WeChat contact search page. Then, a clipboard is provided, and the WeChat name of a preset contact is sent to it. Simulating the user pressing and releasing the Ctrl and V keys sequentially inputs the WeChat name from the clipboard into the contact search page. Simulating the user pressing and releasing the Enter key again allows the preset contact to be searched. Once found, the user is directed to the contact's information input area.

[0098] S155. Read the information to be sent from the preset directory and send the information to be sent to the clipboard;

[0099] S156. By simulating the user's key operation, the information to be sent from the clipboard is input into the information input area;

[0100] S157. Trigger the sending action by simulating the user's key press operation.

[0101] If the selected message type is text, the message to be sent is read from the specified . / text folder on the disk. If the selected message type is image, the message to be sent is read from the specified . / pic folder on the disk. The message is then sent to the clipboard, simulating the user pressing and releasing Ctrl+V keys sequentially, thus sending the message from the clipboard to the message input area. Finally, simulating the user pressing and releasing the Enter key triggers the sending action, sending the content to the preset contact.

[0102] As can be seen, this embodiment of the invention uses a relay bastion host to intercept the cockpit command screen on a browser, sending the content of the target system located in the isolated network segment to office personnel via WeChat and other methods. This achieves the goal of automatically transmitting information without direct access to internal network applications from the external network, thus improving security. By simulating scrolling the browser's scroll bar, the entire webpage content is loaded onto the browser, meeting the need to read the large screen content on mobile devices without requiring mobile webpage adaptation, saving economic costs and serving as a temporary emergency display method. Simultaneously, the timed triggering method frees up manual operation, saving labor costs. The method provided by this embodiment of the invention is decoupled from specific business systems, allowing interception of pages from any business system to meet office needs. The method provided by this embodiment of the invention is compatible with various instant messaging tools; by using simulated keystrokes, messages can be sent through various instant messaging software.

[0103] As can be seen, the core principle of this invention is to access the command center's large screen page from a specific computer in a secure area, select a designated area, text, and chart on the screen for screenshotting, extract key text and data, and generate information to be sent according to a pre-prepared text template. The captured images and text information are then sent to a designated client located in the internet zone or an internal / external network zone via simulated key presses. In other words, this invention can periodically capture webpage information, form standard documents, and send them to users via instant messaging tools such as WeChat and government communication platforms, allowing staff to access the latest information even without an office computer or dedicated network.

[0104] Secondly, embodiments of the present invention provide a device for sending information via an instant messaging tool, the device being deployed on a relay bastion host, see [link to previous document]. Figure 4 The device includes:

[0105] The address login module is used to simulate a user logging into the target system in a browser using simulation technology and redirecting the user to the target webpage address in the target system; wherein, the target webpage address is the address of the webpage displayed on the cockpit command screen, the target system is deployed on a government network that is not connected to the Internet, and the relay bastion host is deployed between the Internet and the government network;

[0106] The content loading module is used to simulate a user dragging a scroll bar on the target webpage address in the browser, so that the browser loads the overall webpage content displayed on the cockpit command screen.

[0107] The type acquisition module is used to retrieve the type selection information pre-configured in the preset configuration file.

[0108] The information acquisition module is used to obtain the corresponding information to be sent from the loaded overall web page content and save the obtained information to be sent to a preset directory.

[0109] The information sending module is used to open the information input area of ​​a preset contact in an instant messaging tool using simulation technology, read the information to be sent from the preset directory, pass the read message to be sent into the information input area, and trigger a sending action; wherein, the sending action is used to send the information to be sent to the preset contact.

[0110] In one embodiment, the information acquisition module includes:

[0111] The first search unit is used to search for the required text object in the overall webpage content loaded by the browser using XPath expressions if the information selection type is text.

[0112] The template acquisition unit is used to acquire a text template from the preset configuration file; wherein the text template is a text information template including multiple placeholders;

[0113] The placeholder replacement unit is used to replace the corresponding placeholder in the text template with the text object to form the information to be sent.

[0114] In one embodiment, the information acquisition module includes:

[0115] The first capturing unit is used to capture the entire webpage content loaded by the browser and save it as a first captured image in a preset image format if the information selection type is an image type.

[0116] The range acquisition unit is used to acquire a pre-defined intercept range;

[0117] The second cropping unit is used to crop from the first cropping image according to the cropping range to obtain a second cropping image in the preset image format.

[0118] In one embodiment, the information sending module includes:

[0119] The tool call-out unit is used to call up the instant messaging tool to the front end of the relay bastion host via an interface call or by simulating user key operations;

[0120] The page entry unit is used to access the contact search page of the instant messaging tool by simulating the user's key press operation;

[0121] The first sending unit is used to send the preset contact to the clipboard;

[0122] The second search unit is used to input a preset contact from the clipboard into the contact search page by simulating the user's key operation, so that the instant messaging tool can find and enter the information input area of ​​the preset contact;

[0123] The second sending unit is used to read the information to be sent from the preset directory and send the information to be sent to the clipboard;

[0124] The third sending unit is used to input the information to be sent from the clipboard into the information input area by simulating the user's key operation;

[0125] The action triggering unit is used to trigger the sending of actions by simulating the user's key press operations.

[0126] In one embodiment, the content loading module includes:

[0127] A window adjustment unit is used to maximize the browser window by simulating a user's window adjustment operation on the browser.

[0128] The first dragging unit is used to drag the browser's scrollbar to the bottom by simulating a user's dragging action on the scrollbar of the browser;

[0129] The second dragging unit is used to drag the browser's scroll bar to the far right by simulating a user's dragging action on the browser's scroll bar; wherein, the browser window size is smaller than the size of the cockpit command screen, and the browser window can only display a portion of the content of the cockpit command screen, and the browser loads the content of the corresponding area on the cockpit command screen during the scrolling process.

[0130] In one embodiment, before simulating a user logging into the target system in a browser using simulation technology and redirecting to the target webpage address in the target system, the address login module is further configured to: obtain timing configuration information from the preset configuration file and represent the timing configuration information as a cron expression format; determine whether the triggering time has arrived based on the timing configuration information in the cron expression format; and when the triggering time arrives, execute the step of simulating a user logging into the target system in a browser using simulation technology and redirecting to the target webpage address in the target system.

[0131] In one embodiment, Selenium technology is used to simulate various user actions on the browser.

[0132] It is understood that explanations of the contents, specific implementation methods, beneficial effects, examples, etc. in the system provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0133] Thirdly, embodiments of the present invention provide a computer-readable medium storing computer instructions, which, when executed by a processor, cause the processor to perform the method provided in the first aspect.

[0134] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0135] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0136] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0137] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0138] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion module connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion module execute some and all of the actual operations, thereby realizing the function of any of the above embodiments.

[0139] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the contents in the computer-readable medium provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0140] Fourthly, one embodiment of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method of any embodiment of the specification.

[0141] It is understood that explanations, specific implementation methods, beneficial effects, examples, etc. of the computing device provided in the embodiments of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0142] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0143] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, widgets, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.

[0144] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for sending information via an instant messaging tool, characterized in that, The method is executed by a relay bastion host, and the method includes: The simulation technology simulates a user logging into the target system in a browser and redirecting the user to the target webpage address in the target system; wherein, the target webpage address is the address of the webpage displayed on the cockpit command screen, the target system is deployed on a government network that is not connected to the Internet, and the relay bastion host is deployed between the Internet and the government network; The simulation technology simulates a user dragging a scroll bar on the target webpage address in the browser, so that the browser loads the overall webpage content displayed on the cockpit command screen. Retrieve the pre-configured information from the preset configuration file and select the type; Obtain the corresponding information to be sent from the loaded overall webpage content, and save the obtained information to be sent to a preset directory; The system uses simulation technology to open the information input area of ​​a preset contact in an instant messaging tool, reads the message to be sent from the preset directory, inputs the read message to be sent into the information input area, and triggers a sending action; wherein, the sending action is used to send the message to be sent to the preset contact.

2. The method according to claim 1, characterized in that, The step of obtaining the corresponding information to be sent from the loaded overall webpage content includes: If the information selection type is text, then the required text object is obtained by searching the entire webpage content loaded by the browser using XPath expressions; Obtain a text template from the preset configuration file; wherein the text template is a text information template including multiple placeholders; The text object replaces the corresponding placeholder in the text template to form the message to be sent.

3. The method according to claim 1, characterized in that, The step of obtaining the corresponding information to be sent from the loaded overall webpage content includes: If the selected information type is an image, then the entire webpage content loaded by the browser is captured and saved as a first captured image in a preset image format; Get the pre-defined capture range; Based on the specified cropping range, a second cropping image of the preset image format is obtained by cropping from the first cropping image.

4. The method according to claim 1, characterized in that, The step of opening the information input area of ​​a preset contact in an instant messaging tool using simulation technology, reading the message to be sent from the preset directory, passing the read message to be sent into the information input area, and triggering the sending action includes: The instant messaging tool is invoked to the front end of the relay bastion host via an interface call or by simulating user key presses. By simulating user keystrokes, the user is directed to the contact search page of the instant messaging tool; Send the preset contact to the clipboard; By simulating user key presses, preset contacts on the clipboard are entered into the contact search page, so that the instant messaging tool can find and enter the information input area of ​​the preset contacts; Read the information to be sent from the preset directory and send the information to be sent to the clipboard; By simulating user key presses, the information to be sent from the clipboard is input into the information input area; The sending action is triggered by simulating the user's key presses.

5. The method according to claim 1, characterized in that, The step of simulating a user dragging a scroll bar on the target webpage address in the browser to load the overall webpage content displayed on the cockpit command screen includes: By simulating a user's window adjustment operation, the browser window is maximized; By simulating a user's dragging action on the browser's scrollbar, the browser's scrollbar is dragged to the bottom; By simulating a user's dragging action on the browser's scrollbar, the browser's scrollbar is dragged to the far right. The browser window is smaller than the cockpit command screen, and only a portion of the cockpit command screen's content can be displayed in the browser window. As the scroll bar scrolls, the browser loads the content of the corresponding area on the cockpit command screen.

6. The method according to claim 1, characterized in that, Before simulating a user logging into the target system in a browser using simulation technology and redirecting to the target webpage address in the target system, the method further includes: Obtain the timing configuration information from the preset configuration file and represent the timing configuration information as a cron expression format; Based on the timing configuration information in the cron expression format, determine whether the triggering time has arrived; When the triggering time arrives, the step of simulating a user logging into the target system in a browser using simulation technology and redirecting to the target webpage address in the target system is executed.

7. The method according to claim 1, characterized in that, The Selenium technology is used to simulate various user actions on the browser.

8. A device for sending information via an instant messaging tool, characterized in that, The device is deployed on a transit bastion host, and the device includes: The address login module is used to simulate a user logging into the target system in a browser using simulation technology and redirecting the user to the target webpage address in the target system; wherein, the target webpage address is the address of the webpage displayed on the cockpit command screen, the target system is deployed on a government network that is not connected to the Internet, and the relay bastion host is deployed between the Internet and the government network; The content loading module is used to simulate a user dragging a scroll bar on the target webpage address in the browser, so that the browser loads the overall webpage content displayed on the cockpit command screen. The type acquisition module is used to retrieve the type selection information pre-configured in the preset configuration file. The information acquisition module is used to obtain the corresponding information to be sent from the loaded overall web page content and save the obtained information to be sent to a preset directory. The information sending module is used to open the information input area of ​​a preset contact in an instant messaging tool using simulation technology, read the information to be sent from the preset directory, pass the read message to be sent into the information input area, and trigger a sending action; wherein, the sending action is used to send the information to be sent to the preset contact.

9. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed in a computer, causes the computer to perform the method described in any one of claims 1 to 7.

10. A computing device, characterized in that, The method includes a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method, device and system for automatically acquiring webpage information by web crawler

    CN111191097A

  • Network access method and device and computer storage medium

    CN116743566A