Disclosure of Invention
Embodiments of the present invention provide a data acquisition method, a plug-in, a storage medium, and an electronic device, so as to overcome the problem of low data utilization rate at least to a certain extent.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, there is provided a data acquisition method, including:
generating a dynamic link library, and injecting the dynamic link library into the process of a target visual window;
executing the dynamic link library to acquire target data in the target visualization window when the process of the target visualization window triggers an interface function;
and performing data processing on the target data according to a preset rule to obtain available data for a third-party application platform to use.
In an exemplary embodiment of the invention, the method further comprises:
generating a configuration file;
and configuring the attribute of the target visualization window by using the configuration file so as to acquire the data in the target visualization window.
In an exemplary embodiment of the invention, the method further comprises:
acquiring two-dimensional coordinates of each data unit in the target visualization window;
and sorting each data unit according to the two-dimensional coordinates to form target data.
In an exemplary embodiment of the present invention, the processing the target data to obtain the usable data includes:
and performing one or more operations of filtering, sorting and formatting on the target data to obtain the available data.
In an exemplary embodiment of the present invention, the processing the target data to obtain the usable data includes:
extracting target data;
analyzing the target data to obtain the attributes of the target data and all attribute values corresponding to each attribute;
and reserving a preset attribute and all attribute values corresponding to the preset attribute, deleting other attributes and attribute values corresponding to the other attributes, and generating available data.
In an exemplary embodiment of the invention, the method further comprises:
storing the available data;
providing the stored available data to the third party application platform when the third party application platform invokes the dynamic link library.
In an exemplary embodiment of the present invention, further comprising:
and outputting the available data to a third-party application platform in a formatted mode.
In an exemplary embodiment of the invention, the method further comprises:
providing a trigger control;
and when receiving the operation of triggering the control, triggering the interface function.
According to a second aspect of the embodiments of the present invention, there is provided a data collection plug-in, including:
the import unit is used for generating a dynamic link library and injecting the dynamic link library into the process of a target visual window;
the trigger acquisition data unit is used for executing the dynamic link library to acquire target data in the target visualization window when the process of the target visualization window triggers an interface function;
and the data processing unit is used for carrying out data processing on the target data according to a preset rule to obtain available data so as to be used by a third-party application platform.
According to a third aspect of embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, which program, when executed by a processor, implements the data acquisition method as described in the first aspect of the embodiments above.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus, including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the data acquisition method as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the technical solutions provided by some embodiments of the present invention, the dynamic link library is injected into the process of the target visualization window, and when the process of the target visualization window triggers the interface function, the dynamic link library is executed, so that target data in the target visualization window can be acquired, thereby acquiring data across platforms and improving the utilization rate of the data; meanwhile, data in a visual window of a plurality of application platforms can be acquired, so that the flexibility and the universality are improved; compared with the operation of scanning into pictures in the prior art, the method also improves the efficiency of data acquisition; in addition, the target data are subjected to data processing according to the preset rule to obtain available data for the third-party platform to use, the available data can be subjected to data processing to form data required by the third-party platform, and the utilization rate of the data is further improved; and the method has no influence on the third-party platform and is not influenced by the third-party platform, so that the stability and the reliability are improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The data acquisition of the prior related art has over-limited requirements on the form of target data to be acquired, and the accuracy of data identification is low, so that the accuracy of data acquisition is low, and the utilization rate of data is low.
Based on this, in the present embodiment, a data acquisition method is first provided. As shown in fig. 1, the method may include steps S110, S120, and S130. Wherein:
s110, generating a dynamic link library, and injecting the dynamic link library into a process of a target visual window;
s120, when the process of the target visual window triggers an interface function, executing a dynamic link library to acquire target data in the target visual window;
and S130, carrying out data processing on the target data according to a preset rule to obtain available data for a third-party application platform to use.
According to the data acquisition method in the embodiment of the example, the target data in the target visualization window is acquired, so that the data can be acquired in a cross-platform manner, and the utilization rate of the data is improved; meanwhile, data in a visual window of a plurality of application platforms can be acquired, so that the flexibility and the universality are improved; compared with the operation of scanning into pictures in the prior art, the method also improves the efficiency of data acquisition; in addition, the target data are subjected to data processing according to the preset rule to obtain available data for the third-party platform to use, the available data can be subjected to data processing to form data required by the third-party platform, and the utilization rate of the data is further improved; and the method has no influence on the third-party platform and is not influenced by the third-party platform, so that the stability and the reliability are improved.
Hereinafter, each step of the data acquisition method in the present exemplary embodiment will be described in more detail with reference to fig. 1 to 4.
And S110, generating a dynamic link library, and injecting the dynamic link library into the process of the target visual window.
The dynamic link library may be a function library that can be shared by a plurality of executable programs, and the executable code of the dynamic link library is executed by calling other executable programs. The executable code of the dynamic link library may be saved as a dynamic link library file, and the extension of the file may be:. dll,. drv,. ocx, or:. cpl, etc., which is not limited in this exemplary embodiment. Furthermore, the calling dynamic link library may be any executable program or other dynamic link library, for example, a dynamic link library mt.dll in the meio network, or an ERP (Enterprise Resource Planning) system, etc., and in this embodiment, the dynamic link library 302 is called by the executable program or other dynamic link library 301, as shown in fig. 3. The method for calling the dynamic link library can be static calling or dynamic calling, and interface function calling or common function calling of the dynamic link library can be used. This exemplary embodiment is not particularly limited thereto.
The dynamic link library can be injected into the process of the target visual window through a remote injection technology, so that the address space of the target process can be entered, and the target process can be matched with and execute the executable codes in the dynamic link library file. The remote injection technology can acquire the related authority of the process in the target process through an interface function, so that a thread can be created in the target process to load the dynamic link library file. The path of the dynamic link library file can be transferred to the memory space of the target process through an interface function.
The target visualization window may be a window that presents information to the user. The application program finishes the interaction with the user by showing information and data in the window, and realizes the self function. For example, a browser interface, an application interface, or an interface to other visualization software running on Windows. This embodiment is not particularly limited thereto. When the window is started, the operating system may start the window by starting a corresponding plurality of processes, and may allocate a memory space for the processes. The process can process relevant instructions by obtaining the memory space allocated by the system, and can also save the generated data and information after the instructions are executed.
And S120, when the process of the target visualization window triggers an interface function, executing the dynamic link library to acquire target data in the target visualization window.
When the process of the target visual window is started, the interface function of the dynamic link library can be executed. The interface function may be a common function in a class, and various functions may be implemented by defining a method. E.g., get data, get rights, etc. The interface function can acquire the authority of the process, so that a thread can be created in the process to execute the dynamic link library file. Through the execution of the dynamic link library file, data in the target visualization window process can be acquired. The data can be obtained by obtaining each unit in the visualization window and the coordinates of each unit in the visualization window, and then arranging each unit according to the coordinates to form target data, such as the coordinates of a cell, character content, character length, and the like. Of course, the target data may also be obtained by other methods according to actual requirements, for example, obtaining the table in the visualization window to directly obtain the data in the table to form the target data, and the like. This embodiment is not particularly limited thereto. The target data may be all data in the process or may be required partial data. This embodiment is not particularly limited thereto.
And S130, performing data processing on the target data according to a preset rule to obtain available data for a third-party application platform to use.
After the target data is obtained, data processing can be performed on the target data according to preset rules to form available data. The preset rule can be established according to the needs of a user or the needs of a third-party platform. For example, only the numerical information or only the text information is retained, and the like, which is not particularly limited in this exemplary embodiment. The data processing may be one or more of data filtering, data sorting and formatting processing on the target data. The data can be processed to obtain available data for the third-party platform, the available data can be directly formatted and output to the third-party application platform, for example, the available data can be directly output to the third-party application platform, or the available data can be stored in a memory, and when the third-party platform calls the dynamic link library, the available data can be transmitted to the third-party application platform. In the present exemplary embodiment, the available data is directly output to the invoicing software 401, as shown in fig. 4, the available data can also be output to a corresponding location according to the format of the ticket, and the invoicing software can directly invoice without the user manually filling out the data.
For more efficient data processing, the present exemplary embodiment further includes a method for obtaining available data through data filtering, as shown in fig. 2. The method of data filtering in the present exemplary embodiment includes steps S210, S220, and S230. Wherein:
and S210, extracting target data.
The target data may be any information that needs to be acquired from the target visualization window, such as numbers, characters, pictures, symbols, and the like, may be original data of the visualization window, or may be partial data obtained by screening the data of the visualization window, which is not particularly limited in this embodiment. Extracting the target data may pass the target data to a function that performs data processing through parameter passing. Of course, the target data may also be extracted in other manners, for example, the target data is saved as a table and stored in the background database, the background database is accessed, and the table of the target data is obtained. This exemplary embodiment is not particularly limited thereto.
S220, analyzing the target data to obtain the attributes of the target data and all attribute values corresponding to each attribute
Parsing the target data may determine attributes and corresponding attribute values of the data by analyzing the acquired character content. For example, the target data may be a table, where the first row or instance of the table is an attribute of the target data. Or analyzing the content of each piece of data and sorting out the attributes of the target data. This embodiment is not particularly limited thereto. The attribute of the data may be the name of the goods, price, quantity, sales, etc., and the attribute value corresponding to the attribute may be bread, 5.5, 1, 235, etc. Of course, according to actual circumstances, the attribute of the data may be other contents, such as a picture, a symbol (an icon of a commodity, a trademark of a product), and the like, and this is not particularly limited in this exemplary embodiment.
S230, reserving the preset attribute and all attribute values corresponding to the preset attribute, deleting other attributes and attribute values corresponding to the other attributes, and generating available data
For example, the preset attribute may be a commodity name and a price, and when all the acquired attributes are the commodity name, the price, the quantity, and the sales amount, all the attribute values corresponding to the quantity and the sales amount may be deleted to generate available data. In order to improve the utilization rate of the available data, the present exemplary embodiment further includes:
the method includes storing available data and providing the stored available data to the third party application platform when the third party application platform calls the dynamic link library. Wherein:
storing the available data may be stored by saving the available data as a table, or an array. But may be stored in other forms such as pointers, linked lists, stacks, etc. This exemplary embodiment is not particularly limited thereto. The available data may be stored on a background server or in the memory of the client. In the present exemplary embodiment, the data is uploaded to the backend server 303 for storage, as shown in fig. 3 and 4. According to actual needs, the data can also be stored in other storage media, for example, a magnetic disk, a mobile hard disk, or a virtual cloud storage space.
The third-party platform can acquire available data by dynamically calling or statically calling the dynamic link library. The available data can be transferred to the third-party application platform through an interface function, can also be transferred to the third-party application platform through a common function, and can also be directly output to the related position of the third-party application platform. In the present exemplary embodiment, the available data is directly output to the invoicing software 401, and the invoicing software 401 can directly invoice using the available data, as shown in fig. 4.
Further, in order to facilitate data acquisition, the present exemplary embodiment further includes:
generating a configuration file, and configuring the attribute of the target visualization window by using the configuration file so as to acquire the data in the target visualization window.
A configuration file may be a collection of settings and files for the environment required by the software system when loaded when the user is using the software. After the user modifies the attributes of the software, the personalized settings of the user can also be saved, and when the user enters the software service next time, the running environment of the software is configured into the personalized settings of the user. For example, program items, screen colors, printer connections, etc. This embodiment is not particularly limited thereto.
The configuration file can be downloaded from a server or copied from a dynamic link library configured with the target visual window. The configuration file may be generated by the server saving the user's configuration when the dynamically linked library is first run. The configuration generation configuration file of the virtual window can be saved through the virtual target visualization window. When other clients without configuration files need to be configured, the server can issue the configuration files to the clients, and the clients can also actively download the configuration files. In this embodiment, generation of the configuration file is not particularly limited. The configuration file may be a configuration of a software operating environment, such as a configuration of a target visualization window by a user, or a configuration of target software and a target dynamic link library, and in this embodiment, the configuration file also configures attributes of the visualization window so as to obtain data in the visualization window. For example, the coordinates of the upper left corner of the window, the window class name, the window title, etc. of the visualization window are configured.
Further, in order to improve the versatility and flexibility of the present invention, the exemplary embodiment further includes:
providing a trigger control, and triggering an interface function when receiving an operation of triggering the control. Wherein:
the trigger control can be set as a virtual button or a physical button, and can also be set as a keyboard key. Of course, other controls may be set according to actual requirements, for example, a photosensitive sensing control, a gesture sensing control, and the like. This exemplary embodiment is not particularly limited thereto. The trigger control may be triggered by a mouse event or a keyboard event of a user, and may also be triggered by other manners according to actual needs, for example, a button event, a touch screen, an interactive gesture, and the like. This exemplary embodiment is not particularly limited thereto.
In addition, in an exemplary embodiment of the present invention, a data acquisition plug-in is further provided, which may be used to execute the data acquisition method of the present invention. As shown in fig. 5. The data collection plug-in 500 may include:
the import unit 510 is configured to generate a dynamic link library, and inject the dynamic link library into a process of a target visualization window;
a data acquiring triggering unit 520, configured to execute the dynamic link library to acquire target data in the target visualization window when a process of the target visualization window triggers an interface function;
and the data processing unit 530 is configured to perform data processing on the target data according to a preset rule to obtain available data, so as to be used by a third-party application platform.
For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the above-described embodiments of the data acquisition method of the present invention for the functional modules of the data acquisition apparatus of the exemplary embodiment of the present invention correspond to the steps of the above-described exemplary embodiment of the data acquisition method.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use with the electronic device implementing an embodiment of the present invention. The computer system 600 of the electronic device shown in fig. 6 is only an example, and should not bring any limitation to the function and the scope of the use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for system operation are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted into the storage section 608 as necessary.
In particular, according to an embodiment of the present invention, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the invention include a computer program product comprising a computer program embodied on a computer-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to implement the data acquisition method as described in the above embodiments.
For example, the electronic device may implement the following as shown in fig. 1: s110, generating a dynamic link library, and injecting the dynamic link library into a process of a target visual window;
s120, when the process of the target visual window triggers an interface function, executing a dynamic link library to acquire target data in the target visual window;
and S130, carrying out data processing on the target data according to a preset rule to obtain available data for a third-party application platform to use.
As another example, the electronic device may implement the steps shown in FIG. 2.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiment of the present invention.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.