Data acquisition method and device, electronic equipment and storage medium

The smart device data is verified and analyzed through the data collection platform, a unified format of device monitoring indicators is generated, and sent to the message middleware for storage, which solves the problems of low collection efficiency and performance bottlenecks in the existing technology, and improves the system Overall processing power and responsiveness.

CN118869784APending Publication Date: 2024-10-29DONGGUAN DERUCCI BEDDING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410827627.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-29

Smart Images

  • Figure CN118869784A_ABST
    Figure CN118869784A_ABST
Patent Text Reader

Abstract

The invention discloses a data collection method and device, electronic equipment and a storage medium. The method comprises the steps that a data collection platform obtains initial equipment data; the data acquisition platform verifies the initial equipment data according to the target index acquisition rule to obtain target equipment data; the data acquisition platform analyzes the target equipment data by adopting a target expression method to obtain a target index number and a target index value; the data acquisition platform integrates the target index number, the target index value, the product type number and the equipment number to obtain target index data; the data acquisition platform encapsulates the target index data in a data message queue, and sends the data message queue to message middleware; and monitoring the message-oriented middleware by adopting the data caching service through the index database, and storing a plurality of monitored target index data according to a target sequence rule. The data acquisition efficiency can be improved, the processing capacity of the system is improved, and the method can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data acquisition method, device, electronic device and storage medium. Background Art

[0002] At present, the collection of equipment monitoring data mainly relies on database calls or API (Application Programming Interface), which mainly collects batch data through a predetermined timed scheduling mechanism. However, these collection methods are affected by the timing of the scheduled scheduling and the amount of data, which will lead to problems such as low data collection efficiency and system performance bottlenecks.

[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention

[0004] The embodiments of the present application aim to solve at least one of the technical problems in the related art to a certain extent. To this end, the main purpose of the embodiments of the present application is to propose a data collection method, device, electronic device and storage medium, which can improve the data collection efficiency and improve the overall processing capability and response speed of the system.

[0005] To achieve the above object, an embodiment of the present application provides a data collection method, which includes the following steps:

[0006] Acquire initial device data of the smart device through a data acquisition platform; the initial device data contains a product type number and a device number;

[0007] Verifying and processing the initial device data according to the target indicator collection rules through the data collection platform, and screening out the target device data matching the target indicator collection rules;

[0008] The target device data is analyzed by the data acquisition platform using a target expression method to obtain a target indicator number and a target indicator value;

[0009] The target indicator number, the target indicator value, the product type number and the equipment number are integrated through the data acquisition platform to obtain target indicator data;

[0010] Encapsulating the target indicator data in a data message queue through the data acquisition platform, and sending the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data;

[0011] The message middleware is monitored by using a data cache service through an indicator database, and the monitored target indicator data are stored according to a target sequence rule.

[0012] In some embodiments, the data type of the initial device data includes a protocol object type and an MQTT message type, and the data collection platform verifies and processes the initial device data according to the target indicator collection rule to screen and obtain target device data that matches the target indicator collection rule, including:

[0013] If the data type of the initial device data is the protocol object type, then use the object name as the target key to query whether the target indicator collection rule exists in the target cache location of the data collection platform, and filter out the target device data that matches the target indicator collection rule;

[0014] If the data type of the initial device data is the MQTT message type, the target MQTT topic is used as the target key to query whether the target indicator collection rule exists in the target cache location of the data collection platform, and the target device data matching the target indicator collection rule is screened.

[0015] In some embodiments, the data acquisition platform uses a target expression method to perform data analysis on the target device data to obtain a target indicator number and a target indicator value, including:

[0016] Calling a target expression parsing engine according to a target collection rule type corresponding to the target device data through the data collection platform;

[0017] The target device data is parsed by the data acquisition platform based on the target expression parsing engine to obtain the target indicator number and the target indicator value.

[0018] In some embodiments, before obtaining the initial device data of the smart device through the data collection platform, the method further includes:

[0019] Upload a first protocol device message to the Internet of Things platform through the smart device;

[0020] Decoding the first protocol device message by using the Internet of Things platform protocol to generate first protocol object data whose data type is a protocol object type, and using the first protocol object data as the initial device data of the smart device;

[0021] or,

[0022] When the client sends a control instruction to the smart device through the Internet of Things platform, the Internet of Things platform generates second protocol object data whose data type is a protocol object type according to the control instruction, and uses the second protocol object data as the initial device data of the smart device.

[0023] In some embodiments, when the client sends a control instruction to the smart device through the Internet of Things platform, after the Internet of Things platform generates protocol object data of a protocol object type according to the control instruction, and uses the protocol object data as the initial device data of the smart device, the method further includes:

[0024] The protocol object data is encoded by the Internet of Things platform using the Internet of Things platform protocol to obtain a second protocol device message;

[0025] The second protocol device message is sent to the smart device through the Internet of Things platform.

[0026] In some embodiments, before obtaining the initial device data of the smart device through the data collection platform, the method further includes:

[0027] Using the target MQTT server to monitor the target MQTT topic message reported by the smart device through the data collection platform;

[0028] The data collection platform matches the first MQTT topic corresponding to the target MQTT topic message and the second MQTT topics corresponding to several MQTT topic messages in the target MQTT topic container respectively, and the target MQTT topic message corresponding to the first MQTT topic that successfully matches the second MQTT topic is screened out, and the successfully matched target MQTT topic message is used as the initial device data of the smart device.

[0029] In some embodiments, before verifying the initial device data according to the target indicator collection rule by the data collection platform and screening to obtain the target device data matching the target indicator collection rule, the method further includes:

[0030] Encapsulate the target indicator collection rules in the IoT platform database into the rule message queue through the IoT platform;

[0031] Broadcasting the rule message queue to the data collection platform through the Internet of Things platform;

[0032] The rule message queue is monitored by the data collection platform, the target indicator collection rule in the rule message queue is obtained, and the target indicator collection rule is stored in a target cache location.

[0033] To achieve the above object, another aspect of the embodiment of the present application provides a data acquisition device, the device comprising the following modules:

[0034] An initial device data acquisition module is used to acquire initial device data of the smart device through a data acquisition platform; the initial device data contains a product type number and a device number;

[0035] An initial device data screening module is used to verify the initial device data according to the target indicator collection rules through the data collection platform, and screen the target device data that matches the target indicator collection rules;

[0036] A target device data analysis module is used to analyze the target device data by using the target expression method through the data acquisition platform to obtain the target indicator number and the target indicator value;

[0037] A target indicator data acquisition module, used to integrate the target indicator number, the target indicator value, the product type number and the equipment number through the data acquisition platform to obtain target indicator data;

[0038] A message middleware storage module, used to encapsulate the target indicator data in a data message queue through the data acquisition platform, and send the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data;

[0039] The target indicator data storage module is used to monitor the message middleware through the indicator database using the data cache service, and store the monitored target indicator data according to the target sequence rule.

[0040] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.

[0041] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0042] The embodiments of the present application include at least the following beneficial effects: the present application provides a data acquisition method, device, electronic device and storage medium, which obtains the initial device data of the smart device through a data acquisition platform; the initial device data contains a product type number and a device number; the data acquisition platform verifies and processes the initial device data according to the target indicator acquisition rule, and screens out the target device data that matches the target indicator acquisition rule; the data acquisition platform uses the target expression method to parse the target device data to obtain the target indicator number and the target indicator value; the data acquisition platform integrates the target indicator number, the target indicator value, the product type number and the device number to obtain the target indicator data; the data acquisition platform encapsulates the target indicator data in a data message queue, and sends the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data; the indicator database uses the data cache service to monitor the message middleware, and the monitored several target indicator data are stored according to the target sequence rule. The embodiment of the present application adopts a target expression method to parse the target device data, so that data of different types and structures can be parsed through a pre-configured target expression method, and recognizable equipment monitoring indicators in a unified format are generated, thereby improving the efficiency of indicator data collection and facilitating storage; by sending a data message queue containing target indicator data to the message middleware for data collection, while introducing the message middleware to improve the stability and reliability of the data, it can solve the system performance bottleneck problem in traditional data scheduling and improve the overall processing capability and response speed of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flow chart of the steps of a data collection method provided in an embodiment of the present application;

[0044] Figure 2 It is a schematic diagram of a process for collecting protocol object data based on device reporting information provided in an embodiment of the present application;

[0045] Figure 3 It is a schematic diagram of a process for collecting protocol object data based on instructions issued by the system according to an embodiment of the present application;

[0046] Figure 4 This is a schematic diagram of a process for collecting MQTT topic messages provided in an embodiment of the present application;

[0047] Figure 5 This is a schematic diagram of an interface for configuring an indicator collection rule provided in an embodiment of the present application;

[0048] Figure 6 This is a schematic diagram of an interface for collecting project information provided by an embodiment of the present application;

[0049] Figure 7 This is a flow chart of obtaining indicator collection rules provided by an embodiment of the present application;

[0050] Figure 8 It is a structural block diagram of a data collection method provided in an embodiment of the present application;

[0051] Fig. 9 It is a flow chart of a data collection method provided in an embodiment of the present application;

[0052] Fig.10 This is a schematic diagram of an interface for monitoring indicator information provided by an embodiment of the present application;

[0053] Fig.11 It is a structural schematic diagram of a data acquisition device provided in an embodiment of the present application;

[0054] Fig.12 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0056] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0057] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0059] At present, the collection of equipment monitoring data mainly relies on database calls or APIs, which mainly perform batch data collection through a predetermined timed scheduling mechanism. However, these collection methods are affected by the timing of the timed scheduling and the amount of data, which will lead to problems such as low data collection efficiency and system performance bottlenecks. In summary, the technical problems existing in the relevant technologies need to be improved.

[0060] In view of this, a data acquisition method, device, electronic device and storage medium are provided in an embodiment of the present application. The scheme obtains the initial device data of the smart device through a data acquisition platform; the initial device data contains a product type number and a device number; the data acquisition platform verifies and processes the initial device data according to the target indicator acquisition rule, and screens out the target device data that matches the target indicator acquisition rule; the data acquisition platform uses the target expression method to parse the target device data to obtain the target indicator number and the target indicator value; the data acquisition platform integrates the target indicator number, the target indicator value, the product type number and the device number to obtain the target indicator data; the data acquisition platform encapsulates the target indicator data in a data message queue, and sends the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data; the indicator database uses the data cache service to monitor the message middleware, and the monitored several target indicator data are stored according to the target sequence rule. The embodiment of the present application adopts a target expression method to parse the target device data, so that data of different types and structures can be parsed through a pre-configured target expression method, and recognizable equipment monitoring indicators in a unified format are generated, thereby improving the efficiency of indicator data collection and facilitating storage; by sending a data message queue containing target indicator data to the message middleware for data collection, while introducing the message middleware to improve the stability and reliability of the data, it can solve the system performance bottleneck problem in traditional data scheduling and improve the overall processing capability and response speed of the system.

[0061] The data collection method provided in the embodiment of the present application relates to the field of data processing technology. The data collection method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network, content distribution network) and big data and artificial intelligence platforms and other basic cloud computing services. The cloud server, the server can also be a node server in the blockchain network; the software can be an application that implements the data collection method, etc., but is not limited to the above forms.

[0062] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs (Personal Computers, personal computers), minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0063] See also Figure 1 , Figure 1 is an optional step flow chart of a data collection method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0064] Step S101, obtaining initial device data of the smart device through a data acquisition platform; the initial device data contains a product type number and a device number;

[0065] In the specific implementation, the embodiment of the present application is based on the scenario of connecting the smart device to the MQTT (Message Queuing Telemetry Transport) server. Specifically, the smart device can access the MQTT server by accessing the IoT (Internet of Things) platform, or access the MQTT server through the MQTT protocol, so as to realize the message reporting and command issuance control of the smart device (such as smart mattress, smart electric bed, smart pillow, smart massager, smart massage chair, smart sofa, etc.). In the embodiment of the present application, by configuring the protocol data object of the device or the unparsed original MQTT message topic (original MQTT message Topic), the pipeline flow of the original data of the device is collected in real time, which effectively smooths the system performance peak.

[0066] For example, an example of an object protocol reporting message (such as a smart bed reporting air pressure value) can be expressed as:

[0067] "Object Name:

[0068] com.derucci.bean.protocol.t10pro.contents.RtStatDataNotify;

[0069] Protocol content (data after conversion to JSON (object protocol)):

[0070] {"alignOnBedState":0,"back":[0,0],"breathRate":0,"buttocks":[0,-79],"crus":[0,0],"ham":[0,0],"head":[ 0,0],"heartRate":0,"loin":[2,8],"onBedState":0,"part":2,"shoulder":[1,41],"signalState":0,"snore":0}".

[0071] For example, an example of a message reported via the MQTT protocol (such as an electric bed reporting heartbeat data):

[0072] "object name: topic:d / p / electricBed / 943cc60dcdb0;

[0073] Protocol content (hexadecimal format): 5A5A 0117 0206 A3".

[0074] Among them, the data acquisition platform can be used to collect, process and store data collected from various devices.

[0075] For smart devices, they are the objects of data collection. Smart devices can be devices that have been connected to the Internet of Things platform (IoT platform). These devices usually have developed and deployed device communication protocols and generated complete protocol objects. In the embodiments of the present application, for these smart devices, data collection can be performed by obtaining the protocol object report message after the IoT platform escapes, and using the protocol object report message as a parameter to call the data collection platform's collection method.

[0076] Smart devices can also be devices that access the company or third-party MQTT server using the MQTT protocol. These devices usually do not develop their own communication protocols; in addition, smart devices can also be devices that have updated the protocol content, but the IoT platform has not developed the updated protocol. Since both types of smart devices cannot collect data using the device protocol object collection method, the MQTT server can be used to directly collect data. In an embodiment of the present application, for these two types of smart devices, data can be collected based on whether the MQTT Topic (MQTT topic) is matched. Specifically, the MQTT message uploaded by the smart device received in the MQTT server is monitored by the data collection platform, and the monitored MQTT message is matched with the MQTT Topic in the configured MQTT Topic message container, and the MQTT message that fails to match is filtered out to obtain the target MQTT message, and then the target MQTT message is sent to the data collection platform.

[0077] Among them, initial device data refers to the data information corresponding to the smart device. The initial device data is used to extract monitoring indicator data that meets the requirements. The monitoring indicator data can be used to quickly identify the status and performance of the equipment, thereby improving operation and maintenance efficiency. It can also be used to predict potential equipment failures and problems, allowing enterprises to intervene or maintain in advance and reduce the impact of unexpected failures.

[0078] The data types of the initial device data include protocol object types and MQTT message types. The protocol object data of the protocol object type is the device data obtained by collecting data from smart devices that have been connected to the IoT platform. The MQTT topic message of the MQTT message type is the device data obtained by collecting data from devices that are connected to the company or third-party MQTT server using the MQTT protocol, or the device data obtained by collecting data from devices that have updated the protocol content but the IoT platform has not developed the updated protocol.

[0079] Among them, the initial device data (protocol object data and MQTT topic message) carries the product type number and device number. For the product type number, it is the product type number of the smart device. For a certain type of device, the manufacturer will assign a unique identifier to distinguish different product series or models; for the device number, it is the unique physical address of the device (MAC (Media Access Control, Media Access Control) address), which is used to identify each device in the network.

[0080] Regarding the collection of protocol object data, in some embodiments, before step S101, it may also include: uploading a first protocol device message to the Internet of Things platform through the smart device; decoding the first protocol device message through the Internet of Things platform using the Internet of Things platform protocol to generate first protocol object data with a data type of a protocol object type, and using the first protocol object data as the initial device data of the smart device; or, when the client sends a control instruction to the smart device through the Internet of Things platform, generating second protocol object data with a data type of a protocol object type through the Internet of Things platform according to the control instruction, and using the second protocol object data as the initial device data of the smart device.

[0081] In some specific embodiments, when the client sends a control instruction to the smart device through the Internet of Things platform, the Internet of Things platform generates protocol object data with a data type of a protocol object type according to the control instruction, and uses the protocol object data as the initial device data of the smart device. It can also include: encoding the second protocol object data using the Internet of Things platform protocol through the Internet of Things platform to obtain a second protocol device message; and sending the second protocol device message to the smart device through the Internet of Things platform.

[0082] The first protocol device message is the device data reported by the smart device, which is a device that has been connected to the Internet of Things platform (IoT platform). The first protocol object data is generated in the process of the smart device reporting the message; the second protocol object data is generated in the process of the client issuing a control instruction to the smart device. The second protocol device message is the data obtained by encoding the second protocol object data using the IoT platform protocol and the IoT platform protocol, which is the data that can be recognized by the smart device.

[0083] Among them, the IoT platform protocol (such as JSON Object Protocol) can refer to a set of rules and standards followed by communications between IoT platforms. These rules define how data is encapsulated, transmitted, parsed, and stored to ensure that information can be exchanged effectively and reliably between different devices, services, and applications.

[0084] Among them, the client is a terminal that sends instructions to smart devices. Instructions can be sent to the Internet of Things platform through the client, and then the Internet of Things platform processes the instructions to obtain messages that can be recognized by smart devices, and finally sends the messages to smart devices. After receiving these instructions, the smart devices will perform corresponding operations according to the instructions.

[0085] Specifically, for the collection of protocol object data, there are two collection methods. One is to refer to Figure 2 , Figure 2 is a schematic diagram of a process for collecting protocol object data based on device reporting information provided in an embodiment of the present application; Figure 2 As shown, on the basis that the smart device has been connected to the Internet of Things platform (IoT platform), the smart device first reports the device message to the IoT platform, and then the IoT platform uses the IoT platform protocol to decode the device message reported by the smart device to generate protocol object data, and then the IoT platform outputs the protocol object data, and finally stores the protocol object data in the database of the IoT platform.

[0086] Second, see Figure 3 , Figure 3 is a flow chart of collecting protocol object data based on the system issuing instructions according to an embodiment of the present application; Figure 3 As shown, first, instructions are sent to the IoT platform through the client (user APP (Application)), and then the IoT platform generates protocol object data according to the instructions. Then, the IoT platform encodes the protocol object data using the IoT platform protocol to obtain instruction messages that can be recognized by smart devices. Finally, the instruction messages are sent to the smart devices. After receiving these instruction messages, the smart devices will perform corresponding operations according to the instruction messages.

[0087] The protocol object data generated when the device reports information and the protocol object data generated when the system issues instructions can be sent to the data acquisition platform as the initial device data of the smart device for further data processing and analysis. The protocol object data generated by the IoT platform will be accompanied by the product type number and device number (unique MAC address) of the smart device.

[0088] Specifically, for the collection of target MQTT topic messages, in some embodiments, before step S101, it may also include: using the target MQTT server to listen to the target MQTT topic messages reported by the smart device through the data collection platform; matching the first MQTT topic corresponding to the target MQTT topic message and the second MQTT topics corresponding to several MQTT topic messages in the target MQTT topic container through the data collection platform, respectively, screening out the target MQTT topic message corresponding to the first MQTT topic that successfully matches the second MQTT topic, and using the successfully matched target MQTT topic message as the initial device data of the smart device.

[0089] Among them, the target MQTT topic message is the MQTT message published by the smart device. These MQTT messages have a specific topic name, which is used to classify and identify different data streams. The target MQTT topic message is a specific type of message that the data collection platform needs to monitor and collect.

[0090] Among them, the target MQTT server is an MQTT proxy server set on the data acquisition platform service, which is used to receive and distribute messages sent by smart devices. It is a device used by the data acquisition platform to monitor specific MQTT topic messages (target MQTT topic messages).

[0091] Among them, the first MQTT topic is the topic corresponding to the target MQTT topic message ("topic" is also called "Topic"), that is, the topic corresponding to the target MQTT topic message monitored by the target MQTT server without any processing.

[0092] For the target MQTT topic container, which is a preset MQTT topic container, the data collection platform needs to configure a target MQTT topic collection container to store the specific topics (Topic) that need to be monitored. This container can contain multiple MQTT topics, each of which corresponds to a specific product type or device. The MQTT topic in the container can be understood as the second MQTT topic, and the first MQTT topic is the topic corresponding to the target MQTT topic message that has not been processed and is monitored by the target MQTT server. The target MQTT topic container plays a filtering role, by matching the topic corresponding to the target MQTT topic message that has not been processed and is monitored by the target MQTT server with multiple topics in the target MQTT topic collection container, retaining the successfully matched target MQTT topic messages, and filtering out the failed matched target MQTT topic messages, which can eliminate data that does not conform to the rules or is abnormal, improve data quality, and the filtered target device data is more in line with the preset analysis requirements, reducing the complexity of subsequent data processing.

[0093] For the collection of target MQTT topic messages, see Figure 4 , Figure 4 Schematic diagram of a process for collecting MQTT topic messages provided in an embodiment of the present application; Figure 4 As shown in the figure, the process of collecting MQTT topic messages is as follows:

[0094] First, the data collection platform service needs to configure the target MQTT server connected to the smart device to realize the function of monitoring the MQTT messages reported by the smart device.

[0095] Then, in order to prevent a large number of MQTT messages monitored by the MQTT server from being reported to the data collection platform to overwhelm the data collection platform server, only the MQTT messages of specific topics need to be monitored in the data collection platform. For example, assuming that the Topic of the MQTT message is set to $share / iot / d / p / # and $share / iot / d / c / #, based on this setting, the data collection platform only supports monitoring messages that meet these two topics to reduce the load on the data collection platform server. At the same time, the shared subscription method starting with $share / iot / can route messages to different data collection platform service nodes, and can improve the concurrent processing performance of the entire data collection platform as the nodes expand horizontally.

[0096] At the same time, the embodiment of the present application has the following requirements for the MQTT Topic configuration of the MQTT server device:

[0097] 1) Device message reporting: d / p / {productId} / {mac};

[0098] 2) Device command is issued: d / c / {productId} / {mac}.

[0099] Among them, productId represents the product type number of the device, and mac represents the number of the device. The purpose of the MQTT Topic configuration requirements for devices connected to the MQTT server is to distinguish different device types and devices, so as to collect data for devices of the same product type, or to collect data for designated devices. When collecting data for devices of the same product type, a wildcard # needs to be written at {mac}. For example, if you need to collect data for all devices of the electric bed type, you only need to configure it as: d / p / electricBed / #, d / c / electricBed / #.

[0100] Furthermore, the data collection platform needs to configure a target MQTT topic collection container to store the specific topics that need to be monitored. This container can contain multiple MQTT topics, and each MQTT topic corresponds to a specific product type or device.

[0101] Finally, the MQTT messages monitored by the data collection platform are filtered. Specifically, the Topic of the monitored MQTT message is matched with multiple Topics in the target MQTT topic collection container, the successfully matched target MQTT topic messages are retained, and the unmatched target MQTT topic messages are filtered out. By parsing the successfully matched target MQTT topic messages, the product type number and device number of the smart device can be obtained. The successfully matched target MQTT topic message is sent to the data collection platform as the initial device data of the smart device for further analysis and processing. At the same time, the product type number and device number of the smart device also need to be sent to the data collection platform.

[0102] In the specific implementation, by configuring the device's protocol data object or the unparsed original MQTT message topic, the protocol object data of the protocol object type and the MQTT topic message of the MQTT message type can be obtained, so as to realize the real-time collection of the pipeline stream of the original data of the smart device and effectively smooth the system performance peak.

[0103] In step S101 shown in the embodiment of the present application, initial device data of the smart device is obtained through a data acquisition platform, which provides a data basis for subsequent data analysis and processing. By obtaining data of the smart device in real time or periodically, it is helpful to maintain the timeliness and accuracy of the data.

[0104] Moreover, before step S101, by configuring the protocol data object of the device or the unparsed original MQTT message topic, the protocol object data of the protocol object type and the MQTT topic message of the MQTT message type can be obtained, so as to realize the real-time collection of the pipeline flow of the original data of the smart device and effectively smooth the system performance peak.

[0105] Step S102, verifying the initial device data according to the target indicator collection rule through the data collection platform, and screening to obtain the target device data matching the target indicator collection rule;

[0106] For target indicator collection rules, see Figure 5 , Figure 5 is a schematic diagram of an interface for configuring an indicator collection rule provided in an embodiment of the present application; Figure 5As shown, the configuration content of the target indicator collection rule includes the collection project name, collection type, collection target, data source, collection project list and other remarks. Among them, the collection type is divided into device protocol and MQTT Topic. The collection target is filled in according to the collection type. When the collection type is the device protocol type, the collection target is the protocol full path object address generated by this protocol; when the collection type is the MQTT Topic type, the collection target is this specific Topic. For example, assuming that it is necessary to collect the indicator information reported by a specific electric bed, the collection target can be filled in as d / p / electricBed / {electric bed mac}. The data source can be divided into two types: device reporting and background service. The collection project list is the expression of indicator collection. A target indicator collection rule can configure multiple collection projects. Each project can include collection indicators (collection project name), expression type, indicator expression, indicator value expression and other contents.

[0107] Specifically, see Figure 6 , Figure 6 This is a schematic diagram of an interface for collecting project information provided by an embodiment of the present application. Figure 6 As shown, Figure 6 The information of the collection items in the indicator collection rules is displayed, where the collection item name is the name of the indicator; the expression type is the expression type mainly supported by the current system. In the embodiment of the present application, there are three expression types: SpEL, Groovy, and JavaScript; the indicator expression is the number that can generate the corresponding indicator; the indicator value expression is the specific indicator value that can be obtained.

[0108] Among them, the target indicator collection rules are configured in the IoT platform (cloud platform). After all the collection expressions are written, the indicator collection rules will be saved to the IoT platform database for the next step of caching. The purpose of caching the indicator collection rules is to query the configured indicator collection rules every time the device data is reported or the instruction is issued to determine whether the data needs to be collected. The query indicator collection rules are generally as follows:

[0109] 1) Query database: The advantage is that the stored data is safe, but the disadvantage is that the database query efficiency is slow and the performance cannot cope with high concurrency scenarios;

[0110] 2) Query cache middleware: The advantage is high query efficiency, but when there is high concurrency, querying third-party cache middleware may cause certain network IO (Input / Output) to block normal business processes;

[0111] 3) Query local cache: Querying directly through system memory is the most efficient. The disadvantage is that it takes up the service's memory. When there are multiple service nodes, each service must store the same indicator collection rules.

[0112] However, the embodiment of the present application takes into account that the configuration information of the actual indicator collection rules is not large, and the embodiment of the present application uses local cache to query the rule configuration.

[0113] In some embodiments, before step S102, it may also include: encapsulating the target indicator collection rules in the Internet of Things platform database in a rule message queue through the Internet of Things platform; broadcasting the rule message queue to the data collection platform through the Internet of Things platform; monitoring the rule message queue through the data collection platform, obtaining the target indicator collection rules in the rule message queue, and storing the target indicator collection rules in the target cache location.

[0114] Among them, the rule message queue is used to store and place target indicator collection rules. The target cache location is the location where the data collection platform stores the target indicator collection rules locally. Every time a device reports data or an instruction is issued, the configured indicator collection rules can be queried in the target cache location in the data collection platform to determine whether the data needs to be collected.

[0115] Specifically, see Figure 7 , Figure 7 is a flow chart of obtaining an indicator collection rule provided by an embodiment of the present application; Figure 7 As shown, Figure 7 The serial number 001 in the figure represents the data collection platform service cluster. First, the Internet of Things platform (cloud platform) configures the indicator collection rules, and then persists the configured indicator collection rules to the local database of the Internet of Things platform. The indicator collection rules in the Internet of Things platform database are encapsulated as MQ (Message Queuing) messages in the rule message queue (MQ message queue), and the rule message queue is broadcast to the data collection platform. Then, each service node of the data collection platform listens to the broadcast rule message queue, obtains the indicator collection rules in the rule message queue, and stores the indicator collection rules in the target cache location of the data collection platform.

[0116] In some embodiments, step S102 may include: if the data type of the initial device data is a protocol object type, then using the object name as the target key to query whether there is a target indicator collection rule in the target cache location of the data collection platform, and filtering to obtain target device data that matches the target indicator collection rule; if the data type of the initial device data is an MQTT message type, then using the target MQTT topic as the target key to query whether there is a target indicator collection rule in the target cache location of the data collection platform, and filtering to obtain target device data that matches the target indicator collection rule.

[0117] The object name is the specific identifier or name of the protocol object in the initial device data, and is a name or identifier defined in the object protocol and used to identify different data objects.

[0118] Among them, the verification processing is the process of matching the initial device data to be collected with the target indicator collection rules of the target cache location of the data collection platform. Specifically, if the data type of the initial device data is a protocol object type, the object name is used as the target key to query whether there is a target indicator collection rule corresponding to the initial device data in the target cache location of the data collection platform, and the target device data that matches the target indicator collection rule is screened out; similarly, if the data type of the initial device data is an MQTT message type, the target MQTT topic is used as the target key to query whether there is a corresponding target indicator collection rule in the target cache location of the data collection platform, and the target device data that matches the target indicator collection rule is screened out.

[0119] Among them, the target device data is the data obtained through verification processing, which can be used for the next step of expression parsing.

[0120] In the specific implementation, if the data type of the initial device data is a protocol object type, the object name is used as the target key to query whether there is a target indicator collection rule in the target cache location of the data collection platform, and the target device data matching the target indicator collection rule is screened; if the data type of the initial device data is an MQTT message type, the target MQTT topic is used as the target key to query whether there is a target indicator collection rule in the target cache location of the data collection platform, and the target device data matching the target indicator collection rule is screened. By associating the data type with a specific query key (object name or MQTT topic), the target device data can be quickly screened and located, avoiding unnecessary traversal and searching, and improving the efficiency and accuracy of data collection. Furthermore, by using a clear query key (such as object name or MQTT topic) for screening, only the device data matching the target indicator collection rule can be selected, thereby reducing the possibility of misselection or omission and enhancing the accuracy of the data; at the same time, by distinguishing data types, corresponding processing methods can be adopted for different types of data, so as to better meet various data collection needs.

[0121] In step S102 shown in the embodiment of the present application, the initial device data is verified and processed according to the target indicator collection rules by the data collection platform, and the target device data matching the target indicator collection rules is screened out. This can eliminate data that does not comply with the rules or is abnormal, thereby improving data quality. The screened target device data is more in line with preset analysis requirements, thereby reducing the complexity of subsequent data processing.

[0122] Moreover, by associating data types with specific query keys (object names or MQTT topics), rapid screening and positioning of target device data is achieved, unnecessary traversal and searching are avoided, and the efficiency and accuracy of data collection are improved. Furthermore, by using clear query keys (such as object names or MQTT topics) for screening, only device data that matches the target indicator collection rules can be selected, thereby reducing the possibility of misselection or omission and enhancing data accuracy. At the same time, by distinguishing data types, corresponding processing methods can be adopted for different types of data, thereby better meeting various data collection needs.

[0123] Step S103, using the data acquisition platform to perform data analysis on the target device data using a target expression method to obtain a target indicator number and a target indicator value;

[0124] In some embodiments, step S103 may include: calling the target expression parsing engine according to the target acquisition rule type corresponding to the target device data through the data acquisition platform; performing data parsing on the target device data based on the target expression parsing engine through the data acquisition platform to obtain the target indicator number and target indicator value.

[0125] The target collection rule types may include SpEl type, Groovy type and JavaScript type. Correspondingly, the target expression parsing engines correspond to SpEl expression parsing engine, Groovy expression parsing engine and JavaScript script parsing engine respectively.

[0126] Among them, the SpEl expression parsing engine can write and execute simple ternary expressions and call system methods, but cannot execute complex code logic. The SpEl expression parsing engine is used to parse protocol object data with high efficiency. The Groovy expression parsing engine can write complex code logic, execute custom methods, etc. It can call system methods in custom methods. The Groovy expression parsing engine can parse complex device messages and can be used to parse MQTTTopic messages. The JavaScript script parsing engine can write complex code logic, execute custom methods, etc. It is mainly used as a supplement. For example, some systems can come with support for parsing JavaScript scripts, do not rely on third-party plug-ins, and are easier to use.

[0127] Step S103 shown in the embodiment of the present application uses a target expression method to parse the target device data through a data acquisition platform to obtain a target indicator number and a target indicator value, so that data of different types and structures can be parsed through a pre-configured target expression method to generate recognizable equipment monitoring indicators in a unified format, thereby improving the efficiency of indicator data collection and facilitating storage. That is, data parsing of the target device data based on the target expression method can convert complex data into a structural form that is easy to analyze and process, thereby providing support for subsequent data integration and analysis.

[0128] Step S104, integrating the target indicator number, the target indicator value, the product type number and the equipment number through the data collection platform to obtain target indicator data;

[0129] The target indicator data is data that integrates the target indicator number, target indicator value, product type number, and device number. For example, assuming that the target indicator data is the heart rate data of a smart bed, the heart rate data of a smart bed mainly has the following attributes:

[0130] Product Type Number: electricBed;

[0131] Equipment number: AE100541SD52B;

[0132] Indicator name: left heart rate;

[0133] Indicator number: left_heatHeart;

[0134] Index value: 68;

[0135] Collection time: 2024-05-01 10:01:52.

[0136] It should be noted that the above-mentioned attribute content of "heart rate data of smart bed" is only a simple example, and each data can be adjusted according to actual conditions. For example: the device number can be modified to XXXX123456, the index value can be modified to 70 (normal heart rate is 60-100), the collection time can be modified to 2022-05-0110:00:00, etc., and the embodiment of the present application does not limit this.

[0137] In step S104 shown in the embodiment of the present application, the target indicator number, target indicator value, product type number and equipment number are integrated through a data acquisition platform to obtain target indicator data. By centrally integrating scattered data, complete information is formed to facilitate storage, and multi-dimensional data analysis and mining can be supported in subsequent data utilization.

[0138] Step S105, encapsulating the target indicator data in a data message queue through the data acquisition platform, and sending the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data;

[0139] The data message queue is a location for storing target indicator data.

[0140] The process of generating the indicator data in the above steps S101 to S104 is all memory-level operation, which can cope with high-concurrency data collection with the support of multiple data collection platform service nodes. However, in order to persist the storage of a large amount of collected indicator data, the following problems must be solved at the same time: 1) Ensure that the data is reliable and not lost, 2) The performance bottleneck of storing the indicator data in the database is limited, and the data efficiency generated by the system memory cannot be achieved, which may block normal business. In order to solve these problems, the embodiment of the present application adopts an MQ message middleware to implement it. The message middleware is an independent system or service, which provides message storage and transmission functions. The message middleware (such as KafKa) will have message data transactions and persistence, which can ensure that the message is not lost; after publishing the MQ message to the message middleware, the business of the device can continue to execute normally. During this period, it is a multi-threaded asynchronous process and will not cause the business thread to be blocked.

[0141] Step S105 shown in the embodiment of the present application encapsulates the target indicator data in a data message queue through a data acquisition platform, and sends the data message queue containing the target indicator data to the message middleware. While introducing the message middleware to improve the stability and reliability of the data, it can also solve the system performance bottleneck problem during traditional data scheduling and improve the overall processing capability and response speed of the system.

[0142] Step S106, monitoring the message middleware by using the data cache service through the indicator database, and storing the monitored target indicator data according to the target sequence rule.

[0143] The indicator database is a location for storing target indicator data to facilitate subsequent data query and analysis.

[0144] Among them, the target order rule is the consumption order. In the message queue system, when the data cache service (consumer) listens to the message middleware and consumes messages to store in the indicator database, the consumption order refers to the order followed by the consumer when reading and processing messages. This order is of great significance for ensuring data consistency and order.

[0145] In the specific implementation, the process of collecting indicator data is to first encapsulate the indicator data into a data message queue through the data collection platform, then publish the data message queue to the message middleware, monitor the data message queue through the indicator database using the data cache service, and then store the indicator data in the indicator database according to the consumption order.

[0146] In step S106 shown in the embodiment of the present application, the indicator database uses a data cache service to monitor the message middleware, and stores the monitored target indicator data according to the target sequence rule. The data cache service can significantly improve the reading and writing performance of the data and reduce the direct access pressure to the database. At the same time, storage according to the target sequence rule facilitates subsequent data query and analysis. The indicator database, as a persistent storage layer for data, can improve the security and reliability of the data.

[0147] In steps S101 to S106 shown in the embodiment of the present application, initial device data of the smart device is obtained through a data acquisition platform; the initial device data contains a product type number and a device number; the initial device data is verified and processed according to the target indicator acquisition rule by the data acquisition platform, and the target device data matching the target indicator acquisition rule is screened; the target device data is analyzed by the data acquisition platform using the target expression method to obtain the target indicator number and the target indicator value; the target indicator number, the target indicator value, the product type number and the device number are integrated through the data acquisition platform to obtain the target indicator data; the target indicator data is encapsulated in a data message queue through the data acquisition platform, and the data message queue containing the target indicator data is sent to the message middleware; the data message queue contains a number of target indicator data; the message middleware is monitored by the indicator database using the data cache service, and the monitored several target indicator data are stored according to the target sequence rule. The embodiment of the present application adopts a target expression method to parse the target device data, so that data of different types and structures can be parsed through a pre-configured target expression method, and recognizable equipment monitoring indicators in a unified format are generated, thereby improving the efficiency of indicator data collection, facilitating storage, and saving system resources; by sending a data message queue containing target indicator data to the message middleware for data collection, while improving the stability and reliability of the data, it can solve the system performance bottleneck problem in traditional data scheduling and improve the overall processing capability and response speed of the system.

[0148] In addition, by configuring the device's protocol data object or unparsed original MQTT message topic, you can obtain the protocol object data of the protocol object type and the MQTT topic message of the MQTT message type, and realize real-time collection of the pipeline stream of the original data of the smart device, which can make the system run more smoothly and reduce system performance bottlenecks.

[0149] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.

[0150] See also Figure 8 , Figure 8 is a structural block diagram of a data collection method provided in an embodiment of the present application; the device data flow of the data collection method provided in an embodiment of the present application is as follows Figure 8 As shown, Figure 8The serial number 002 in the figure indicates a smart device, which can be divided into three parts: device data, collection platform, and indicator database. Specifically, at the device data processing level, EMQX is a high-performance MQTT message agent that can process a large number of messages and support distributed architecture. It is responsible for collecting data from smart devices, mainly MQTT messages, and reporting MQTT messages to the data collection platform. The device protocol embedding point is a specific interface or function point in the smart device to collect data. The device protocol embedding point is responsible for extracting data from the smart device according to a specific object protocol, mainly protocol object data, and reporting the protocol object data to the data collection platform. At the data collection platform level, the protocol object data and the MQTT message in the MQTT client are parsed by the corresponding expression parsing engine to obtain the indicator number and indicator value, and then the indicator number, indicator value, and the product type number and device number attached to the smart device data are integrated to obtain the indicator data, and finally the indicator data is stored in the indicator database.

[0151] See also Fig. 9 , Fig. 9 is a flow chart of a data collection method provided in an embodiment of the present application; Fig. 9 As shown in Figure 2, the overall process of the data collection method is as follows:

[0152] The first step is to extract protocol object data from smart devices according to a specific object protocol through device protocol tracking, and report the protocol object data to the data collection platform, or use the MQTT server to listen to the MQTT topic messages reported by smart devices through the data collection platform. By configuring the device's protocol data object or the unparsed original MQTT message topic, you can obtain protocol object data of the protocol object type and MQTT topic messages of the MQTT message type, realize real-time collection of the pipeline flow of the original data of smart devices, and effectively smooth the system performance peak.

[0153] The second step is to query the local cache indicator collection rule configuration of the data collection platform based on the acquired device data after the data collection platform obtains the device data (protocol object data and MQTT topic message). Specifically, if the data type of the initial device data is the protocol object type, the object name is used as the target key to query whether there is a target indicator collection rule in the target cache location of the data collection platform, and the target device data matching the target indicator collection rule is obtained by screening; if the data type of the initial device data is the MQTT message type, the target MQTT topic is used as the target key to query whether there is a target indicator collection rule in the target cache location of the data collection platform, and the target device data matching the target indicator collection rule is obtained by screening. If the indicator collection rule configuration cannot be found in the local cache location of the device data, the process ends. By associating data types with specific query keys (object names or MQTT topics), the target device data can be quickly screened and located, unnecessary traversal and searching can be avoided, and the efficiency and accuracy of data collection can be improved. Furthermore, by using clear query keys (such as object names or MQTT topics) for screening, only device data that matches the target indicator collection rules can be selected, thereby reducing the possibility of misselection or omission and enhancing data accuracy. At the same time, by distinguishing data types, corresponding processing methods can be used for different types of data, thereby better meeting various data collection needs.

[0154] In the third step, when the device data passes the indicator collection rule verification in the second step, the step of traversing the expression list can be entered. By traversing the expression list, the expression engine type corresponding to the device data can be obtained, and then the expression parsing engine is distributed to the device data. Among them, the SpEl expression parsing engine can write and execute simple ternary expressions, and can also call system methods, but cannot execute complex code logic. The SpEl expression parsing engine is used to perform parsing of protocol object data with high efficiency. The Groovy expression parsing engine can write complex code logic, execute custom methods, etc., and can call system methods in custom methods. The Groovy expression parsing engine can parse complex device messages and can be used to parse MQTT Topic messages. The JavaScript script parsing engine can write complex code logic, execute custom methods, etc., mainly as a supplement. For example, some systems can come with support for parsing JavaScript scripts, do not rely on third-party plug-ins, and are easier to use. The target device data is parsed using the target expression method through the data collection platform to obtain the indicator number and indicator value. It enables data of different types and structures to be parsed through a pre-configured target expression method to generate recognizable equipment monitoring indicators in a unified format, thereby improving the efficiency of indicator data collection and facilitating storage. That is, data parsing of target device data based on the target expression method can convert complex data into a structural form that is easy to analyze and process, providing support for subsequent data integration and analysis.

[0155] The fourth step is to integrate the indicator number, indicator value, product type number and equipment number carried by the equipment data through the data collection platform to obtain the indicator data, encapsulate the indicator data in the data message queue, and send the data message queue containing the indicator data to the message middleware. By centralizing and integrating the scattered data, complete information is formed, which is easy to store and can support multi-dimensional data analysis and mining in subsequent data utilization. While introducing the message middleware to improve the stability and reliability of the data, it can also solve the system performance bottleneck problem in traditional data scheduling and improve the overall processing capacity and response speed of the system.

[0156] The fifth step is to monitor the message middleware through the indicator database using the data cache service, store the monitored indicator data according to the target sequence rules, and finally end the process. The data cache service can significantly improve the data read and write performance and reduce the pressure of direct access to the database. At the same time, storage according to the target sequence rules facilitates subsequent data query and analysis. The indicator database, as a persistent storage layer for data, can improve the security and reliability of data.

[0157] See also Fig.10 , Fig.10is a schematic diagram of an interface for monitoring indicator information provided by an embodiment of the present application; Fig.10 As shown, all monitoring indicator information of the smart device can be obtained through the Web (World Wide Web) front end and the back end sql (Structured Query Language) query.

[0158] In summary, the current related technologies usually collect equipment monitoring data based on database calls or APIs, and collect data in batches through timed scheduling. However, the collection efficiency of these methods is affected by the timing of timed scheduling and the amount of data. Every time new indicator data needs to be collected, code development and deployment need to be re-performed, and a large amount of one-time data collection may affect server performance. In addition, too long scheduling intervals will also reduce the timeliness of data. Moreover, these methods cannot collect data in real time, cannot adapt to diverse equipment protocol data structures, and traditional timed scheduling batch collection may lead to system performance bottlenecks, as well as frequent release and deployment problems.

[0159] The data collection method adopted in the embodiment of the present application can realize the real-time collection of the original data of the device through the pipeline flow by configuring the protocol data object of the device or the unparsed original MQTT message topic, effectively smoothing the system performance peak. In addition, data of different types and structures can be parsed by pre-configured SpEL, Groovy and other expressions, and recognizable device monitoring indicator data in a unified format can be generated. The whole process can achieve data collection through simple script development and zero system deployment. That is, real-time data collection through pipeline flow can make the system run more smoothly and reduce performance bottlenecks; using expression parsing technology, data of different types and structures can be parsed into unified indicator data, which is convenient for storage, greatly improving work efficiency and saving system resources.

[0160] It should be pointed out that this embodiment only briefly illustrates the general process of the data acquisition method. The detailed description of each step can refer to the relevant content in the aforementioned embodiment and will not be repeated here. It can be understood that the present invention is not limited to this.

[0161] The embodiment of the present application obtains initial device data of the smart device through a data acquisition platform; the initial device data contains a product type number and a device number; the data acquisition platform verifies and processes the initial device data according to the target indicator acquisition rule, and screens to obtain target device data that matches the target indicator acquisition rule; the data acquisition platform uses the target expression method to parse the target device data to obtain the target indicator number and the target indicator value; the data acquisition platform integrates the target indicator number, the target indicator value, the product type number and the device number to obtain the target indicator data; the data acquisition platform encapsulates the target indicator data in a data message queue, and sends the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data; the indicator database uses the data cache service to monitor the message middleware, and the monitored several target indicator data are stored according to the target sequence rule. The embodiment of the present application adopts a target expression method to parse the target device data, so that data of different types and structures can be parsed through a pre-configured target expression method, and recognizable equipment monitoring indicators in a unified format are generated, thereby improving the efficiency of indicator data collection, facilitating storage, and saving system resources; by sending a data message queue containing target indicator data to the message middleware for data collection, while improving the stability and reliability of the data, it can solve the system performance bottleneck problem in traditional data scheduling and improve the overall processing capability and response speed of the system.

[0162] In addition, by configuring the device's protocol data object or unparsed original MQTT message topic, you can obtain the protocol object data of the protocol object type and the MQTT topic message of the MQTT message type, and realize real-time collection of the pipeline stream of the original data of the smart device, which can make the system run more smoothly and reduce system performance bottlenecks.

[0163] See also Fig.11 The embodiment of the present application further provides a data acquisition device 1100, which can implement the above data acquisition method. The device 1100 includes:

[0164] The initial device data acquisition module 1101 is used to acquire the initial device data of the smart device through the data acquisition platform; the initial device data contains a product type number and a device number;

[0165] The initial device data screening module 1102 is used to verify the initial device data according to the target indicator collection rule through the data collection platform, and screen the target device data that matches the target indicator collection rule;

[0166] The target device data analysis module 1103 is used to analyze the target device data by using the target expression method through the data acquisition platform to obtain the target indicator number and the target indicator value;

[0167] The target indicator data acquisition module 1104 is used to integrate the target indicator number, the target indicator value, the product type number and the equipment number through the data acquisition platform to obtain the target indicator data;

[0168] The message middleware storage module 1105 is used to encapsulate the target indicator data in a data message queue through the data collection platform, and send the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data;

[0169] The target indicator data storage module 1106 is used to monitor the message middleware through the indicator database using the data cache service, and store the monitored target indicator data according to the target sequence rule.

[0170] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0171] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above data collection method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0172] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0173] See also Fig.12 , Fig.12 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0174] The processor 1201 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC for short), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0175] The memory 1202 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1202 can store an operating system and other application programs. When the technical solution provided in the embodiments of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1202, and the processor 1201 calls and executes the data acquisition method of the embodiments of this application;

[0176] Input / output interface 1203, used to implement information input and output;

[0177] The communication interface 1204 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0178] A bus 1205 that transmits information between various components of the device (e.g., the processor 1201, the memory 1202, the input / output interface 1203, and the communication interface 1204);

[0179] The processor 1201 , the memory 1202 , the input / output interface 1203 and the communication interface 1204 are connected to each other in communication within the device via the bus 1205 .

[0180] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above-mentioned data collection method when executed by a processor.

[0181] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0182] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0183] The data acquisition method, data acquisition device, electronic device and storage medium provided by the embodiments of the present application obtain initial device data of smart devices through a data acquisition platform; the initial device data contains a product type number and a device number; the data acquisition platform verifies and processes the initial device data according to the target indicator acquisition rule, and screens to obtain target device data that matches the target indicator acquisition rule; the data acquisition platform uses the target expression method to perform data analysis on the target device data to obtain the target indicator number and the target indicator value; the data acquisition platform integrates the target indicator number, the target indicator value, the product type number and the device number to obtain the target indicator data; the data acquisition platform encapsulates the target indicator data in a data message queue, and sends the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data; the indicator database uses the data cache service to monitor the message middleware, and the monitored several target indicator data are stored according to the target sequence rule. The embodiment of the present application adopts a target expression method to parse the target device data, so that data of different types and structures can be parsed through a pre-configured target expression method, and recognizable equipment monitoring indicators in a unified format are generated, thereby improving the efficiency of indicator data collection and facilitating storage; by sending a data message queue containing target indicator data to the message middleware for data collection, while introducing the message middleware to improve the stability and reliability of the data, it can solve the system performance bottleneck problem in traditional data scheduling and improve the overall processing capability and response speed of the system.

[0184] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0185] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0186] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0187] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0188] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0189] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0190] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0191] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0192] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0193] If the integrated unit is implemented in the form of 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 the present application, 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, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0194] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A data collection method, It is characterized in that The method comprises the following steps: Acquire initial device data of the smart device through a data acquisition platform; the initial device data contains a product type number and a device number; Verifying and processing the initial device data according to the target indicator collection rules through the data collection platform, and screening out the target device data matching the target indicator collection rules; The target device data is analyzed by the data acquisition platform using a target expression method to obtain a target indicator number and a target indicator value; The target indicator number, the target indicator value, the product type number and the equipment number are integrated through the data acquisition platform to obtain target indicator data; Encapsulating the target indicator data in a data message queue through the data acquisition platform, and sending the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data; The message middleware is monitored by using a data cache service through an indicator database, and the monitored target indicator data are stored according to a target sequence rule.

2. The method according to claim 1, It is characterized in that The data type of the initial device data includes a protocol object type and an MQTT message type. The data collection platform verifies and processes the initial device data according to the target indicator collection rule, and screens and obtains target device data that matches the target indicator collection rule, including: If the data type of the initial device data is the protocol object type, then use the object name as the target key to query whether the target indicator collection rule exists in the target cache location of the data collection platform, and filter out the target device data that matches the target indicator collection rule; If the data type of the initial device data is the MQTT message type, the target MQTT topic is used as the target key to query whether the target indicator collection rule exists in the target cache location of the data collection platform, and the target device data matching the target indicator collection rule is screened.

3. The method according to claim 1, It is characterized in that The data acquisition platform uses a target expression method to perform data analysis on the target device data to obtain a target indicator number and a target indicator value, including: Calling a target expression parsing engine according to a target collection rule type corresponding to the target device data through the data collection platform; The target device data is parsed by the data acquisition platform based on the target expression parsing engine to obtain the target indicator number and the target indicator value.

4. The method according to claim 1, It is characterized in that Before obtaining the initial device data of the smart device through the data acquisition platform, the method further includes: Upload a first protocol device message to the Internet of Things platform through the smart device; Decoding the first protocol device message by using the Internet of Things platform protocol to generate first protocol object data whose data type is a protocol object type, and using the first protocol object data as the initial device data of the smart device; or, When the client sends a control instruction to the smart device through the Internet of Things platform, the Internet of Things platform generates second protocol object data whose data type is a protocol object type according to the control instruction, and uses the second protocol object data as the initial device data of the smart device.

5. The method according to claim 4, It is characterized in that When the client sends a control instruction to the smart device through the Internet of Things platform, the Internet of Things platform generates protocol object data of a protocol object type according to the control instruction, and uses the protocol object data as the initial device data of the smart device, the method further includes: The protocol object data is encoded by the Internet of Things platform using the Internet of Things platform protocol to obtain a second protocol device message; The second protocol device message is sent to the smart device through the Internet of Things platform.

6. The method according to claim 1, It is characterized in that Before obtaining the initial device data of the smart device through the data acquisition platform, the method further includes: Using the target MQTT server to monitor the target MQTT topic message reported by the smart device through the data collection platform; The data collection platform matches the first MQTT topic corresponding to the target MQTT topic message and the second MQTT topics corresponding to several MQTT topic messages in the target MQTT topic container respectively, and the target MQTT topic message corresponding to the first MQTT topic that successfully matches the second MQTT topic is screened out, and the successfully matched target MQTT topic message is used as the initial device data of the smart device.

7. The method according to claim 1, It is characterized in that Before verifying the initial device data according to the target indicator collection rule by the data collection platform and screening to obtain the target device data matching the target indicator collection rule, the method further includes: Encapsulate the target indicator collection rules in the IoT platform database into the rule message queue through the IoT platform; Broadcasting the rule message queue to the data collection platform through the Internet of Things platform; The rule message queue is monitored by the data collection platform, the target indicator collection rule in the rule message queue is obtained, and the target indicator collection rule is stored in a target cache location.

8. A data acquisition device, It is characterized in that The device comprises the following modules: An initial device data acquisition module is used to acquire initial device data of the smart device through a data acquisition platform; the initial device data contains a product type number and a device number; An initial device data screening module is used to verify the initial device data according to the target indicator collection rules through the data collection platform, and screen the target device data that matches the target indicator collection rules; A target device data analysis module is used to analyze the target device data by using the target expression method through the data acquisition platform to obtain the target indicator number and the target indicator value; A target indicator data acquisition module, used to integrate the target indicator number, the target indicator value, the product type number and the equipment number through the data acquisition platform to obtain target indicator data; A message middleware storage module, used to encapsulate the target indicator data in a data message queue through the data acquisition platform, and send the data message queue containing the target indicator data to the message middleware; the data message queue contains a number of target indicator data; The target indicator data storage module is used to monitor the message middleware through the indicator database using the data cache service, and store the monitored target indicator data according to the target sequence rule.

9. An electronic device, It is characterized in that The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program. It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.