Security balance reminding method and device based on automatic simulation keyboard and mouse operation
Through automated simulation of key and mouse operations, real-time query of margin balance from the financial trading platform and SMS reminders are achieved, solving the problem of manual inquiry and easy to make mistakes, and achieving efficient and accurate fund monitoring and reminders.
Patent Information
- Application Number
- CN202411587677.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-03-07
AI Technical Summary
In the prior art, manual inquiry of transaction records from financial trading platforms in real time for summing and counting, resulting in a lot of manpower and prone to errors. Especially on special platforms such as the Hang Seng system, API methods cannot easily obtain data.
The method based on automated simulation of key and mouse operations is adopted, and the mouse and keyboard operation is simulated by controlling window handles and UI elements, the process of querying margin balance from the financial trading platform is realized, and the target component is generated for real-time monitoring. When the margin balance is lower than the preset threshold, the user is reminded through SMS.
Real-time reading of margin balance data of financial trading platform is achieved, ensuring efficient utilization of funds, saving a lot of manpower and material resources, and ensuring 100% accuracy of the process.
Smart Images

Figure CN119579296A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a margin balance reminder method and device based on automated simulation of keyboard and mouse operations. Background Art
[0002] Due to the high frequency of futures trading, the margin balance of bank accounts is constantly changing. Financial personnel need to make fund transfer operations based on the real-time balance and pre-set thresholds to ensure user withdrawals and improve fund utilization. Some data need to be manually queried from the financial trading platform in real time and added to the bank balance for statistics.
[0003] However, manually querying transaction records from financial trading platforms for summing and statistics requires a lot of manpower, and manual data transmission is prone to errors. Some financial trading platforms, such as the Hang Seng system, cannot easily obtain data through the API method due to the special requirements of their network environment. Summary of the invention
[0004] In view of this, the present application provides a margin balance reminder method and device based on automated simulated keyboard and mouse operations to achieve real-time reading of the Hang Seng system margin balance data, ensure 100% accuracy of the process, and immediately send SMS reminders for records that exceed the threshold, thereby ensuring efficient utilization of funds and saving a lot of manpower and material resources.
[0005] In a first aspect, the present application provides a margin balance reminder method based on automated simulated keyboard and mouse operations, the method comprising: Determine the process of querying margin balance from the financial trading platform through automated simulated keyboard and mouse operations, and generate corresponding target demand analysis documents; According to the target demand analysis document, the process is divided into several functional modules, and the logical relationship between the functional modules is determined; Simulating mouse and keyboard operations by controlling window handles and UI elements to obtain a number of functional components corresponding to the several functional modules; The functional components are combined and spliced according to the logical relationship to obtain a target component, and the margin balance of the financial trading platform is detected through the target component; When it is detected that the margin balance is lower than a preset reminder threshold, a reminder message is sent to the target user through a preset reminder method.
[0006] Optionally, before simulating the mouse and keyboard operations by controlling the window handle and UI elements, the method further includes: Perform an adaptability test on each interface of the financial trading platform. When it is determined that the automated simulation of keyboard and mouse operations can accurately identify and operate the elements of each interface, then execute the step of simulating mouse and keyboard operations by controlling window handles and UI elements.
[0007] Optionally, the simulation of mouse and keyboard operations is realized by controlling window handles and UI elements to obtain several functional components corresponding to the several functional modules, including: Locate UI elements on the operation interface corresponding to each functional module, and then simulate mouse and keyboard operations by calling the system API; Encapsulate the code for simulating mouse and keyboard operations into reusable components, each component receives necessary simulation parameters and performs corresponding simulation operations, wherein the simulation parameters include target window handle, UI element identifier, and operation type; After testing each component to ensure that the component can correctly simulate mouse and keyboard operations, the component is determined as the functional component.
[0008] Optionally, when positioning UI elements on the operation interface corresponding to each functional module, the method further includes: Image recognition or DOM element parsing technology is used to improve the accuracy and stability of the UI element positioning.
[0009] Optionally, when it is detected that the margin balance is lower than a preset reminder threshold, after sending a reminder message to the target user in a preset reminder manner, the method further includes: When it is detected that the margin balance is restored to above the reminder threshold, a notification that the balance has returned to normal is sent to the target user.
[0010] A second aspect of the present application provides a margin balance reminder device based on automated simulation of keyboard and mouse operations, the device comprising: A requirement document generation unit, used to determine the process of querying the margin balance from the financial trading platform through automated simulated keyboard and mouse operations, and generate a corresponding target requirement analysis document; A process splitting unit, used to split the process into several functional modules according to the target demand analysis document, and determine the logical relationship between the functional modules; A component obtaining unit, used to simulate mouse and keyboard operations by controlling window handles and UI elements, so as to obtain a plurality of functional components corresponding to the plurality of functional modules; The reminder unit is used to splice and combine the functional components through the logical relationship to obtain the target component, and detect the margin balance of the financial trading platform through the target component. When it is detected that the margin balance is lower than a preset reminder threshold, a reminder message is sent to the target user through a preset reminder method.
[0011] Optionally, before the component obtains the simulation of the mouse and keyboard operation by controlling the window handle and the UI element, the device further includes: The interface testing unit is used to perform adaptability testing on each interface of the financial trading platform. When it is determined that the automated simulation of keyboard and mouse operations can accurately identify and operate the elements of each interface, the step of simulating mouse and keyboard operations by controlling window handles and UI elements is executed.
[0012] Optionally, the component obtaining unit simulates the mouse and keyboard operations by controlling the window handle and UI element to obtain the functional components corresponding to the functional modules, including: Locate UI elements on the operation interface corresponding to each functional module, and then simulate mouse and keyboard operations by calling the system API; Encapsulate the code for simulating mouse and keyboard operations into reusable components, each component receives necessary simulation parameters and performs corresponding simulation operations, wherein the simulation parameters include target window handle, UI element identifier, and operation type; After testing each component to ensure that the component can correctly simulate mouse and keyboard operations, the component is determined as the functional component.
[0013] Optionally, when the component obtaining unit locates UI elements in the operation interface corresponding to each functional module, the component obtaining unit also uses image recognition or DOM element parsing technology to improve the accuracy and stability of the UI element positioning.
[0014] Optionally, when the reminder unit detects that the margin balance is lower than a preset reminder threshold, after sending a reminder message to the target user in a preset reminder manner, the device further includes: The restoration reminder unit is used to send a notification of the balance returning to normal to the target user when it is detected that the margin balance is restored to above the reminder threshold.
[0015] In the embodiment provided by the present application, the process of querying the margin balance from the financial trading platform is first determined to generate the corresponding demand analysis document, and then the above process is split into several functional modules according to the document, and the logical relationship between each module is determined; then the simulation of the mouse and keyboard operation is realized by controlling the window handle and UI element method to obtain several functional components corresponding to the above functional modules; then the various functional components are spliced and combined according to the above logical relationship to generate the corresponding target component, through which the margin balance of the financial trading platform can be determined in real time, and finally according to the preset threshold, it is determined whether it is necessary to remind the user. This realizes the real-time reading of the margin balance data of the financial trading platform, and the immediate SMS reminder of the records exceeding the threshold, ensuring the efficient utilization of funds and saving a lot of manpower and material resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A flow chart of the method provided in the embodiment of the present application; Figure 2 A structural diagram of a device provided in an embodiment of the present application; Figure 3 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0017] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0018] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0019] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0020] The present application provides a margin balance reminder method and device based on automated simulated keyboard and mouse operations, so as to realize real-time reading of margin balance data of a financial trading platform, ensure efficient utilization of funds, and save a lot of manpower and material resources.
[0021] The technical solution of the present application is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0022] like Figure 1 As shown, it is a flow chart of a margin balance reminder method based on automated simulated keyboard and mouse operation provided by the present application, and the process includes: Step S101, determining a process for querying a margin balance from a financial trading platform through automated simulated keyboard and mouse operations, and generating a corresponding target demand analysis document.
[0023] In this embodiment, the margin balance can be queried on the financial trading platform manually to determine the corresponding process. The process may include logging in with a username and password, opening the financial trading platform interface, querying transaction records, processing data to determine the margin balance, etc. After determination, the process is organized into a target demand analysis document for record keeping.
[0024] Step S102, splitting the process into several functional modules according to the target demand analysis document, and determining the logical relationship between the functional modules.
[0025] In this embodiment, the process can be split into several functional modules according to the nodes of each process in the target demand analysis document, such as a login module, a query module, A, B, C interface opening modules, etc., and the logical relationship between the various functional modules can be determined through the process. For example, during manual query, it is found that after logging into the financial transaction platform through the login module, it is necessary to open the A interface to query the balance by querying a certain condition. Then, the logical relationship corresponding to the process can be determined as functional module-query module-A interface opening module.
[0026] Step S103, simulating the mouse and keyboard operations by controlling the window handle and UI elements to obtain a plurality of functional components corresponding to the plurality of functional modules.
[0027] In this embodiment, it is first necessary to clarify which operating systems (such as Windows, MacOS, Linux, etc.) this method will run on, because different operating systems manage window handles and UI elements differently. Then choose the appropriate development language and tools. For applications that require efficient execution and direct interaction with the underlying system, C++ is a common choice because it provides direct access to system resources. In addition, you can also consider using high-level languages such as Python, combined with corresponding libraries (such as pywin32, pyautogui, etc.) to implement it.
[0028] After determining the operating system, identify the window handle. On the Windows platform, you can get the window handle by calling Win32 APIs (such as FindWindow, EnumWindows, etc.) These APIs allow you to find windows based on their class name, title, or other properties.
[0029] Then, the UI elements are positioned, such as coordinate positioning, control identification, etc. Then, the mouse and keyboard operations are simulated by calling the system APIs (such as SendInput, mouse_event, keybd_event, etc.). These APIs allow you to send events such as mouse movement, click, double-click, wheel scrolling, and keyboard keystrokes.
[0030] Finally, the code for simulating mouse and keyboard operations is encapsulated into reusable components. Each component receives necessary simulation parameters and performs corresponding simulation operations, wherein the simulation parameters include target window handle, UI element identifier, and operation type.
[0031] After packaging, each component is tested to ensure that the component can correctly simulate mouse and keyboard operations, and then the component is determined as the above-mentioned functional component, such as a login component, a query component, etc., and corresponding operations can be achieved through various components.
[0032] In another embodiment, before simulating the mouse and keyboard operations by controlling the window handle and UI elements, the method further includes: Perform an adaptability test on each interface of the financial trading platform. When it is determined that the automated simulation of keyboard and mouse operations can accurately identify and operate the elements of each interface, then execute the step of simulating mouse and keyboard operations by controlling window handles and UI elements.
[0033] In this embodiment, by performing adaptability tests on various interfaces of the financial trading platform, it can be ensured that the automated simulated keyboard and mouse operations can accurately identify and operate the elements of each interface.
[0034] In another embodiment, when positioning UI elements on the operation interface corresponding to each functional module, the method further includes: Image recognition or DOM element parsing technology is used to improve the accuracy and stability of the UI element positioning.
[0035] In this embodiment, the image recognition technology identifies specific elements on the page by comparing the page screenshot with the preset template image. This method is particularly suitable for elements that are difficult to accurately locate using traditional positioning methods (such as XPath, CSS selectors), such as dynamically changing verification codes, specific areas in complex graphical interfaces, etc. The DOM (Document Object Model) element parsing technology locates and identifies page elements by parsing the DOM structure of the page. This method relies on the HTML or XML structure of the page and is suitable for most Web-based UI automation testing scenarios.
[0036] Step S104, splicing and combining the functional components through the logical relationship to obtain the target component, and detecting the margin balance of the financial trading platform through the target component. When it is detected that the margin balance is lower than the preset reminder threshold, a reminder message is sent to the target user through a preset reminder method.
[0037] In this embodiment, each functional module is combined and spliced according to the process of querying the margin balance from the financial trading platform and the logical relationship of each functional module, so as to obtain a target component that can automatically query the margin balance from the financial trading platform. By running the target component, the margin balance can be determined, thereby realizing real-time monitoring of the margin balance. When the margin balance is lower than the preset reminder threshold, the target user is reminded by SMS or email.
[0038] In another embodiment, when it is detected that the margin balance is lower than a preset reminder threshold, after sending a reminder message to the target user in a preset reminder manner, the method further includes: When it is detected that the margin balance is restored to above the reminder threshold, a notification that the balance has returned to normal is sent to the target user.
[0039] So far, completed Figure 1 The process shown.
[0040] In the embodiment of the present application, the process of querying the margin balance from the financial trading platform is first determined to generate the corresponding demand analysis document, and then the above process is split into several functional modules according to the document, and the logical relationship between each module is determined; then the simulation of the mouse and keyboard operation is realized by controlling the window handle and UI element method to obtain several functional components corresponding to the above functional modules; then the various functional components are spliced and combined according to the above logical relationship to generate the corresponding target component, through which the margin balance of the financial trading platform can be determined in real time, and finally according to the preset threshold, it is determined whether it is necessary to remind the user. This realizes the real-time reading of the margin balance data of the financial trading platform, and the immediate SMS reminder of the records exceeding the threshold, ensuring the efficient utilization of funds and saving a lot of manpower and material resources.
[0041] This method can be run on a margin balance reminder system based on automated simulated keyboard and mouse operations. The system can be composed of three programs: Server, Control, and Agent. It adopts a three-tier architecture and supports both B / S mode and C / S mode. The core engine of the system is developed in efficient C++ language, focusing on low energy consumption of resource overhead. The system is based on the design concept of atomicization and componentization to ensure the reusability and flexibility of the technical architecture. The system follows the concept of green software, does not require installation, and is easy to deploy.
[0042] The present application also provides a margin balance reminder device based on automated simulated keyboard and mouse operations, such as Figure 2 As shown, the device comprises: The requirement document generating unit 201 is used to determine the process of querying the margin balance from the financial trading platform through automated simulated keyboard and mouse operations, and generate a corresponding target requirement analysis document; A process splitting unit 202 is used to split the process into several functional modules according to the target demand analysis document and determine the logical relationship between the functional modules; The component obtaining unit 203 is used to simulate the mouse and keyboard operations by controlling the window handle and UI elements to obtain the functional components corresponding to the functional modules; The reminder unit 204 is used to splice and combine the functional components through the logical relationship to obtain the target component, and detect the margin balance of the financial trading platform through the target component. When it is detected that the margin balance is lower than the preset reminder threshold, a reminder message is sent to the target user through a preset reminder method.
[0043] In another embodiment, before the component obtaining unit realizes the simulation of mouse and keyboard operations by controlling the window handle and UI element, the device further includes: The interface testing unit 205 is used to perform adaptability testing on each interface of the financial trading platform. When it is determined that the automated simulation of keyboard and mouse operations can accurately identify and operate the elements of each interface, the step of simulating mouse and keyboard operations by controlling window handles and UI elements is executed.
[0044] In another embodiment, the component obtaining unit simulates the mouse and keyboard operations by controlling the window handle and the UI element to obtain the functional components corresponding to the functional modules, including: Locate UI elements on the operation interface corresponding to each functional module, and then simulate mouse and keyboard operations by calling the system API; Encapsulate the code for simulating mouse and keyboard operations into reusable components, each component receives necessary simulation parameters and performs corresponding simulation operations, wherein the simulation parameters include target window handle, UI element identifier, and operation type; After testing each component to ensure that the component can correctly simulate mouse and keyboard operations, the component is determined as the functional component.
[0045] In another embodiment, when the component obtaining unit locates UI elements in the operation interface corresponding to each functional module, the component obtaining unit also uses image recognition or DOM element parsing technology to improve the accuracy and stability of the UI element positioning.
[0046] In another embodiment, when the reminder unit detects that the margin balance is lower than a preset reminder threshold, after sending a reminder message to the target user in a preset reminder manner, the device further includes: The restoration reminder unit 206 is used to send a notification of the balance restoration to the target user when it is detected that the margin balance is restored to above the reminder threshold.
[0047] The above-mentioned embodiment of the present invention provides a margin balance reminder method based on automated simulation of keyboard and mouse operations, and based on this method, provides a margin balance reminder device based on automated simulation of keyboard and mouse operations. Through the above-mentioned method and device, real-time reading of the margin balance data of the financial trading platform is realized, and SMS reminders are immediately sent for records exceeding the threshold, thereby ensuring efficient utilization of funds and saving a lot of manpower and material resources.
[0048] This embodiment also discloses a computer device, such as Figure 3 As shown, the computer device includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement any of the above-mentioned margin balance reminder methods based on automated simulation of keyboard and mouse operations.
[0049] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A margin balance reminder method based on automated simulation of keyboard and mouse operations, characterized in that: The method comprises: Determine the process of querying margin balance from the financial trading platform through automated simulated keyboard and mouse operations, and generate corresponding target demand analysis documents; According to the target demand analysis document, the process is divided into several functional modules, and the logical relationship between the functional modules is determined; Simulating mouse and keyboard operations by controlling window handles and UI elements to obtain a number of functional components corresponding to the several functional modules; The functional components are combined and spliced according to the logical relationship to obtain a target component, and the margin balance of the financial trading platform is detected through the target component; When it is detected that the margin balance is lower than a preset reminder threshold, a reminder message is sent to the target user through a preset reminder method.
2. The method according to claim 1, characterized in that Before simulating the mouse and keyboard operations by controlling the window handle and UI elements, the method further includes: Perform an adaptability test on each interface of the financial trading platform. When it is determined that the automated simulation of keyboard and mouse operations can accurately identify and operate the elements of each interface, then execute the step of simulating mouse and keyboard operations by controlling window handles and UI elements.
3. The method according to claim 1, characterized in that The simulation of mouse and keyboard operations is achieved by controlling the window handle and UI element to obtain the functional components corresponding to the functional modules, including: Locate UI elements on the operation interface corresponding to each functional module, and then simulate mouse and keyboard operations by calling the system API; Encapsulate the code for simulating mouse and keyboard operations into reusable components, each component receives necessary simulation parameters and performs corresponding simulation operations, wherein the simulation parameters include target window handle, UI element identifier, and operation type; After testing each component to ensure that the component can correctly simulate mouse and keyboard operations, the component is determined as the functional component.
4. The method according to claim 1, characterized in that When positioning UI elements on the operation interface corresponding to each functional module, the method further includes: Image recognition or DOM element parsing technology is used to improve the accuracy and stability of the UI element positioning.
5. The method according to claim 1, characterized in that When it is detected that the margin balance is lower than a preset reminder threshold, after sending a reminder message to the target user in a preset reminder manner, the method further includes: When it is detected that the margin balance is restored to above the reminder threshold, a notification that the balance has returned to normal is sent to the target user.
6. A margin balance reminder device based on automated simulation of keyboard and mouse operations, characterized in that: The device comprises: A requirement document generation unit, used to determine the process of querying the margin balance from the financial trading platform through automated simulated keyboard and mouse operations, and generate a corresponding target requirement analysis document; A process splitting unit, used to split the process into several functional modules according to the target demand analysis document, and determine the logical relationship between the functional modules; A component obtaining unit, used to simulate mouse and keyboard operations by controlling window handles and UI elements, so as to obtain a plurality of functional components corresponding to the plurality of functional modules; The reminder unit is used to splice and combine the functional components through the logical relationship to obtain the target component, and detect the margin balance of the financial trading platform through the target component. When it is detected that the margin balance is lower than a preset reminder threshold, a reminder message is sent to the target user through a preset reminder method.
7. The device according to claim 6, characterized in that Before the component acquisition unit realizes the simulation of mouse and keyboard operations by controlling the window handle and UI element, the device further includes: The interface testing unit is used to perform adaptability testing on each interface of the financial trading platform. When it is determined that the automated simulation of keyboard and mouse operations can accurately identify and operate the elements of each interface, the step of simulating mouse and keyboard operations by controlling window handles and UI elements is executed.
8. The device according to claim 6, characterized in that The component acquisition unit simulates the mouse and keyboard operations by controlling the window handle and UI element to obtain the functional components corresponding to the functional modules, including: Locate UI elements on the operation interface corresponding to each functional module, and then simulate mouse and keyboard operations by calling the system API; Encapsulate the code for simulating mouse and keyboard operations into reusable components, each component receives necessary simulation parameters and performs corresponding simulation operations, wherein the simulation parameters include target window handle, UI element identifier, and operation type; After testing each component to ensure that the component can correctly simulate mouse and keyboard operations, the component is determined as the functional component.
9. The device according to claim 6, characterized in that When the component obtaining unit locates UI elements in the operation interface corresponding to each functional module, the component obtaining unit also uses image recognition or DOM element parsing technology to improve the accuracy and stability of the UI element positioning.
10. The device according to claim 6, characterized in that When the reminder unit detects that the margin balance is lower than a preset reminder threshold, after sending a reminder message to the target user in a preset reminder manner, the device further includes: The restoration reminder unit is used to send a notification of the balance returning to normal to the target user when it is detected that the margin balance is restored to above the reminder threshold.
Citation Information
Cited By
System for automatically downloading online banking pipeline
CN121501365A