Data acquisition method and related device

Through the data source information model of the target data source type, the communication connection between the server and the data source is automatically established, which solves the problems of high server storage space requirements and cumbersome operations, and achieves efficient processing of data update and synchronization.

CN118568140APending Publication Date: 2024-08-30NINGBO HOLLYSYS INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410958814.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, when the server stores data from multiple different data sources, the storage space is high, and after the data is updated, code needs to be manually written to establish a communication connection, resulting in cumbersome operations.

Method used

Provide a data acquisition method that automatically establishes a communication connection between the server and the data source through the data source information model of the target data source type, reducing storage space requirements and eliminating the need to synchronize data from the data source to the server.

Benefits of technology

This reduces server storage space requirements, simplifies the data update and synchronization process, and improves operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568140A
    Figure CN118568140A
Patent Text Reader

Abstract

The invention discloses a data acquisition method and a related device, and relates to the field of Internet of Things, and if a server needs to access data sources of different data source types, different target data source types can be selected; different data source types correspond to different data source information models; through the target data source information model corresponding to the target data source type, how to establish communication connection between the target data source belonging to the target data source type and the server can be determined. As the data source addresses and the user login information of different data sources are different, the user needs to input the data source address of the target data source and the user login information logging in the target data source. As the server can be automatically switched to access different data sources, the data in the data sources do not need to be stored in the storage space of the server, and the requirement for the storage space of the server is lowered. And if the data in the data source is updated, the data does not need to be synchronized to the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Internet of Things, and in particular to a data acquisition method and related devices. Background Art

[0002] The data stored in the server may come from multiple different data sources. If the data in a data source is updated, the updated data needs to be stored in the server. This ensures that the data obtained from the server is the latest and most accurate. Since the server stores data from multiple different data sources, the storage space requirements for the server are relatively high.

[0003] Moreover, if the data in the data source is updated, the updated data needs to be sent to the server. At this time, the R&D personnel need to write code to establish a communication connection between the server and the data source, so as to send the updated data to the server, which leads to cumbersome operations. Summary of the invention

[0004] In view of the above problems, the present application provides a data acquisition method and related devices to achieve the purpose of reducing the server storage space requirements and eliminating the need to synchronize data from the data source to the server. The specific solution is as follows:

[0005] The first aspect of the present application provides a data acquisition method, comprising:

[0006] Obtaining an instruction to establish a communication connection with a target data source belonging to a target data source type;

[0007] From the correspondence between the preset data source types and the data source information models, the target data source information model corresponding to the target data source type is searched, the target data source information model including the access method information of the server accessing the data source belonging to the target data source type, the verification method information in the process of establishing a communication connection between the server and the data source belonging to the target data source type, the data format conversion relationship between the server and the data source belonging to the target data source type, and the statement conversion relationship between the server and the query statement of the data source belonging to the target data source type; the access method at least corresponds to a data source address variable, and the verification method information at least corresponds to a user login information variable;

[0008] Assign the data source address of the target data source input by the user to the data source address variable and assign the user login information for logging into the target data source input by the user to the user login information variable;

[0009] Establishing a communication connection between the server and the target data source through the access method information and the verification method information;

[0010] Get the first query statement;

[0011] Converting the first query statement into a second query statement through the statement conversion relationship;

[0012] Sending the second query statement to the target data source;

[0013] Receiving first business data obtained by the target data source in response to the second query statement;

[0014] The first business data is converted into second business data through the data format conversion relationship.

[0015] In a possible implementation, the statement conversion relationship includes a correspondence relationship between a first query keyword and a second query keyword and a preset structure of a query statement in the target data source, the first query keyword is applicable to the server, and the second query keyword is applicable to a data source belonging to the target data source type;

[0016] The step of converting the first query statement into a second query statement through the statement conversion relationship comprises:

[0017] Acquire a target first query keyword and a query object from the first query statement;

[0018] From the correspondence between the first query keyword and the second query keyword, searching for a target second query keyword corresponding to the target first query keyword;

[0019] Based on the preset structure, obtaining a query statement template including the target second query keyword and a query object placeholder;

[0020] The query object placeholder in the query statement template is replaced with the query object to obtain the second query statement.

[0021] In a possible implementation, the access method information includes a target access identifier, the verification method information includes a target verification identifier, and the step of establishing a communication connection between the server and the target data source through the access method information and the verification method information includes:

[0022] Finding a target access method corresponding to the target access identifier from a preset correspondence between the access identifier and the access method, wherein the target access method includes the data source address variable;

[0023] From the preset correspondence between the verification identifier and the verification method, searching for the target verification method corresponding to the target verification identifier, the target verification method including the user login information variable;

[0024] The target access method and the target authentication method are executed to establish a communication connection between the server and the target data source.

[0025] In a possible implementation, the method further includes:

[0026] Acquire a target identifier of the electronic device corresponding to the first query statement;

[0027] Sending the second service data to the electronic device having the target identifier;

[0028] The second business data is the basis for the electronic device to perform operations.

[0029] In a possible implementation, the step of assigning the data source address of the target data source input by the user to the data source address variable and assigning the user login information for logging into the target data source input by the user to the user login information variable includes:

[0030] Acquire setting variables that need to be filled in by the user from the target data source information model, wherein the setting variables include the data source address variable and the user login information variable;

[0031] Controlling the display of prompt information for prompting the user to fill in the setting variables;

[0032] Receive the data source address of the target data source and the user login information for logging into the target data source input by the user;

[0033] The data source address of the target data source is assigned to the data source address variable, and the user login information is assigned to the user login information variable.

[0034] A second aspect of the present application provides a data acquisition device, which is applied to a server, and the data acquisition device includes:

[0035] A first acquisition module, used to acquire an instruction to establish a communication connection with a target data source belonging to the target data source type;

[0036] A search module, used to search for a target data source information model corresponding to the target data source type from a correspondence between preset data source types and data source information models, wherein the target data source information model includes access method information of the server accessing a data source belonging to the target data source type, verification method information in a process of establishing a communication connection between the server and the data source belonging to the target data source type, a data format conversion relationship between the server and the data source belonging to the target data source type, and a statement conversion relationship between the server and the query statement of the data source belonging to the target data source type; the access method corresponds to at least a data source address variable, and the verification method information corresponds to at least a user login information variable;

[0037] An assignment module, used to assign the data source address of the target data source input by the user to the data source address variable and to assign the user login information for logging into the target data source input by the user to the user login information variable;

[0038] An establishing module, used to establish a communication connection between the server and the target data source through the access mode information and the verification mode information;

[0039] A second acquisition module, used to acquire the first query statement;

[0040] A first conversion module, configured to convert the first query statement into a second query statement through the statement conversion relationship;

[0041] A first sending module, configured to send the second query statement to the target data source;

[0042] A receiving module, configured to receive first business data obtained by the target data source in response to the second query statement;

[0043] The second conversion module is used to convert the first business data into second business data through the data format conversion relationship.

[0044] In a possible implementation, the statement conversion relationship includes a correspondence between a first query keyword and a second query keyword and a preset structure of a query statement in the target data source, the first query keyword is applicable to the server, and the second query keyword is applicable to a data source belonging to the target data source type; the first conversion module includes:

[0045] A first acquisition unit, configured to acquire a target first query keyword and a query object from the first query statement;

[0046] A first searching unit, configured to search for a target second query keyword corresponding to the target first query keyword from a correspondence between the first query keyword and the second query keyword;

[0047] A second acquisition unit, configured to acquire a query statement template including the target second query keyword and a query object placeholder based on the preset structure;

[0048] A replacing unit is used to replace the query object placeholder in the query statement template with the query object to obtain the second query statement.

[0049] A third aspect of the present application provides a computer program product, including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the data acquisition method of the first aspect or any implementation of the first aspect.

[0050] A fourth aspect of the present application provides a server, comprising at least one processor and a memory connected to the processor, wherein:

[0051] The memory is used to store computer programs;

[0052] The processor is used to execute the computer program so that the server can implement the data acquisition method of the first aspect or any implementation manner of the first aspect.

[0053] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by a server, the server can implement the data acquisition method of the first aspect or any implementation method of the first aspect.

[0054] Through the above technical solution, the present application provides a data acquisition method. If the server needs to access data sources of different data source types, different target data source types can be selected; different data source types correspond to different data source information models; through the target data source information model corresponding to the target data source type, it can be determined how the target data source belonging to the target data source type establishes a communication connection with the server. Since the data source addresses and user login information of different data sources are different, the user is required to enter the data source address of the target data source and the user login information for logging in to the target data source. Since the server can automatically switch to access different data sources, there is no need to store the data in the data source in its own storage space, reducing the requirements for its own storage space. If the data in the data source is updated, it does not need to be synchronized to the server. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0056] Figure 1 A schematic diagram of a system architecture provided for this application;

[0057] Figure 2 A schematic diagram of an optional hardware structure of a terminal 100 provided in this application;

[0058] Figure 3 A structural intention of a server 200 provided for this application;

[0059] Figure 4 A flowchart of a data acquisition method provided in an embodiment of the present application;

[0060] Figure 5 A schematic diagram of a data architecture provided for an embodiment of the present application;

[0061] Figure 6 A schematic diagram of the structure of a data acquisition device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.

[0063] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0064] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0065] See also Figure 1 , Figure 1A schematic diagram of a system architecture is shown. The system may include a terminal 100, a server 200 and a data source 300. The server 200 may include one or more servers ( Figure 1 In the example, a server is included, and the server 200 can provide the method provided in the embodiment of the present application for one or more terminals.

[0066] Among them, an application can be installed on the terminal 100, and the above application can provide an interface. The terminal 100 can receive relevant parameters entered by the user on the interface, such as user login information, the address of the data source and the first query statement, and send the above parameters to the server 200. The server 200 can obtain business data from the data source 300 based on the received parameters, and return the business data to the terminal 100 or send it to other electronic devices.

[0067] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining business data based on the received parameters and returning it to the terminal 100 or sending it to other electronic devices without the cooperation of the server, which is not limited in the embodiments of the present application.

[0068] Next describe Figure 1 The product form of the mid-terminal 100;

[0069] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any limitation on this.

[0070] Figure 2 An optional hardware structure diagram of the terminal 100 is shown.

[0071] refer to Figure 2 As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), an earphone jack 163 (optional), a processor 170, an external interface 180, a power supply 190 and other components. Those skilled in the art will appreciate that Figure 2This is merely an example of a terminal and does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown in the figure, or a combination of certain components, or different components.

[0072] The input unit 130 can be used to receive input digital or character information, and generate key signal input related to the user settings and function control of the terminal. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can collect the user's touch operations on or near it (such as the user's operation on or near the touch screen using any suitable object such as fingers, joints, stylus, etc.), and drive the corresponding connection device according to a pre-set program. The touch screen can detect the user's touch action on the touch screen, convert the touch action into a touch signal and send it to the processor 170, and can receive and execute the command sent by the processor 170; the touch signal at least includes the touch point coordinate information. The touch screen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, the touch screen can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch screen 131, the input unit 130 can also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0073] Among them, the input device 132 can receive input data and the like.

[0074] The display unit 140 may be used to display information input by the user or provided to the user, various menus of the terminal 100, interactive interfaces, file display and / or playback of any multimedia file. In the embodiment of the present application, the display unit 140 may be used to display an interface for receiving parameters, processing results, etc.

[0075] The memory 120 can be used to store instructions and data. The memory 120 can mainly include an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files, texts, etc.; the instruction storage area can store software units such as operating systems, applications, instructions required for at least one function, or their subsets and extensions. It can also include a non-volatile random access memory; provide the processor 170 with hardware, software and data resources including management of computing and processing equipment, and support control software and applications. It is also used for the storage of multimedia files, and the storage of running programs and applications.

[0076] The processor 170 is the control center of the terminal 100. It uses various interfaces and lines to connect various parts of the entire terminal 100. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it executes various functions of the terminal 100 and processes data, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application program, and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 170. In some embodiments, the processor and the memory may be implemented on a single chip, and in some embodiments, they may also be implemented separately on separate chips. The processor 170 may also be used to generate corresponding operation control signals, send them to corresponding components of the computing and processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that each functional module therein performs corresponding functions, thereby controlling the corresponding components to act according to the requirements of the instructions.

[0077] The memory 120 may be used to store software codes related to the data acquisition method, the processor 170 may execute the steps of the data acquisition method, and may also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to implement corresponding functions.

[0078] The radio frequency unit 110 (optional) can be used for receiving and sending information or receiving and sending signals during a call, for example, after receiving the downlink information of the base station, it is sent to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the radio frequency unit 110 can also communicate with network devices and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.

[0079] In this embodiment of the present application, the RF unit 110 can send data to the server 200 and receive processing results sent by the server 200.

[0080] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.

[0081] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0082] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to communicate with other devices, or to connect a charger to charge the terminal 100 .

[0083] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which are not described in detail here. Some or all of the methods described below may be applied in the following embodiments. Figure 2 In the terminal 100 shown.

[0084] Next describe Figure 1 The product form of the server 200;

[0085] Figure 3 A structural diagram of a server 200 is provided, such as Figure 3 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.

[0086] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0087] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0088] The memory 204 may include a volatile memory, such as a random access memory (RAM). The memory 204 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard drive (HDD), or a solid state drive (SSD).

[0089] The memory 204 may be used to store software codes related to the data acquisition method, and the processor 202 may execute the steps of the chip data acquisition method and may also schedule other units to implement corresponding functions.

[0090] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.

[0091] Reference Figure 4 , Figure 4 A flow chart of a data acquisition method provided in an embodiment of the present application is shown as follows: Figure 4 As shown, a data acquisition method provided in an embodiment of the present application may include steps 401 to 409, and these steps are described in detail below.

[0092] Step 401: Obtain an instruction to establish a communication connection with a target data source belonging to the target data source type.

[0093] Exemplarily, the terminal 100 may display a user interface, through which the target data source type may be selected or input, so that the terminal 100 obtains the above instruction.

[0094] The data source types are described below. The data sources mentioned in the embodiments of the present application are all external data sources. The external data sources can be different data sources of the same enterprise, or data sources of different enterprises.

[0095] If the data source is a database, the data source type refers to the database type. Exemplarily, the database type includes but is not limited to: relational database, graph database, document-oriented database, SQLSever database, key-value storage database, Qracle database, MySQL database, hierarchical database, DB2 database, column storage database, non-relational database, Sybase database, object-oriented database, time series database, XML database, Redis database, MongoDB database.

[0096] If the data source is a public interface of an external system, that is, an interface provided by a third-party service provider, the data source type includes but is not limited to: Web Service interface, RESTful (Representational State Transfer) interface.

[0097] If the data source is an external file system, such as a file server, the data source type is a file server type. File server types include but are not limited to: Ftp (File Transfer Protocol) server and Minio server.

[0098] If the data source is an IOT (Internet of Things) device, the data source type is the type of the IOT device.

[0099] If the data source is an application, the data source type includes but is not limited to: API (Application ProgramInterface) interface.

[0100] If the data source is a storage space for storing time series data, the data source type is the type of the storage space. Exemplarily, the storage space may be a database or an external file system.

[0101] Step 402: searching for a target data source information model corresponding to the target data source type from the preset correspondence between the data source type and the data source information model.

[0102] The target data source information model includes access method information of the server accessing the data source belonging to the target data source type, verification method information in the process of establishing a communication connection between the server and the data source belonging to the target data source type, data format conversion relationship between the server and the data source belonging to the target data source type, and statement conversion relationship between the server and the query statement of the data source belonging to the target data source type. The access method corresponds to at least a data source address variable, and the verification method information corresponds to at least a user login information variable.

[0103] The following is an example of the target data source information model.

[0104] Assuming that the target data source type is a SQLSever database, the access method information in the target data source information model corresponds to but is not limited to: the driver program and data source address variables of the SQLSever database; the verification method information corresponds to but is not limited to: information required to meet permission verification, for example, user login information variables.

[0105] Different database types have different corresponding database drivers. Database drivers can facilitate the communication between the server and the target data source over the network.

[0106] Exemplarily, different data sources belonging to the same target data source type have different data source addresses and user login information, so the target data source information model includes variables such as data source address variables and user login information variables, and the specific values ​​of the variables need to be filled in by the user.

[0107] Exemplarily, the user login information variables include, but are not limited to: a user name variable, a user password variable, and a database name variable.

[0108] Assuming that the target data source type is a RESTful interface, the access method information in the target data source information model corresponds to but is not limited to: data source address variable; the verification method information includes but is not limited to: permission verification method and information required to satisfy permission verification, such as user login information variable.

[0109] Exemplarily, if the user's position is required during the permission verification process, the user login information variable includes the user's position variable.

[0110] Exemplarily, the information required for authority verification includes user login information, because the user level can be determined by the user name in the user login information, and the user authority can be determined based on the user level.

[0111] Exemplarily, the permission verification method may refer to a verification method that determines a user level by a user name and determines user permissions based on the user level. Exemplarily, the permission verification method may be a verification method of a target data source.

[0112] Exemplarily, if the target data source type is a Minio server, the access method information in the target data source information model corresponds to but is not limited to: a server address field; the verification method information includes but is not limited to: information required to satisfy permission verification, for example, a user login information variable.

[0113] Exemplarily, if the target data source type is a storage space for storing time series data, the access method information in the target data source information model includes but is not limited to: data source address variables; verification method information includes but is not limited to: information required to meet authority verification, such as user login information variables.

[0114] Exemplarily, the primary key of the time series data stored in the storage space can be directly assigned to the electronic device that needs to execute the data. The first query statement in step 405 can include the primary key.

[0115] Exemplarily, if the target data source type is a data source of an IOT device, the access method information in the target data source information model includes but is not limited to: an IOT device address field; the verification method information includes but is not limited to: information required to satisfy authority verification, such as a user login information variable. At this time, the target data source information model also includes: a data format conversion relationship between the server 200 and the IOT device. Thus, the server converts the second business data into business data suitable for the IOT device.

[0116] The embodiment of the present application decouples the data source information model from the server 200. No matter which data source type the data source to be accessed is, it can be switched to the corresponding data source type based on the "correspondence between the data source type and the data source information model".

[0117] The following is an example of the related technology. In the related technology, the method of connecting the server to the external system public interface is: using a hard-coded method to access the external system public interface. If the external system public interface changes, it is necessary to modify the corresponding program code in the server, which is cumbersome, that is, the external system public interface and the server are not decoupled.

[0118] The data format conversion relationship is explained below.

[0119] If the data format of the data stored in the server 200 is different from the data format of the data stored in the target data source, for example, the gender of the data stored in the target data source is represented by {0,1}, while the gender of the data stored in the server 200 is represented by {male, female}, data format conversion is required. The data format conversion relationship is the conversion relationship between the data format of the data stored in the server 200 and the data format of the data stored in the target data source.

[0120] If the data format of the data stored in the server 200 is the same as the data format of the data stored in the target data source, the data format conversion relationship is none.

[0121] Exemplarily, the data format includes, but is not limited to, the way data is represented (e.g., the way data gender is represented), the data type of data (e.g., the data type of the ID number data stored in server 200 is character type, and the data type of the ID number data stored in the target data source is integer type).

[0122] Exemplarily, the data format conversion relationship includes: a corresponding relationship between the data format of data in the server 200 and the data format of data in the target data source representing the same meaning.

[0123] The statement conversion relationship is explained below.

[0124] Exemplarily, the query statements that the server can respond to and the query statements that the target data source can respond to may be different. For example, the database inside the server 200 is a SQL Server database, and the data of the target data source is stored in a SQL database, then the query statements that the server can respond to and the query statements that the target data source can respond to are different, and the following example is used to illustrate.

[0125] If you need to search for field 1, Field1, and field 2, Field2, from table A of the target data source, the query statement applicable to server 200 is: Select Field1+Field2 from table A; the query statement applicable to the target data source is: Select Field1||Field2 from table A.

[0126] Step 403: assigning the data source address of the target data source input by the user to the data source address variable and assigning the user login information for logging into the target data source input by the user to the user login information variable.

[0127] Exemplarily, the terminal 100 may display a user interface, and the user may input a data source address and user login information in the user interface.

[0128] Exemplarily, the user login information includes, but is not limited to, a user name and a user password. Exemplarily, the user password includes, but is not limited to, one or more of a character string and biometric information.

[0129] Exemplarily, the data source address may include at least one of an IP (Internet Protocol Address) address, a MAC (Media Access Control Address) address, and a port number.

[0130] It is understandable that there are multiple ways to implement step 403, and the embodiments of the present application provide but are not limited to the following two.

[0131] The first implementation of step 403 includes the following steps A11 to A14.

[0132] Step A11: From the correspondence between data source types and variables that users need to fill in, search for the variables that users need to fill in that correspond to the target data source type.

[0133] The correspondence between the data source type and the variables that the user needs to fill in can be preset, so that after the user selects the target data source type, the user can find the variables that the target data source type needs to fill in from the correspondence between the data source type and the variables that the user needs to fill in, such as the data source address variable and the user login information variable. Thus, the user is prompted to enter the variables that the user needs to fill in.

[0134] Step A12: Control the display of prompt information prompting the user to fill in the variables that the user needs to fill in.

[0135] Step A13: receiving the data source address of the target data source and the user login information for logging into the target data source input by the user.

[0136] Step A14: assigning the data source address of the target data source to the data source address variable; and assigning the user login information to the user login information variable.

[0137] In the first implementation, if the user-filled variable corresponding to the data source type needs to be changed, the corresponding relationship in step A11 needs to be changed, which is cumbersome. Based on this, the following second implementation is provided.

[0138] The second implementation of step 403 includes the following steps A21 to A24.

[0139] Step A21: Acquire setting variables that need to be filled in by the user from the target data source information model, wherein the setting variables include the data source address variable and the user login information variable.

[0140] Exemplarily, each field in the target data source information model is set with an identifier. The first identifier is set for fields that do not require user input. For example, the driver of the SQLSever database does not require user input, so the first identifier is set; the field that requires user input is called a variable and is set with a second identifier. For example, the data source address variable and the user login information variable are the second identifiers. The set variable marked with the second identifier can be obtained from the target data source information model. If the user needs to fill in the variable and it changes, the corresponding identifier can be directly set for the corresponding field in the data source information model, which is more convenient.

[0141] Step A22: Control the display of prompt information for prompting the user to fill in the setting variables.

[0142] Step A23: receiving the data source address of the target data source and the user login information for logging into the target data source input by the user.

[0143] Step A24: assigning the data source address of the target data source to the data source address variable, and assigning the user login information to the user login information variable.

[0144] Exemplarily, the variables that users need to fill in in the data source information model can be called a configuration parameter variable information model.

[0145] Step 404: Establish a communication connection between the server and the target data source through the access method information and the verification method information.

[0146] In an optional implementation, the data source information model is tightly coupled with the access method information and the verification method information, that is, the access method information and the verification method information are explanations of the access method information and the verification method information in step 402. If at least part of the access method information and / or the verification method information needs to be changed, such as changing the driver of the SQLSever database, the data source information model needs to be modified, resulting in cumbersome operations.

[0147] In an optional implementation, the data source information model is decoupled from the access mode information and the verification mode information, and the specific implementation includes the following steps B1 to B3. The access mode information includes a target access identifier, and the verification mode information includes a target verification identifier.

[0148] Step B1: searching for a target access method corresponding to the target access identifier from a preset correspondence between the access identifier and the access method, wherein the target access method includes the data source address variable.

[0149] It is understandable that for the description of the target access method and the target verification method, reference may be made to the explanation of the access method information and the verification method information in step 402, which will not be repeated here.

[0150] Step B2: searching for a target verification method corresponding to the target verification identifier from a preset correspondence relationship between verification identifiers and verification methods, wherein the target verification method includes the user login information variable.

[0151] Step B3: Execute the target access method and the target verification method to establish a communication connection between the server and the target data source.

[0152] If the user needs to change the driver of the SQLSever database in the access method, it is sufficient to change the "correspondence between the access identifier and the access method" without changing the data source information model. Moreover, if multiple different access identifiers correspond to the same access method, multiple different access identifiers can correspond to the same access method, thereby reducing data redundancy.

[0153] If the user needs to change the information required for permission verification in the verification method, it is sufficient to change the "correspondence between the verification identifier and the verification method" without changing the data source information model. Moreover, if multiple different verification identifiers correspond to the same verification method, multiple different access identifiers can correspond to the same access method, thereby reducing data redundancy.

[0154] Step 405: Obtain a first query statement.

[0155] Exemplarily, the terminal 100 may display a user interface, and the user may input the first query statement through the user interface displayed by the terminal 100 .

[0156] Exemplarily, the data service information model in the implementation of the present application corresponds to the first query statement. For example, the data service information model can parse the statement conversion relationship to obtain the second query statement based on the first query statement.

[0157] Step 406: Convert the first query statement into a second query statement through the statement conversion relationship.

[0158] Step 407: Send the second query statement to the target data source.

[0159] Step 408: Receive first business data obtained by the target data source in response to the second query statement.

[0160] Exemplarily, the variables that users need to fill in in the data source information model can be called a configuration parameter variable information model. In the embodiment of the present application, the data source information model object includes: a data source information model after the configuration parameter variable information model has been assigned a value and a data service information model.

[0161] Exemplarily, different data source types correspond to different data source information models, and different data source types correspond to different data source information model objects.

[0162] Step 409: Convert the first business data into second business data through the data format conversion relationship.

[0163] Exemplarily, the data service information model in the implementation of the present application corresponds to the first business data. For example, the data service information model can parse the data format conversion relationship to obtain the second business data based on the first business data.

[0164] Exemplarily, the data service information model is related to the specific business data to be queried, and the data service information model exposes parameter values ​​such as input parameters of a customizable structure (e.g., a first query statement, a statement conversion relationship, a data format conversion relationship, a first business data, a query object) and a return value (e.g., a second query statement and a second business data) to ensure that the output data is parsable to enhance the readability of the data service information model. Different business data are obtained by setting parameter values ​​in the data service information model. Input parameters include fixed values ​​and / or variables. Exemplarily, the input parameter may be the variable value of a variable (which may be a variable in an instruction) in the information model (i.e., the electronic device 400 mentioned later). Exemplarily, the variable value of a variable in the information model is read by defining HQL (Hibernate Query Language) in the information model.

[0165] The information model is a data carrier that describes the industrial informationization process, including but not limited to: equipment data, organizational data, process data, process data, etc. The data source information model describes the structure of the information model required to access the data source. The data service information model is the structure of the information model that provides data services after the target data source has been determined. The variable information model is one of the elements contained in the information model, which describes the variable data of the information entity in the information model.

[0166] Exemplarily, the data service information model uses a programmable JavaScript language combined with an operation language for a data source to integrate and convert the first query statement and the first business data to ensure the availability of the return value.

[0167] Exemplarily, if the data source is a data source of an IOT device, the first query statement is an instruction to obtain data and does not require conversion, that is, the first query statement is the second query statement; after obtaining the first business data, the second business data can be directly obtained based on the data format conversion relationship, so there is no need for a data service information model.

[0168] The present application provides a configurable data source information model for each data source, which meets the needs for querying and editing the data stored in the data source; and provides a unified channel for data interconnection between data sources in different environments and of different data source types. The present application organizes the basic information required for accessing the data source by establishing a "correspondence between the data source type and the data source information model", and through business analysis, the data source to be accessed is concretized by establishing a data service information model. Among them, the data service information model corresponding to the data source of each data source type includes but is not limited to: a data access data service information model, which is used to read the rules configured by the data source information model, parse the obtained first business data, and obtain the second business data; a statement access data service information model, which is used to read the rules configured by the data source information model, and parse the obtained first query statement to obtain the second query statement.

[0169] The embodiment of the present application sets the "correspondence between data source type and data source information model" to dynamically switch the data source connected to the server 200, thereby shielding the underlying differences, breaking down the barriers between different data sources, and reducing the difficulty of development.

[0170] The embodiment of the present application does not need to store the data in the data source in the storage space of the server itself, nor does it need to be migrated to other data sources, thereby achieving the connection between the server and the original data source while keeping the original data source unchanged.

[0171] An embodiment of the present application provides a data acquisition method. If the server needs to access data sources of different data source types, different target data source types can be selected; different data source types correspond to different data source information models; through the target data source information model corresponding to the target data source type, it can be determined how the target data source belonging to the target data source type establishes a communication connection with the server. Since the data source addresses and user login information of different data sources are different, the user is required to input the data source address of the target data source and the user login information for logging in to the target data source. Since the server can automatically switch to access different data sources, there is no need to store the data in the data source in its own storage space, reducing the requirements for its own storage space. If the data in the data source is updated, it does not need to be synchronized to the server.

[0172] It is understandable that the embodiments of the present application can be applied to a variety of application scenarios. The embodiments of the present application provide but are not limited to the following four application scenarios.

[0173] The first application scenario: Figure 1 The system architecture also includes an electronic device 400, and the second business data obtained by the terminal 100 from the data source 300 through the server 200 is the data that the electronic device 400 needs to run.

[0174] Exemplarily, the electronic device 400 is an IOT (Internet of Things) device. Exemplarily, the IOT device includes, but is not limited to: one or more of smart home devices, industrial sensors, smart cameras, and robots.

[0175] It is understandable that the terminal 100 and the server 200 may belong to the same enterprise AA, or the terminal 100 and the server 200 may belong to different enterprises, and the server belongs to the enterprise AA. Different data sources may belong to the same enterprise AA as the server 200, or different data sources may belong to different enterprises as the server 200. Different enterprises may entrust the enterprise AA to perform corresponding tasks, or the enterprise AA itself needs to perform corresponding tasks, and the tasks need to be performed by the electronic device 400. If the tasks entrusted to the enterprise AA by different enterprises or the tasks of the enterprise AA itself are stored in the server 200, the server 200 requires a very large storage space. If the tasks entrusted to the enterprise AA by different enterprises change, the tasks in the server 200 also need to be updated in time. If the update is not timely, it may cause the electronic device 400 of the enterprise AA to have completed the unchanged original tasks, resulting in a waste of resources. Therefore, the tasks entrusted by different enterprises can be stored in the data source of the corresponding enterprise. If the tasks of the enterprise change, the data source within the enterprise itself can be directly updated. Users of enterprise AA (such as R&D personnel) can select the target data source type, input the data source address of the target data source, input the user login information for logging into the target data source, and input the first query statement through the terminal 100 connected to the server 200. The server 200 can obtain the corresponding business data from the target data source and send the business data to the electronic device 400, so that the electronic device 400 runs the business data.

[0176] In the first application scenario, after the user inputs the first query statement through the terminal 100, the target identifier can be input, so that a corresponding relationship between the target identifier and the first query statement is established. The target identifier is the identifier of the electronic device that executes the first query statement to query the first business data. Exemplarily, the number of target identifiers can be one or more.

[0177] Exemplarily, the number of the first query statements may be one or more, and each first query statement may correspond to one or more target identifiers.

[0178] In the first application scenario, after the terminal 100 displays the second service data, the user can input a target identifier, thereby establishing a corresponding relationship between the second service data and the target identifier.

[0179] In summary, the embodiment of the present application also includes the following steps C1 to C2.

[0180] Step C1: Obtain the target identifier of the electronic device corresponding to the first query statement.

[0181] Step C2: Send the second service data to the electronic device having the target identifier.

[0182] The second business data is the basis for the electronic device to perform operations.

[0183] For example, if the electronic device 400 is an IOT device, the target data source is the data source of the IoT device, and after converting the first business data into the second business data, it can be directly assigned to the electronic device 400, that is, the information model. The data source information model serves as a rule configuration carrier and provides business data in a unified manner to the outside.

[0184] Exemplarily, the second business data may be assigned to corresponding variables in the information model, thereby obtaining a plurality of service instructions, and the service instructions are sent to the electronic device.

[0185] The second application scenario: Figure 1 The system architecture also includes an electronic device 400, and the second business data obtained by the terminal 100 from the data source 300 through the server 200 is the data that the electronic device 400 needs to execute.

[0186] Exemplarily, the terminal 100 and the server 200 may belong to the same enterprise AA, or the terminal 100 and the server 200 may belong to different enterprises, where the server belongs to enterprise AA and the electronic device 400 belongs to the server 400 of enterprise BB.

[0187] Assuming that enterprise AA has purchased multiple machines from enterprise BB, the purchase records of the machines can be maintained in the data source of enterprise BB. The server 200 of enterprise AA does not need to store the purchase information of multiple machines. If a machine is damaged and needs to be repaired, the user of enterprise AA (e.g., maintenance personnel) can select the target data source type through the terminal 100 connected to the server 200, input the data source address of the target data source, i.e., the address of the server 400, input the user login information for logging into the target data source, and input the first query statement (the first query statement includes the identification of the damaged machine). The server 200 can obtain the corresponding business data, i.e., the purchase information of the damaged machine from the target data source, and send the business data to the server 400. The server 400 can send the purchase information to the terminal device held by the maintenance personnel of enterprise BB, and create a maintenance work order for the maintenance personnel of enterprise BB. Thus, the purpose of automatic warranty of the damaged machine is automatically achieved.

[0188] In the first application scenario and the second application scenario, both include an electronic device 400. Exemplarily, the electronic device 400 includes a variable field, and the second service data received by the electronic device 400 can be assigned to the variable field. Exemplarily, the variable field can be a variable field in an instruction. Thus, the electronic device 400 performs a corresponding operation based on the instruction assigned with the second service data.

[0189] The third application scenario: the second service data obtained by the terminal 100 from the data source 300 through the server 200 is for viewing by the holder of the terminal 100 .

[0190] In the third application scenario, it also includes: controlling the terminal 100 to display the second business data.

[0191] Fourth application scenario: the second service data obtained by the terminal 100 from one or more data sources CC through the server 200 needs to be transmitted to other data sources DD.

[0192] Exemplarily, before being transmitted to the data source DD, the second business data needs to be converted into third business data that conforms to the data format of the data source DD; and the third business data is sent to the data source DD.

[0193] Exemplarily, the fourth application scenario may specifically be an industrial information scenario. Since the industrial informatization process is a long and complex process of continuous iteration of various information systems, the new information system must interact with the old information system used in the past in terms of data or tasks. For example, the data source CC is the old information system, and the data source DD is the new information system; or, the data source CC is the new information system, and the data source DD is the old information system. Using the data acquisition method provided in the embodiment of the present application, the new and old information systems can coexist and transition smoothly.

[0194] In the related art, if the data source CC is an old information system and the data source DD is a new information system, the data of the data source CC needs to be migrated to the data source DD. For example, if the data source CC is a relational database, then during the migration process, it is necessary to use ETL (Extract-Transform-Load) to convert and clean the data, and import the converted and cleaned data into the data source DD. A lot of code needs to be written to achieve data synchronization between the data source CC and the data source DD, but the synchronization still cannot be guaranteed to be real-time. The present application uses server 200 as an intermediate platform to achieve data interaction between different data sources. The data is still stored in the original data source and does not need to be migrated.

[0195] In order for those skilled in the art to better understand the data source types, data source information models, information models, and application scenarios that can be accessed by the embodiments of the present application, the following examples are given for illustration. Figure 5 , which is a schematic diagram of the data architecture provided in an embodiment of the present application.

[0196] External data source types include, but are not limited to: relational databases, data sources of IOT devices, external applications, time series databases, and external file systems. In order to accommodate the above data source types, different data source information models are configured for different data source types; different data sources are accessed through different data source information models. For example, the data source information model used to access the data source includes, but is not limited to: a data source information model with JDBC (Java Database Connectivity) service function (corresponding to a relational database), a data source information model with an IOT adapter service function (corresponding to a data source of an IOT device), a data source information model with a file service function (corresponding to an application), a data source information model with a time series service function (corresponding to a time series database), and a data source information model with a RESTful service function (corresponding to an external file system).

[0197] It is understandable that the access method information, verification method information, data format conversion relationship, and statement conversion relationship set in data source information models with different functions are different.

[0198] like Figure 5 As shown, the information model can assign the second business data obtained from the data source to the corresponding variable (also called variable information model). Figure 5 The information model shown may include n variables, where the n variables are: variable 1, variable 2, ..., variable n. Exemplarily, multiple information models may be included. Figure 5 This is only an example and does not limit the data of the information model included in this application. Exemplarily, the information model also includes: the source of the second business data, the source of the second business data in the information model can be one or more data sources, Figure 5 The second business data in the information model shown comes from data source one, data source two and data source three, wherein data source one, data source two and data source three can be any data source provided in the embodiment of the present application.

[0199] It can be understood that after the second business data from different data sources are assigned to corresponding variables, different services can be obtained. Exemplarily, the information model also includes: service instructions obtained for different second business data in each data source. Exemplarily, the electronic device 400 can execute the corresponding service instructions.

[0200] Figure 5In the example, it is assumed that the number of service instructions obtained based on different second business data in each data source is the same and is M. Exemplarily, the number of service instructions obtained based on different second business data in different data sources may be the same or different, which is not limited here.

[0201] The service instructions corresponding to data source one are respectively: service instruction one, service instruction two, ..., service instruction M; the service instructions corresponding to data source two are respectively: service instruction one, service instruction two, ..., service instruction M; the service instructions corresponding to data source three are respectively: service instruction one, service instruction two, ..., service instruction M. Exemplarily, different data sources correspond to different service instructions.

[0202] Figure 5 The application scenario is shown in FIG. 4 . For example, applications of other enterprises, namely external applications, can use the service instructions in the information model; applications within the enterprise can use the service instructions in the information model.

[0203] Exemplarily, a corresponding service instruction may be selected through a user interface.

[0204] In an optional implementation, there are multiple implementations of step 406. The embodiment of the present application provides but is not limited to the following method, which includes the following steps D1 to D4.

[0205] Step D1: Obtain a target first query keyword and a query object from the first query statement.

[0206] The statement conversion relationship includes a correspondence between a first query keyword and a second query keyword and a preset structure of a query statement in the target data source, the first query keyword is applicable to the server, and the second query keyword is applicable to a data source belonging to the target data source type.

[0207] It is understandable that the query statements that the server 200 can respond to and the query statements that the target data source can respond to may be different. For example, the database inside the server 200 is a SQL Server database, and the data of the target data source is stored in a SQL database, then the query statements that the server can respond to and the query statements that the target data source can respond to are different, and an example is given below to illustrate.

[0208] If you need to search for field 1, i.e. Field1, and field 2, i.e. Field2, from table A of the target data source, you can input a first query statement for server 200 through terminal 100, i.e. Select Field1+Field2 from table A; the target first query keywords obtained from the first query statement include: Select, +, and from, and the query objects obtained from the first query statement include: Field1, Field2, and table A.

[0209] Step D2: searching for a target second query keyword corresponding to the target first query keyword from the correspondence between the first query keyword and the second query keyword.

[0210] Still taking the above as an example, assuming that the correspondence between the first query keyword and the second query keyword is represented by a table, the correspondence may be as shown in Table 1.

[0211] Table 1

[0212] First search keyword Second search keyword Select Select + || from from … …

[0213] From Table 1, it can be found that the target second query keyword corresponding to the first query keyword Select is Select; the target second query keyword corresponding to the first query keyword + is ||; and the target second query keyword corresponding to the first query keyword from is from.

[0214] Step D3: Based on the preset structure, a query statement template including the target second query keyword and a query object placeholder is obtained.

[0215] It is understandable that the preset structures of different data source types may be different or the same. The preset structure includes the relative positions of each query type and the query keyword. For example, in the preset structure corresponding to the server 200, the position of the query keyword Select and the query type "query field" is "the query field is located after Select", and the position of the query keyword "+" and the query type "query field" is "the query field is located on both sides of the "+"".

[0216] It is understandable that the positions of query keywords with the same meaning in the query statement templates corresponding to different data source types may be different. Still taking the above as an example, the query statement template obtained is Select [placeholder 001]||[placeholder 002]from [placeholder 003].

[0217] Exemplarily, the query type corresponding to the query object includes but is not limited to: query field, query table, query condition. The query objects of the same query type may be located in the same or different positions in the query statement templates corresponding to different data source types.

[0218] Exemplarily, after obtaining the query statement template, a correspondence between the placeholder identifiers in the query statement template and the query type is automatically established. For example, [placeholder 001] corresponds to "query field" Field1, [placeholder 002] corresponds to "query field" Field2, and [placeholder 003] corresponds to "query table" Table A.

[0219] Step D4: Replace the query object placeholder in the query statement template with the query object to obtain the second query statement.

[0220] Still taking the above as an example, the server 200 can convert the first query statement into a second query statement: SelectField1||Field2 from Table A.

[0221] This application is different from the related art in that data is extracted, transformed, and loaded from one data source to another through ETL. This application does not actually access business data. Business data is maintained in their respective data sources. The data source information model only references the business data through configuration. Therefore, it does not cause complex operations for data synchronization between the two end users, and there is no need to pay attention to whether the data is synchronized. No additional storage space is required to increase server pressure.

[0222] This application realizes low-code or even code-free development when accessing data sources. It can access multiple data sources without modifying the code, and there is no need to modify the underlying code to modify the data source.

[0223] This application uses a configurable method, namely, setting the "correspondence between data source type and data source information model" to access the data source. By modifying the configuration rules, the modification of the data format of the data source can be adapted.

[0224] A data acquisition method provided by an embodiment of the present application is introduced above, and a device for executing the above data acquisition method will be introduced below.

[0225] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of a data acquisition device provided in an embodiment of the present application. Figure 6 As shown, the data acquisition device comprises:

[0226] A first acquisition module 601 is used to acquire an instruction to establish a communication connection with a target data source belonging to a target data source type;

[0227] The search module 602 is used to search for the target data source information model corresponding to the target data source type from the correspondence between the preset data source types and the data source information models, wherein the target data source information model includes the access method information of the server accessing the data source belonging to the target data source type, the verification method information in the process of establishing a communication connection between the server and the data source belonging to the target data source type, the data format conversion relationship between the server and the data source belonging to the target data source type, and the statement conversion relationship between the query statement of the server and the data source belonging to the target data source type; the access method corresponds to at least a data source address variable, and the verification method information corresponds to at least a user login information variable;

[0228] The assignment module 603 is used to assign the data source address of the target data source input by the user to the data source address variable and assign the user login information for logging into the target data source input by the user to the user login information variable;

[0229] Establishing module 604, used to establish a communication connection between the server and the target data source through the access mode information and the verification mode information;

[0230] The second acquisition module 605 is used to acquire the first query statement;

[0231] A first conversion module 606, configured to convert the first query statement into a second query statement through the statement conversion relationship;

[0232] A first sending module 607, configured to send the second query statement to the target data source;

[0233] A receiving module 608, configured to receive first business data obtained by the target data source in response to the second query statement;

[0234] The second conversion module 609 is used to convert the first business data into second business data through the data format conversion relationship.

[0235] In an optional implementation, the statement conversion relationship includes a correspondence between a first query keyword and a second query keyword and a preset structure of a query statement in the target data source, the first query keyword is applicable to the server, and the second query keyword is applicable to a data source belonging to the target data source type; the first conversion module includes:

[0236] A first acquisition unit, configured to acquire a target first query keyword and a query object from the first query statement;

[0237] A first searching unit, configured to search for a target second query keyword corresponding to the target first query keyword from a correspondence between the first query keyword and the second query keyword;

[0238] A second acquisition unit, configured to acquire a query statement template including the target second query keyword and a query object placeholder based on the preset structure;

[0239] A replacing unit is used to replace the query object placeholder in the query statement template with the query object to obtain the second query statement.

[0240] In an optional implementation, the access method information includes a target access identifier, the verification method information includes a target verification identifier, and the establishing module includes:

[0241] A second searching unit, configured to search for a target access method corresponding to the target access identifier from a preset correspondence relationship between the access identifier and the access method, wherein the target access method includes the data source address variable;

[0242] A third searching unit, configured to search for a target verification method corresponding to the target verification identifier from a preset correspondence relationship between verification identifiers and verification methods, wherein the target verification method includes the user login information variable;

[0243] An execution unit is used to execute the target access method and the target verification method to establish a communication connection between the server and the target data source.

[0244] In an optional implementation, the method further includes:

[0245] A third acquisition module, used to acquire a target identifier of the electronic device corresponding to the first query statement;

[0246] A second sending module, used for sending the second service data to the electronic device having the target identifier;

[0247] The second business data is the basis for the electronic device to perform operations.

[0248] In an optional implementation, the assignment module includes:

[0249] A third acquisition unit is used to acquire setting variables that need to be filled in by the user from the target data source information model, wherein the setting variables include the data source address variable and the user login information variable;

[0250] A control unit, used for controlling the display of prompt information for prompting the user to fill in the setting variables;

[0251] A receiving unit, configured to receive a data source address of the target data source and user login information for logging into the target data source input by a user;

[0252] An assignment unit is used to assign the data source address of the target data source to the data source address variable, and to assign the user login information to the user login information variable.

[0253] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any data acquisition method provided in the embodiment of the present application.

[0254] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any data acquisition method provided in the embodiment of the present application.

[0255] It should be noted that the data acquisition method and related devices provided by the present invention can be used in the fields of Internet of Things, mobile Internet, cloud computing, and big data edge computing.

[0256] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0257] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0258] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0259] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a training device, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, training device, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

Claims

1. A data acquisition method, It is characterized in that Applied to a server, the data acquisition method includes: Obtaining an instruction to establish a communication connection with a target data source belonging to a target data source type; From the correspondence between the preset data source types and the data source information models, the target data source information model corresponding to the target data source type is searched, the target data source information model including the access method information of the server accessing the data source belonging to the target data source type, the verification method information in the process of establishing a communication connection between the server and the data source belonging to the target data source type, the data format conversion relationship between the server and the data source belonging to the target data source type, and the statement conversion relationship between the server and the query statement of the data source belonging to the target data source type; the access method corresponds to at least a data source address variable, and the verification method information corresponds to at least a user login information variable; Assign the data source address of the target data source input by the user to the data source address variable and assign the user login information for logging into the target data source input by the user to the user login information variable; Establishing a communication connection between the server and the target data source through the access method information and the verification method information; Get the first query statement; Converting the first query statement into a second query statement through the statement conversion relationship; Sending the second query statement to the target data source; Receiving first business data obtained by the target data source in response to the second query statement; The first business data is converted into second business data through the data format conversion relationship.

2. According to the data acquisition method of claim 1, It is characterized in that The statement conversion relationship includes a correspondence relationship between a first query keyword and a second query keyword and a preset structure of a query statement in the target data source, the first query keyword is applicable to the server, and the second query keyword is applicable to a data source belonging to the target data source type; The step of converting the first query statement into a second query statement through the statement conversion relationship comprises: Acquire a target first query keyword and a query object from the first query statement; From the correspondence between the first query keyword and the second query keyword, searching for a target second query keyword corresponding to the target first query keyword; Based on the preset structure, obtaining a query statement template including the target second query keyword and a query object placeholder; The query object placeholder in the query statement template is replaced with the query object to obtain the second query statement.

3. According to the data acquisition method of claim 1, It is characterized in that The access method information includes a target access identifier, the verification method information includes a target verification identifier, and the step of establishing a communication connection between the server and the target data source through the access method information and the verification method information includes: Finding a target access method corresponding to the target access identifier from a preset correspondence between the access identifier and the access method, wherein the target access method includes the data source address variable; From the preset correspondence between the verification identifier and the verification method, searching for the target verification method corresponding to the target verification identifier, the target verification method including the user login information variable; The target access method and the target authentication method are executed to establish a communication connection between the server and the target data source.

4. The data acquisition method according to any one of claims 1 to 3, It is characterized in that Also includes: Acquire a target identifier of the electronic device corresponding to the first query statement; Sending the second service data to the electronic device having the target identifier; The second business data is the basis for the electronic device to perform operations.

5. According to the data acquisition method of claim 1, It is characterized in that The step of assigning the data source address of the target data source input by the user to the data source address variable and assigning the user login information for logging into the target data source input by the user to the user login information variable comprises: Acquire setting variables that need to be filled in by the user from the target data source information model, wherein the setting variables include the data source address variable and the user login information variable; Controlling the display of prompt information for prompting the user to fill in the setting variables; Receive the data source address of the target data source and the user login information for logging into the target data source input by the user; The data source address of the target data source is assigned to the data source address variable, and the user login information is assigned to the user login information variable.

6. A data acquisition device, It is characterized in that Applied to a server, the data acquisition device comprises: A first acquisition module, used to acquire an instruction to establish a communication connection with a target data source belonging to the target data source type; A search module, used to search for a target data source information model corresponding to the target data source type from a correspondence between preset data source types and data source information models, wherein the target data source information model includes access method information of the server accessing a data source belonging to the target data source type, verification method information in a process of establishing a communication connection between the server and the data source belonging to the target data source type, a data format conversion relationship between the server and the data source belonging to the target data source type, and a statement conversion relationship between the server and the query statement of the data source belonging to the target data source type; the access method corresponds to at least a data source address variable, and the verification method information corresponds to at least a user login information variable; An assignment module, used to assign the data source address of the target data source input by the user to the data source address variable and to assign the user login information for logging into the target data source input by the user to the user login information variable; An establishing module, used to establish a communication connection between the server and the target data source through the access mode information and the verification mode information; A second acquisition module, used to acquire the first query statement; A first conversion module, configured to convert the first query statement into a second query statement through the statement conversion relationship; A first sending module, configured to send the second query statement to the target data source; A receiving module, configured to receive first business data obtained by the target data source in response to the second query statement; The second conversion module is used to convert the first business data into second business data through the data format conversion relationship.

7. The data acquisition device according to claim 6, It is characterized in that The statement conversion relationship includes a correspondence relationship between a first query keyword and a second query keyword and a preset structure of a query statement in the target data source, the first query keyword is applicable to the server, and the second query keyword is applicable to a data source belonging to the target data source type; The first conversion module comprises: A first acquisition unit, configured to acquire a target first query keyword and a query object from the first query statement; A first search unit, configured to search for a target second query keyword corresponding to the target first query keyword from a correspondence between the first query keyword and the second query keyword; A second acquisition unit, configured to acquire a query statement template including the target second query keyword and a query object placeholder based on the preset structure; A replacement unit is used to replace the query object placeholder in the query statement template with the query object to obtain the second query statement.

8. A computer program product, It is characterized in that The method comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the data acquisition method according to any one of claims 1 to 5.

9. A server, It is characterized in that The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the server can implement the data acquisition method according to any one of claims 1 to 5.

10. A computer storage medium, It is characterized in that The storage medium carries one or more computer programs, and when the one or more computer programs are executed by the server, the server can implement the data acquisition method as described in any one of claims 1 to 5.