[go: up one dir, main page]

CN111737291A - Method, apparatus and database for querying equipment information - Google Patents

Method, apparatus and database for querying equipment information Download PDF

Info

Publication number
CN111737291A
CN111737291A CN202010531434.XA CN202010531434A CN111737291A CN 111737291 A CN111737291 A CN 111737291A CN 202010531434 A CN202010531434 A CN 202010531434A CN 111737291 A CN111737291 A CN 111737291A
Authority
CN
China
Prior art keywords
data
device attribute
query
user
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010531434.XA
Other languages
Chinese (zh)
Other versions
CN111737291B (en
Inventor
赵迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202010531434.XA priority Critical patent/CN111737291B/en
Publication of CN111737291A publication Critical patent/CN111737291A/en
Application granted granted Critical
Publication of CN111737291B publication Critical patent/CN111737291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application relates to the technical field of information query and discloses a method for querying equipment information. The method for inquiring the equipment information comprises the following steps: the server obtains the device attribute and a pre-created query interface of the set data, and queries the device attribute value in the query interface of the set data according to the device attribute, wherein the set data is stored in a partial data table of a database, the partial data table corresponds to the authority of an authorized user, and the data table comprises the device attribute and the device attribute value corresponding to the device attribute. The method for inquiring the equipment information can reduce the time consumption of the inquiry process. The application also discloses a device for inquiring the equipment information and a database for storing the equipment information.

Description

用于查询设备信息的方法、装置和数据库Method, apparatus and database for querying equipment information

技术领域technical field

本申请涉及信息查询技术领域,例如涉及一种用于查询设备信息的方法、装置和数据库。The present application relates to the technical field of information query, for example, to a method, apparatus and database for querying device information.

背景技术Background technique

目前,大多数的查询数据的产品可一对一针对性地查询设备数据,即,一次只能查询一个设备的一种数据。然而在实际应用中,往往需要查询大量数据,为了实现批量数据的查询,现有技术中将多个查询指令组合成一个查询表单,并发送该查询表单,服务器接收到该查询表单后,拆分出各个查询指令,依据各个查询指令依次在数据库中查询,再返回查询结果。At present, most data query products can query device data one-to-one, that is, only one type of data of one device can be queried at a time. However, in practical applications, it is often necessary to query a large amount of data. In order to realize the query of batch data, in the prior art, multiple query instructions are combined into a query form, and the query form is sent. After the server receives the query form, it splits the query form. Each query command is issued, the database is queried in turn according to each query command, and the query result is returned.

在实现本公开实施例的过程中,发现相关技术中至少存在如下问题:In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art:

这种查询设备信息的方法耗时长。This method of querying device information takes a long time.

发明内容SUMMARY OF THE INVENTION

为了对披露的实施例的一些方面有基本的理解,下面给出了简单的概括。所述概括不是泛泛评述,也不是要确定关键/重要组成元素或描绘这些实施例的保护范围,而是作为后面的详细说明的序言。In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended to be an extensive review, nor to identify key/critical elements or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.

本公开实施例提供了一种用于查询设备信息的方法、装置和数据库,以解决查询批量信息的过程耗时长、实时性差的技术问题。The embodiments of the present disclosure provide a method, an apparatus and a database for querying device information, so as to solve the technical problems that the process of querying batch information is time-consuming and has poor real-time performance.

在一些可选的实施例中,用于查询设备信息的方法应用于服务器,所述用于查询设备信息的方法包括:In some optional embodiments, a method for querying device information is applied to a server, and the method for querying device information includes:

获得设备属性和预创建的设定数据的查询接口;A query interface for obtaining device properties and pre-created setting data;

根据所述设备属性在所述设定数据的查询接口查询设备属性值;Query the device attribute value in the query interface of the setting data according to the device attribute;

其中,所述设定数据存储在数据库的部分数据表中,所述部分数据表与授权用户的权限相对应,数据表包括所述设备属性及其对应的设备属性值。The setting data is stored in a partial data table in the database, the partial data table corresponds to the authority of the authorized user, and the data table includes the device attributes and their corresponding device attribute values.

可选地,所述设定数据的查询接口是通过以下方式创建的:Optionally, the query interface for the setting data is created in the following manner:

获得授权用户的权限;Access to authorized users;

匹配所述授权用户的每个权限与数据结构的描述信息,确定所述设定数据;Match the description information of each authority of the authorized user with the data structure, and determine the setting data;

建立查询接口;Create a query interface;

建立所述查询接口与所述设定数据的映射关系;establishing a mapping relationship between the query interface and the setting data;

设置所述查询接口的预设查询规则。A preset query rule of the query interface is set.

可选地,获得所述授权用户的权限,包括:Optionally, obtaining the authority of the authorized user includes:

获得用户信息;obtain user information;

在授权用户列表中匹配所述用户信息,判断所述用户信息是否为授权用户信息;Match the user information in the authorized user list, and determine whether the user information is authorized user information;

在所述用户信息为授权用户信息的情况下,根据所述用户信息在设定接口查询所述授权用户的权限。In the case that the user information is authorized user information, the authority of the authorized user is queried on the setting interface according to the user information.

可选地,根据所述设备属性在设定数据的查询接口查询设备属性值,包括:Optionally, query the device attribute value on the query interface of the setting data according to the device attribute, including:

将所述设备属性调整为预设查询结构;其中,所述预设查询结构与所述设定数据的查询接口的预设查询规则相适配;Adjusting the device attribute to a preset query structure; wherein, the preset query structure is adapted to the preset query rules of the query interface of the set data;

根据所述预设查询结构在所述设定数据的查询接口查询所述设备属性值。The device attribute value is queried on the query interface of the setting data according to the preset query structure.

可选地,获得设备属性,包括:Optionally, obtain device properties, including:

获得设备身份标识号(Identity document,ID);Obtain the device identification number (Identity document, ID);

根据所述设备ID读取所述设备属性。The device attribute is read according to the device ID.

可选地,根据所述设备ID读取所述设备属性,包括:Optionally, reading the device attribute according to the device ID, including:

根据所述设备ID在远程字典服务(Remote Dictionary Server,Redis)中读取所述设备属性;According to the device ID, read the device attribute in a remote dictionary service (Remote Dictionary Server, Redis);

在所述Redis中无法成功读取所述设备属性的情况下,根据所述设备ID在数据库中读取所述设备属性。In the case that the device attribute cannot be successfully read in the Redis, the device attribute is read in the database according to the device ID.

在一些可选的实施例中,用于查询设备信息的方法应用于终端,所述用于查询设备信息的方法包括:In some optional embodiments, the method for querying device information is applied to a terminal, and the method for querying device information includes:

向服务器发送设备ID;其中,所述设备ID用于查询设备属性;Send a device ID to the server; wherein, the device ID is used to query device attributes;

接收服务器发送的设备属性值;其中,所述设备属性值是根据所述设备属性在设定数据的查询接口查询的,所述设定数据存储在数据库的部分数据表中,所述部分数据表与授权用户的权限相对应,数据表包括所述设备属性及其对应的设备属性值;Receive the device attribute value sent by the server; wherein, the device attribute value is queried in the query interface of the setting data according to the device attribute, and the setting data is stored in a part of the data table of the database, and the part of the data table Corresponding to the authority of the authorized user, the data table includes the device attribute and its corresponding device attribute value;

显示所述设备属性值。Displays the device property value.

可选地,在接收服务器发送的设备属性值之前,用于查询设备信息的方法还包括:Optionally, before receiving the device attribute value sent by the server, the method for querying device information further includes:

获得用户信息;obtain user information;

向所述服务器发送所述用户信息;其中,所述用户信息用于判断当前用户是否具有访问数据的权限。Sending the user information to the server; wherein the user information is used to determine whether the current user has the right to access data.

在一些可选的实施例中,用于存储设备信息的数据库包括:In some optional embodiments, the database for storing device information includes:

配置结构模块,被配置为生成设定数据的查询接口;a configuration structure module configured to generate a query interface for setting data;

数据结构模块,存储有设定数据,所述设定数据包括设备属性及其对应的设备属性值。The data structure module stores setting data, and the setting data includes device attributes and their corresponding device attribute values.

可选地,用于存储设备信息的数据库还包括:Optionally, the database for storing device information further includes:

授权结构模块,存储用户权限及其对应的授权数据结构;The authorization structure module stores user rights and their corresponding authorization data structures;

所述数据结构模块存储有授权数据,所述授权数据结构与所述授权数据具有映射关系;The data structure module stores authorization data, and the authorization data structure has a mapping relationship with the authorization data;

所述配置结构模块还被配置为确定特定用户权限对应的全部授权数据为设定数据。The configuration structure module is further configured to determine all authorization data corresponding to a specific user authority as setting data.

在一些可选的实施例中,用于查询设备信息的装置应用于服务器,所述用于查询设备信息的装置包括:In some optional embodiments, the apparatus for querying equipment information is applied to a server, and the apparatus for querying equipment information includes:

第一获得模块,被配置为获得设备属性和预创建的设定数据的查询接口;a first obtaining module, configured to obtain a query interface for device attributes and pre-created setting data;

查询模块,被配置为根据所述设备属性在所述设定数据的查询接口查询设备属性值;a query module, configured to query the device attribute value at the query interface of the setting data according to the device attribute;

其中,所述设定数据存储在数据库的部分数据表中,所述部分数据表与授权用户的权限相对应,数据表包括所述设备属性及其对应的设备属性值。The setting data is stored in a partial data table in the database, the partial data table corresponds to the authority of the authorized user, and the data table includes the device attributes and their corresponding device attribute values.

可选地,所述第一获得模块包括:Optionally, the first obtaining module includes:

第一获得单元,被配置为获得授权用户的权限;a first obtaining unit, configured to obtain the authority of an authorized user;

匹配单元,被配置为匹配所述授权用户的每个权限与数据结构的描述信息,确定所述设定数据;a matching unit, configured to match each authority of the authorized user with the description information of the data structure, and determine the setting data;

第一创建单元,被配置为建立查询接口;a first creating unit, configured to create a query interface;

第二创建单元,被配置为建立所述查询接口与所述设定数据的映射关系;a second creating unit, configured to establish a mapping relationship between the query interface and the setting data;

设置单元,被配置为设置所述查询接口的预设查询规则。a setting unit, configured to set a preset query rule of the query interface.

可选地,所述第一获得单元被具体配置为:Optionally, the first obtaining unit is specifically configured as:

获得用户信息;obtain user information;

在授权用户列表中匹配所述用户信息,判断所述用户信息是否为授权用户信息;Match the user information in the authorized user list, and determine whether the user information is authorized user information;

在所述用户信息为授权用户信息的情况下,根据所述用户信息在设定接口查询所述授权用户的权限。In the case that the user information is authorized user information, the authority of the authorized user is queried on the setting interface according to the user information.

可选地,所述查询模块包括:Optionally, the query module includes:

调整单元,被配置为将所述设备属性调整为预设查询结构;其中,所述预设查询结构与所述设定数据的查询接口的预设查询规则相适配;an adjustment unit configured to adjust the device attribute to a preset query structure; wherein the preset query structure is adapted to a preset query rule of the query interface of the setting data;

查询单元,被配置为根据所述预设查询结构在所述设定数据的查询接口查询所述设备属性值。The query unit is configured to query the device attribute value on the query interface of the setting data according to the preset query structure.

可选地,所述第一获得模块包括:Optionally, the first obtaining module includes:

第二获得单元,被配置为获得设备ID;a second obtaining unit, configured to obtain the device ID;

读取单元,被配置为根据所述设备ID读取所述设备属性。a reading unit, configured to read the device attribute according to the device ID.

可选地,所述读取单元被具体配置为:Optionally, the reading unit is specifically configured to:

根据所述设备ID在Redis中读取所述设备属性;Read the device attribute in Redis according to the device ID;

在所述Redis中无法成功读取所述设备属性的情况下,根据所述设备ID在数据库中读取所述设备属性。In the case that the device attribute cannot be successfully read in the Redis, the device attribute is read in the database according to the device ID.

在一些可选的实施例中,用于查询设备信息的装置应用于终端,所述用于查询设备信息的装置包括:In some optional embodiments, the device for querying device information is applied to a terminal, and the device for querying device information includes:

第一发送模块,被配置为向服务器发送设备ID;其中,所述设备ID用于查询设备属性;a first sending module, configured to send a device ID to the server; wherein, the device ID is used to query device attributes;

第一接收模块,被配置为接收服务器发送的设备属性值;其中,设备属性值是根据所述设备属性在设定数据的查询接口查询的,所述设定数据存储在数据库的部分数据表中,所述部分数据表与授权用户的权限相对应,数据表包括所述设备属性及其对应的设备属性值;The first receiving module is configured to receive the device attribute value sent by the server; wherein, the device attribute value is queried in the query interface of the setting data according to the device attribute, and the setting data is stored in a part of the data table of the database , the part of the data table corresponds to the authority of the authorized user, and the data table includes the device attribute and its corresponding device attribute value;

显示模块,被配置为显示所述设备属性值。A display module configured to display the device property value.

可选地,用于查询设备信息的装置还包括:Optionally, the device for querying device information further includes:

第二获得模块,被配置为在接收服务器发送的设备属性值之前,获得用户信息;The second obtaining module is configured to obtain user information before receiving the device attribute value sent by the server;

第二发送模块,被配置为向所述服务器发送所述用户信息;其中,所述用户信息用于判断当前用户是否具有访问数据的权限。The second sending module is configured to send the user information to the server; wherein, the user information is used to determine whether the current user has the right to access data.

本公开实施例提供的用于查询设备信息的方法、装置和数据库,可以实现以下技术效果:The method, device, and database for querying device information provided by the embodiments of the present disclosure can achieve the following technical effects:

在需要查询设备属性值时,根据设备属性在设定数据的查询接口进行查询,只需访问存储设定数据的数据表,即可获得设备属性值,而无需访问全部数据库,减少了查询过程的耗时。When the device attribute value needs to be queried, according to the device attribute, the query interface of the set data can be queried, and the device attribute value can be obtained only by accessing the data table storing the set data, without accessing the entire database, which reduces the query process. time consuming.

以上的总体描述和下文中的描述仅是示例性和解释性的,不用于限制本申请。The foregoing general description and the following description are exemplary and explanatory only and are not intended to limit the application.

附图说明Description of drawings

一个或一个以上实施例通过与之对应的附图进行示例性说明,这些示例性说明和附图并不构成对实施例的限定,附图中具有相同参考数字标号的元件示为类似的元件,并且其中:One or more embodiments are exemplified by the accompanying drawings, which do not constitute limitations of the embodiments, and elements with the same reference numerals in the drawings are shown as similar elements, and where:

图1是本公开实施例提供的一种用于查询设备信息的方法所涉及的实际环境的环境示意图;FIG. 1 is an environmental schematic diagram of an actual environment involved in a method for querying device information provided by an embodiment of the present disclosure;

图2是本公开实施例提供的一种用于查询设备信息的方法的示意图;2 is a schematic diagram of a method for querying device information provided by an embodiment of the present disclosure;

图3是本公开实施例提供的一种用于创建设定数据的查询接口的示意图;3 is a schematic diagram of a query interface for creating setting data provided by an embodiment of the present disclosure;

图4是本公开实施例提供的一种用于获得授权用户的权限的示意图;FIG. 4 is a schematic diagram for obtaining the authority of an authorized user provided by an embodiment of the present disclosure;

图5是本公开实施例提供的一种用于在设定数据的查询接口查询设备属性值的示意图;5 is a schematic diagram of querying device attribute values on a query interface for setting data provided by an embodiment of the present disclosure;

图6是本公开实施例提供的一种用于查询设备信息的方法的示意图;6 is a schematic diagram of a method for querying device information provided by an embodiment of the present disclosure;

图7是本公开实施例提供的一种用于查询设备信息的方法的示意图;7 is a schematic diagram of a method for querying device information provided by an embodiment of the present disclosure;

图8是本公开实施例提供的一种用于查询设备信息的方法的示意图;8 is a schematic diagram of a method for querying device information provided by an embodiment of the present disclosure;

图9是本公开实施例提供的一种用于查询设备信息的方法的示意图;9 is a schematic diagram of a method for querying device information provided by an embodiment of the present disclosure;

图10a是本公开实施例提供的一种用于存储设备信息的数据库的示意图;10a is a schematic diagram of a database for storing device information provided by an embodiment of the present disclosure;

图10b是本公开实施例提供的一种用于存储设备信息的数据库的示意图;10b is a schematic diagram of a database for storing device information provided by an embodiment of the present disclosure;

图11a是本公开实施例提供的一种用于查询设备信息的装置的示意图;11a is a schematic diagram of an apparatus for querying device information provided by an embodiment of the present disclosure;

图11b是本公开实施例提供的一种用于查询设备信息的装置的示意图;11b is a schematic diagram of an apparatus for querying device information provided by an embodiment of the present disclosure;

图11c是本公开实施例提供的一种用于查询设备信息的装置的示意图;11c is a schematic diagram of an apparatus for querying device information provided by an embodiment of the present disclosure;

图11d是本公开实施例提供的一种用于查询设备信息的装置的示意图;11d is a schematic diagram of an apparatus for querying device information provided by an embodiment of the present disclosure;

图12a是本公开实施例提供的一种用于查询设备信息的装置的示意图;12a is a schematic diagram of an apparatus for querying device information provided by an embodiment of the present disclosure;

图12b是本公开实施例提供的一种用于查询设备信息的装置的示意图;12b is a schematic diagram of an apparatus for querying device information provided by an embodiment of the present disclosure;

图13是本公开实施例提供的一种用于查询设备信息的装置的示意图。FIG. 13 is a schematic diagram of an apparatus for querying device information provided by an embodiment of the present disclosure.

具体实施方式Detailed ways

为了能够更加详尽地了解本公开实施例的特点与技术内容,下面结合附图对本公开实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本公开实施例。在以下的技术描述中,为方便解释起见,通过多个细节以提供对所披露实施例的充分理解。然而,在没有这些细节的情况下,一个或一个以上实施例仍然可以实施。在其它情况下,为简化附图,熟知的结构和装置可以简化展示。In order to understand the features and technical contents of the embodiments of the present disclosure in more detail, the implementation of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings, which are for reference only and are not intended to limit the embodiments of the present disclosure. In the following technical description, for the convenience of explanation, numerous details are provided to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown simplified in order to simplify the drawings.

本公开实施例的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开实施例的实施例。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含。The terms "first", "second" and the like in the description and claims of the embodiments of the present disclosure 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 so used may be interchanged under appropriate circumstances for the purposes of implementing the embodiments of the disclosure described herein. Furthermore, the terms "comprising" and "having", and any variations thereof, are intended to cover non-exclusive inclusion.

除非另有说明,术语“多个”表示两个或两个以上。Unless stated otherwise, the term "plurality" means two or more.

本公开实施例中,字符“/”表示前后对象是一种“或”的关系。例如,A/B表示:A或B。In the embodiment of the present disclosure, the character "/" indicates that the preceding and following objects are in an "or" relationship. For example, A/B means: A or B.

术语“和/或”是一种描述对象的关联关系,表示可以存在三种关系。例如,A和/或B,表示:A或B,或,A和B这三种关系。The term "and/or" is an associative relationship describing objects, indicating that three relationships can exist. For example, A and/or B, means: A or B, or, A and B three relationships.

目前,大多数的查询数据的产品可一对一针对性地查询设备数据,即,一次只能查询一个设备的一种数据。在本公开实施例中,为了实现批量查询设备的信息,终端向服务器发送设备ID,服务器根据该设备ID获得设备属性,并依据该设备属性在设定数据的查询接口中一次性批量查询设备属性值,只需执行一次查询指令,即可获得设备的多个消息,而无需逐条执行查询设备属性值,减少了执行查询指令的次数,减少了查询时间,提高了查询批量信息过程的实时性。At present, most data query products can query device data one-to-one, that is, only one type of data of one device can be queried at a time. In the embodiment of the present disclosure, in order to query the information of devices in batches, the terminal sends the device ID to the server, the server obtains the device attribute according to the device ID, and according to the device attribute, the device attribute is queried in batches in the query interface of the set data at one time. It only needs to execute the query command once to obtain multiple messages of the device without executing the query device attribute value one by one, which reduces the number of query commands executed, reduces the query time, and improves the real-time performance of the process of querying batch information.

结合图1所示,本公开实施例提供了一种用于查询设备信息的方法所涉及的实际环境的环境示意图。该实施环境中包括终端110和服务器120。With reference to FIG. 1 , an embodiment of the present disclosure provides an environmental schematic diagram of an actual environment involved in a method for querying device information. The implementation environment includes the terminal 110 and the server 120 .

终端110是具有网络访问功能、人机交互功能的电子设备。终端110可以为智能手机、平板电脑、超级移动个人计算机(Ultra-mobile Personal Computer,UMPC)、上网本、个人数字助理(Personal Digital Assistant,PDA)等设备,且不限于此。终端上安装有特定应用程序(Application,APP)。终端110可设置在设备上,也可独立设置。The terminal 110 is an electronic device with a network access function and a human-computer interaction function. The terminal 110 may be a device such as a smart phone, a tablet computer, an Ultra-mobile Personal Computer (UMPC), a netbook, a Personal Digital Assistant (PDA), etc., but is not limited thereto. A specific application (Application, APP) is installed on the terminal. The terminal 110 can be set on the device, or can be set independently.

服务器120可以是一台服务器,或者由若干服务器组成的服务器集群,或者由若干服务器组成的分布式服务器。The server 120 may be one server, or a server cluster consisting of several servers, or a distributed server consisting of several servers.

在一些实际应用中,服务器120为分布式服务器,且服务器120的部署符合服务并发原则、服务分级原则、服务基于授权和服务扩展原则。服务节点(Nodes)分布在用户侧和设备侧,Nodes通过分布式系统的可靠协调系统(ZooKeeper)响应实时服务请求。In some practical applications, the server 120 is a distributed server, and the deployment of the server 120 complies with the principle of service concurrency, the principle of service classification, the principle of service-based authorization, and the principle of service expansion. Service nodes (Nodes) are distributed on the user side and the device side, and Nodes respond to real-time service requests through the reliable coordination system (ZooKeeper) of the distributed system.

结合图2所示,本公开实施例提供了一种用于查询设备信息的方法。该实施例中以该用于查询设备信息的方法应用于图1所示的服务器中来举例说明。用于查询设备信息的方法包括:With reference to FIG. 2 , an embodiment of the present disclosure provides a method for querying device information. In this embodiment, the method for querying device information is applied to the server shown in FIG. 1 as an example. Methods for querying device information include:

S201、获得设备属性和预创建的设定数据的查询接口。S201. Obtain a query interface for device attributes and pre-created setting data.

其中,设备属性指的是设备的可被记录数据的属性。例如,设备属性包括设备详情、设备运行曲线、设备实时状态和设备故障中的一个或多个。Among them, the device attribute refers to the attribute of the device that can be recorded data. For example, device properties include one or more of device details, device operating curves, device real-time status, and device failures.

设备详情可包括:设备下线时间、设备安装时间、首次绑定时间、设备安装地址、设备生产工厂、设备累计在线时长、设备开机时长、设备累计运行时长、设备累计故障报警次数、用户ID、用户最近一次登录时间、用户最近一次登录终端名称中的一个或多个。The equipment details can include: equipment offline time, equipment installation time, first binding time, equipment installation address, equipment production factory, equipment online time, equipment startup time, equipment running time, equipment fault alarm times, user ID, One or more of the last login time of the user and the last login terminal name of the user.

设备运行曲线是设备可调节的特定环境变量随时间变化的曲线。例如,空调可调节室内温度,则设备运行曲线可包括室内温度随时间变化的曲线;冰箱可调节冷藏室温度和冷冻室温度,则设备运行曲线可包括冷藏室温度随时间变化的曲线或冷冻室温度随时间变化的曲线。A device operating curve is a curve of specific environmental variables that can be adjusted by the device over time. For example, if the air conditioner can adjust the indoor temperature, the equipment operation curve can include the curve of the indoor temperature changing with time; the refrigerator can adjust the temperature of the refrigerator compartment and the freezer compartment, then the equipment operation curve can include the curve of the temperature change of the refrigerator compartment or the freezer compartment with time. Curve of temperature versus time.

设备实时状态为设备中各执行器的实时运行状态,例如蜂鸣器的实时运行状态,或者,冰箱/空调压缩机的实时运行状态,或者,设备门的开关状态。The real-time state of the device is the real-time running state of each actuator in the device, such as the real-time running state of the buzzer, or the real-time running state of the refrigerator/air conditioner compressor, or the opening and closing state of the device door.

设备故障可包括故障代码、故障描述以及故障发生时间。Equipment faults can include fault codes, fault descriptions, and when the fault occurred.

可直接接收设备属性,例如,终端向服务器直接发送设备属性,服务器直接获得设备属性。The device properties can be directly received, for example, the terminal directly sends the device properties to the server, and the server directly obtains the device properties.

或者,间接获得设备属性,例如,获得设备ID(接收终端发送的设备ID),根据设备ID读取设备属性。这样,终端只需要向服务器发送设备ID即可,即,用户只需要在终端中选择/输入设备ID,服务即可获得全部设备属性值,减少用户操作,提高用户使用体验。Or, obtain the device attribute indirectly, for example, obtain the device ID (the device ID sent by the receiving terminal), and read the device attribute according to the device ID. In this way, the terminal only needs to send the device ID to the server, that is, the user only needs to select/input the device ID in the terminal, and the service can obtain all device attribute values, which reduces user operations and improves user experience.

可选地,根据设备ID读取设备属性,包括:根据设备ID在Redis中读取设备属性;在Redis中无法成功读取设备属性的情况下,根据设备ID在数据库中读取设备属性。在Redis中读取设备属性,可提高读取速度,进一步地缩短查询设备批量信息的耗时,提高查询批量信息的实时性。Optionally, reading the device properties according to the device ID includes: reading the device properties in Redis according to the device ID; if the device properties cannot be successfully read in Redis, reading the device properties in the database according to the device ID. Reading device attributes in Redis can improve the reading speed, further shorten the time-consuming of querying device batch information, and improve the real-time performance of querying batch information.

相对应地,在设备属性发生变化的情况下,服务器接收设备新的设备属性,并将该设备新的设备属性更新至Redis。便于下一次读取。Correspondingly, when the device attribute changes, the server receives the new device attribute of the device, and updates the new device attribute of the device to Redis. for the next reading.

可选地,设定数据包括设备详情数据、设备运行曲线数据、设备实时状态数据和设备故障数据中的一个或多个。Optionally, the setting data includes one or more of equipment detail data, equipment operation curve data, equipment real-time status data and equipment failure data.

可通过以下方式获得设定数据的查询接口:依据设备ID确定与设备ID相对应的设定数据的查询接口;或者,获得用户信息,依据用户信息确定与用户信息相对应的设定数据的查询接口。The query interface for setting data can be obtained in the following ways: a query interface for determining the setting data corresponding to the device ID according to the device ID; or, obtaining user information, and determining the query interface for setting data corresponding to the user information according to the user information interface.

在一些实际应用中,在用户初次登录,初次查询设备信息时,创建设定数据的查询接口,再获得设备属性以及设定数据的查询接口;在用户非初次登录并查询设备信息时,获得设备属性并直接查询到设定数据的查询接口。In some practical applications, when a user logs in for the first time and queries device information for the first time, a query interface for setting data is created, and then a query interface for device attributes and setting data is obtained; attribute and directly query the query interface of the set data.

在一些实际应用中,在授权用户的权限发生变化时,重新创建设定数据的查询接口,再获得设备属性和设定数据的查询接口。In some practical applications, when the authority of the authorized user changes, the query interface for setting data is re-created, and then the query interface for device attributes and setting data is obtained.

在一些实际应用中,服务器为分布式服务器,例如多机部署的开元分布式服务框架Dubbo服务器,设定数据的查询接口可以为远程过程调用(Remote Procedure Call,RPC)接口。采用多机部署的Dubbo服务器还可以实现服务并发。In some practical applications, the server is a distributed server, such as the Kaiyuan distributed service framework Dubbo server deployed on multiple machines, and the query interface for setting data can be a Remote Procedure Call (RPC) interface. Dubbo servers deployed on multiple machines can also achieve service concurrency.

S202、根据设备属性在设定数据的查询接口查询设备属性值。S202 , query the device attribute value on the query interface of the setting data according to the device attribute.

其中,设定数据存储在数据库的部分数据表中,部分数据表与授权用户的权限相对应,即,部分数据表是数据库中授权用户有访问权限的数据表,数据表包括设备属性及其对应的设备属性值。Among them, the setting data is stored in some data tables in the database, and some data tables correspond to the permissions of authorized users, that is, some data tables are data tables in the database that authorized users have access rights, and the data tables include device attributes and their corresponding value of the device property.

设备属性值为与设备属性相对应的具体值。例如设备属性值包括设备详情值、设备运行曲线值、设备实时状态值和设备故障值中的一个或多个。The device attribute value is a concrete value corresponding to the device attribute. For example, the device attribute value includes one or more of the device detail value, the device operation curve value, the device real-time state value, and the device fault value.

设备详情值可包括:设备下线时间值、设备安装时间值、首次绑定时间值、设备安装地址值、设备生产工厂值、设备累计在线时长值、设备开机时长值、设备累计运行时长值、设备累计故障报警次数值、用户ID值、用户最近一次登录时间值、用户最近一次登录终端名称值中的一个或多个。The device details values can include: device offline time value, device installation time value, first binding time value, device installation address value, device production factory value, device cumulative online time value, device startup time value, device cumulative running time value, One or more of the value of the cumulative number of fault alarms of the device, the value of the user ID, the value of the last login time of the user, and the value of the last login terminal name of the user.

设备运行曲线值是设备可调节的特定环境变量随时间变化的值。例如,空调可调节室内温度,则设备运行曲线值可包括随时间变化的室内温度值;冰箱可调节冷藏室温度和冷冻室温度,则设备运行曲线可包括随时间变化的冷藏室温度值或冷冻室温度值。The device operating curve value is the time-varying value of a specific environmental variable that can be adjusted by the device. For example, if the air conditioner can adjust the indoor temperature, the equipment operation curve value can include the indoor temperature value that changes with time; the refrigerator can adjust the temperature of the refrigerator compartment and the freezer compartment, and the equipment operation curve can include the temperature value of the refrigerator compartment or the freezer temperature value that changes with time. room temperature value.

设备实时状态值包括蜂鸣器的实时运行状态值,或者,冰箱/空调压缩机的实时运行状态值,或者,设备门的开关状态值。The real-time state value of the equipment includes the real-time running state value of the buzzer, or the real-time running state value of the refrigerator/air conditioner compressor, or the opening and closing state value of the device door.

设备故障值可包括故障代码值、故障描述值以及故障发生时间值。其中,故障代码值和故障描述值是预定义的,二者一一对应。故障描述值可为用电故障报警、设备内部故障报警或设备所在环境报警。或者,故障描述值可为电源过压/低压保护报警、漏电报警;或者,压缩机异常报警、风机异常报警;或者,环境温度过高/过低报警、环境湿度过大报警。The device fault value may include a fault code value, a fault description value, and a fault occurrence time value. Among them, the fault code value and the fault description value are predefined, and there is a one-to-one correspondence between the two. The fault description value can be an alarm for electricity failure, an alarm for an internal failure of the device, or an alarm for the environment where the device is located. Or, the fault description value can be power supply over-voltage/low-voltage protection alarm, leakage alarm; or abnormal compressor alarm, fan abnormal alarm; or high/low ambient temperature alarm, high ambient humidity alarm.

向设定数据的查询接口发送预设查询结构的查询指令,该查询接口即可返回设备属性值。在一些实际应用中,该查询接口可动态调用设定数据。Send the query command of the preset query structure to the query interface of the set data, and the query interface can return the device attribute value. In some practical applications, the query interface can dynamically call setting data.

在需要查询设备属性值时,根据设备属性在设定数据的查询接口进行查询,只需访问存储设定数据的数据表,即可获得设备属性值,而无需访问全部数据库,减少了查询过程的耗时。When the device attribute value needs to be queried, according to the device attribute, the query interface of the set data can be queried, and the device attribute value can be obtained only by accessing the data table storing the set data, without accessing the entire database, which reduces the query process. time consuming.

在一些应用场景中,在多个终端向服务器发送多个查询指令的情况下,服务器获得各终端的优先级和各查询服务的优先级,将优先级高的查询服务提供给优先级高的终端。In some application scenarios, when multiple terminals send multiple query commands to the server, the server obtains the priority of each terminal and the priority of each query service, and provides the query service with high priority to the terminal with high priority .

结合图3所示,设定数据的查询接口是通过以下方式创建的:As shown in Figure 3, the query interface for setting data is created in the following ways:

S301、获得授权用户的权限。S301. Obtain the authority of an authorized user.

这里的权限指的是用户访问数据(各设备属性值)的权限,通过设置数据的访问权限,提高了数据安全性。The authority here refers to the user's authority to access data (attribute values of each device). By setting the data access authority, data security is improved.

权限可以包括:允许访问的设备、允许访问的设备的数据属性和允许访问的时间段中的一个或多个。例如,允许第一用户访问A设备和B设备,不允许第一用户访问C设备,允许第二用户访问B设备和C设备,不允许第二用户访问A设备;或者,允许第一用户访问A设备的设备详情,不允许第一用户访问A设备的设备运行曲线、设备实时状态和设备故障,允许第二用户访问A设备的设备详情、设备故障,不允许第二用户访问A设备的设备运行曲线和设备实时状态;或者,允许第一用户访问A设备近一周的设备属性值,允许第二用户访问A设备近半月的设备属性值。Permissions may include one or more of: a device that is allowed to access, a data attribute of the device that is allowed to access, and a time period for which access is allowed. For example, the first user is allowed to access device A and device B, the first user is not allowed to access device C, the second user is allowed to access device B and device C, and the second user is not allowed to access device A; or, the first user is allowed to access device A The device details of the device, the first user is not allowed to access the device running curve, device real-time status and device faults of the A device, the second user is allowed to access the device details and device faults of the A device, and the second user is not allowed to access the device operation of the A device curve and real-time status of the device; or, allow the first user to access the device attribute values of the A device for the past week, and allow the second user to access the device attribute values of the A device for the past half month.

可通过终端向服务器直接发送授权用户的权限;The authority of the authorized user can be sent directly to the server through the terminal;

或者,终端向服务器发送用户信息,在服务器中,一个接口暴露单用户的权限,服务器通过该接口即可查询授权用户的权限。Alternatively, the terminal sends user information to the server, and in the server, an interface exposes the authority of a single user, and the server can query the authority of the authorized user through this interface.

S302、匹配授权用户的每个权限与数据结构的描述信息,确定设定数据。S302 , match each authority of the authorized user with the description information of the data structure, and determine the setting data.

数据结构的描述信息包括数据表中存储数据的设备隶属信息、存储数据的属性信息以及存储数据的时间信息。The description information of the data structure includes the information of the device that stores the data in the data table, the attribute information of the stored data, and the time information of the stored data.

授权用户的每个权限均与一个或多个数据结构相匹配,通过授权用户的权限可匹配出一个或多个数据结构,一个多个数据结构对应的数据表中存储的数据即为授权数据,该授权数据即为上述步骤中的设定数据。Each authority of an authorized user is matched with one or more data structures, and one or more data structures can be matched by the authority of the authorized user. The data stored in the data table corresponding to one or more data structures is the authorization data. The authorization data is the setting data in the above steps.

在一些实际应用中,服务器为分布式服务器,例如多机部署的Dubbo服务器,多机部署的Dubbo服务器的元数据中心对内管理所有可开放数据的描述信息,对外暴露开放的数据结构RPC接口。通过数据结构RPC接口即可查询所有数据结构的描述信息。In some practical applications, the server is a distributed server, such as a Dubbo server deployed on multiple machines. The metadata center of the Dubbo server deployed on multiple machines manages the description information of all open data internally, and exposes the open data structure RPC interface to the outside world. The description information of all data structures can be queried through the data structure RPC interface.

服务器通过设备ID读取设备属性,可获得全部设备属性。一个用户往往只被允许访问部分设备属性的属性值,即,设定数据中包括部分设备属性及其对应的设备属性值。根据设备属性在设定数据的查询接口查询获得的设备属性值只是用户被授权访问的设备属性值(并非全部设备属性对应的属性值)。在获得设备属性值的过程中,终端向服务器发送设备ID,服务器即可向终端返回用户可访问的设备属性值,显然,降低了网络消耗;同时,用户只需要提供设备ID即可获得用户可访问的设备属性值,也提高了用户使用体验。The server reads the device properties through the device ID, and can obtain all device properties. A user is usually only allowed to access the property values of some device properties, that is, the setting data includes some device properties and their corresponding device property values. The device attribute value obtained by querying the device attribute in the query interface of the setting data is only the device attribute value that the user is authorized to access (not the attribute value corresponding to all device attributes). In the process of obtaining the device attribute value, the terminal sends the device ID to the server, and the server can return the user-accessible device attribute value to the terminal. Obviously, network consumption is reduced; at the same time, the user only needs to provide the device ID to obtain the user-accessible device attribute value. Accessing device attribute values also improves user experience.

S303、建立查询接口。S303. Establish a query interface.

例如,创建一变量,用于表示查询接口。For example, create a variable to represent the query interface.

S304、建立查询接口与设定数据的映射关系。S304. Establish a mapping relationship between the query interface and the setting data.

例如,绑定设定数据的统一资源定位符(Uniform Resource Locator,URL)与前述一变量。For example, the Uniform Resource Locator (URL) of the setting data is bound to the aforementioned variable.

S305、设置查询接口的预设查询规则。S305. Set a preset query rule of the query interface.

例如,设置查询接口的请求类型、入口参数和返回参数。其中,请求类型包括GET或POST,入口参数包括一个或多个设备属性,返回参数包括上述一个或多个设备属性(入口参数)对应的设备属性值。For example, set the request type, entry parameters and return parameters of the query interface. The request type includes GET or POST, the entry parameter includes one or more device attributes, and the return parameter includes the device attribute value corresponding to the above one or more device attributes (entry parameters).

为了提高数据安全性,数据库中通常设置访问权限。在上述步骤中,存储设定数据的数据表中均为该授权用户可访问的设定数据,方便授权用户批量读取这些设定数据,进一步降低了查询批量信息的耗时,提高了查询批量信息的实时性。In order to improve data security, access rights are usually set in the database. In the above steps, all the data tables that store the setting data are the setting data accessible to the authorized user, which facilitates the authorized users to read these setting data in batches, further reduces the time-consuming of querying batch information, and increases the batch size of querying. real-time information.

在一些实际应用场景中,设备属性有多个,且,不同用户需求的设备属性值不同。例如,设备属性包括a、b和c,第一用户只需要a值,第二用户只需要b值和c值。在这种情况下,授权用户的权限为用户自定义的,即,授权用户的权限为该授权用户最大权限的一部分。例如,理论中第一用户可以访问a和b,但在使用过程中,第一用户只可以访问a,则,第一用户的最大权限为可以访问a和b,实际应用过程中第一用户的权限为可以访问a,不可访问b;理论中第二用户可以访问a、b和c,实际应用中,第二用户只可以访问b和c,则,第二用户的最大权限为可以访问a、b和c,实际应用中第二用户的权限为可以访问b和c。通过设置第一用户的权限,使返回给第一用户的值只包括a值(不包括b值和c值);同样,通过设置第二用户的权限,使返回给第二用户的值只包括b值和c值(不包括a值),可见,设置用户的权限,不仅仅可提高数据的安全性,还可针对不同用户配置符合用户需求的查询结果,而无需传送全部设备属性值,提高了用户的使用体验;同时也降低了网络消耗。In some practical application scenarios, there are multiple device attributes, and different user requirements have different device attribute values. For example, the device attributes include a, b, and c, the first user only needs the a value, and the second user only needs the b value and the c value. In this case, the authority of the authorized user is user-defined, that is, the authority of the authorized user is a part of the maximum authority of the authorized user. For example, in theory, the first user can access a and b, but in the process of use, the first user can only access a, then, the first user's maximum authority can access a and b. In the actual application process, the first user's The permission is to be able to access a, but not to access b; in theory, the second user can access a, b, and c. In practical applications, the second user can only access b and c. Then, the maximum permission of the second user is to access a, b and c. b and c, in the actual application, the authority of the second user is to be able to access b and c. By setting the authority of the first user, the value returned to the first user only includes the a value (excluding the b value and the c value); similarly, by setting the authority of the second user, the value returned to the second user only includes b value and c value (excluding a value), it can be seen that setting user permissions can not only improve data security, but also configure query results that meet user needs for different users without transmitting all device attribute values. It improves the user experience; it also reduces network consumption.

结合图4所示,获得授权用户的权限,包括:As shown in Figure 4, the permissions of authorized users are obtained, including:

S401、获得用户信息。S401. Obtain user information.

终端读取用户输入的用户信息,终端将用户信息发送至服务器,这样,服务器即可获得用户信息。或者,终端向服务器发送的查询请求中包括用户信息,服务器接收到查询请求后,解析出用户信息。The terminal reads the user information input by the user, and the terminal sends the user information to the server, so that the server can obtain the user information. Or, the query request sent by the terminal to the server includes user information, and the server parses out the user information after receiving the query request.

在用户获得授权之前,用户信息包括用户密码,或者,用户密码和用户ID,终端将用户信息发送至服务器,服务器接收该用户信息。可选地,终端通过鉴权接口将用户信息发送至服务器。例如,在分布式服务器中,终端通过鉴权RPC接口将用户信息发送至服务器。Before the user obtains authorization, the user information includes a user password, or a user password and a user ID. The terminal sends the user information to the server, and the server receives the user information. Optionally, the terminal sends the user information to the server through an authentication interface. For example, in a distributed server, the terminal sends user information to the server through an authentication RPC interface.

在用户获得授权之后,用户信息包括用户密码,或者,用户ID,或者,用户密码和用户ID,服务器读取终端发送的查询请求,在查询请求中解析出用户信息。After the user obtains authorization, the user information includes a user password, or a user ID, or a user password and a user ID. The server reads the query request sent by the terminal, and parses the user information in the query request.

S402、在授权用户列表中匹配用户信息,判断用户信息是否为授权用户信息。S402. Match user information in the authorized user list, and determine whether the user information is authorized user information.

授权用户列表中存储有授权用户信息,若在授权用户列表中成功匹配到用户信息,则用户信息为授权用户信息;若在授权用户列表中无法匹配到用户信息,则用户信息为非授权用户信息。Authorized user information is stored in the authorized user list. If the user information is successfully matched in the authorized user list, the user information is authorized user information; if the user information cannot be matched in the authorized user list, the user information is unauthorized user information. .

S403、在用户信息为授权用户信息的情况下,根据用户信息在设定接口查询授权用户的权限。S403 , in the case that the user information is the authorized user information, query the authority of the authorized user on the setting interface according to the user information.

设定接口暴露单个用户的权限,通过该设定接口即可查询授权用户的权限。The setting interface exposes the authority of a single user, and the authority of the authorized user can be queried through the setting interface.

通过上述步骤即可获得授权用户的权限。Through the above steps, the authority of the authorized user can be obtained.

结合图5所示,根据设备属性在设定数据的查询接口查询设备属性值,包括:With reference to Figure 5, according to the device attribute, the device attribute value is queried in the query interface of the set data, including:

S501、将设备属性调整为预设查询结构。S501. Adjust the device attribute to a preset query structure.

其中,预设查询结构与设定数据的查询接口的预设查询规则相适配。The preset query structure is adapted to the preset query rules of the query interface of the set data.

预设查询结构中包括一个或多个条件,查询结果中每个数据都满足这些条件。The preset query structure includes one or more conditions, and each data in the query result satisfies these conditions.

在一些具体应用中,预设查询结构中包括查询方式、表名、查询条件等,其中,查询方式可以是模糊查询或排序查询,查询条件可以是时间筛选或上下限筛选等。In some specific applications, the preset query structure includes query methods, table names, query conditions, etc., wherein the query method can be a fuzzy query or a sorted query, and the query conditions can be time filtering or upper and lower limit filtering.

S502、根据预设查询结构在设定数据的查询接口查询设备属性值。S502 , query the device attribute value on the query interface of the setting data according to the preset query structure.

设定数据查询接口接收到预设查询结构的查询指令后,返回与该查询指令相对应的查询结果。After receiving the query command of the preset query structure, the setting data query interface returns a query result corresponding to the query command.

通过上述步骤,即可获得与设备属性相对应的多个信息。Through the above steps, multiple pieces of information corresponding to device attributes can be obtained.

结合图6所示,本公开实施例提供了一种用于查询设备信息的方法。本实施例中以该用于查询设备信息的方法应用于图1所示的终端中举例说明。该用于查询设备信息的方法包括:With reference to FIG. 6 , an embodiment of the present disclosure provides a method for querying device information. In this embodiment, the method for querying device information is applied to the terminal shown in FIG. 1 as an example for illustration. The method for querying device information includes:

S601、向服务器发送设备ID;其中,设备ID用于查询设备属性。S601. Send a device ID to a server, where the device ID is used to query device attributes.

其中,设备ID包括设备编号或设备媒体存取控制位址(Media Access ControlAddress,MAC)。在实际应用中,设备ID可以是全部或部分设备编号,或者,设备ID可以是全部或部分设备MAC。The device ID includes a device number or a device media access control address (Media Access Control Address, MAC). In practical applications, the device ID may be all or part of the device number, or the device ID may be all or part of the device MAC.

服务器在接收到设备ID后,可以根据设备ID在Redis中读取设备属性;在Redis中无法成功读取设备属性的情况下,根据设备ID在数据库中读取设备属性。After receiving the device ID, the server can read the device attribute in Redis according to the device ID; if the device attribute cannot be successfully read in Redis, the device attribute can be read in the database according to the device ID.

设备属性指的是设备的可被记录数据的属性。例如,设备属性包括设备详情、设备运行曲线、设备实时状态和设备故障中的一个或多个。Device properties refer to properties of a device that can be recorded with data. For example, device properties include one or more of device details, device operating curves, device real-time status, and device failures.

S602、接收服务器发送的设备属性值。S602. Receive the device attribute value sent by the server.

其中,设备属性值是根据设备属性在设定数据的查询接口查询的,设定数据存储在数据库中的部分数据表,设定数据包括设备属性及其对应的设备属性值。The device attribute value is queried in the query interface of the setting data according to the device attribute, and the setting data is stored in a part of the data table in the database, and the setting data includes the device attribute and its corresponding device attribute value.

设备属性指的是设备的可被记录数据的属性。例如,设备属性包括设备详情、设备运行曲线、设备实时状态和设备故障中的一个或多个。Device properties refer to properties of a device that can be recorded with data. For example, device properties include one or more of device details, device operating curves, device real-time status, and device failures.

设备详情可包括:设备下线时间、设备安装时间、首次绑定时间、设备安装地址、设备生产工厂、设备累计在线时长、设备开机时长、设备累计运行时长、设备累计故障报警次数、用户ID、用户最近一次登录时间、用户最近一次登录终端名称中的一个或多个。The equipment details can include: equipment offline time, equipment installation time, first binding time, equipment installation address, equipment production factory, equipment online time, equipment startup time, equipment running time, equipment fault alarm times, user ID, One or more of the last login time of the user and the last login terminal name of the user.

设备运行曲线是设备可调节的特定环境变量随时间变化的曲线。例如,空调可调节室内温度,则设备运行曲线可包括室内温度随时间变化的曲线;冰箱可调节冷藏室温度和冷冻室温度,则设备运行曲线可包括冷藏室温度随时间变化的曲线或冷冻室温度随时间变化的曲线。A device operating curve is a curve of specific environmental variables that can be adjusted by the device over time. For example, if the air conditioner can adjust the indoor temperature, the equipment operation curve can include the curve of the indoor temperature changing with time; the refrigerator can adjust the temperature of the refrigerator compartment and the freezer compartment, then the equipment operation curve can include the curve of the temperature change of the refrigerator compartment or the freezer compartment with time. Curve of temperature versus time.

设备实时状态为设备中各执行器的实时运行状态,例如蜂鸣器的实时运行状态,或者,冰箱/空调压缩机的实时运行状态,或者,设备门的开关状态。The real-time state of the device is the real-time running state of each actuator in the device, such as the real-time running state of the buzzer, or the real-time running state of the refrigerator/air conditioner compressor, or the opening and closing state of the device door.

设备故障可包括故障代码、故障描述以及故障发生时间。Equipment faults can include fault codes, fault descriptions, and when the fault occurred.

设备属性值为与设备属性相对应的具体值。例如设备属性值包括设备详情值、设备运行曲线值、设备实时状态值和设备故障值中的一个或多个。The device attribute value is a concrete value corresponding to the device attribute. For example, the device attribute value includes one or more of the device detail value, the device operation curve value, the device real-time state value, and the device fault value.

设备详情值可包括:设备下线时间值、设备安装时间值、首次绑定时间值、设备安装地址值、设备生产工厂值、设备累计在线时长值、设备开机时长值、设备累计运行时长值、设备累计故障报警次数值、用户ID值、用户最近一次登录时间值、用户最近一次登录终端名称值中的一个或多个。The device details values can include: device offline time value, device installation time value, first binding time value, device installation address value, device production factory value, device cumulative online time value, device startup time value, device cumulative running time value, One or more of the value of the cumulative number of fault alarms of the device, the value of the user ID, the value of the last login time of the user, and the value of the last login terminal name of the user.

设备运行曲线值是设备可调节的特定环境变量随时间变化的值。例如,空调可调节室内温度,则设备运行曲线值可包括随时间变化的室内温度值;冰箱可调节冷藏室温度和冷冻室温度,则设备运行曲线可包括随时间变化的冷藏室温度值或冷冻室温度值。The device operating curve value is the time-varying value of a specific environmental variable that can be adjusted by the device. For example, if the air conditioner can adjust the indoor temperature, the equipment operation curve value can include the indoor temperature value that changes with time; the refrigerator can adjust the temperature of the refrigerator compartment and the freezer compartment, and the equipment operation curve can include the temperature value of the refrigerator compartment or the freezer temperature value that changes with time. room temperature value.

设备实时状态值包括蜂鸣器的实时运行状态值,或者,冰箱/空调压缩机的实时运行状态值,或者,设备门的开关状态值。The real-time state value of the equipment includes the real-time running state value of the buzzer, or the real-time running state value of the refrigerator/air conditioner compressor, or the opening and closing state value of the device door.

设备故障值可包括故障代码值、故障描述值以及故障发生时间值。其中,故障代码值和故障描述值是预定义的,二者一一对应。故障描述值可为用电故障报警、设备内部故障报警或设备所在环境报警。或者,故障描述值可为电源过压/低压保护报警、漏电报警;或者,压缩机异常报警、风机异常报警;或者,环境温度过高/过低报警、环境湿度过大报警。The device fault value may include a fault code value, a fault description value, and a fault occurrence time value. Among them, the fault code value and the fault description value are predefined, and there is a one-to-one correspondence between the two. The fault description value can be an alarm for electricity failure, an alarm for an internal failure of the device, or an alarm for the environment where the device is located. Or, the fault description value can be power supply over-voltage/low-voltage protection alarm, leakage alarm; or abnormal compressor alarm, fan abnormal alarm; or high/low ambient temperature alarm, high ambient humidity alarm.

可选地,在接收服务器发送的设备属性值之前,用于查询设备信息的方法还包括:获得筛选时间段,向所述服务器发送筛选时间段。Optionally, before receiving the device attribute value sent by the server, the method for querying device information further includes: obtaining a screening time period, and sending the screening time period to the server.

在一些应用场景中,终端为包括触摸屏,用户在触摸屏中输入筛选时间段,终端读取用户对触摸屏的操作,获得筛选时间段。In some application scenarios, the terminal includes a touch screen, the user inputs the screening time period on the touch screen, and the terminal reads the user's operation on the touch screen to obtain the screening time period.

在另一些实际应用场景中,终端包括显示屏和输入装置(例如键盘或机械操作面板),用户通过输入装置输入筛选时间段,终端读取用户对输入装置的操作,获得筛选时间段。In other practical application scenarios, the terminal includes a display screen and an input device (such as a keyboard or a mechanical operation panel), the user inputs the screening time period through the input device, and the terminal reads the user's operation on the input device to obtain the screening time period.

S603、显示设备属性值。S603. Display the device attribute value.

终端以表格的形式显示设备属性值,例如,终端以表格的形式显示设备详情、设备实施状态信息和设备故障。The terminal displays device attribute values in tabular form, for example, the terminal displays device details, device implementation status information, and device faults in tabular form.

或者,终端以曲线的形式显示设备属性值,例如,终端显示设备运行曲线。Or, the terminal displays the device property value in the form of a curve, for example, the terminal displays the device running curve.

在需要查询设备属性值时,根据设备属性在设定数据的查询接口进行查询,只需访问存储设定数据的数据表,即可获得设备属性值,而无需访问全部数据库,减少了查询过程的耗时。When the device attribute value needs to be queried, according to the device attribute, the query interface of the set data can be queried, and the device attribute value can be obtained only by accessing the data table storing the set data, without accessing the entire database, which reduces the query process. time consuming.

结合图7所示,在接收服务器发送的设备属性值之前,用于查询设备信息的方法还包括:With reference to Figure 7, before receiving the device attribute value sent by the server, the method for querying device information further includes:

S701、获得用户信息。S701. Obtain user information.

终端读取用户输入的用户信息,终端将用户信息发送至服务器,这样,服务器即可获得用户信息。用户信息包括用户密码,或者,用户密码和用户ID。The terminal reads the user information input by the user, and the terminal sends the user information to the server, so that the server can obtain the user information. User information includes user password, or, user password and user ID.

在一些实际应用场景中,终端为包括触摸屏,用户在触摸屏中输入用户信息,终端读取用户对触摸屏的操作,获得用户信息。In some practical application scenarios, the terminal includes a touch screen, the user inputs user information on the touch screen, and the terminal reads the user's operation on the touch screen to obtain the user information.

在另一些实际应用场景中,终端包括显示屏和输入装置(例如键盘或机械操作面板),用户通过输入装置输入用户信息,终端读取用户对输入装置的操作,获得用户信息。In other practical application scenarios, the terminal includes a display screen and an input device (such as a keyboard or a mechanical operation panel), the user inputs user information through the input device, and the terminal reads the user's operation on the input device to obtain the user information.

S702、向服务器发送用户信息。S702. Send user information to the server.

服务器可根据用户信息,判断当前用户是否有访问数据的权限。提高了数据安全性。The server can determine whether the current user has the right to access the data according to the user information. Improved data security.

结合图8所示,本公开实施例提供了一种用于查询设备信息的方法。本实施例在终端和服务器进行信息交互的角度对用于查询设备信息的方法进行举例说明。用于查询设备信息的方法包括:With reference to FIG. 8 , an embodiment of the present disclosure provides a method for querying device information. In this embodiment, the method for querying device information is described by way of example from the perspective of information interaction between the terminal and the server. Methods for querying device information include:

S801、终端向服务器发送设备ID;S801, the terminal sends the device ID to the server;

S802、服务器根据设备ID获得设备属性;S802, the server obtains the device attribute according to the device ID;

S803、服务器获得设定数据的查询接口;S803, the server obtains a query interface for setting data;

S804、服务器根据设备属性在设定数据的查询接口查询设备属性值;S804, the server queries the device attribute value on the query interface of the set data according to the device attribute;

S805、终端接收服务器发送的设备属性值;S805, the terminal receives the device attribute value sent by the server;

S806、终端显示设备属性值。S806, the terminal displays the device attribute value.

结合图9所示,本公开实施例提供了一种用于查询设备信息的方法。本实施例在终端与服务器进行信息交互的角度对用于查询设备信息的方法进行举例说明。用于查询设备信息的方法包括:With reference to FIG. 9 , an embodiment of the present disclosure provides a method for querying device information. In this embodiment, the method for querying device information is described by way of example from the perspective of information interaction between the terminal and the server. Methods for querying device information include:

S901、终端获得用户信息;S901. The terminal obtains user information;

S902、终端向服务器发送用户信息;S902, the terminal sends user information to the server;

S903、服务器在授权用户列表中匹配所述用户信息,判断所述用户信息是否为授权用户信息;S903, the server matches the user information in the authorized user list, and determines whether the user information is authorized user information;

S904、在用户信息为授权用户信息的情况下,终端向服务器发送设备ID;S904, in the case that the user information is authorized user information, the terminal sends the device ID to the server;

S905、服务器根据设备ID获得设备属性;S905, the server obtains the device attribute according to the device ID;

S906、服务器获得设定数据的查询接口;S906, the server obtains a query interface for setting data;

S907、服务器根据设备属性在设定数据的查询接口查询设备属性值;S907, the server queries the device attribute value on the query interface of the set data according to the device attribute;

S908、终端接收服务器发送的设备属性值;S908, the terminal receives the device attribute value sent by the server;

S909、终端显示设备属性值。S909, the terminal displays the device attribute value.

在一些实际应用场景中,用户在登录界面登录,用户在选择界面选择设备ID和时间段,用户点击确认,界面显示设备详情、运行曲线、实时状态和故障推送中的一个或多个。In some practical application scenarios, the user logs in on the login interface, the user selects the device ID and time period on the selection interface, the user clicks confirm, and the interface displays one or more of the device details, running curve, real-time status, and fault push.

结合图10a所示,本公开实施例提供了一种用于存储设备信息的数据库。该用于存储设备信息的数据库包括配置结构模块1001和数据结构模块1002,其中,配置结构模块1001被配置为生成设定数据的查询接口;数据结构模块1002存储有设定数据,设定数据包括设备属性及其对应的设备属性值。With reference to Fig. 10a, an embodiment of the present disclosure provides a database for storing device information. The database for storing device information includes a configuration structure module 1001 and a data structure module 1002, wherein the configuration structure module 1001 is configured to generate a query interface for setting data; the data structure module 1002 stores setting data, and the setting data includes Device properties and their corresponding device property values.

在上述数据库中,设备属性及其对应的设备属性值作为具备查询接口的独立模块,便于独立访问设定数据,在需要查询设备属性值时,根据设备属性在设定数据的查询接口进行查询,只需访问存储设定数据的数据表,即可获得设备属性值,而无需访问全部数据库,减少了查询过程的耗时。In the above database, the device attributes and their corresponding device attribute values are used as independent modules with a query interface, which facilitates independent access to the setting data. The device property value can be obtained by simply accessing the data table storing the setting data, without accessing the entire database, reducing the time-consuming of the query process.

结合图10b所示,用于存储设备信息的数据库还包括授权结构模块1003。授权结构模块1003存储用户权限及其对应的授权数据结构;数据结构模块1002存储有授权数据,授权数据结构与授权数据具有映射关系;配置结构模块1001还被配置为确定特定用户权限对应的全部授权数据为设定数据。As shown in FIG. 10 b , the database for storing device information further includes an authorization structure module 1003 . The authorization structure module 1003 stores the user authority and its corresponding authorization data structure; the data structure module 1002 stores authorization data, and the authorization data structure and the authorization data have a mapping relationship; the configuration structure module 1001 is also configured to determine all authorizations corresponding to the specific user authority The data is the setting data.

上述数据库的各个模型可以设置在同一台服务上,也可以设置在不同服务器上。Each model of the above database can be set on the same service or on different servers.

配置结构模块1001可通过关系型表存储数据,例如利用KeyValue结构或Json结构存储数据。配置结构模块1001还可以包括Redis。The configuration structure module 1001 may store data through a relational table, for example, using a KeyValue structure or a Json structure to store data. The configuration fabric module 1001 may also include Redis.

数据结构模块1002可通过关系型表存储数据,例如利用KeyValue结构或Json结构存储数据。数据结构模块1002还可以包括Redis。The data structure module 1002 can store data through a relational table, for example, using a KeyValue structure or a Json structure to store data. The data structure module 1002 may also include Redis.

授权结构模块1003可通过关系型表存储数据,例如利用KeyValue结构或Json结构存储数据。授权结构模块1003还可以包括Redis。The authorization structure module 1003 can store data through a relational table, for example, using a KeyValue structure or a Json structure to store data. The authorization structure module 1003 may also include Redis.

在一些实施例中,用于存储设备信息的数据库还包括有效管理模块,该有效管理模块中存储接口访问记录、授权监控以及调用时延。In some embodiments, the database for storing device information further includes an effective management module, in which the effective management module stores interface access records, authorization monitoring, and invocation delays.

可选地,用于存储设备信息的数据库还包括高速缓冲存储器(Cache)模块,该Cache模块与配置结构模块1001和有效管理模块连接。在配置结构模块1001或有效管理模块变更数据后,将变更的数据同步到Cache模块,可降低数据库的压力。Optionally, the database for storing device information further includes a cache memory (Cache) module, which is connected with the configuration structure module 1001 and the effective management module. After the configuration structure module 1001 or the effective management module changes the data, the changed data is synchronized to the Cache module, which can reduce the pressure on the database.

结合图11a所示,本公开实施例提供了一种用于查询设备信息的装置。该用于查询设备信息的装置可以通过软件、硬件或者两者的结合实现成为图1所示服务器的全部或者一部分。该用于查询设备信息的装置包括第一获得模块1110和查询模块1120,其中,第一获得模块1110被配置为获得设备属性和预创建的设定数据的查询接口;查询模块1120被配置为根据设备属性在设定数据的查询接口查询设备属性值,设定数据存储在数据库的部分数据表中,部分数据表与授权用户的权限相对应,数据表包括设备属性及其对应的设备属性值。With reference to Fig. 11a, an embodiment of the present disclosure provides an apparatus for querying device information. The apparatus for querying device information can be implemented as all or a part of the server shown in FIG. 1 through software, hardware or a combination of the two. The apparatus for querying device information includes a first obtaining module 1110 and a querying module 1120, wherein the first obtaining module 1110 is configured to obtain a query interface for device attributes and pre-created setting data; the querying module 1120 is configured to The device attribute queries the device attribute value in the query interface of the setting data. The setting data is stored in some data tables of the database, and some data tables correspond to the authority of the authorized user. The data table includes the device attributes and their corresponding device attribute values.

结合图11b所示,第一获得模块1110包括第一获得单元1111、匹配单元1112、第一创建单元1113、第二创建单元1114和设置单元1115,其中,第一获得单元1111被配置为获得授权用户的权限;匹配单元1112被配置为匹配授权用户的每个权限与数据结构的描述信息,确定设定数据;第一创建单元1113被配置为建立查询接口;第二创建单元1114被配置为建立查询接口与设定数据的映射关系;设置单元1115被配置为设置所述查询接口的预设查询规则。11b, the first obtaining module 1110 includes a first obtaining unit 1111, a matching unit 1112, a first creating unit 1113, a second creating unit 1114 and a setting unit 1115, wherein the first obtaining unit 1111 is configured to obtain authorization the user's authority; the matching unit 1112 is configured to match each authority of the authorized user with the description information of the data structure, and determine the setting data; the first creating unit 1113 is configured to create a query interface; the second creating unit 1114 is configured to create The mapping relationship between the query interface and the setting data; the setting unit 1115 is configured to set a preset query rule of the query interface.

可选地,第一获得单元被具体配置为:Optionally, the first obtaining unit is specifically configured as:

获得用户信息;obtain user information;

在授权用户列表中匹配用户信息,判断用户信息是否为授权用户信息;Match the user information in the authorized user list to determine whether the user information is authorized user information;

在用户信息为授权用户信息的情况下,根据用户信息在设定接口查询授权用户的权限。In the case that the user information is the authorized user information, the authority of the authorized user is queried in the setting interface according to the user information.

结合图11c所示,查询模块1120包括调整单元1121和查询单元1122,其中,调整单元1121被配置为将设备属性调整为预设查询结构,预设查询结构与设定数据的查询接口的预设查询规则相适配;查询单元1122被配置为根据预设查询结构在设定数据的查询接口查询设备属性值。11c, the query module 1120 includes an adjustment unit 1121 and a query unit 1122, wherein the adjustment unit 1121 is configured to adjust the device attributes to a preset query structure, the preset query structure and the preset data query interface preset The query rule is adapted; the query unit 1122 is configured to query the device attribute value in the query interface of the setting data according to the preset query structure.

结合图11d所示,第一获得模块1110包括第二获得单元1114和读取单元1115,其中,第二获得单元1114被配置为获得设备ID;读取单元1115被配置为根据设备ID读取设备属性。As shown in FIG. 11d, the first obtaining module 1110 includes a second obtaining unit 1114 and a reading unit 1115, wherein the second obtaining unit 1114 is configured to obtain the device ID; the reading unit 1115 is configured to read the device according to the device ID Attributes.

可选地,读取单元被具体配置为:根据设备ID在Redis中读取设备属性;在Redis中无法成功读取设备属性的情况下,根据设备ID在数据库中读取设备属性。Optionally, the reading unit is specifically configured to: read the device attribute in Redis according to the device ID; if the device attribute cannot be successfully read in Redis, read the device attribute in the database according to the device ID.

结合图12a所示,本公开实施例提供了一种用于查询设备信息的装置。该用于查询设备信息的装置可以通过软件、硬件或两者结合实现图1所示的终端的全部或一部分。该用于查询设备信息的装置包括第一发送模块1210、第一接收模块1220和显示模块1230,其中,第一发送模块1210被配置为向服务器发送设备ID;其中,设备ID用于查询设备属性;第一接收模块1220被配置为接收服务器发送的设备属性值;其中,设备属性值是根据设备属性在设定数据的查询接口查询的,设定数据存储在数据库的部分数据表中,部分数据表与授权用户的权限相对应,数据表包括设备属性及其对应的设备属性值;显示模块1230被配置为显示设备属性值。With reference to Fig. 12a, an embodiment of the present disclosure provides an apparatus for querying device information. The apparatus for querying device information may implement all or a part of the terminal shown in FIG. 1 through software, hardware or a combination of the two. The apparatus for querying device information includes a first sending module 1210, a first receiving module 1220 and a display module 1230, wherein the first sending module 1210 is configured to send a device ID to a server; wherein the device ID is used to query device attributes The first receiving module 1220 is configured to receive the device attribute value sent by the server; wherein, the device attribute value is queried according to the device attribute in the query interface of the set data, and the set data is stored in the partial data table of the database, and the partial data The table corresponds to the authority of the authorized user, and the data table includes device attributes and their corresponding device attribute values; the display module 1230 is configured to display the device attribute values.

结合图12b所示,用于查询设备信息的装置还包括第二获得模块1240和第二发送模块1250,其中,第二获得模块1240被配置为在接收服务器发送的设备属性值之前,获得用户信息;第二发送模块1250被配置为向服务器发送用户信息;其中,用户信息用于判断当前用户是否具有访问数据的权限。12b, the apparatus for querying device information further includes a second obtaining module 1240 and a second sending module 1250, wherein the second obtaining module 1240 is configured to obtain user information before receiving the device attribute value sent by the server ; The second sending module 1250 is configured to send user information to the server; wherein, the user information is used to determine whether the current user has the right to access data.

可选地,第二获得模块1240还被配置为获得筛选时间段;所述第二发送模块1250还被配置为向所述服务器发送所述筛选时间段。Optionally, the second obtaining module 1240 is further configured to obtain a screening time period; the second sending module 1250 is further configured to send the screening time period to the server.

在一些实施例中,用于查询设备信息的装置包括处理器和存储有程序指令的存储器,处理器被配置为在执行程序指令时,执行前述实施例提供的用于查询设备信息的方法。In some embodiments, the apparatus for querying device information includes a processor and a memory storing program instructions, and the processor is configured to execute the method for querying device information provided by the foregoing embodiments when executing the program instructions.

结合图13所示,本公开实施例提供了一种用于查询设备信息的装置。该用于查询设备信息的装置包括:With reference to FIG. 13 , an embodiment of the present disclosure provides an apparatus for querying device information. The device for querying device information includes:

处理器(processor)131和存储器(memory)132,还可以包括通信接口(Communication Interface)133和总线134。其中,处理器131、通信接口133、存储器132可以通过总线134完成相互间的通信。通信接口133可以用于信息传输。处理器131可以调用存储器132中的逻辑指令,以执行前述实施例提供的用于查询设备信息的方法。A processor (processor) 131 and a memory (memory) 132 may also include a communication interface (Communication Interface) 133 and a bus 134 . The processor 131 , the communication interface 133 , and the memory 132 can communicate with each other through the bus 134 . The communication interface 133 may be used for information transfer. The processor 131 may invoke the logic instructions in the memory 132 to execute the method for querying device information provided by the foregoing embodiments.

此外,上述的存储器132中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。In addition, the above-mentioned logic instructions in the memory 132 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.

存储器132作为一种计算机可读存储介质,可用于存储软件程序、计算机可执行程序,如本公开实施例中的方法对应的程序指令/模块。处理器131通过运行存储在存储器132中的软件程序、指令以及模块,从而执行功能应用以及数据处理,即实现上述方法实施例中的方法。As a computer-readable storage medium, the memory 132 may be used to store software programs and computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 131 executes functional applications and data processing by running the software programs, instructions, and modules stored in the memory 132 , that is, to implement the methods in the above method embodiments.

存储器132可包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序;存储数据区可存储根据终端设备的使用所创建的数据等。此外,存储器132可以包括高速随机存取存储器,还可以包括非易失性存储器。The memory 132 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the terminal device, and the like. Additionally, memory 132 may include high-speed random access memory, and may also include non-volatile memory.

本公开实施例提供了一种存储介质,存储有计算机可执行指令,计算机可执行指令设置为执行前述实施例提供的用于查询设备信息的方法。Embodiments of the present disclosure provide a storage medium storing computer-executable instructions, where the computer-executable instructions are configured to execute the method for querying device information provided by the foregoing embodiments.

本公开实施例提供了一种计算机程序产品,计算机程序产品包括存储在计算机可读存储介质上的计算机程序,计算机程序包括程序指令,当程序指令被计算机执行时,使计算机执行前述实施例提供的用于查询设备信息的方法。Embodiments of the present disclosure provide a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer is made to execute the program provided by the foregoing embodiments. The method used to query device information.

上述的计算机可读存储介质可以是暂态计算机可读存储介质,也可以是非暂态计算机可读存储介质。The above-mentioned computer-readable storage medium may be a transient computer-readable storage medium, and may also be a non-transitory computer-readable storage medium.

本公开实施例的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括一个或一个以上指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开实施例中方法的全部或部分步骤。而前述的存储介质可以是非暂态存储介质,包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机读取存储器(Random Access Memory,RAM)、磁碟或者光盘等多种可以存储程序代码的介质,也可以是暂态存储介质。The technical solutions of the embodiments of the present disclosure may be embodied in the form of software products, and the computer software products are stored in a storage medium and include one or more instructions to enable a computer device (which may be a personal computer, a server, or a network equipment, etc.) to execute all or part of the steps of the methods in the embodiments of the present disclosure. The aforementioned storage medium may be a non-transitory storage medium, including: U disk, removable hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc. A medium that can store program codes, and can also be a transient storage medium.

以上描述和附图充分地示出了本公开的实施例,以使本领域的技术人员能够实践它们。其他实施例可以包括结构的、逻辑的、电气的、过程的以及其他的改变。实施例仅代表可能的变化。除非明确要求,否则单独的部件和功能是可选的,并且操作的顺序可以变化。一些实施例的部分和特征可以被包括在或替换其他实施例的部分和特征。而且,本申请中使用的用词仅用于描述实施例并且不用于限制权利要求。如在实施例以及权利要求的描述中使用的,除非上下文清楚地表明,否则单数形式的“一个”(a)、“一个”(an)和“所述”(the)旨在同样包括复数形式。类似地,如在本申请中所使用的术语“和/或”是指包含一个或一个以上相关联的列出的任何以及所有可能的组合。另外,当用于本申请中时,术语“包括”(comprise)及其变型“包括”(comprises)和/或包括(comprising)等指陈述的特征、整体、步骤、操作、元素,和/或组件的存在,但不排除一个或一个以上其它特征、整体、步骤、操作、元素、组件和/或这些的分组的存在或添加。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法或者设备中还存在另外的相同要素。本文中,每个实施例重点说明的可以是与其他实施例的不同之处,各个实施例之间相同相似部分可以互相参见。对于实施例公开的方法、产品等而言,如果其与实施例公开的方法部分相对应,那么相关之处可以参见方法部分的描述。The foregoing description and drawings sufficiently illustrate the embodiments of the present disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, process, and other changes. The examples are only representative of possible variations. Unless expressly required, individual components and functions are optional and the order of operations may vary. Portions and features of some embodiments may be included in or substituted for those of other embodiments. Also, the terms used in this application are used to describe the embodiments only and not to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a" (a), "an" (an) and "the" (the) are intended to include the plural forms as well, unless the context clearly dictates otherwise. . Similarly, the term "and/or" as used in this application is meant to include any and all possible combinations of one or more of the associated listings. Additionally, when used in this application, the term "comprise" and its variations "comprises" and/or including and/or the like refer to stated features, integers, steps, operations, elements, and/or The presence of a component does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and/or groupings of these. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, or device that includes the element. Herein, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, reference may be made to the description of the method section for relevant parts.

本领域技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,可以取决于技术方案的特定应用和设计约束条件。技术人员可以对每个特定的应用来使用不同方法以实现所描述的功能,但是这种实现不应认为超出本公开实施例的范围。技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Skilled artisans may use different methods for implementing the described functionality for each particular application, but such implementations should not be considered beyond the scope of the disclosed embodiments. A skilled person can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described systems, devices and units, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

本文所披露的实施例中,所揭露的方法、产品(包括但不限于装置、设备等),可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,单元的划分,可以仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例。另外,在本公开实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In the embodiments disclosed herein, the disclosed methods and products (including but not limited to apparatuses, devices, etc.) may be implemented in other ways. For example, the apparatus embodiments described above are only illustrative. For example, the division of units may only be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integration into another system, or some features can be ignored, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms. Units described as separate components may or may not be physically separated, and components shown as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. This embodiment may be implemented by selecting some or all of the units according to actual needs. In addition, each functional unit in the embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

附图中的流程图和框图显示了根据本公开实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,模块、程序段或代码的一部分包含一个或一个以上用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这可以依所涉及的功能而定。框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executables for implementing the specified logical function(s) instruction. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in special purpose hardware-based systems that perform the specified functions or actions, or special purpose hardware implemented in combination with computer instructions.

Claims (11)

1. A method for inquiring equipment information is applied to a server, and is characterized in that the method comprises the following steps:
obtaining the equipment attribute and a query interface of pre-created setting data;
inquiring the attribute value of the equipment in an inquiry interface of the set data according to the attribute of the equipment;
the setting data is stored in a partial data table of a database, the partial data table corresponds to the authority of an authorized user, and the data table comprises the device attribute and the device attribute value corresponding to the device attribute.
2. The method of claim 1, wherein the query interface for the provisioning data is created by:
obtaining the authority of an authorized user;
matching each authority of the authorized user with the description information of a data structure, and determining the set data;
establishing a query interface;
establishing a mapping relation between the query interface and the set data;
and setting a preset inquiry rule of the inquiry interface.
3. The method of claim 2, wherein obtaining the rights of the authorized user comprises:
obtaining user information;
matching the user information in an authorized user list, and judging whether the user information is authorized user information;
and under the condition that the user information is authorized user information, inquiring the authority of the authorized user in a setting interface according to the user information.
4. The method of claim 1, wherein querying the device attribute value in a query interface of the setting data according to the device attribute comprises:
adjusting the device attribute to a preset query structure; the preset query structure is matched with a preset query rule of a query interface of the set data;
and inquiring the equipment attribute value at the inquiry interface of the set data according to the preset inquiry structure.
5. The method of any of claims 1 to 4, wherein obtaining device attributes comprises:
obtaining a device ID;
and reading the device attribute according to the device ID.
6. The method of claim 5, wherein reading the device attribute according to the device ID comprises:
reading the device attribute in Redis according to the device ID;
and under the condition that the device attribute cannot be successfully read in the Redis, reading the device attribute in a database according to the device ID.
7. A method for inquiring equipment information is applied to a terminal, and is characterized in that the method comprises the following steps:
sending the device ID to a server; wherein the device ID is used for inquiring device attributes;
receiving a device attribute value sent by a server; the device attribute value is inquired in an inquiry interface of set data according to the device attribute, the set data is stored in a partial data table of a database, the partial data table corresponds to the authority of an authorized user, and the data table comprises the device attribute and the device attribute value corresponding to the device attribute;
and displaying the equipment attribute value.
8. A database for storing device information, comprising:
a configuration structure module configured to generate a query interface of the setting data;
and the data structure module stores setting data, and the setting data comprises equipment attributes and corresponding equipment attribute values.
9. The database of claim 8, further comprising:
the authorization structure module stores the user authority and an authorization data structure corresponding to the user authority;
the data structure module stores authorization data, and the authorization data structure and the authorization data have a mapping relation;
the configuration structure module is also configured to determine all authorization data corresponding to the specific user authority as setting data.
10. An apparatus for querying device information, applied to a server, the apparatus comprising:
a first obtaining module configured to obtain a device attribute and a query interface of pre-created setting data;
the query module is configured to query the device attribute value at the query interface of the set data according to the device attribute;
the setting data is stored in a partial data table of a database, the partial data table corresponds to the authority of an authorized user, and the data table comprises the device attribute and the device attribute value corresponding to the device attribute.
11. An apparatus for querying device information, applied to a terminal, the apparatus comprising:
a first transmitting module configured to transmit the device ID to the server; wherein, the device ID is used for inquiring the device attribute;
the first receiving module is configured to receive the device attribute value sent by the server; the device attribute value is inquired in an inquiry interface of set data according to the device attribute, the set data is stored in a partial data table of a database, the partial data table corresponds to the authority of an authorized user, and the data table comprises the device attribute and the device attribute value corresponding to the device attribute;
a display module configured to display the device attribute values.
CN202010531434.XA 2020-06-11 2020-06-11 Method, device and database for querying equipment information Active CN111737291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010531434.XA CN111737291B (en) 2020-06-11 2020-06-11 Method, device and database for querying equipment information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010531434.XA CN111737291B (en) 2020-06-11 2020-06-11 Method, device and database for querying equipment information

Publications (2)

Publication Number Publication Date
CN111737291A true CN111737291A (en) 2020-10-02
CN111737291B CN111737291B (en) 2023-07-21

Family

ID=72650144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010531434.XA Active CN111737291B (en) 2020-06-11 2020-06-11 Method, device and database for querying equipment information

Country Status (1)

Country Link
CN (1) CN111737291B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112699146A (en) * 2020-12-31 2021-04-23 新奥数能科技有限公司 Data pushing method and device based on general information model, server and storage medium
WO2024149092A1 (en) * 2023-01-10 2024-07-18 华为技术有限公司 Attribute value synchronization method and device

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6366915B1 (en) * 1998-11-04 2002-04-02 Micron Technology, Inc. Method and system for efficiently retrieving information from multiple databases
CN101030175A (en) * 2006-02-28 2007-09-05 国际商业机器公司 Universal serial bus storage device and access control method thereof
CN106649772A (en) * 2016-12-27 2017-05-10 上海上讯信息技术股份有限公司 Method and equipment for accessing data
CN107545047A (en) * 2017-08-17 2018-01-05 平安科技(深圳)有限公司 The querying method and terminal device of user right data
US20180025174A1 (en) * 2016-07-21 2018-01-25 Salesforce.Com, Inc. Access controlled queries against user data in a datastore
CN108804944A (en) * 2018-06-04 2018-11-13 北京奇虎科技有限公司 Access authorization for resource configuration method based on tables of data and device
CN108830101A (en) * 2018-06-04 2018-11-16 北京奇虎科技有限公司 Application permission configuration method and device based on tables of data
CN110298189A (en) * 2018-03-23 2019-10-01 华为技术有限公司 Data base authority management method and equipment
CN110399747A (en) * 2019-07-18 2019-11-01 佳都新太科技股份有限公司 A kind of user right correlating method, querying method and device
CN110704833A (en) * 2019-10-10 2020-01-17 北京字节跳动网络技术有限公司 Data permission configuration method, device, electronic device and storage medium
CN110704872A (en) * 2019-09-24 2020-01-17 天津卓朗科技发展有限公司 Data query method and device, electronic equipment and computer readable storage medium
CN110795485A (en) * 2019-10-29 2020-02-14 杭州求是优脉科技有限公司 Database access method, device and equipment
US20200118076A1 (en) * 2008-01-15 2020-04-16 Sciquest, Inc. User-Specific Rule-Based Database Querying
CN111177671A (en) * 2019-12-16 2020-05-19 北京淇瑀信息科技有限公司 Data management platform and method and electronic equipment
CN111177789A (en) * 2020-01-07 2020-05-19 江苏满运软件科技有限公司 Authority management method, system, device and storage medium

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6366915B1 (en) * 1998-11-04 2002-04-02 Micron Technology, Inc. Method and system for efficiently retrieving information from multiple databases
CN101030175A (en) * 2006-02-28 2007-09-05 国际商业机器公司 Universal serial bus storage device and access control method thereof
US20200118076A1 (en) * 2008-01-15 2020-04-16 Sciquest, Inc. User-Specific Rule-Based Database Querying
US20180025174A1 (en) * 2016-07-21 2018-01-25 Salesforce.Com, Inc. Access controlled queries against user data in a datastore
CN106649772A (en) * 2016-12-27 2017-05-10 上海上讯信息技术股份有限公司 Method and equipment for accessing data
CN107545047A (en) * 2017-08-17 2018-01-05 平安科技(深圳)有限公司 The querying method and terminal device of user right data
CN110298189A (en) * 2018-03-23 2019-10-01 华为技术有限公司 Data base authority management method and equipment
CN108830101A (en) * 2018-06-04 2018-11-16 北京奇虎科技有限公司 Application permission configuration method and device based on tables of data
CN108804944A (en) * 2018-06-04 2018-11-13 北京奇虎科技有限公司 Access authorization for resource configuration method based on tables of data and device
CN110399747A (en) * 2019-07-18 2019-11-01 佳都新太科技股份有限公司 A kind of user right correlating method, querying method and device
CN110704872A (en) * 2019-09-24 2020-01-17 天津卓朗科技发展有限公司 Data query method and device, electronic equipment and computer readable storage medium
CN110704833A (en) * 2019-10-10 2020-01-17 北京字节跳动网络技术有限公司 Data permission configuration method, device, electronic device and storage medium
CN110795485A (en) * 2019-10-29 2020-02-14 杭州求是优脉科技有限公司 Database access method, device and equipment
CN111177671A (en) * 2019-12-16 2020-05-19 北京淇瑀信息科技有限公司 Data management platform and method and electronic equipment
CN111177789A (en) * 2020-01-07 2020-05-19 江苏满运软件科技有限公司 Authority management method, system, device and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
JAYAPANDIAN M 等: "Automated creation of a forms-based database query interface", PROCEEDINGS OF THE VLDB ENDOWMENT, vol. 1, no. 1, pages 695 - 709, XP058376001, DOI: 10.14778/1453856.1453932 *
申宝成 等: "加强数据库应用安全的权限分级方法及应用", 太原重型机械学院学报, no. 02, pages 162 - 165 *
申彦: "大规模数据集高效数据挖掘算法研究", 中国博士学位论文全文数据库信息科技辑, no. 08, pages 138 - 159 *
邓庆彬: "ESB数据操纵控制器的设计与实现", 中国优秀硕士学位论文全文数据库信息科技辑, no. 01, pages 139 - 159 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112699146A (en) * 2020-12-31 2021-04-23 新奥数能科技有限公司 Data pushing method and device based on general information model, server and storage medium
WO2024149092A1 (en) * 2023-01-10 2024-07-18 华为技术有限公司 Attribute value synchronization method and device

Also Published As

Publication number Publication date
CN111737291B (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN109901533B (en) Method and apparatus for use in a process control system
WO2022247519A1 (en) Object model device management method and apparatus, device, system, and storage medium
CN107733863B (en) Log debugging method and device under distributed hadoop environment
EP3945739A1 (en) Non-intrusive / agentless network device identification
CN106779485B (en) SOA architecture-based comprehensive management system and data processing method
CN111737291B (en) Method, device and database for querying equipment information
CN112231168A (en) Micro server control method, device, equipment and storage medium
CN103413083A (en) Security defending system for single host
CN113973275A (en) Data processing method, apparatus and medium
CN109451503A (en) A kind of offline user authentication state maintaining method and system
JP2021051740A (en) Secure off-premises access of process control data by mobile device
CN103516701A (en) Data processing method and password management system
US10063664B2 (en) Network system and control device
CN105975528B (en) Synchronization method, device and system for background configuration file
CN116069802A (en) Method, device, electronic equipment and storage medium for accessing database
JP6575311B2 (en) Network system and control device
EP3028430B1 (en) System allowing access to defined addresse after check with access-list
EP4311185A1 (en) Systems and methods for network discovery in a multi-layer operational technology network
CN116881275A (en) Database query method, device and storage medium
CN116055186A (en) Access authentication method, device, computer equipment and storage medium
CN109309608B (en) A wide-area dynamic unlocking system for smart home IoT network
CN112596491B (en) Method and apparatus for defining authorization rules for peripheral devices based on peripheral device classification
CN112565218B (en) Intelligent processing method and device for call abnormity, electronic equipment and storage medium
JP2015118459A (en) Image forming apparatus, information terminal, server apparatus, data processing system, image forming apparatus communication method, information terminal communication method, server apparatus communication method, and program
CN120068049B (en) Permission transition method, apparatus, system, device, storage medium and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant