Device data query method, device, server and computer-readable storage medium

By encapsulating device change data into event information and converting it into data to be queried, efficient query of IoT device data is realized, the problem of low cross-module or cross-device data query efficiency is solved, and data processing efficiency and server performance are improved.

CN114356958BActive Publication Date: 2024-09-13SHANDONG YOU INTERNET OF THINGS CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111479994.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2024-09-13
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

In the Internet of Things industry, the efficiency of cross-module or cross-device data query for data such as device status is low, which affects the execution performance of the server. It is especially difficult in large data volumes and cluster processing.

Method used

By obtaining the change data of the device, encapsulating it into event information, determining the event type and converting it into data to be queried, receiving query parameters to obtain the target data, and using the communication module, business module and query module to achieve efficient data query.

Benefits of technology

It improves the query efficiency of device data and can quickly obtain changed device data from the database, making it convenient for users to understand the operating status of IoT devices in a timely manner and reducing the processing pressure on the server.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114356958B
    Figure CN114356958B
Patent Text Reader

Abstract

The present invention discloses a device data query method, comprising the steps of: obtaining the change data of the device, encapsulating the change data into event information; determining the event type corresponding to the event information, and converting the event information into data to be queried according to the event type; receiving input query parameters, and obtaining target data corresponding to the query parameters from the data to be queried. The present invention also discloses a device data query apparatus, a server, and a computer-readable storage medium. By applying the device data query method of the present invention to the server, the efficiency of cross-module or cross-device data retrieval can be improved, reducing the data processing and cluster pressure of the server, and also improving the efficiency of data query by users or technicians.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data application, and in particular to a device data query method, device, server and computer-readable storage medium. Background Art

[0002] At present, it is essential to display some device states such as device online status, alarm status, and device data such as basic device attributes in the Internet of Things industry. Especially when the relevant data of the device changes, the changed data must be recorded, saved, and presented. Data such as device status is generally stored in the communication module of the server remotely connected to the device, and the status data is displayed in the business module of the server. In this way, if the business module wants to display the status data, it must call data across modules, which greatly affects the efficiency of data reading and presentation, affects the execution performance of the server, and is very difficult in terms of large data volume and cluster processing. Therefore, there is an urgent need for a technical solution that can improve the efficient retrieval of data across modules or devices. Summary of the invention

[0003] The present invention proposes a device data query method, device, server and computer-readable storage medium, which are intended to solve the technical problem of low efficiency in retrieving device data when device data is changed.

[0004] To achieve the above object, the present invention provides a device data query method, which comprises the following steps:

[0005] Acquire change data of the device, and encapsulate the change data into event information;

[0006] Determine the event type corresponding to the event information, and convert the event information into data to be queried according to the event type;

[0007] An input query parameter is received, and target data corresponding to the query parameter is acquired from the data to be queried.

[0008] Optionally, before the step of obtaining the change data of the device and encapsulating the change data into event information, the step includes:

[0009] Detect all data in the device according to a preset frequency, and determine whether all the data has changed;

[0010] If all the data are changed, the changed data among all the data are determined.

[0011] Optionally, the step of converting the event information into data to be queried according to the event type includes:

[0012] Obtain a data structure table corresponding to the event type;

[0013] Determine the event data in the event information, and determine the data structure corresponding to the event data in the data structure table;

[0014] According to the data structure, converting the event data into corresponding formatted data;

[0015] The data to be queried is generated according to the formatted data.

[0016] Optionally, the step of generating the data to be queried according to the formatted data includes:

[0017] Determining whether device encoding data exists in the formatted data;

[0018] If the device code data does not exist in the formatted data, obtaining the device code of the device and converting the device code into the device code data;

[0019] The set of the formatted data and the device code data is used as the data to be queried.

[0020] Optionally, the step of generating the data to be queried according to the formatted data further includes:

[0021] Obtaining a service tag corresponding to the formatted data;

[0022] converting the service tag into tag data, and associating the tag data with the formatted data;

[0023] The set of the formatted data and the tag data associated with the formatted data is used as data to be queried.

[0024] Optionally, the step of determining the event type corresponding to the event information and converting the event information into data to be queried according to the event type further includes:

[0025] Determine the event type corresponding to the event information, and retrieve the data change record corresponding to the event type;

[0026] If the data change record is retrieved, then read the record time corresponding to the data change record;

[0027] Obtaining a current time node, and determining whether a difference between the current time node and the recording time is less than a preset time interval;

[0028] If it is greater than a preset time interval, the event information is converted into data to be queried according to the event type.

[0029] Optionally, the event types include device status changes, device basic parameter changes, and user information changes.

[0030] In addition, to achieve the above-mentioned purpose, the present invention further provides a device data query apparatus, characterized in that the device data query apparatus comprises:

[0031] The communication module is used to obtain the change data of the device and encapsulate the change data into event information;

[0032] A business module, used to determine the event type corresponding to the event information, and convert the event information into data to be queried according to the event type;

[0033] The query module is used to receive input query parameters and obtain target data corresponding to the query parameters from the data to be queried.

[0034] In addition, to achieve the above-mentioned purpose, the present invention also provides a server, which includes a memory, a processor, and a device data query program stored in the memory and executable on the processor, wherein: when the device data query program is executed by the processor, the steps of the device data query method described above are implemented.

[0035] In addition, to achieve the above purpose, the present invention also provides a computer-readable storage medium, on which a device data query program is stored, and when the device data query program is executed by a processor, the steps of the device data query method described above are implemented.

[0036] The device data query method in the present invention first obtains the change data of the device and encapsulates the change data into event information, which can package and classify the scattered original data transmitted by the Internet of Things device, providing convenience for improving the subsequent data processing efficiency. Then, by determining the event type corresponding to the event information and converting the event information into data to be queried according to the event type, the event information can be converted into data to be queried that can be quickly queried and directly displayed according to different event types, thereby improving the efficiency of data retrieval. Finally, by receiving the input query parameters and obtaining the target data corresponding to the query parameters from the data to be queried, the changed device data can be quickly obtained from the database, which is convenient for users and technicians to understand the operating status of the Internet of Things device in a timely manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 A schematic diagram of the terminal structure of the hardware operating environment of the server involved in the embodiment of the present invention;

[0038] Figure 2This is a flow chart of a first embodiment of a device data query method of the present invention;

[0039] Figure 3 A schematic diagram of a data structure involved in the second embodiment of the device data query method of the present invention;

[0040] Figure 4 A schematic diagram of an overall process involved in the third embodiment of the device data query method of the present invention;

[0041] Figure 5 It is a schematic diagram of a device data query apparatus involved in the device data query method of the present invention. DETAILED DESCRIPTION

[0042] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0043] like Figure 1 As shown, Figure 1 It is a schematic diagram of the terminal structure of the hardware operating environment of the server involved in the embodiment of the present invention.

[0044] like Figure 1 As shown, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display (Display), an input unit such as a control panel, and the optional user interface 1003 may also include a standard wired port and a wireless port. The network interface 1004 may optionally include a standard wired port and a wireless port (such as a 5G port). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001. The memory 1005 as a computer storage medium may include a device data query program.

[0045] Those skilled in the art will understand that Figure 1 The terminal structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0046] like Figure 2 As shown, Figure 2 : is a flow chart of a first embodiment of a device data query method of the present invention. In this embodiment, the method includes:

[0047] Step S10, obtaining the change data of the device, and encapsulating the change data into event information;

[0048] The devices in this embodiment refer to various large and small devices that are connected to the Internet through the Internet of Things technology. They can be household devices, such as rice cookers, refrigerators, humidifiers, televisions, electric curtains, indoor monitoring, etc., or various devices used in production and work, such as large trucks, machine tools, medical equipment, etc. With the development of Internet of Things technology today, it is only necessary to configure module components such as data acquisition and control cards, Internet of Things wireless I / O modules, and remote Ethernet I / O modules on the devices that need to be monitored as needed to achieve remote monitoring and control. Because the application of Internet of Things technology is simple and has rich functions, in order to enhance the user experience, it is necessary to improve the efficiency of monitoring. At present, the control of Internet of Things devices can be efficiently and timely controlled when the network conditions are good, but it is very necessary to improve the efficiency of Internet of Things device monitoring, especially the monitoring efficiency when the status of Internet of Things devices changes, because monitoring is the basis of control. In many cases, it is necessary to perform corresponding control only when the relevant data of the device is monitored to change.

[0049] When the data of an IoT device changes, the IoT device can proactively report the changed data and push a message to the server connected to the IoT device. The communication module of the server can also periodically query the IoT device or directly obtain the full data of the IoT device, compare the current full data with the previous historical data, and find out the changed parameters and other data. The data here includes but is not limited to several types of data: basic device information, user information, group information, project information, device status information, device tag information, etc. For example, basic device information includes device name, device type, device number, hardware version, communication protocol, etc.; device status information includes online and offline status, upgrade status, alarm status, etc.; user information may include user account, permission information, usage records, etc.

[0050] In this embodiment, after the communication module of the server obtains the changed data of the IoT device, it will package the changed data into various events, and then send the various events to the business module in the server. Among them, for some IoT devices, the change data of various event types will be transmitted in batches, so that the server can directly package and package the change data of each batch, and directly confirm the event type corresponding to each batch of change data. However, there are also many IoT devices that directly transmit all the scattered data that have changed to the server without any processing. In this case, the server needs to classify and package these scattered data, such as packaging all the change data of the IoT device from online to offline, and confirm that the event type corresponding to the packaged event is a device status change.

[0051] In one embodiment, before step S10, the following steps are included:

[0052] Step a, detecting all data in the device according to a preset frequency, and determining whether all the data has changed;

[0053] Step b: if all the data are changed, determine the changed data in all the data.

[0054] The communication module of the server will query the IoT device at a preset frequency. After obtaining the full data in the IoT device, it will compare the current full data with the most recent historical full data to find the changed data compared to the most recent historical full data. After determining the changed data, the communication module of the server can send it to the business module of the server through the message queue. In order to prevent network packet loss during data transmission between the communication module and the business module, and the situation where the data that should be sent is missed due to communication module problems, if the device no longer changes the information at this time, it will never be able to display the correct information. The business module of the server can actively send an active synchronization request to the communication module at a regular time. After receiving the request, the communication module will encapsulate the changed data of the IoT device and send it to the business module through the message queue. Specifically, in response to this problem, the corresponding program of the business module in the server will be divided according to the number of the IoT device, and the communication module will be regularly sent to actively query the current status of the device, so as to achieve the effect of state calibration. This approach can not only compensate for data, but also reduce the processing pressure between services through segmented query.

[0055] Step S20, determining the event type corresponding to the event information, and converting the event information into data to be queried according to the event type;

[0056] Specifically, the event types include device status changes, device basic parameter changes, and user information changes.

[0057] A data structure table corresponding to each event type is pre-stored in the server system. The event information is converted into data to be queried according to a preset format consisting of field names and field types in the data structure table, that is, the event information is formatted according to the preset format.

[0058] In another embodiment, after the step of converting the event information into data to be queried according to the event type, the method further includes:

[0059] The data to be queried is stored as a virtual device individual in the MongonDB database. MongoDB is a database based on distributed file storage, written in C++ language, and is designed to provide a scalable, high-performance data storage solution for WEB applications.

[0060] In yet another embodiment, the step S20 further includes:

[0061] Determine the event type corresponding to the event information, and retrieve the data change record corresponding to the event type;

[0062] If the data change record is retrieved, then read the record time corresponding to the data change record;

[0063] Obtaining a current time node, and determining whether a difference between the current time node and the recording time is less than a preset time interval;

[0064] If it is greater than a preset time interval, a step of converting the event information into data to be queried according to the event type is executed.

[0065] Before the business module processes the event information, it needs to determine whether the event information has been processed before to prevent the server from endlessly repeating the task of converting data.

[0066] Specifically, each time event information is converted into data to be queried, this event will be recorded. In order to save cache or storage space, only the event type needs to be recorded in the data change record, and there is no need to record the specific event information in detail. If the same event type is transmitted to the business module, it is necessary to read the time when the data change record of the event type is generated, and subtract the time when the data change record is generated from the current time point to obtain a difference. If this difference is greater than the preset time interval, continue to execute the next step. If it is less than or equal to the preset time interval, it is determined to be a repeated push of the same event information, and the next step is stopped. This can prevent the server from doing useless work and save server efficiency. In addition, only the event type is recorded in the data change record, and the required server disk capacity is extremely low, saving server capacity.

[0067] Step S30: receiving an input query parameter, and acquiring target data corresponding to the query parameter from the data to be queried.

[0068] The query parameters here can be input by users or technicians through a visual interface, and then the background will automatically configure SQL (Structured Query Language) according to the input parameters, so that the target data required by users or technicians can be finally obtained from the data to be queried stored in the MongonDB database. The target data here is simply the intuitive data obtained from the initial change data through the above transformation process. In addition to users or technicians being able to query the target data, each data to be queried can also generate corresponding push messages, which are displayed in a carousel through push messages to remind users or technicians that the relevant data of the IoT device has changed.

[0069] The device data query method in the present invention first obtains the change data of the device and encapsulates the change data into event information, which can package and classify the scattered original data transmitted by the Internet of Things device, providing convenience for improving the subsequent data processing efficiency. Then, by determining the event type corresponding to the event information and converting the event information into data to be queried according to the event type, the event information can be converted into data to be queried that can be quickly queried and directly displayed according to different event types, thereby improving the efficiency of data retrieval. Finally, by receiving the input query parameters and obtaining the target data corresponding to the query parameters from the data to be queried, the changed device data can be quickly obtained from the database, which is convenient for users and technicians to understand the operating status of the Internet of Things device in a timely manner.

[0070] Furthermore, based on the first embodiment of the device data query method of the present invention, a second embodiment of the device data query method of the present invention is proposed. In this embodiment, the step of converting the event information into data to be queried according to the event type includes:

[0071] Step c, obtaining a data structure table corresponding to the event type;

[0072] Step d, determining the event data in the event information, and determining the data structure corresponding to the event data in the data structure table;

[0073] Step e, converting the event data into corresponding formatted data according to the data structure;

[0074] Step f: generating the data to be queried according to the formatted data.

[0075] In this embodiment, the data structure table corresponding to the event type can be referred to Figure 3 , taking this as an example, Figure 3 This is a schematic diagram of a data structure involved in the second embodiment of the device data query method of the present invention. As shown in the figure, the data structure table is a part of the schematic diagram corresponding to the event type of the device status change. The data structure table corresponding to various event types contains at least two items: field name and field type. The field name _id represents the device type, and the corresponding field type is int, that is, the integer field type. The other deviceName refers to the device name, and the corresponding field type is string. The remaining devicePass in the table refers to the communication password of the device, deviceNo represents the device number, deviceHardver represents the hardware version, and deviceSoftver represents the software version. The field types corresponding to these field names are all string field types.

[0076] While obtaining the data structure table corresponding to the event type, traverse all event data in the event. The event data here can be distinguished from the above-mentioned change data. It is just that the scattered change data is sorted and each change data is packaged into different events to become event data. Determine the data structure corresponding to each event data, that is, the corresponding field name and field type. Specifically, fuzzy match each event data with the field name in the data structure table, determine the field name with the highest matching degree, and then convert the event data into the field name and the corresponding field type, that is, complete the formatting of the event data, and use the collection of all formatted data as the data to be queried.

[0077] In one embodiment, the step f comprises:

[0078] Step g, determining whether there is device coding data in the formatted data;

[0079] Step h, if the device code data does not exist in the formatted data, obtaining the device code of the device and converting the device code into the device code data;

[0080] Step i: taking the set of the formatted data and the device coded data as the data to be queried.

[0081] After the event data is formatted, it is determined whether there is device code data in the formatted data, that is, whether there is data with a field name of deviceNo. If the data exists, a collection of all formatted data is used as data to be queried.

[0082] If there is no data with the field name deviceNo in the formatted data, the device code of the IoT device is obtained. Specifically, the business module can directly inquire the communication module, and then the communication module forwards the inquiry instruction to the IoT device, and finally the IoT device reports its own device code. Alternatively, each time the IoT device transmits data to the server, the server records the device code corresponding to the IoT device each time data is transmitted, and the business module directly reads the device code corresponding to the formatted data from the server cache.

[0083] After obtaining the device code, no matter what format the device code is in, such as text txt format, the device code is formatted into device code data in the same format as the above formatted data, and finally the entire set of formatted data and device code data is used as the data to be queried. In this way, when users or technicians query data related to a certain IoT device, they only need to enter the parameters of the device code to directly locate all the collection data associated with the device code in the data to be queried.

[0084] In another embodiment, the step f further comprises:

[0085] Step j, obtaining a service tag corresponding to the formatted data;

[0086] Step k, converting the service tag into tag data, and associating the tag data with the formatted data;

[0087] Step 1: taking the set of the formatted data and the tag data associated with the formatted data as data to be queried.

[0088] In order to further improve the efficiency of querying the target data from the data to be queried, label data can be added to each event data or formatted data according to the purpose of the IoT device and the actual needs of the user or technician. According to actual needs, multiple business labels can be configured in the server. For example, business labels can be configured according to the characteristics of IoT devices, such as large equipment, household equipment, office equipment, small equipment, life equipment, medical equipment, etc. The initial business label text is formatted into label data, and the label data is added to the formatted data matching the business label. In simple terms, the above process is to format the business label into label data and add it to the original formatted data to form a new formatted data, that is, a label is added to each formatted data. Finally, all the formatted data and the collection of label data associated with each formatted data are used as the data to be queried. By labeling each event data or formatted data in this way, the actual needs of users can be met, and the target data they want can be quickly found according to their own custom labels, which improves the efficiency of users in finding data and enhances the user experience.

[0089] In addition, in another embodiment, the device code, formatted data, and the set of tag data associated with the formatted data can be used as the data to be queried, that is, a virtual device individual can be abstracted in the form of device ID-device status*n-device other attributes*n-business tag*n and stored in the MongonDB database, so that users or technicians can quickly search for related data by inputting parameters contained in the formatted data or by device codes or customary business tags, meeting the user's diverse search needs. For example, to query a user's online large-scale equipment:

[0090] Enter the user parameters: currently logged in user, enter the online status: online, enter the business tag: large equipment, and then query according to these three input parameters. Of course, the input business tag can also be replaced with the equipment code, which will not be repeated here.

[0091] Furthermore, based on the above-mentioned embodiment of the present invention, a third embodiment of the device data query method of the present invention is proposed. In this embodiment, after the step of converting the event information into data to be queried according to the event type, the method further includes:

[0092] Determine whether the data to be queried is successfully converted;

[0093] If the conversion is not successful, the node of the process of converting the event information into the data to be queried is recorded;

[0094] Starting the conversion task corresponding to the node and determining whether the conversion task can be executed;

[0095] If the conversion task cannot be executed, a message indicating the conversion failure is pushed.

[0096] That is, this embodiment provides an exception handling mechanism, which is mainly a correction mechanism for the exceptions that occur when the relevant programs of the business module convert data. The abnormal behavior in the event triggering / event processing is captured and recorded through the Spring AOP mechanism. The format of the record is: device number-event content-error information-time. Then customize the re-execution of the wrong operation. If the retry still fails, an alarm will be pushed to the operation and maintenance personnel for error troubleshooting. In this way, it can realize automatic trial and error of the server and reduce the workload of technical personnel. It can also report to the technical personnel in time when the problem cannot be solved after trial and error, so that the technical personnel can find and solve the problem in time, which improves the efficiency of solving abnormal problems.

[0097] For further understanding of the present invention, please refer to Figure 4 , Figure 4 This is a schematic diagram of the overall process involved in the third embodiment of the device data query method of the present invention. As shown in the figure, first, the device data outside the server is transmitted to the communication module in the server to encapsulate the device data to obtain an event, and then the event is sent to the event processing module in the business module for data conversion and other processing. Finally, the converted data is stored in the storage module in the business module, that is, the MongoDB database. At this time, the device shadow is automatically updated in the MongoDB database. The device shadow here refers to the data mirroring of the device's hot information. If the above processes are all carried out normally and ended smoothly, if abnormalities occur in the event processing module and the storage module, it is necessary to perform exception processing and alarm processing, wherein the exception processing and alarm processing are handled by the verification module in the server. If the automatic processing is successful, the task that the corresponding node has not completed will continue to be executed. If the automatic processing is not successful, the relevant abnormality and alarm information will be pushed to the technician.

[0098] In addition, refer to Figure 5 The present invention also provides a device data query device, the device data query device comprising:

[0099] The communication module A10 is used to obtain the change data of the device and encapsulate the change data into event information;

[0100] The business module A20 is used to determine the event type corresponding to the event information, and convert the event information into data to be queried according to the event type;

[0101] The query module A30 is used to receive input query parameters and obtain target data corresponding to the query parameters from the data to be queried.

[0102] Optionally, the communication module A10 is further used for:

[0103] Detect all data in the device according to a preset frequency, and determine whether all the data has changed;

[0104] If all the data are changed, the changed data among all the data are determined.

[0105] Optionally, the business module A20 is further used to:

[0106] Obtain a data structure table corresponding to the event type;

[0107] Determine the event data in the event information, and determine the data structure corresponding to the event data in the data structure table;

[0108] According to the data structure, converting the event data into corresponding formatted data;

[0109] The data to be queried is generated according to the formatted data.

[0110] Optionally, the business module A20 is further used to:

[0111] Determining whether device encoding data exists in the formatted data;

[0112] If the device code data does not exist in the formatted data, obtaining the device code of the device and converting the device code into the device code data;

[0113] The set of the formatted data and the device code data is used as the data to be queried.

[0114] Optionally, the business module A20 is further used to:

[0115] Obtaining a service tag corresponding to the formatted data;

[0116] converting the service tag into tag data, and associating the tag data with the formatted data;

[0117] The set of the formatted data and the tag data associated with the formatted data is used as data to be queried.

[0118] Optionally, the business module A20 is further used to:

[0119] Determine the event type corresponding to the event information, and retrieve the data change record corresponding to the event type;

[0120] If the data change record is retrieved, then read the record time corresponding to the data change record;

[0121] Obtaining a current time node, and determining whether a difference between the current time node and the recording time is less than a preset time interval;

[0122] If it is greater than a preset time interval, the event information is converted into data to be queried according to the event type.

[0123] Optionally, the business module A20 is further used to:

[0124] The event types include device status changes, device basic parameter changes, and user information changes.

[0125] The specific implementation of the device data query apparatus of the present invention is basically the same as the embodiments of the device data query method described above, and will not be described in detail here.

[0126] In addition, the present invention also proposes a server, which includes a memory, a processor, and a device data query program stored in the memory and executable on the processor, and when the processor executes the device data query program, the steps of the device data query method described in the above embodiment are implemented.

[0127] The specific implementation of the server of the present invention is basically the same as the various embodiments of the above-mentioned device data query method, and will not be repeated here.

[0128] In addition, the present invention also proposes a computer-readable storage medium, characterized in that the computer-readable storage medium includes a device data query program, and when the device data query program is executed by a processor, the steps of the device data query method described in the above embodiment are implemented.

[0129] The specific implementation of the computer-readable storage medium of the present invention is basically the same as the various embodiments of the above-mentioned device data query method, and will not be repeated here.

[0130] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0131] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a TV, mobile phone, computer, server, car machine, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0132] In the present invention, the terms "first", "second", "third", "fourth" and "fifth" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0133] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0134] Although the embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It is understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art can change, modify and replace the above embodiments within the scope of the present invention, and these changes, modifications and replacements should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A device data query method, characterized in that: The device data query method comprises the following steps: Acquire change data of the device, and encapsulate the change data into event information; Determine the event type corresponding to the event information, and convert the event information into data to be queried according to the event type; Receiving an input query parameter, and acquiring target data corresponding to the query parameter from the data to be queried; The step of converting the event information into data to be queried according to the event type includes: Obtaining a data structure table corresponding to the event type, wherein the data structure table includes: a field name and a field type; Determine the event data in the event information, and perform fuzzy matching between the event data and the field names in the data structure table to determine the field name with the highest matching degree; Convert the event data into the field name with the highest matching degree and the corresponding field type to obtain formatted data corresponding to the event data; The data to be queried is generated according to the formatted data.

2. The device data query method according to claim 1, characterized in that: Before the step of obtaining the change data of the device and encapsulating the change data into event information, the method includes: Detect all data in the device according to a preset frequency, and determine whether all the data has changed; If all the data are changed, the changed data among all the data are determined.

3. The device data query method according to claim 2, characterized in that: The step of generating the data to be queried according to the formatted data comprises: Determining whether device encoding data exists in the formatted data; If the device code data does not exist in the formatted data, obtaining the device code of the device and converting the device code into the device code data; The set of the formatted data and the device code data is used as the data to be queried.

4. The device data query method according to claim 2, characterized in that: The step of generating the data to be queried according to the formatted data further includes: Obtaining a service tag corresponding to the formatted data; converting the service tag into tag data, and associating the tag data with the formatted data; The set of the formatted data and the tag data associated with the formatted data is used as data to be queried.

5. The device data query method according to claim 1, characterized in that: The step of determining the event type corresponding to the event information and converting the event information into data to be queried according to the event type further includes: Determine the event type corresponding to the event information, and retrieve the data change record corresponding to the event type; If the data change record is retrieved, then read the record time corresponding to the data change record; Obtaining a current time node, and determining whether a difference between the current time node and the recording time is less than a preset time interval; If it is greater than a preset time interval, the event information is converted into data to be queried according to the event type.

6. The device data query method according to claim 1, characterized in that: The event types include device status changes, device basic parameter changes, and user information changes.

7. A device data query device, characterized in that: The device data query device comprises: The communication module is used to obtain the change data of the device and encapsulate the change data into event information; A business module, used to determine the event type corresponding to the event information, and convert the event information into data to be queried according to the event type; A query module, used to receive an input query parameter and obtain target data corresponding to the query parameter from the data to be queried; The business module is also used for: Obtaining a data structure table corresponding to the event type, wherein the data structure table includes: a field name and a field type; Determine the event data in the event information, and perform fuzzy matching between the event data and the field names in the data structure table to determine the field name with the highest matching degree; Convert the event data into the field name with the highest matching degree and the corresponding field type to obtain formatted data corresponding to the event data; The data to be queried is generated according to the formatted data.

8. A server, characterized in that: The server includes a memory, a processor, and a device data query program stored in the memory and executable on the processor, wherein: when the device data query program is executed by the processor, the steps of the device data query method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a device data query program, and when the device data query program is executed by a processor, the steps of the device data query method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Managing change events for devices in an enterprise system

    CN106605210A

  • Data query method, device and system, computer equipment and storage medium

    CN110704422A

  • Control method and device for state query of Internet of Things equipment

    CN111859109A

  • Internet of things equipment state event processing method and device and electronic equipment

    CN112398955A