Data extraction method and device, electronic equipment and computer program product
By detecting device status in IoT devices and extracting data using plug-in adapters, the problem of low data collection efficiency for devices from multiple manufacturers is solved, achieving efficient and low-cost data collection and unified access, and improving system resource utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA TOWER CO LTD
- Filing Date
- 2026-03-05
- Publication Date
- 2026-06-09
AI Technical Summary
Existing IoT devices suffer from low efficiency in data collection, especially when multiple manufacturers and types of devices are accessed in a unified manner. Current technologies struggle to achieve both real-time performance and high efficiency, and also suffer from high development costs, high system coupling, and high maintenance difficulty.
After receiving the data acquisition command from the scheduler, the target device is identified and its status is detected as running. The device information is then obtained to determine the plug-in adapter. The plug-in adapter is called to extract the device data and send the data to the business platform. Different acquisition frequencies and distributed lock mechanisms are set according to the device type to avoid duplicate acquisition and resource waste.
It improves the efficiency of data collection from different devices, reduces resource consumption, achieves efficient data collection and unified access, and reduces operation and maintenance complexity and development costs.
Smart Images

Figure CN122173170A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of the Internet of Things (IoT), and more specifically, to a data extraction method, apparatus, electronic device, and computer program product. Background Technology
[0002] With the development of IoT technology, various IoT monitoring devices (such as rainfall monitoring stations, surface displacement monitoring stations, and groundwater monitoring stations) are widely used in critical infrastructure fields such as geological disaster early warning, ecological environment monitoring, and safety management of water conservancy facilities. However, the current IoT devices are diverse in type and model, and different manufacturers lack unified standards in terms of communication protocols, data formats, interface specifications, authentication mechanisms, and device attribute definitions. This poses a significant technical challenge to IoT management platforms in achieving unified access for devices from multiple manufacturers and of multiple types.
[0003] Current device access methods include: 1. The management platform obtains platform data through periodic HTTP (Hypertext Transfer Protocol) requests. While simple to implement, this method cannot adapt to the data change characteristics of different types of devices, resulting in delayed real-time data response and low-frequency data being polled by high-frequency invalid polling, leading to a waste of network resources. 2. Configuring customized access modules for each manufacturer and directly calling their private APIs (Application Programming Interfaces). While functionally complete, this method has high development costs, low code reusability, high system coupling, and high maintenance difficulty. 3. Achieving batch synchronization through data extraction, transformation, and loading processes. While suitable for offline statistical scenarios, this method struggles to meet the real-time monitoring needs at the minute or even second level, and is complex to configure, difficult to debug, and unsuitable for dynamically changing monitoring scenarios. 4. Embedded access based on SDKs (Software Development Kits). While this method can improve initial development efficiency, the coexistence of multiple SDKs can easily lead to version conflicts, memory leaks, and runtime dependency conflicts, making stability difficult to guarantee.
[0004] There is currently no effective solution to the technical problem of low collection efficiency when collecting device data from different devices in related technologies. Summary of the Invention
[0005] The main objective of this application is to provide a data extraction method, apparatus, electronic device, and computer program product to solve the technical problem of low collection efficiency when collecting device data from different devices in related technologies.
[0006] To achieve the above objectives, according to one aspect of this application, a data extraction method is provided. The method includes: upon receiving a data acquisition instruction sent by a scheduler, determining the target device associated with the data acquisition instruction, wherein the data acquisition instruction is used to instruct the collection of data from the target device; detecting the device status of the target device, and if the device status is running, obtaining device information of the target device, and determining a plug-in adapter based on the device information, wherein the device information is used to indicate the production object of the target device, and the plug-in adapter is used to extract the device data collected by the target device through a preset interface associated with the production object; invoking the plug-in adapter to extract the device data, and sending the device data to the business platform.
[0007] Optionally, the data acquisition instructions are generated in the following ways: obtaining a device list, wherein the device list includes M devices and the data acquisition type of each device, where M is a positive integer; determining the acquisition frequency according to the data acquisition type of each of the M devices to obtain M acquisition frequencies, and configuring a preset scheduler according to the M acquisition frequencies to obtain a scheduler, wherein each acquisition frequency is used to instruct the scheduler to generate different data acquisition instructions at different frequencies; responding to a device access instruction, and controlling the scheduler to generate data acquisition instructions according to the device access instruction, wherein the device access instruction refers to the instruction to establish a communication connection between the target device and the business platform.
[0008] Optionally, determining the acquisition frequency based on the data acquisition type of the M devices includes: for a device, if the data acquisition type of the device is alarm acquisition, the acquisition frequency is determined as the first acquisition frequency; if the data acquisition type of the device is environmental parameter acquisition, the acquisition frequency is determined as the second acquisition frequency, wherein the first acquisition frequency is greater than the second acquisition frequency; if the data acquisition type of the device is data statistics, the acquisition frequency is determined as the third acquisition frequency, wherein the second acquisition frequency is greater than the third acquisition frequency.
[0009] Optionally, before detecting the device status of the target device, the method further includes: obtaining device parameters of the target device, generating a lock key based on the device parameters, and invoking a distributed lock based on the lock key within a preset time period, wherein the device parameters are used to indicate the device characteristics and data acquisition type of the target device; if the invocation of the distributed lock fails within the preset time period, the step of detecting the device status of the target device ends; if the invocation of the distributed lock succeeds within the preset time period, the step of detecting the device status of the target device is executed.
[0010] Optionally, detecting the device status of the target device includes: obtaining a cache queue and obtaining device parameters of the target device, wherein the device parameters are used to indicate the device characteristics and data acquisition type of the target device; extracting a status value from the cache queue according to the device parameters; if the status value is a first value, determining the device status as running; if the status value is a second value, determining the device status as offline, and ending the step of obtaining the device information of the target device.
[0011] Optionally, the process of calling the plug-in adapter to extract device data includes: verifying the authentication cache token associated with the target device through the plug-in adapter; if the authentication cache token is invalid, re-obtaining the authentication cache token of the production object through a preset interface; controlling the plug-in adapter to construct a collection request based on the authentication cache token, and sending the collection request to the client of the production object through the preset interface; wherein, if the client of the production object receives the collection request, it sends the initial device data to be collected from the target device; if the initial device data sent by the client is received, the initial device data is standardized to obtain the device data; if the authentication cache token is valid, the step of controlling the plug-in adapter to construct a collection request based on the authentication cache token is executed.
[0012] Optionally, before verifying the authentication cache token associated with the target device through the plug-in adapter, the method further includes: obtaining the extraction status of device data, wherein the extraction status includes at least: first extraction status and non-first extraction status; when the extraction status is the first extraction status, controlling the plug-in adapter to call a preset interface to obtain the initial authentication cache token of the production object, and caching the initial authentication cache token in the cache area of the target device; when the extraction status is non-first extraction status, performing the step of verifying the authentication cache token associated with the target device through the plug-in adapter.
[0013] To achieve the above objectives, according to another aspect of this application, a data extraction apparatus is provided. The apparatus includes: a determining unit, configured to determine a target device associated with a data acquisition instruction sent by a scheduler, wherein the data acquisition instruction instructs the collection of data from the target device; a detecting unit, configured to detect the device status of the target device, and if the device status is running, acquire device information of the target device and determine a plug-in adapter based on the device information, wherein the device information indicates a production object for the target device, and the plug-in adapter is configured to extract the device data collected by the target device through a preset interface associated with the production object; and a calling unit, configured to call the plug-in adapter to extract the device data and send the device data to a business platform.
[0014] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to execute the data extraction method described above.
[0015] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory storing an executable program, and the processor for running the program, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-described data extraction methods.
[0016] According to another aspect of the present invention, a computer program product is also provided, the computer program product including a computer program, wherein when the computer program is executed by a processor, it implements the data extraction method described above.
[0017] In this embodiment, a data extraction method is adopted. Upon receiving a data acquisition instruction sent by the scheduler, the target device associated with the data acquisition instruction is determined. The data acquisition instruction is used to instruct the collection of data from the target device. The device status of the target device is detected. If the device status is running, the device information of the target device is obtained, and a plug-in adapter is determined based on the device information. The device information is used to indicate the production object of the target device, and the plug-in adapter is used to extract the device data collected by the target device through a preset interface associated with the production object. The plug-in adapter is called to extract the device data and send the device data to the business platform. This solves the technical problem of low collection efficiency when collecting device data from different devices in related technologies. By detecting the device status of the target device, obtaining the device information of the target device if the device status is running, determining the plug-in adapter based on the device information, calling the plug-in adapter to extract the device data, and sending the data to the business platform, the technical effect of improving the collection efficiency of device data from different devices and reducing resource consumption is achieved. Attached Figure Description
[0018] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 It is a hardware structure block diagram of a computer terminal (or mobile device) used to implement a data extraction method;
[0020] Figure 2 This is a flowchart of a data extraction method provided according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of a data extraction system provided according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of an optional data extraction method provided according to an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of a data extraction device provided according to an embodiment of this application;
[0024] Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, this system has interfaces with relevant users or organizations to provide users with corresponding operation data for them to choose to agree to or refuse automated decision-making results. Before obtaining relevant information, a request for obtaining the information needs to be sent to the aforementioned user or organization through the interface, and the relevant information is obtained after receiving consent from the aforementioned user or organization; if the user chooses to refuse, the expert decision-making process is initiated. Users can view the purpose of data use in real time through authorization decoding and have the right to withdraw authorization or delete data at any time. After the authorization is withdrawn, the system will terminate the relevant data processing within 24 hours.
[0028] It should be noted that the information collected in this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation access points for users to choose to authorize use or refuse use.
[0029] Example 1
[0030] According to an embodiment of this application, a method embodiment for data extraction is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0031] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 This is a hardware structure block diagram of a computer terminal (or mobile device) used to implement a data extraction method, such as... Figure 1 As shown, computer terminal 10 (or mobile device) may include one or more ( Figure 1The processor 102 (which may include, but is not limited to, a microprocessor MCU (Microcontroller Unit) or a programmable gate array (FPGA)) is shown as 102a, 102b, ..., 102n. It also includes a memory 104 for storing data and a transmission device 106 for communication functions. In addition, it may include: a display, an input / output interface, a Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a keyboard, a cursor control device, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0032] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0033] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the data extraction method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned data extraction method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0034] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network interface controller (NIC) and a network interface, which can be connected to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a radio frequency (RF) module, used for wireless communication with the Internet.
[0035] The display can be, for example, a touchscreen liquid crystal display (LCD), which allows the user to interact with the user interface of the computer terminal 10 (or mobile device).
[0036] Under the aforementioned operating environment, this application provides the following: Figure 2 The data extraction method shown. Figure 2 This is a flowchart of a data extraction method provided according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0037] Step S201: Upon receiving a data acquisition instruction sent by the scheduler, determine the target device associated with the data acquisition instruction, wherein the data acquisition instruction is used to instruct the collection of data from the target device.
[0038] It should be noted that the scheduler refers to a distributed task scheduling module used to trigger data acquisition tasks. It generates and distributes data acquisition instructions based on the device's configured acquisition frequency strategy (such as real-time, minute, hourly, etc.). These instructions specify the object to be acquired (i.e., the target device), and their fields may include: taskType (acquisition frequency), deviceCode (device unique code), etc. Upon receiving these instructions, the device identifier can be parsed to identify the target device, preventing invalid task execution due to configuration errors and improving system resource utilization and data accuracy.
[0039] Step S202: Detect the device status of the target device. If the device status is running, obtain the device information of the target device and determine the plug-in adapter based on the device information. The device information is used to indicate the production object of the target device, and the plug-in adapter is used to extract the device data collected by the target device through the preset interface associated with the production object.
[0040] Specifically, after identifying the target device for data collection, the device status can be detected, that is, the logical operating status of the device can be detected. For example, the result can be dynamically judged by the heartbeat mechanism or the time of the most recent successful data collection. If the device has successfully reported data within the last 5 minutes, the device status is characterized as running; if there is no response for more than 15 minutes, the device status is characterized as offline.
[0041] When the device is in the running state, the core metadata field used to identify the device's production source can be obtained, that is, the device information of the target device can be obtained. Then, based on the device information, the price difference adapter used to collect device data can be determined. Here, the device information can refer to the production object field associated with the target device, and each device is bound to a production object. The plug-in adapter refers to the data adaptation implementation module based on the plug-in architecture design. Each plug-in adapter is an independent Java class that encapsulates the communication protocols (such as HTTPS (Hypertext Transfer Protocol Secure) requests) and data format parsing of different production objects.
[0042] It should be noted that if you need to add new production objects, you can directly add a JAR (Java Archive) package in the plugin adapter without restarting the service, thereby achieving isolation of differences in production objects.
[0043] Step S203: Call the plug-in adapter to extract device data and send the device data to the business platform.
[0044] Specifically, after determining the plugin adapter corresponding to the production object, the plugin adapter can be called via an interface to extract device data collected by the target device. For example, when the target device is an IoT monitoring device for rainfall monitoring, the device data can be rainfall and displacement change data. Finally, the standardized device data is sent to the business platform of the downstream system through a channel, such as a message queue. It should be noted that idempotency verification can be performed before data transmission to avoid duplicate transmissions.
[0045] The data extraction method provided in this application, upon receiving a data acquisition instruction sent by a scheduler, determines the target device associated with the data acquisition instruction, wherein the data acquisition instruction is used to instruct the collection of data collected by the target device; detects the device status of the target device, and if the device status is running, obtains the device information of the target device, and determines a plug-in adapter based on the device information, wherein the device information is used to indicate the production object of the target device, and the plug-in adapter is used to extract the device data collected by the target device through a preset interface associated with the production object; calls the plug-in adapter to extract the device data, and sends the device data to the business platform. This method solves the technical problem of low collection efficiency when collecting device data from different devices in related technologies. By detecting the device status of the target device, obtaining the device information of the target device if the device status is running, determining the plug-in adapter based on the device information, calling the plug-in adapter to extract the device data, and sending the data to the business platform, the method achieves the technical effect of improving the collection efficiency of device data from different devices and reducing resource consumption.
[0046] Optionally, in the data extraction method provided in this application embodiment, the data acquisition instruction is generated in the following manner: obtaining a device list, wherein the device list includes M devices and the data acquisition type of each device, where M is a positive integer; determining the acquisition frequency according to the data acquisition type of each of the M devices to obtain M acquisition frequencies, and configuring a preset scheduler according to the M acquisition frequencies to obtain a scheduler, wherein each acquisition frequency is used to indicate the frequency at which the scheduler generates different data acquisition instructions; responding to a device access instruction, and controlling the scheduler to generate data acquisition instructions according to the device access instruction, wherein the device access instruction refers to the instruction to establish a communication connection between the target device and the service platform.
[0047] The target device can be determined based on the data acquisition command, which can be generated by the scheduler. Specifically, the device list containing all registered IoT devices and their data acquisition types can be obtained first. Each IoT device in the device list has a corresponding device identifier, which indicates the device information of each IoT device. The data acquisition type refers to the category preset by the device according to its monitoring characteristics, such as "rainfall monitoring station" corresponding to "minute level", "groundwater monitoring station" corresponding to "hour level", and "daily report statistics" corresponding to "daily level".
[0048] Furthermore, after obtaining a device list including multiple devices and related information, the data acquisition type of the listed devices can be converted into a specific scheduling time interval, that is, the corresponding acquisition frequency can be determined. For example, if the data acquisition type is "minute-level", the acquisition frequency is once every minute; if it is "hour-level", the acquisition frequency is once every hour; if it is "day-level", the acquisition frequency is once every 24 hours. Then, the preset scheduler is configured according to the acquisition frequency, that is, based on the acquisition frequency of each device, an independent task for generating different data acquisition instructions is created in the scheduler, and its execution cycle is set, thus obtaining the scheduler. At this time, in response to the device access instruction, the scheduler can be controlled to trigger the independent task according to the set execution cycle, thereby generating data acquisition instructions.
[0049] This embodiment maps the data acquisition type in the device list to the acquisition frequency, and generates data acquisition instructions by the scheduler based on the acquisition frequency configuration when the device is connected. This achieves differentiation and real-time response of device acquisition behavior, avoids the tedious operation of manually configuring scheduling tasks for each device, significantly reduces operation and maintenance complexity, and improves the efficiency of new device access.
[0050] Optionally, in the data extraction method provided in this application embodiment, determining the collection frequency according to the data collection type of the M devices includes: for a device, if the data collection type of the device is alarm collection type, the collection frequency is determined as a first collection frequency; if the data collection type of the device is environmental parameter collection type, the collection frequency is determined as a second collection frequency, wherein the first collection frequency is greater than the second collection frequency; if the data collection type of the device is data statistics type, the collection frequency is determined as a third collection frequency, wherein the second collection frequency is greater than the third collection frequency.
[0051] Specifically, after determining the data acquisition type of each device, the monitoring content and data change characteristics of each device can be determined based on the data acquisition type. When the data acquisition type of the device is alarm acquisition type, it indicates that the device is used to report real-time anomalies or emergency events, such as reporting the online / offline status of the device, tilt angle over-limit alarm, water level change alarm, etc. The data must respond quickly and there should be no significant delay. Therefore, the acquisition frequency can be determined as the first acquisition frequency, for example, the acquisition frequency can be determined as the real-time acquisition frequency.
[0052] When the device's data acquisition type is environmental parameter acquisition, it indicates that the device is used to monitor slowly changing environmental variables, such as temperature, humidity, groundwater level, and soil moisture content. These values fluctuate gently and do not require high-frequency acquisition. In this case, the acquisition frequency can be set to a second acquisition frequency, lower than the first, such as once per hour. This reduces the acquisition frequency while ensuring data validity, decreasing network transmission and server load, avoiding unnecessary repeated acquisition of low-rate-of-change data, and improving resource utilization. When the device's data acquisition type is data statistics, it indicates that the device is used to generate daily, monthly, and trend summary reports, such as daily cumulative rainfall and weekly average displacement. Real-time acquisition is not required; only daily or longer-term summaries are needed. In this case, the acquisition frequency can be set to the lowest possible third acquisition frequency.
[0053] This embodiment categorizes devices into three types based on data acquisition: alarms, environmental parameters, and data statistics. By setting decreasing acquisition frequencies for each category, it achieves precise matching between acquisition strategies and data service requirements, significantly reducing invalid acquisition requests, lowering network and computing resource consumption, and improving operational efficiency and economy.
[0054] Optionally, in the data extraction method provided in this application embodiment, before detecting the device status of the target device, the method further includes: obtaining device parameters of the target device, generating a lock key based on the device parameters, and calling a distributed lock based on the lock key within a preset time period, wherein the device parameters are used to indicate the device characteristics and data collection type of the target device; if the call to the distributed lock fails within the preset time period, the step of detecting the device status of the target device ends; if the call to the distributed lock succeeds within the preset time period, the step of detecting the device status of the target device is executed.
[0055] Specifically, before detecting the device status of the target device, it is necessary to obtain the device parameters of the target device, and then concatenate the device parameters to form a unique string, which serves as the identifier of the distributed lock, i.e., generating a unique lock key. This lock key can contain the device characteristics of the target device (i.e., the unique device code deviceCode) and the data acquisition type of the target device from the device parameters. Then, an attempt is made to acquire the lock using this lock key as the key name, i.e., to attempt to call the distributed lock. If the lock is acquired successfully, it means that the task of detecting the device status is the only instance currently executing the data acquisition task for that device.
[0056] If the distributed lock call fails within the preset time period, it indicates that other task instances are processing the data collection task for that device. In this case, the device status detection of the target device needs to be stopped to avoid wasting resources. If the distributed lock call succeeds within the preset time period, it means that the current task is the sole executor of this data collection for that device. In this case, the steps of detecting the device status of the target device can continue, thereby avoiding data conflicts or duplicate uploads caused by multiple instances operating the same device simultaneously, ensuring the atomicity and reliability of the process.
[0057] This embodiment generates a unique lock key using device parameters and applies for a distributed lock before the device collects data, ensuring that only one task instance executes the same device within the same collection cycle. This effectively avoids the problem of duplicate collection caused by multiple concurrent triggering instances of the scheduler and reduces invalid network requests.
[0058] Optionally, in the data extraction method provided in this application embodiment, detecting the device status of the target device includes: obtaining a cache queue and obtaining device parameters of the target device, wherein the device parameters are used to indicate the device characteristics and data acquisition type of the target device; extracting a status value from the cache queue according to the device parameters; if the status value is a first value, determining the device status as running; if the status value is a second value, determining the device status as offline, and ending the step of obtaining the device information of the target device.
[0059] Specifically, when detecting device status, a cache queue for storing the latest device status information is first obtained. Then, based on the target device's device parameters, the target device's status value is extracted from the cache queue. This status value can be a first value (e.g., 1) or a second value (e.g., 0). If the status value is the first value, it indicates that the target device has recently reported data or responded with a heartbeat, and is in a communicable state. In this case, the device status can be determined as running. Conversely, if the status value is the second value, it indicates that the device has not reported any data within a preset time window (e.g., 15 minutes). In this case, the device status can be determined as offline, and the process of obtaining the target device's information ends, preventing meaningless resource consumption on known offline devices.
[0060] This embodiment uses the status values in the cache queue to determine the device status, avoiding repeated adapter calls and interface requests to offline devices, significantly reducing invalid load and improving resource utilization.
[0061] Optionally, in the data extraction method provided in this application embodiment, calling the plug-in adapter to extract device data includes: verifying the authentication cache token associated with the target device through the plug-in adapter; if the authentication cache token is invalid, re-obtaining the authentication cache token of the production object through a preset interface; controlling the plug-in adapter to construct a collection request based on the authentication cache token, and sending the collection request to the client of the production object through the preset interface, wherein, when the client of the production object receives the collection request, it sends the initial device data collected by the target device; when the initial device data sent by the client is received, the initial device data is standardized to obtain device data; and if the authentication cache token is valid, executing the step of controlling the plug-in adapter to construct a collection request based on the authentication cache token.
[0062] Specifically, after determining the corresponding plugin adapter for the target device, the authentication cache token of the target device can first be verified through the aforementioned plugin adapter. This involves reading the cached value and comparing the current time with the expiration time to check if the target device's token has expired or is empty. The authentication cache token refers to the target device's access credential (such as a token), cached in a cache (which can be Redis) and associated with an expiration time (e.g., 1800 seconds). When the authentication cache token is invalid, i.e., when the target device's token has expired or is empty, login can be completed and a new authentication cache token from the production object can be obtained through the fixed preset interface provided by the production object.
[0063] Furthermore, after obtaining the authentication cache token of the production object, the plug-in adapter can be controlled to construct a collection request based on the authentication cache token, that is, to concatenate the relevant information of the target device into the HTTP request, thereby obtaining the collection request, and then send the collection request to the client of the production object through a preset interface. After receiving the above request, the production object can transmit the initial device data collected from the target device according to the request.
[0064] After receiving the initial device data from the client, the initial device data can be standardized. For example, the original fields can be converted into standard fields according to a preset mapping relationship, and the units, formats, and timestamps can be standardized. Then, data quality checks (such as numerical range and field integrity) can be performed to filter out abnormal data, thereby obtaining the device data. It should be noted that if the authentication cache token is valid, that is, the target device's token has not expired or is empty, the above operations can be performed directly. That is, the re-acquisition operation can be skipped, and the request can be initiated directly using the cached token until the device data is obtained.
[0065] This embodiment verifies, acquires, and uses authentication cache tokens through a plug-in adapter, combined with the standardized transformation of raw data, thereby completing secure, stable, and formatted data collection without manual intervention, reducing the collection failure rate caused by authentication failure.
[0066] Optionally, in the data extraction method provided in this application embodiment, before verifying the authentication cache token associated with the target device through the plug-in adapter, the method further includes: obtaining the extraction status of device data, wherein the extraction status includes at least: first extraction status and non-first extraction status; when the extraction status is the first extraction status, controlling the plug-in adapter to call a preset interface to obtain the initial authentication cache token of the production object, and caching the initial authentication cache token in the cache area of the target device; when the extraction status is non-first extraction status, performing the step of verifying the authentication cache token associated with the target device through the plug-in adapter.
[0067] It should be noted that before verifying the authentication cache token, the extraction status of the target device also needs to be verified. The extraction status refers to whether the target device's device data has been extracted within a historical time period. This can include the first extraction status and non-first extraction status. The first extraction status indicates that the device is being scheduled for data collection for the first time, while the non-first extraction status indicates that the device has successfully completed at least one data collection operation before.
[0068] If it's the first time collecting data (i.e., the extraction status is "first extraction"), the plugin adapter needs to call a preset interface to obtain the initial authentication cache token for the production object and cache it in the target device's cache. This means storing the obtained authentication cache token (i.e., Token) in the cache using the device code as the key and setting an expiration time consistent with the Token, thus synchronizing the cache and token lifecycles. Conversely, if the extraction status is not "first extraction", the cached Token can be used directly, followed by subsequent steps such as checking its validity.
[0069] This embodiment distinguishes between the first and subsequent states of device data extraction, thus avoiding repeated login operations, significantly reducing the number of authentication requests, and improving overall execution efficiency.
[0070] This application also provides a data extraction system. Figure 3This is a schematic diagram of a data extraction system provided according to an embodiment of this application. The system includes a scheduling layer, an adapter layer, a data processing layer, and an infrastructure layer. The scheduling layer can control the scheduler to generate data acquisition instructions and determine the acquisition frequency according to the data acquisition type of the device. For example, the data acquisition instruction corresponding to "rainfall monitoring station" is "minute-level", the data acquisition instruction corresponding to "groundwater monitoring station" is "hour-level", and the data acquisition instruction corresponding to "daily report statistics" is "daily-level". The adapter layer is used to call the plug-in adapter to extract the initial device data. The data processing layer is used to standardize the initial device data to obtain the device data. The infrastructure layer is used to provide basic services to ensure the high availability of the system.
[0071] The system described above can be used to perform an optional data extraction method. Figure 4 This is a schematic diagram of an optional data extraction method provided according to an embodiment of this application, such as... Figure 4 As shown, the method includes:
[0072] To integrate IoT device data into the business platform, a data collection command is first triggered by the scheduler in the scheduling layer. Based on this command, the target device for data upload is determined. To ensure that only one task instance executes for the same device within the same collection cycle, and to avoid duplicate collection caused by multiple scheduler instances triggering concurrently, the device parameters of the target device need to be obtained before detecting its status. A unique string is then constructed from these parameters to serve as the lock key. A lock is then acquired on the key name, i.e., an attempt is made to acquire a distributed lock. If the lock acquisition is successful, it indicates that the task currently detecting the device status is the only instance executing the data collection task for that device. Conversely, if the lock acquisition fails, it means that another instance is already processing data collection for that device, and the current collection operation needs to be skipped to avoid resource waste.
[0073] If the distributed lock is successfully acquired within the preset time period, it indicates that the current task is the only executor of this data collection for the device. At this time, the status value can be extracted from the cache queue according to the device parameters of the target device, and the target device can be checked for online status based on the status value. If the status value is the second value, it indicates that the device has not reported any data within the preset time window (such as 15 minutes). At this time, the device status can be determined as offline status, and this data collection can be skipped.
[0074] Conversely, if the status value is the first value, it indicates that the target device has recently reported data or responded with a heartbeat. The device status can then be determined as running. Next, based on the target device's information, the plug-in adapter is identified, and this adapter is used to check the validity of the target device's token, i.e., to verify the authentication cache token associated with the target device. If the authentication cache token is invalid, it is necessary to re-obtain the production object's authentication cache token through a preset interface. If the authentication cache token is valid or has been re-obtained, the production object's preset interface can be called to send the collection request to the production object's client.
[0075] If calling the preset interface of the aforementioned production object fails, it needs to be called again. If it still fails, an alarm message needs to be recorded. If calling the preset interface of the aforementioned production object succeeds, the initial device data collected from the target device sent by the client can be standardized and converted into a data format. The converted data should then be validated for data quality. If the validation result indicates that the data is invalid, an alarm message still needs to be recorded. Conversely, if the validation result indicates that the data is valid, the validated data should be sent to the business platform as device data, and the distributed lock should be released until the next data collection task is executed.
[0076] This embodiment detects the device status of the target device. When the device status is running, it obtains the device information of the target device, then determines the plug-in adapter based on the device information, calls the plug-in adapter to extract device data, and sends the data to the business platform. This achieves the technical effect of improving the collection efficiency of device data from different devices and reducing resource consumption.
[0077] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0078] Example 2
[0079] This application also provides a data extraction device. It should be noted that the data extraction device of this application can be used to execute the data extraction method provided in this application. The data extraction device provided in this application is described below.
[0080] According to an embodiment of this application, an apparatus for implementing the above-described data extraction method is also provided. Figure 5 This is a schematic diagram of a data extraction device provided according to an embodiment of this application, such as... Figure 5As shown, the device includes: a determination unit 50, a detection unit 51, and a recall unit 52.
[0081] The determining unit 50 is used to determine the target device associated with the data acquisition instruction when it receives the data acquisition instruction sent by the scheduler, wherein the data acquisition instruction is used to instruct the collection of data collected by the target device;
[0082] The detection unit 51 is used to detect the device status of the target device. When the device status is running, it acquires the device information of the target device and determines the plug-in adapter based on the device information. The device information is used to indicate the production object of the target device, and the plug-in adapter is used to extract the device data collected by the target device through the preset interface associated with the production object.
[0083] Calling unit 52 is used to call the plug-in adapter to extract device data and send the device data to the business platform.
[0084] The data extraction device provided in this application embodiment, through the determining unit 50, determines the target device associated with the data acquisition instruction when receiving the data acquisition instruction sent by the scheduler, wherein the data acquisition instruction is used to instruct the collection of data collected by the target device; the detection unit 51 detects the device status of the target device, and when the device status is running, obtains the device information of the target device, and determines the plug-in adapter based on the device information, wherein the device information is used to indicate the production object of the production target device, and the plug-in adapter is used to extract the device data collected by the target device through a preset interface associated with the production object; the calling unit 52 calls the plug-in adapter to extract the device data and sends the device data to the business platform, thereby solving the technical problem of low collection efficiency when collecting device data from different devices in related technologies. By detecting the device status of the target device, obtaining the device information of the target device when the device status is running, determining the plug-in adapter based on the device information, calling the plug-in adapter to extract the device data, and sending the data to the business platform, the technical effect of improving the collection efficiency of collecting device data from different devices and reducing resource consumption is achieved.
[0085] Optionally, in the data extraction apparatus provided in this application embodiment, the determining unit 50 includes: a first acquisition module, used to acquire a device list, wherein the device list includes M devices and the data acquisition type of each device, where M is a positive integer; a first determining module, used to determine the acquisition frequency according to the data acquisition type of each of the M devices, to obtain M acquisition frequencies, and to configure a preset scheduler according to the M acquisition frequencies, to obtain a scheduler, wherein each acquisition frequency is used to indicate the frequency at which the scheduler generates different data acquisition instructions; and a response module, used to respond to a device access instruction, and to control the scheduler to generate a data acquisition instruction according to the device access instruction, wherein the device access instruction refers to an instruction to establish a communication connection between the target device and the service platform.
[0086] Optionally, in the data extraction device provided in this application embodiment, the determining unit 50 includes: a second determining module, used to determine the acquisition frequency as a first acquisition frequency when the data acquisition type of the device is alarm acquisition type; a third determining module, used to determine the acquisition frequency as a second acquisition frequency when the data acquisition type of the device is environmental parameter acquisition type, wherein the first acquisition frequency is greater than the second acquisition frequency; and a fourth determining module, used to determine the acquisition frequency as a third acquisition frequency when the data acquisition type of the device is data statistics type, wherein the second acquisition frequency is greater than the third acquisition frequency.
[0087] Optionally, in the data extraction apparatus provided in this application embodiment, the apparatus further includes: a first acquisition unit, configured to acquire device parameters of the target device before detecting the device status of the target device, generate a lock key based on the device parameters, and invoke a distributed lock based on the lock key within a preset time period, wherein the device parameters are used to indicate the device characteristics and data acquisition type of the target device; an end unit, configured to end the step of detecting the device status of the target device if the invocation of the distributed lock fails within the preset time period; and a first execution unit, configured to execute the step of detecting the device status of the target device if the invocation of the distributed lock succeeds within the preset time period.
[0088] Optionally, in the data extraction apparatus provided in this application embodiment, the detection unit 51 includes: a second acquisition module, used to acquire a cache queue and acquire device parameters of the target device, wherein the device parameters are used to indicate the device characteristics and data acquisition type of the target device; an extraction module, used to extract a status value from the cache queue according to the device parameters, and determine the device status as running when the status value is a first value; and a fifth determination module, used to determine the device status as offline when the status value is a second value, and end the step of acquiring device information of the target device.
[0089] Optionally, in the data extraction device provided in this application embodiment, the calling unit 52 includes: a verification module, used to verify the authentication cache token associated with the target device through the plug-in adapter, and to re-obtain the authentication cache token of the production object through a preset interface if the authentication cache token is invalid; a control module, used to control the plug-in adapter to construct a collection request based on the authentication cache token, and to send the collection request to the client of the production object through a preset interface, wherein, when the client of the production object receives the collection request, it sends the initial device data collected by the target device; a processing module, used to standardize the initial device data after receiving the initial device data sent by the client to obtain device data; and an execution module, used to execute the step of controlling the plug-in adapter to construct a collection request based on the authentication cache token if the authentication cache token is valid.
[0090] Optionally, in the data extraction apparatus provided in this application embodiment, the apparatus further includes: a second acquisition unit, configured to acquire the extraction status of device data before verifying the authentication cache token associated with the target device through the plug-in adapter, wherein the extraction status includes at least: a first extraction status and a non-first extraction status; a control unit, configured to control the plug-in adapter to call a preset interface to acquire the initial authentication cache token of the production object and cache the initial authentication cache token in the cache area of the target device when the extraction status is the first extraction status; and a second execution unit, configured to execute the step of verifying the authentication cache token associated with the target device through the plug-in adapter when the extraction status is a non-first extraction status.
[0091] It should be noted that the determining unit 50, detecting unit 51, and calling unit 52 mentioned above correspond to steps S201 to S203 in Embodiment 1. The instances and application scenarios implemented by the above units and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above units can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.
[0092] Example 3
[0093] Embodiments of this application may provide a computer terminal, which may be any computer terminal device in a group of computer terminals. Optionally, in this embodiment, the aforementioned computer terminal may also be replaced with a mobile terminal or an electronic device, etc.
[0094] Optionally, in this embodiment, the computer terminal may be located in at least one of a plurality of network devices in a computer network.
[0095] In this embodiment, the computer terminal described above can execute the following steps of the data extraction method: upon receiving a data acquisition instruction sent by the scheduler, determining the target device associated with the data acquisition instruction, wherein the data acquisition instruction is used to instruct the collection of data collected by the target device; detecting the device status of the target device, and if the device status is running, obtaining the device information of the target device, and determining the plug-in adapter based on the device information, wherein the device information is used to instruct the production object of the target device, and the plug-in adapter is used to extract the device data collected by the target device through a preset interface associated with the production object; calling the plug-in adapter to extract the device data, and sending the device data to the business platform.
[0096] Optionally, the computer terminal described above can execute the following steps in the data extraction method: obtaining a device list, wherein the device list includes M devices and the data acquisition type of each device, where M is a positive integer; determining the acquisition frequency according to the data acquisition type of each of the M devices to obtain M acquisition frequencies, and configuring a preset scheduler according to the M acquisition frequencies to obtain a scheduler, wherein each acquisition frequency is used to instruct the scheduler to generate different data acquisition instructions at different frequencies; responding to a device access instruction, and controlling the scheduler to generate data acquisition instructions according to the device access instruction, wherein the device access instruction refers to the instruction to establish a communication connection between the target device and the business platform.
[0097] Optionally, the computer terminal described above can execute the program code for the following steps in the data extraction method: For a device, if the device's data acquisition type is alarm acquisition type, the acquisition frequency is determined as a first acquisition frequency; if the device's data acquisition type is environmental parameter acquisition type, the acquisition frequency is determined as a second acquisition frequency, wherein the first acquisition frequency is greater than the second acquisition frequency; if the device's data acquisition type is data statistics type, the acquisition frequency is determined as a third acquisition frequency, wherein the second acquisition frequency is greater than the third acquisition frequency.
[0098] Optionally, the computer terminal described above can execute the following steps in the data extraction method: obtaining the device parameters of the target device, generating a lock key based on the device parameters, and calling the distributed lock based on the lock key within a preset time period, wherein the device parameters are used to indicate the device characteristics and data acquisition type of the target device; if the call to the distributed lock fails within the preset time period, the step of detecting the device status of the target device ends; if the call to the distributed lock succeeds within the preset time period, the step of detecting the device status of the target device is executed.
[0099] Optionally, the computer terminal described above can execute the following steps in the data extraction method: obtain a cache queue and obtain device parameters of the target device, wherein the device parameters are used to indicate the device characteristics and data acquisition type of the target device; extract a status value from the cache queue according to the device parameters; if the status value is a first value, determine the device status as running; if the status value is a second value, determine the device status as offline, and end the step of obtaining device information of the target device.
[0100] Optionally, the computer terminal described above can execute the following steps in the data extraction method: verifying the authentication cache token associated with the target device through the plug-in adapter; if the authentication cache token is invalid, re-obtaining the authentication cache token of the production object through a preset interface; controlling the plug-in adapter to construct a collection request based on the authentication cache token, and sending the collection request to the client of the production object through the preset interface; wherein, if the client of the production object receives the collection request, sending the initial device data collected by the target device; if the initial device data sent by the client is received, standardizing the initial device data to obtain device data; if the authentication cache token is valid, executing the step of controlling the plug-in adapter to construct a collection request based on the authentication cache token.
[0101] Optionally, the computer terminal described above can execute the following steps in the data extraction method: obtaining the extraction status of device data, wherein the extraction status includes at least: first extraction status and non-first extraction status; when the extraction status is the first extraction status, controlling the plug-in adapter to call a preset interface to obtain the initial authentication cache token of the production object, and caching the initial authentication cache token to the cache area of the target device; when the extraction status is non-first extraction status, performing the step of verifying the authentication cache token associated with the target device through the plug-in adapter.
[0102] Optionally, Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6 (Only one is shown) Processor 602, memory 604, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0103] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the data extraction method and apparatus in this embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned data extraction method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0104] The processor can access the information and application programs stored in the memory via the transmission device to execute the steps described above in the data extraction method.
[0105] Those skilled in the art will understand that Figure 6 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 6 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 6 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 6 The different configurations shown.
[0106] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0107] Example 4
[0108] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the data extraction method provided in Embodiment 1.
[0109] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.
[0110] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: upon receiving a data acquisition instruction sent by the scheduler, determining the target device associated with the data acquisition instruction, wherein the data acquisition instruction is used to instruct the collection of data from the target device; detecting the device status of the target device, and if the device status is running, obtaining the device information of the target device, and determining the plug-in adapter based on the device information, wherein the device information is used to instruct the production object of the target device, and the plug-in adapter is used to extract the device data collected by the target device through a preset interface associated with the production object; calling the plug-in adapter to extract the device data, and sending the device data to the business platform.
[0111] This application also provides a computer program product, which, when executed on a data processing device, is suitable for performing data extraction method steps.
[0112] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0113] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0114] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0115] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0116] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0117] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0118] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for extracting data, characterized in that, include: Upon receiving a data acquisition instruction sent by the scheduler, the target device associated with the data acquisition instruction is determined, wherein the data acquisition instruction is used to instruct the collection of data collected by the target device; The device status of the target device is detected. If the device status is running, the device information of the target device is obtained, and the plug-in adapter is determined based on the device information. The device information is used to indicate the production object that produces the target device, and the plug-in adapter is used to extract the device data collected by the target device through a preset interface associated with the production object. The plugin adapter is invoked to extract the device data and then the device data is sent to the business platform.
2. The method according to claim 1, characterized in that, The data acquisition command is generated in the following manner: Obtain a device list, wherein the device list includes M devices and the data acquisition type of each device, where M is a positive integer; The acquisition frequency is determined according to the data acquisition type of the M devices to obtain M acquisition frequencies. The preset scheduler is then configured according to the M acquisition frequencies to obtain the scheduler. Each acquisition frequency is used to indicate the frequency at which the scheduler generates different data acquisition instructions. In response to a device access command, the scheduler is controlled to generate a data acquisition command based on the device access command, wherein the device access command is a command to establish a communication connection between the target device and the service platform.
3. The method according to claim 2, characterized in that, The acquisition frequency is determined based on the data acquisition type of the M devices, including: For a device, if the data acquisition type of the device is alarm acquisition type, the acquisition frequency is determined as the first acquisition frequency; When the data acquisition type of the device is environmental parameter acquisition type, the acquisition frequency is determined as the second acquisition frequency, wherein the first acquisition frequency is greater than the second acquisition frequency; When the data acquisition type of the device is data statistics, the acquisition frequency is determined as the third acquisition frequency, wherein the second acquisition frequency is greater than the third acquisition frequency.
4. The method according to claim 1, characterized in that, Before detecting the device status of the target device, the method further includes: Obtain the device parameters of the target device, generate a lock key based on the device parameters, and invoke a distributed lock based on the lock key within a preset time period. The device parameters are used to indicate the device characteristics and data acquisition type of the target device. If the call to the distributed lock fails within the preset time period, the step of detecting the device status of the target device will end. If the distributed lock is successfully invoked within the preset time period, the step of detecting the device status of the target device is executed.
5. The method according to claim 1, characterized in that, Detecting the device status of the target device includes: Obtain the cache queue and obtain the device parameters of the target device, wherein the device parameters are used to indicate the device characteristics and data acquisition type of the target device; Based on the device parameters, a status value is extracted from the cache queue. If the status value is a first value, the device status is determined as the running status. If the status value is the second value, the device status is determined to be offline, and the step of obtaining the device information of the target device ends.
6. The method according to claim 1, characterized in that, Calling the plug-in adapter to extract the device data includes: The plug-in adapter verifies the authentication cache token associated with the target device. If the authentication cache token is invalid, the authentication cache token of the production object is retrieved again through the preset interface. The plug-in adapter is controlled to construct a collection request based on the authentication cache token, and the collection request is sent to the client of the production object through the preset interface. When the client of the production object receives the collection request, the initial device data collected by the target device is sent. Upon receiving the initial device data sent by the client, the initial device data is standardized to obtain the device data; If the authentication cache token is valid, the step of controlling the plugin adapter to construct a collection request based on the authentication cache token is executed.
7. The method according to claim 6, characterized in that, Before verifying the authentication cache token associated with the target device through the plug-in adapter, the method further includes: The extraction status of the device data is obtained, wherein the extraction status includes at least: first extraction status and non-first extraction status; When the extraction state is the first extraction state, the plug-in adapter is controlled to call the preset interface to obtain the initial authentication cache token of the production object, and the initial authentication cache token is cached in the cache area of the target device; If the extraction status is the non-first extraction status, the step of verifying the authentication cache token associated with the target device through the plug-in adapter is performed.
8. A data extraction device, characterized in that, include: A determining unit is configured to determine the target device associated with a data acquisition instruction sent by a scheduler upon receiving such an instruction, wherein the data acquisition instruction is used to instruct the collection of data from the target device. The detection unit is used to detect the device status of the target device. When the device status is running, it acquires the device information of the target device and determines the plug-in adapter based on the device information. The device information is used to indicate the production object that produces the target device, and the plug-in adapter is used to extract the device data collected by the target device through a preset interface associated with the production object. The calling unit is used to call the plug-in adapter to extract the device data and send the device data to the business platform.
9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the data extraction method according to any one of claims 1 to 7.
10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the data extraction method according to any one of claims 1 to 7.