WO2022143239A1 - 一种控制系统的设备信息查询方法及查询设备 - Google Patents
一种控制系统的设备信息查询方法及查询设备 Download PDFInfo
- Publication number
- WO2022143239A1 WO2022143239A1 PCT/CN2021/139462 CN2021139462W WO2022143239A1 WO 2022143239 A1 WO2022143239 A1 WO 2022143239A1 CN 2021139462 W CN2021139462 W CN 2021139462W WO 2022143239 A1 WO2022143239 A1 WO 2022143239A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- identification code
- query
- classification
- device information
- level
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/9038—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/906—Clustering; Classification
Definitions
- the present application relates to an information query method, in particular to a device information query method and query device of a control system.
- device information query services are often encountered, but these services involve not many types of devices, and one device belongs to multiple categories.
- a device information classification table usually It requires three data tables to process, a device information classification table, a device information table, and a relationship table to record the corresponding relationship between classification and device information.
- Another method is to record multiple values in the corresponding relationship between classification and device information in a field in the form of a character string in the form of a delimiter.
- the present application provides a method for querying device information of a control system, comprising the steps of:
- the query condition for the device information table in the database is generated according to the above classification item identification code, wherein the device information table includes a device name field and a device identification code field for storing the device name and the combined device identification code.
- the query result includes the device information record that meets the query condition obtained by the database query in the device information table according to the query instruction;
- the hierarchical classification of the device information includes L levels, each level of classification includes a plurality of classification items, the classification item identification code is used to identify the classification item, and each classification identification code corresponds to a classification item, where L is an integer greater than or equal to 1.
- the device identification code is used to identify the device, and the device identification code is generated by the binary operation of at least one of the classification item identification codes in the L-th classification.
- the initial value of the classification item identification code in each level of classification is 2 to the power of N, and N is used to represent the arrangement order of the classification items in the current level of classification.
- the device identification code is generated from a plurality of the classification item identification codes.
- the device identification code is obtained from a plurality of the classification item identification codes of the Lth level through an OR operation in binary.
- the hierarchical classification is a two-level hierarchical classification, wherein the classification item identification code of the second-level classification is an initial value of the classification item identification code of the first-level classification and the classification item identification of the second-level classification
- the initial value of the code is a decimal number formed by concatenating the initial value of the code in binary.
- the device identification code is generated from the classification item identification code of at least one second-level classification. If the device name corresponds to multiple second-level classification items, the device identification code is the classification of multiple second-level classifications.
- the item identification code is converted to a decimal number after operation in binary.
- the query condition is that the classification item identification code and the device identification code perform an AND operation in binary
- the result is equal to the classification identification code; if the query condition is satisfied, the query result includes the device identification code and its corresponding device name.
- the query condition is multiple classification item identification codes
- the result of binary AND operation with the device identification code after performing binary XOR of the code is equal to zero; if the query condition is established, the query result includes the device identification code and its corresponding device name.
- the query request includes multiple classification item identification codes
- the equipment information belonging to multiple classification items is to be queried at the same time, and the classification level of the equipment information is one level, the query condition is the multiple classification items.
- the classification item identification code performs binary XOR, and then performs binary AND operation with the device identification code, which is greater than or equal to the binary XOR value of the multiple classification items; if the condition is true, the identification code and device name included in the query result belong to all the categories at the same time. describe multiple categories.
- the present application also provides a query device for a control system, comprising: a query request receiving device for receiving a query request from a client, the query request carrying a classification item identification code generated by hierarchical classification of device information; query condition generation an apparatus for generating a query condition for a device information table in a database according to the classification item identification code, wherein the device information table includes a device name field and a device identification code field for storing the device name and the device identification code.
- a query device used for sending a query instruction including the query conditions to a database for query
- a query result receiving device used for receiving the query result returned by the database, and sending the device identification code or device in the device information record obtained by the query name to the client; wherein the query result includes the device information records that meet the query conditions obtained by the database query in the device information table according to the query instruction.
- This application realizes the rapid query of equipment information by directly querying the equipment information table of the database. Because the equipment identification code is generated from the classification item identification code, it contains the corresponding information of the equipment and the classification item, so there is no need to construct multiple tables. There is no need to query multiple tables; in addition, by converting the device identification code from the binary sequence to the decimal system, various data classification situations are recorded, and the effect of fast indexing is achieved through certain operations.
- FIG. 1 is a schematic diagram of a control system according to an embodiment of the present application.
- FIG. 1 is a schematic diagram of a control system according to an embodiment of the present application.
- the control system 10 includes a client 11, a server 12, a gateway 13, a plurality of sensors 14, a plurality of lamps 15, a controller (not shown), a database (not shown) and other devices.
- This embodiment The user can query the device information in the control system on the client 11, and can also query the device information on other clients.
- the query request is sent to the server through a wired or wireless network, and the server can query the stored device information.
- An embodiment of the present application provides a method for querying device information, including the steps of: receiving a query request from a client, and the query request carries a classification item identification code generated by hierarchical classification of device information;
- the hierarchical classification of device information in this embodiment only includes first-level classification, wherein the first-level classification items of device information include "gateway”, "home lighting equipment”, “controller”, "sensor” And “office lighting equipment”, the unique identification code of each classification item in the first-level classification is the classification item identification code, and its initial value is set to the Nth power of 2 in order, and N is the Nth in the first-level classification.
- the equipment information table includes the equipment name field and the equipment identification code field.
- the equipment identification code and its corresponding device name are filled in the equipment identification field and the equipment name field in the equipment information table and Store the device information table in the database.
- Each device in the device information table in Table 2 has its own classification.
- “Bluetooth gateway” belongs to the first-level classification item "gateway”
- “embedded downlight” also belongs to the first-level classification item "home lighting equipment and office lighting equipment”. ;
- “Bluetooth Gateway” only belongs to one first-level classification item “Gateway”
- the device identification code of "Bluetooth Gateway” is set to the classification item identification code 00000001 of the first-level classification item "Gateway” of its upper level, and converted into Decimal number 1 is stored in the equipment information table of the database
- “embedded downlight” belongs to "home lighting equipment and office lighting equipment", which means that embedded downlight corresponds to two first-level classification items, among which "home lighting equipment”
- the classification item identification code is 00000010, and the classification item identification code of "office lighting equipment” is 00010000, then the equipment identification code of the embedded downlight is calculated from the classification item identification codes of the two first-level classifications above it.
- the method can perform "or" operation on the two first-class classification item identification codes in binary; the binary string corresponding to the equipment identification code 2 of the first-level classification item "home lighting equipment” is 00000010, and the classification of "office lighting equipment”
- the binary string corresponding to the item identification code 16 is 00010000, and the two binary strings are bitwise or later to obtain 00010010, which is converted to decimal as 18, that is, 00000010
- 00010000 00010010, and the decimal number 18 is stored in the device ID in the device information table code field.
- the server Generate the query condition for the device information table in the database according to the classification item identification code included in the query request received by the server; the server generates the query database instruction including the query condition, and sends it to the database to query the target device information;
- the query result includes the device information record that meets the query condition obtained by the database query in the device information table according to the query instruction;
- Table 1 Control system equipment information first-level classification item table
- the classification level of equipment information is level one
- the query condition generated by the server is: the identification code of the category item and the equipment
- the result of the "AND" operation of the identification code in binary is equal to the classification identification code; if the query condition is satisfied, the returned query result includes the device identification code and its corresponding device name.
- the device information corresponding to this device identification code belongs to the target device information to be queried.
- the query condition is: "multiple classification items”
- the classification item identification code performs binary "exclusive OR” operation and then performs binary "AND” operation with the equipment identification code, and the result is not equal to zero.
- the device identification code and its corresponding device name belong to the device information to be queried.
- the query condition is: "Multiple classification item identification codes are binary After XOR, perform binary AND operation with the device identification code, which is greater than or equal to the binary XOR value of multiple classification items”;
- the identification code and device name included in the query result belong to the plurality of classification items at the same time.
- the method for querying device information includes receiving a query request from a client carrying a classification item identification code generated by two-level classification for device information; wherein, each level of classification item identification code is generated by the following method : First, the initial value of the classification item identification code of each level of classification item is set to the power of 2, where N is the arrangement order of the classification item in this level of classification items; secondly, the classification item identification code of the first-level classification item is set as Its initial value; the classification item identification code of the secondary classification item is a decimal number generated by splicing the initial value of the classification item identification code of the primary classification item and the initial value of the classification item identification code of the secondary classification item in binary. .
- the generation process of the classification item identification code of the secondary classification item "lamp panel” is as follows: the initial value of the classification item identification code of the primary classification item "office lighting equipment” is: 00000001, the secondary classification The initial of the classification item identification code of the item "lamp panel”: 00000001; then, the classification item identification code of "lamp panel” is the combination of the two: 0000000100000001, which is converted into a decimal number of 257.
- the generation process of the classification item identification code of the secondary classification item "wireless gateway” is as follows:
- the initial value of the classification item identification code of the first-level classification item "Gateway" corresponding to "Wireless Gateway” is: 00000010; the initial value of the classification item identification code of the second-level classification item "Wireless Gateway” is set to 00010000; : 0000001000010000, converted into decimal number 528 as the classification item identification code of the wireless gateway.
- the device identification code in the equipment information under the L-level classification item is generated by the classification item identification code of one L-level classification item or by the classification item identification code of multiple L-level classification items after the "OR" operation is performed in binary. , and then converted to decimal to generate a decimal number.
- the device name and the device identification code are filled in the device information table, and then the device information table is stored in the database, wherein the device information table at least includes the device name field and the device identification code field.
- the query conditions set according to the identification codes of multiple classification items are: "After the identification codes of multiple classification items to be searched are subjected to the "exclusive OR” operation, and the equipment identification The result of the "AND” operation of the code is greater than or equal to the "exclusive OR” operation result of the identification codes of the classification items to be checked.
- the query method is to shift the category item identification code of the first-level category item to the left to generate an intermediate item A with the same length as the category item identification code of the second-level category item, and generate an intermediate item A with the same length as the category item identification code of the second-level category item.
- the middle item A and then perform an "AND" operation on A and the device identification code, and the "AND" operation result is equal to A.
- the calculation results meet the query conditions, and the query results include Two device information for grille light panel and recessed downlight.
- the query result includes the device information record that meets the query condition obtained by the database query in the device information table according to the query instruction;
- the present application also provides a query device for a control system, comprising: a query request receiving device for receiving a query request from a client, the query request carrying a classification item identification code generated by hierarchical classification of device information; query condition generation an apparatus for generating a query condition for a device information table in a database according to the classification item identification code, wherein the device information table includes a device name field and a device identification code field for storing the device name and the device identification code.
- a query device configured to send a query instruction including the query condition to a database;
- the query result receiving device is used for receiving the query result returned by the database, and sending the device identification code or device name in the device information record obtained by the query to the client; wherein the query result includes the database in the device information table according to the query instruction.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本申请提供了一种控制系统的设备信息查询方法,包括步骤:接收来自客户端的查询请求,所述查询请求携带有设备信息按层级分类生成的分类项标识码;根据所述分类项标识码生成对数据库中设备信息表的查询条件,其中所述设备信息表包括设备名称字段和设备标识码字段,用于存储设备名称和合设备标识码;发送包括所述查询条件的查询指令到数据库;接收数据库返回的查询结果,其中查询结果包括数据库根据所述查询指令在设备信息表中查询得到的符合所述查询条件的设备信息记录;发送所述查询到的设备信息记录中的设备标识码或设备名称到客户端。本申请通过由分类项标识码生成的设备标识码直接查询数据库的设备信息表实现了对设备信息的快速查询。
Description
本申请要求了申请日为2020年12月31日,申请号为202011619661.4,发明名称为“一种控制系统的设备信息查询方法及查询设备”的中国专利申请的优先权,该项专利申请的全部内容通过引用结合在本申请中。
本申请涉及一种信息查询方法,特别是涉及控制系统的设备信息查询方法及查询设备。
控制系统的一些日常业务中,经常会遇到设备信息查询业务,但是这些业务涉及到的设备类别种类不多,并且一个设备属于多个分类,而对这种多对多关系的业务场景,通常是需要三张数据表来处理,一个设备信息分类表,一个设备信息表,还有一个关系表把分类和设备信息的对应关系记录下来。另一种方法是以分隔符的方式,把分类及设备信息对应关系中的多个值以字符串的形式记录在一个字段里。
通过第一种关系表的方式对存储的设备信息进行查询时,需要在数据库中查多张表,查询效率比较低,而且由于需要存储多张表,存储效率也比较低。以分隔符连接成字符串形式的方式对设备信息进行查询时,由于字符串中存在分隔符,所以无法快速索引,查询效率也比较低。
发明内容
针对以上问题,本申请提供了一种控制系统的设备信息的查询方法,包括步骤:
接收来自客户端的查询请求,查询请求携带有设备信息按层级分类生成的分类项标识码;
根据上述分类项标识码生成对数据库中设备信息表的查询条件,其中所述设备信息表包括设备名称字段和设备标识码字段,用于存储设备名称和合设备标识码。
发送包括所述查询条件的查询指令到数据库;
接收数据库返回的查询结果,其中查询结果包括数据库根据所述查询指令在设备信息表中查询得到的符合所述查询条件的设备信息记录;
发送所述查询到的设备信息记录中的设备标识码或设备名称到客户端。
优选地,设备信息的层级分类包括L级,所述每一级分类包括多个分类项,所述分类项标识码用于标识所述分类项,每一个所述分类标识码对应一个分类项,其中L为大于等于1的整数。
优选地,设备标识码用于标识设备,所述设备标识码由第L级分类中的至少一个所述分类项标识码通过二进制运算生成。
优选地,每一级分类中所述分类项标识码的初始值为2的N次方,N用于表示所述分类项在本级分类中的排列次序。
优选地,如果一个设备名称和第L级分类的多个所述分类项相对应,则所述设备标识码由多个所述分类项标识码生成。
优选地,所述设备标识码由第L级的多个所述分类项标识码在二进制下通过或运算获得。
优选地,每个第M级分类的所述分类项标识码由至少一个第M-1级分类的所述分类项标识码和第M级分类的所述分类项标识码的初始值生成,其中M>=2且M<=L。
优选地,层级分类是两级层级分类,其中第二级分类的所述分类项标识码是一个第一级分类的所述分类项标识码的初始值和第二级分类的所述分类项标识码的初始值在二进制下拼接后形成的十进制数。
优选地,设备标识码由至少一个第二级分类的所述分类项标识码生成,如果设备名称和多个第二级分类项对应,则设备标识码是多个第二级分类的所述分类项标识码在二进制下运算后转换成形成的一个十进制数。
优选地,当查询请求中只包括一个所述分类项标识码,且设备信息分类层级是一级时,所述查询条件为所述分类项标识码与所述设备标识码在二进制下进行与运算的结果等于所述分类识别码;如果查询条件成立,则查询结果包括所述设备标识码及其对应的设备名称。
优选地,当查询请求中包括多个分类项标识码时,如果要查询所述多个分类项下的设备信息、且设备信息分类层级是一级,则所述查询条件为多个分类项标识码进行二进制异或后再和所述设备标识码进行二进制与运算的结果等于零;如果查询条件成立,则查询结果包括所述设备标识码及其对应的设备名称。
优选地,当查询请求中包括多个分类项标识码时,如果要查询同时属于多个分类项下的设备信息,且所述设备信息的分类层级是一级,则查询条件为所述多个分类项标识码进行二进制异或后再和设备标识码进行二进制与运算大于或等于所述多个分类项的二进制异或值;如果条件成立,则查询结果包括的标识码和设备名称同时属于所述多个分类项。
本申请还提供了一种控制系统的查询设备,包括:查询请求接收装置,用于接收来自客户端的查询请求,所述查询请求携带有设备信息按层级分类生成的分类项标识码;查询条件生成装置,用于根据所述分类项标识码生成对数据库中设备信息表的查询条件,其中所述设备信息表包括设备名称字段和设备标识码字段,用于存储设备名称和合设备标识码。查询装置,用于发送包括所述查询条件的查询指令到数据库进行查询;查询结果接收装置,用于接收数据库返回的查询结果,并发送所述查询到的设备信息记录中的设备标识码或设备名称到客户端;其中查询结果包括数据库根据所述查询指令在设备信息表中查询得到的符合所述查询条件的设备信息记录。
本申请通过直接查询数据库的设备信息表实现了对设备信息的快速查询,设备标识码因为由分类项标识码生成,包含了设备和分类项的对应信息,从而不需要构造多张表,查询时也不需要查询多张表;此外,通过把设备标识码从二进制序列转换到十进制的方式,达到了 记录多种数据分类情况,并且通过一定的运算实现了快速索引的效果。
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1是本申请实施例的控制系统的示意图。
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
图1是本申请实施例的控制系统的示意图。参照图1,控制系统10包括客户端11、服务器12、网关13、多个传感器14、多个灯具15、控制器(未示出)、数据库(未示出)等多个设备,本实施例中用户在客户端11进行控制系统中的设备信息的查询,也可以在其它客户端上进行设备信息的查询,查询请求通过有线或无线网络发送到服务器,通过服务器对存储的设备信息查询。本申请实施例提供了一种设备信息的查询方法,包括步骤:接收来自客户端的查询请求,查询请求携带设备信息按层级分类生成的分类项标识码;
结合表1和表2,本实施例中设备信息的层级分类只包括一级分类,其中,设备信息的一级分类项包括“网关”、“家居照明设备”、“控制器”、“传感器”和“办公照明设备”,一级分类中的每个分类项的唯一标识码为分类项标识码,其初始值按顺序设定为2的N次方,N是在一级分类中的第N个分类项,在二进制下,每一个分类项标识码占用一个字节的一个比特位,如“网关”的分类项标识码为:00000001;按顺序第二个一级分类项“家居灯具”的分类项标识码为:00000010;第三个“控制器”的分类项标识码为:00000100以此类推,如果一个字节长度不够,可以增加字节长度。
参照表2,设备信息表包括设备名称字段和设备标识码字段,当求出设备标志码后,把设备标志码及其对应的设备名称填入设备信息表中的设备标识字段和设备名称字段并把设备信息表存入数据库中。
表2设备信息表中的每一个设备都有所属分类,如“蓝牙网关”属于一级分类项“网关”,“嵌入式筒灯”同时属于一级分类项“家居照明设备和办公照明设备”;其中,“蓝牙网关”只属于一个一级分类项“网关”,则“蓝牙网关”的设备标识码设为其上一级的一级分类项“网关”的分类项标识码00000001,转换成十进制数1存入数据库的设备信息表;而“嵌入式筒灯”属于“家居照明设备和办公照明设备”,意味着嵌入式筒灯对应两个一级分类项,其中“家居照明设备”的分类项标识码为00000010,“办公照明设备”的分类项标识码为00010000,则嵌入式筒灯的设备标识码由其上一级两个一级分类的分类项 标识码计算得出,具体计算方法可以把两个一级分类的分类项标识码在二进制下进行“或”运算;一级分类项“家居照明设备”的设备标识码2对应的二进制串为00000010,“办公照明设备”的分类项标识码16对应的二进制串为00010000,两个二进制数串按位或以后,得到00010010,转为十进制为18,即00000010|00010000=00010010,把十进制数18存入设备信息表中的设备标识码字段。
根据服务器接收到的查询请求中包括的分类项标识码生成对数据库中设备信息表的查询条件;服务器生成包括查询条件的查询数据库指令,并发送到数据库进行目标设备信息查询;
接收数据库返回的查询结果,其中查询结果包括数据库根据所述查询指令在设备信息表中查询得到的符合所述查询条件的设备信息记录;
发送所述查询到的设备信息记录中的设备标识码或设备名称到客户端。
表1:控制系统设备信息一级分类项表
| 分类项标识码 | 分类项名称 |
| 1 | 网关 |
| 2 | 家居照明设备 |
| 4 | 控制器 |
| 8 | 传感器 |
| 16 | 办公照明设备 |
表2设备信息表
| 设备名称 | 设备标识码 |
| 蓝牙网关 | 1 |
| 嵌入式筒灯 | 4 |
当查询一个分类项下的设备信息时,即请求中只包括一个所述分类项标识码,本实施例中设备信息分类层级为一级,服务器生成的查询条件为:该分类项标识码与设备标识码在二进制下进行“与”运算的结果等于该分类识别码;如果查询条件成立,则返回的查询结果包括设备标识码及其对应的设备名称。比如我们要查询属于一级分类项“网关”的设备信息,那么数据库的查询条件为:“网关分类项标志码&设备标志码==(等于)网关分类项标识码”,如果条件成立,则此设备标识码对应的设备信息属于要查询的目标设备信息,表2中,蓝牙网关的设备标识码为1,嵌入式筒灯的设备标志码为18,分别和网关分类项标识码进行“与”运算,即(1)00000001&00000001=00000001,符合查询条件;(2)00000010&00010010=2,不符合查询条件,所以蓝牙网关的设备标识码及对应蓝牙网关为所要查询的结果。
当查询属于多个一级分类项中的设备信息时,即查询请求中包括多个分类项标识码时,本实施例中设备信息分类层级是一级,则所述查询条件为:“多个分类项标识码进行二进制“异或”运算后再和设备标识码进行二进制“与”运算的结果不等于零”。
如果设备标识码符合查询条件,则该设备标识码及其对应的设备名称是属于要查询的设备信息。
本实施例中,如要查询属于“网关”或“家居照明设备”的相关设备,那么查询条件为:“(000000001 xor 00000010)&设备标识码!=0”;把蓝牙网关的设备标识码00000001,嵌入式筒灯的设备标识码00010010带入查询条件进行运算,即000000101&00000001=000000001!=0,00000011&00010010=00000010!=0,两个运算结果都不等于0,都符合查询条件,所以嵌入式筒灯和网关为所要查询的结果。
当查询同时符合多个分类项的设备时,即查询请求中包括多个分类项标识码,且所述设备信息的分类层级是一级,则查询条件为:“多个分类项标识码进行二进制异或后再和设备标识码进行二进制与运算大于或等于多个分类项的二进制异或值”;
如果条件成立,则查询结果中包括的标识码和设备名称同时属于所述多个分类项。本实施例中,当需要查询既属于分类项“家居照明设备”又属于分类项“办公照明设备”的设备信息时,查询条件为:(2 xor 16)&设备标识码>=(2 xor 16),其中2是家居照明设备的分类项标识码,16位办公照明设备的分类项标识码,通过计算18&1=0;18&18=18;所以嵌入式筒灯及其设备标识码即为所要查询的目标设备。
本申请的实施例二的设备信息的查询方法中,包括接收来自客户端的查询请求携带对设备信息按两级分类生成的分类项标识码;其中,每一级分类项标识码由下面的方法产生:首先为每级分类项的分类项标识码设置初始值为2的N次方,N是该分类项在本级分类项的排列次序;其次,一级分类项的分类项标识码设定为其初始值;二级分类项的分类项标识码是一个由一级分类项的分类项标识码的初始值和二级分类项的分类项标识码的初始值在二进制下拼接后生成的十进制数。本实施例中采用了二级分类,不过并不限于此,可以推广到L级,L为大于2的整数,其中,L级分类中每一级分类项的分类项标识码产生规则如下:M级分类的分类项标识码由至少一个第M-1级分类的分类项标识码的初始值和第M级分类的分类项标识码的初始值生成,其中M>2且M<=L。
参照表3,本实施例中,比如二级分类项“灯盘”的分类项标识码生成过程如下:一级分类项“办公照明设备”的分类项标识码初始值为:00000001,二级分类项“灯盘”的分类项标识码的初始:00000001;则,“灯盘”的分类项标识码为两者拼接:0000000100000001,转换成的十进制数257。
二级分类项“无线网关”的分类项标识码的生成过程如下:
“无线网关”对应的一级分类的分类项“网关”的分类项标识码的初始值为:00000010;二级分类项“无线网关”的分类项标识码的初始值设置为00010000;两者拼接:0000001000010000,转换成十进制数528做为无线网关的分类项标识码。
设备信息表4中,“格栅灯盘”属于“办公照明设备”下的二级分类项“灯盘”,所以设备标识码为257;而“嵌入式筒灯”既属于“办公照明设备”下的“筒灯”58,又属于“家居照明设备”下的“筒灯”1088,把520和1056在二进制下进行或运算后转换成十进制等于1576,故其设备标识码为1576。
以此类推,L级分类项下设备信息中设备标识码,由一个L级分类项的分类项标识码生成或者由多个L级分类项的分类项标识码在二进制下通过“或”运算后,再转换而成十进制后生成的十进制数。
计算出设备标识码后,把设备名称和设备标识码填入设备信息表,然后设备信息表存入数据库中,其中设备信息表至少包括设备名称字段和设备标识码字段。
根据分类项标识码生成对数据库中设备信息表的查询条件,发送包括查询条件的查询指令到数据库;
当查询一个二级分类项所属的设备信息时,查询条件为:用这个分类项对应的分类项标识值和设备标识码做“与”运算,如果运算结果等于该分类项标识值,则符合查询条件。如我们要查询属于二级分类项“灯盘”下的设备信息,那么查询条件设为:257&设备标识码等于257,其中,值257是二级分类项“灯盘”的分类项标识码;参照表4,设备信息表中包括格栅灯盘标识码和嵌入式筒灯标识码,把它们分别和灯盘标识码257进行“与”运算,257&257=257,258&1346=256,运算后得出格栅灯盘符合查询条件,即格栅灯盘为所要查询的结果,查询返回包括格栅灯盘的设备标识码和设备名称-格栅灯盘的信息。
如果查询符合多个第二级分项所属的设备信息的,那么设定的查询条件为,多个要查询的分类项标识码异或,然后与设备标识码与运算的结果不等于零。如要查询属于二级分类项“灯盘”或““筒灯”下的照明设备信息,那么查询条件为:(257 xor 258)&设备标识码!=0;其中257为灯盘的分类项标识码,258为筒灯的分类项标识码;参照设备信息表4,计算3&257=1;3&1346=2;计算结果都不为零,符合查询条件,所以格栅灯盘、嵌入式筒灯即为所要查询的结果。
当要查询同时符合多个二级分类项的设备信息时,根据多个分类项标识码设定的查询条件为:“多个要查的分类项标识码进行“异或”运算后和设备标志码进行“与”运算的结果大于等于多个要查的分类项标识码的“异或”运算结果。如我们要查询既属于“办公照明设备”下“筒灯”又属于“家居照明设备”下“筒灯”的设备信息,那么查询条件为:(258 xor 1088)&设备标识码>=(258 xor 1088),把表4的设备标志码分别代入后,1346&1=0,计算结果不符合查询条件;1346&1346=1346,计算结果符合查询条件;则设备标识码1346及对应设备名称嵌入式筒灯是要查询的结果。
当要查询一个一级分类项的设备信息时,查询方式为把一级分类项的分类项标识码左移生成一个和二级分类项的分类项标识码长度相同的一个中间项A,生成一个中间项A,然后把A和设备标识码进行“与”运算,“与”运算结果等于A。
如要查询属于一级分类项“办公照明设备”的设备信息,那么查询条件为:(1<<8)&设备标识码==(1<<8),其中,1为办公照明设备的分类项标识码,左移8位后生成两个字节长度的分类项标识码256,把设备标志码分别代入进行计算:256&257=256;256&1346=256;计算结果都符合查询条件,则查询结果包括格栅灯盘和嵌入式筒灯两个设 备信息。
当要查询符合多个第一级分类项所属的设备信息时,比如要查询属于“办公照明设备”或“网关”的设备信息,那么查询条件为:“两个一级分类项的分类项标识码移位后异或的计算结果后再和设备标识码进行与运算的结果不等于零”即(1<<8 xor 2<<8)&设备标识码!=0,其中整数1为办公照明设备的分类项标识码,整数2为家居照明设备的分类项标识码,两个异或结果为768,异或结果768分别和设备表中格栅筒灯和嵌入式筒灯的设备标识码进行与运算,768&257=256;768&1346=256;计算结果不等于零所以格栅筒灯和嵌入式筒灯即为所要查询的结果。
当查询同时符合多个一级分类项的设备信息时,如要查询既属于“办公照明设备”又属于“家居照明设备”的设备信息,那么根据查询请求中的分类项标识码生存查询条件为:“两个一级分类项的分类项标识码移位后异或的计算结果B再和设备标识码进行与运算的结果大于等于B”,即(1<<8 xor 4<<8)&设备标识码>=(1<<8 xor 4<<8);其中整数1为办公照明设备的分类项标识码,整数4为家居照明设备的分类标识码,移位异或的结果1280分别和设备标识码进行与运算,1280&257=256;1280&1346=1280;根据计算结果嵌入式筒灯为要查询的结果。
接收数据库返回的查询结果,其中查询结果包括数据库根据所述查询指令在设备信息表中查询得到的符合所述查询条件的设备信息记录;
发送所述查询到的设备信息记录中的设备标识码或设备名称到客户端。
表3-本申请实施例二的两极分类表
表四-本申请实施例二的设备信息表
| 设备名称 | 设备标识码 |
| 格栅灯盘 | 257 |
| 嵌入式筒灯 | 1346 |
本申请还提供了一种控制系统的查询设备,包括:查询请求接收装置,用于接收来自客户端的查询请求,所述查询请求携带有设备信息按层级分类生成的分类项标识码;查询条件生成装置,用于根据所述分类项标识码生成对数据库中设备信息表的查询条件,其中所述设备信息表包括设备名称字段和设备标识码字段,用于存储设备名称和合设备标识码。查询装 置,用于发送包括所述查询条件的查询指令到数据库;
查询结果接收装置,用于接收数据库返回的查询结果,并发送所述查询到的设备信息记录中的设备标识码或设备名称到客户端;其中查询结果包括数据库根据所述查询指令在设备信息表中查询得到的符合所述查询条件的设备信息记录。
应该注意的是上述实施例对本申请进行说明而不是对本申请进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本申请可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
至此,本领域技术人员应认识到,虽然本文已详尽示出和描述了本申请的多个示例性实施例,但是,在不脱离本申请精神和范围的情况下,仍可根据本申请公开的内容直接确定或推导出符合本申请原理的许多其他变型或修改。因此,本申请的范围应被理解和认定为覆盖了所有这些其他变型或修改。
Claims (15)
- 一种控制系统的设备信息查询方法,包括步骤:接收来自客户端的查询请求,所述查询请求携带有设备信息按层级分类生成的分类项标识码;根据所述分类项标识码生成对数据库中设备信息表的查询条件,其中所述设备信息表包括设备名称字段和设备标识码字段,用于存储设备名称和合设备标识码;发送包括所述查询条件的查询指令到数据库;接收数据库返回的查询结果,其中查询结果包括数据库根据所述查询指令在设备信息表中查询得到的符合所述查询条件的设备信息记录;发送所述查询到的设备信息记录中的设备标识码或设备名称到客户端。
- 根据权利要求1所述的控制系统的设备信息查询方法,其特征在于,设备信息的层级分类包括L级,所述每一级分类包括多个分类项,所述分类项标识码用于标识所述分类项,每一个所述分类标识码为一个十进制数并对应一个分类项,其中L为大于等于1的整数。
- 根据权利要求2所述的控制系统的设备信息查询方法,其特征在于,所述设备标识码用于标识设备,所述设备标识码为十进制数,由第L级分类中的至少一个所述分类项标识码生成。
- 根据权利要求3所述的控制系统的设备信息查询方法,其特征在于,每一级分类中所述分类项标识码的初始值为2的N次方,N用于表示所述分类项在本级分类中的排列次序。
- 根据权利要求4所述的控制系统的设备信息查询方法,其特征在于,如果一个设备名称和第L级分类的多个所述分类项相对应,则所述设备标识码由多个所述分类项标识码生成。
- 根据权利要求5所述的控制系统的设备信息查询方法,其特征在于,所述设备标识码由第L级的多个所述分类项标识码在二进制下通过或运算获得。
- 根据权利要求4所述的控制系统的设备信息查询方法,其特征在于,每个第M级分类的所述分类项标识码由至少一个第M-1级分类的所述分类项标识码和第M级分类的所述分类项标识码的初始值生成,其中M>=2且M<=L。
- 根据权利要求7所述的控制系统的设备信息查询方法,其特征在于,所述层级分类是两级层级分类,其中第二级分类的所述分类项标识码是一个第一级分类的所述分类项标识码的初始值和第二级分类的所述分类项标识码的初始值在二进制下拼接后形成的十进制数。
- 根据权利要求8所述的控制系统的设备信息查询方法,其特征在于,所述设备标识码 由至少一个第二级分类的所述分类项标识码生成,如果设备名称和多个第二级分类项对应,则设备标识码是多个第二级分类的所述分类项标识码在二进制下运算后转换成形成的一个十进制数。
- 根据权利要求1到9任意一项控制系统的设备信息查询方法,其特征在于,当查询请求中只包括一个所述分类项标识码,且设备信息分类层级是一级时,所述查询条件为所述分类项标识码与所述设备标识码在二进制下进行与运算的结果等于所述分类识别码;如果查询条件成立,则查询结果包括所述设备标识码及其对应的设备名称。
- 根据权利要求1到9任意一项控制系统的设备信息查询方法,其特征在于,当查询请求中包括多个分类项标识码时,如果要查询所述多个分类项下的设备信息、且设备信息分类层级是一级,则所述查询条件为多个分类项标识码进行二进制异或后再和所述设备标识码进行二进制与运算的结果等于零;如果查询条件成立,则查询结果包括所述设备标识码及其对应的设备名称。
- 根据权利要求1到9任意一项所述的控制系统的设备信息查询方法,其特征在于,当查询请求中包括多个分类项标识码时,如果要查询同时属于多个分类项下的设备信息,且所述设备信息的分类层级是一级,则查询条件为所述多个分类项标识码进行二进制异或后再和设备标识码进行二进制与运算大于或等于所述多个分类项的二进制异或值;如果条件成立,则查询结果包括的标识码和设备名称同时属于所述多个分类项。
- 一种控制系统的设备信息查询方法,包括步骤:向服务器发送查询请求,所述查询请求携带有设备信息按层级分类生成的十进制数的分类项标识码;接收查询结果,其中,查询结果包括由服务器根据所述分类项标识码生成的查询条件查询数据库的设备信息表获得的设备信息,其中设备信息包括十进制的设备标识码;在客户端上显示所述设备信息。
- 根据权利要求13所述的设备信息查询方法,其特征在于,所述设备信息表包括设备名称字段和设备标识码字段,用于存储设备名称和合设备标识码,其中所述每个设备标志码是一个由至少一个所述分类项标识码生成的十进制数。
- 一种控制系统的查询设备,其特征在于,包括:查询请求接收装置,用于接收来自客户端的查询请求,所述查询请求携带有设备信息按层级分类生成的分类项标识码;查询条件生成装置,用于根据所述分类项标识码生成对数据库中设备信息表的查询条件,其中所述设备信息表包括设备名称字段和设备标识码字段,用于存储设备名称和合设备标识码;查询装置,用于发送包括所述查询条件的查询指令到数据库进行查询;查询结果接收装置,用于接收数据库返回的查询结果,并发送所述查询到的设备信息记录中的设备标识码或设备名称到客户端;其中查询结果包括数据库根据所述查询指令在设备信息表中查询得到的符合所述查询条件的设备信息记录。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011619661.4 | 2020-12-31 | ||
| CN202011619661.4A CN112765408B (zh) | 2020-12-31 | 2020-12-31 | 一种控制系统的设备信息查询方法及查询设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022143239A1 true WO2022143239A1 (zh) | 2022-07-07 |
Family
ID=75698194
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/139462 Ceased WO2022143239A1 (zh) | 2020-12-31 | 2021-12-20 | 一种控制系统的设备信息查询方法及查询设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN112765408B (zh) |
| WO (1) | WO2022143239A1 (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112765408B (zh) * | 2020-12-31 | 2024-08-20 | 欧普照明股份有限公司 | 一种控制系统的设备信息查询方法及查询设备 |
| CN114840609A (zh) * | 2022-02-24 | 2022-08-02 | 中国平安人寿保险股份有限公司 | 目标分类的方法、装置、计算机设备及存储介质 |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070027856A1 (en) * | 2005-07-27 | 2007-02-01 | Nhn Corporation | Product searching system and method using search logic according to each category |
| CN102135932A (zh) * | 2011-03-08 | 2011-07-27 | 浪潮(北京)电子信息产业有限公司 | 一种监控系统及监控方法 |
| CN104090949A (zh) * | 2014-07-02 | 2014-10-08 | 河海大学 | 面向水利数据整合与共享的索引方法 |
| CN104645610A (zh) * | 2014-09-22 | 2015-05-27 | 北京乐动卓越科技有限公司 | 一种游戏对象标识码的编码方法及系统 |
| CN106547843A (zh) * | 2016-10-14 | 2017-03-29 | 深圳峰创智诚科技有限公司 | 多级分类查询方法和装置 |
| CN110096627A (zh) * | 2019-03-27 | 2019-08-06 | 北京星坊科技有限公司 | 珠宝信息的查询方法、装置、计算机设备和存储介质 |
| CN112765408A (zh) * | 2020-12-31 | 2021-05-07 | 欧普照明股份有限公司 | 一种控制系统的设备信息查询方法及查询设备 |
Family Cites Families (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8463805B2 (en) * | 2010-09-15 | 2013-06-11 | Cbs Interactive, Inc. | Mapping product identification information to a product |
| CN102098659B (zh) * | 2011-02-11 | 2013-07-24 | 王兰睿 | 一种快速校验国际移动设备标识的方法及系统 |
| KR20120114430A (ko) * | 2011-03-18 | 2012-10-17 | 한신평신용정보 주식회사 | 콘택 등급 정보를 이용한 전화 마케팅 시스템 및 그 방법 |
| WO2013053092A1 (zh) * | 2011-10-10 | 2013-04-18 | 华为技术有限公司 | 获取用户设备信息的方法、设备和系统 |
| CN104378233B (zh) * | 2014-11-17 | 2018-04-03 | 北京百度网讯科技有限公司 | 设备统一管理方法、纳入方法及相应装置 |
| WO2016132472A1 (ja) * | 2015-02-18 | 2016-08-25 | 三菱電機株式会社 | データ検索装置及びデータ検索方法及びデータ検索プログラム |
| WO2016178127A1 (en) * | 2015-05-03 | 2016-11-10 | Arm Technologies Israel Ltd. | System, device, and method of managing trustworthiness of electronic devices |
| CN106681999B (zh) * | 2015-11-05 | 2021-01-26 | 阿里巴巴集团控股有限公司 | 一种数据表查询方法及设备 |
| CN108268799B (zh) * | 2017-12-28 | 2020-09-01 | 上海数据交易中心有限公司 | 数据查询系统和方法、存储介质、终端 |
| CN108647333A (zh) * | 2018-05-11 | 2018-10-12 | 中国林业科学研究院资源信息研究所 | 一种信息共享方法、装置及设备 |
| CN109308305B (zh) * | 2018-09-30 | 2021-06-08 | 广州圣亚科技有限公司 | 监测数据的查询方法、装置和计算机设备 |
| CN109710862A (zh) * | 2019-01-02 | 2019-05-03 | 深圳壹账通智能科技有限公司 | 信息查询方法、装置、计算机设备和存储介质 |
| CN111241350B (zh) * | 2020-01-07 | 2024-02-02 | 平安科技(深圳)有限公司 | 图数据查询方法、装置、计算机设备和存储介质 |
| CN111858601B (zh) * | 2020-07-23 | 2024-11-29 | 中国平安财产保险股份有限公司 | 树形结构数据查询方法、装置、设备及存储介质 |
-
2020
- 2020-12-31 CN CN202011619661.4A patent/CN112765408B/zh active Active
-
2021
- 2021-12-20 WO PCT/CN2021/139462 patent/WO2022143239A1/zh not_active Ceased
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20070027856A1 (en) * | 2005-07-27 | 2007-02-01 | Nhn Corporation | Product searching system and method using search logic according to each category |
| CN102135932A (zh) * | 2011-03-08 | 2011-07-27 | 浪潮(北京)电子信息产业有限公司 | 一种监控系统及监控方法 |
| CN104090949A (zh) * | 2014-07-02 | 2014-10-08 | 河海大学 | 面向水利数据整合与共享的索引方法 |
| CN104645610A (zh) * | 2014-09-22 | 2015-05-27 | 北京乐动卓越科技有限公司 | 一种游戏对象标识码的编码方法及系统 |
| CN106547843A (zh) * | 2016-10-14 | 2017-03-29 | 深圳峰创智诚科技有限公司 | 多级分类查询方法和装置 |
| CN110096627A (zh) * | 2019-03-27 | 2019-08-06 | 北京星坊科技有限公司 | 珠宝信息的查询方法、装置、计算机设备和存储介质 |
| CN112765408A (zh) * | 2020-12-31 | 2021-05-07 | 欧普照明股份有限公司 | 一种控制系统的设备信息查询方法及查询设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112765408B (zh) | 2024-08-20 |
| CN112765408A (zh) | 2021-05-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8977660B1 (en) | Multi-level distributed hash table for data storage in a hierarchically arranged network | |
| US10257092B2 (en) | CCN routing using hardware-assisted hash tables | |
| TWI287723B (en) | Method and data structure for a low memory overhead database | |
| CN109726202B (zh) | 一种区块链数据存储方法及计算机存储介质 | |
| US9978025B2 (en) | Ordered-element naming for name-based packet forwarding | |
| US9536059B2 (en) | Method and system for verifying renamed content using manifests in a content centric network | |
| JP5661104B2 (ja) | 検索エンジンインデクシング及びインデックスを使用する検索のための方法とシステム | |
| EP2772040B1 (en) | Prefix and predictive search in a distributed hash table | |
| CN103246659B (zh) | 键值数据查询的方法和装置 | |
| CN104115146A (zh) | 在分布式系统中存储和搜索带标签的内容项的方法 | |
| WO2022143239A1 (zh) | 一种控制系统的设备信息查询方法及查询设备 | |
| WO2011004846A1 (ja) | 情報検索システム、情報管理装置、情報検索方法、情報管理方法、及び、記録媒体 | |
| US10581741B2 (en) | Method and system for interest groups in a content centric network | |
| CN101621502A (zh) | 存储、查找路由表的方法及装置 | |
| CN115065561B (zh) | 一种基于数据库数据存储的信息交互方法及系统 | |
| CN105930345A (zh) | 基于分布式实时数据库的层次索引方法 | |
| CN102571936B (zh) | 数据查找的方法、装置及系统 | |
| CN109951541A (zh) | 一种流水号生成方法及服务器 | |
| CN110704395B (zh) | 一种用于分布式系统的唯一标识方法 | |
| CN107613039A (zh) | Ip地址归属地查询方法、装置、系统及存储介质 | |
| CN104102748B (zh) | 文件映射方法及装置和文件推荐方法及装置 | |
| KR101582050B1 (ko) | 블룸 필터 선―검색을 이용한 이름 검색 장치 및 방법 | |
| CN108460030A (zh) | 一种基于改进的布隆过滤器的集合元素判断方法 | |
| CN114239039A (zh) | 一种自定义区块链上动态适配数据结构的方法 | |
| CN102054036B (zh) | 一种文件同步方法和装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21913980 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21913980 Country of ref document: EP Kind code of ref document: A1 |
