Query method and device of equipment data, equipment and storage medium
By obtaining the product's unique identifier and the protocol's unique identifier, a target database key is generated for matching, which solves the problem of low efficiency in device data query in existing technologies and enables efficient query and accurate response of location values in multi-condition filtering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG PHNIX ECO ENERGY SOLUTION
- Filing Date
- 2022-12-09
- Publication Date
- 2026-07-21
AI Technical Summary
In existing technologies, retrieving device data by directly querying the database is inefficient, especially when multiple conditions are being filtered, as it is difficult to effectively utilize location values for querying.
By obtaining the product's unique identifier, the system queries the pre-built database to obtain the device barcode and protocol unique identifier. Based on these identifiers, it queries the locations in the cached data, uses the device barcode and protocol unique identifier to generate the target database key, performs matching and logical operations, obtains the target location value, and finally responds with the target device data to the system interface.
It improves the efficiency of equipment data retrieval, enabling direct querying of equipment data by location value in multi-condition filtering, thus improving query response speed and accuracy.
Smart Images

Figure CN116166898B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of big data technology, and in particular to a method, apparatus, device, and storage medium for querying device data. Background Technology
[0002] With the development of the internet and information technology, the amount of stored device data is increasing, and the demand for querying this data is also rising, such as filtering lists based on multiple conditions. Currently, relational database management systems are typically used to query locations and location values to obtain the corresponding device data.
[0003] However, due to the large amount of data stored in a single table, the solution of directly querying the database to obtain the location and location value is not advisable. In other words, it is not possible to directly query equipment data by location value in multi-condition filtering, resulting in low efficiency in reading equipment data. Summary of the Invention
[0004] This invention provides a method, apparatus, device, and storage medium for querying device data, addressing the problem of improving the efficiency of retrieving device data.
[0005] The first aspect of this invention provides a method for querying device data, comprising:
[0006] Obtain the unique identifier of the product to be queried, and query the preset database using the unique identifier of the product to obtain the device barcode and protocol unique identifier;
[0007] Based on the device barcode and the protocol unique identifier, the location of the preset cached data is queried to obtain the target location value;
[0008] Based on the target location value, obtain the target device data corresponding to the product to be queried, and respond to the preset system interface.
[0009] Optionally, in a first implementation of the first aspect of the present invention, the step of querying the location of the preset cached data based on the device barcode and the protocol unique identifier to obtain the target location value includes:
[0010] Obtain the user-selected location and generate a target database key based on the device barcode, the protocol unique identifier, and the user-selected location;
[0011] The target point value is obtained by matching the points in the preset cached data with the target database key.
[0012] Optionally, in a second implementation of the first aspect of the present invention, the step of obtaining the target device data corresponding to the product to be queried based on the target location value and responding to the preset system interface includes:
[0013] Obtain the logical operator selected by the user, and call the preset regular expression matching algorithm to generate a regular expression corresponding to the selected point and the logical operator;
[0014] The target point value is logically matched using the regular expression to obtain the target device data corresponding to the product to be queried, and then the response is sent to the preset system interface.
[0015] Optionally, in a third implementation of the first aspect of the present invention, the step of obtaining the target device data corresponding to the product to be queried based on the target location value and responding to the preset system interface includes:
[0016] By using the product's unique identifier, the device list in the cached data is queried to obtain the first device data;
[0017] Obtain the device data from the target point location value to obtain the second device data;
[0018] The intersection of the first device data and the second device data is calculated to obtain the target device data corresponding to the product to be queried, and then the response is sent to the preset system interface.
[0019] Optionally, in a fourth implementation of the first aspect of the present invention, the step of obtaining the target device data corresponding to the product to be queried based on the target location value and responding to the preset system interface includes:
[0020] Based on the target location value, obtain the target device data corresponding to the product to be queried, and obtain the target filtering conditions. The target filtering conditions are used to indicate filtering conditions other than location value filtering.
[0021] Based on the target filtering criteria, the device data in the cached data is filtered to obtain the device data to be compared;
[0022] Determine whether the target device data is consistent with the comparison device data;
[0023] If the target device data matches the comparison device data, the target device data will be sent to the preset system interface.
[0024] Optionally, in a fifth implementation of the first aspect of the present invention, after determining whether the target device data is consistent with the comparison device data, the method further includes:
[0025] If the target device data is inconsistent with the comparison device data, the similarity between the target device data and the comparison device data is calculated to obtain the target similarity.
[0026] Determine whether the target similarity is greater than a preset threshold;
[0027] If the target similarity is greater than a preset threshold, the target device data and the data to be compared are merged and deduplicated to obtain composite target device data.
[0028] The composite target device data is then sent to the preset system interface.
[0029] Optionally, in a sixth implementation of the first aspect of the present invention, the step of obtaining the target device data corresponding to the product to be queried based on the target location value and responding to the preset system interface includes:
[0030] Based on the target location value, obtain the target device data corresponding to the product to be queried;
[0031] The target device data is deduplicated to obtain the deduplicated target device data;
[0032] The pre-defined response interface is invoked to transmit the deduplicated target device data to the front end, so that the front end can render the deduplicated target device data onto the pre-defined system interface.
[0033] A second aspect of the present invention provides a device for querying device data, comprising:
[0034] The first query module is used to obtain the unique identifier of the product to be queried, and to query a pre-set database through the unique identifier of the product to obtain the device barcode and protocol unique identifier.
[0035] The second query module is used to query the location of the preset cached data based on the device barcode and the protocol unique identifier to obtain the target location value;
[0036] The response acquisition module is used to acquire the target device data corresponding to the product to be queried based on the target location value, and respond to the preset system interface.
[0037] Optionally, in a first implementation of the second aspect of the present invention, the second query module includes:
[0038] The generation unit is used to obtain the user-selected point and generate a target database key based on the device barcode, the protocol unique identifier and the user-selected point.
[0039] The matching unit is used to match the points of the preset cached data with the target database key to obtain the target point value.
[0040] Optionally, in a second implementation of the second aspect of the present invention, the response acquisition module is specifically used for:
[0041] Obtain the logical operator selected by the user, and call the preset regular expression matching algorithm to generate a regular expression corresponding to the selected point and the logical operator;
[0042] The target point value is logically matched using the regular expression to obtain the target device data corresponding to the product to be queried, and then the response is sent to the preset system interface.
[0043] Optionally, in a third implementation of the second aspect of the present invention, the response acquisition module may further be specifically used for:
[0044] By using the product's unique identifier, the device list in the cached data is queried to obtain the first device data;
[0045] Obtain the device data from the target point location value to obtain the second device data;
[0046] The intersection of the first device data and the second device data is calculated to obtain the target device data corresponding to the product to be queried, and then the response is sent to the preset system interface.
[0047] Optionally, in a fourth implementation of the second aspect of the present invention, the response acquisition module may further be specifically used for:
[0048] Based on the target location value, obtain the target device data corresponding to the product to be queried, and obtain the target filtering conditions. The target filtering conditions are used to indicate filtering conditions other than location value filtering.
[0049] Based on the target filtering criteria, the device data in the cached data is filtered to obtain the device data to be compared;
[0050] Determine whether the target device data is consistent with the comparison device data;
[0051] If the target device data matches the comparison device data, the target device data will be sent to the preset system interface.
[0052] Optionally, in a fifth implementation of the second aspect of the present invention, the response acquisition module may further be specifically used for:
[0053] If the target device data is inconsistent with the comparison device data, the similarity between the target device data and the comparison device data is calculated to obtain the target similarity.
[0054] Determine whether the target similarity is greater than a preset threshold;
[0055] If the target similarity is greater than a preset threshold, the target device data and the data to be compared are merged and deduplicated to obtain composite target device data.
[0056] The composite target device data is then sent to the preset system interface.
[0057] Optionally, in a sixth implementation of the second aspect of the present invention, the response acquisition module may further be specifically used for:
[0058] Based on the target location value, obtain the target device data corresponding to the product to be queried;
[0059] The target device data is deduplicated to obtain the deduplicated target device data;
[0060] The pre-defined response interface is invoked to transmit the deduplicated target device data to the front end, so that the front end can render the deduplicated target device data onto the pre-defined system interface.
[0061] A third aspect of the present invention provides a device for querying device data, comprising: a memory and at least one processor, wherein the memory stores a computer program; the at least one processor invokes the computer program in the memory to cause the device for querying device data to execute the device data querying method described above.
[0062] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the above-described method for querying device data.
[0063] The technical solution provided by this invention involves obtaining the unique identifier of the product to be queried, querying a pre-set database using the unique identifier to obtain the device barcode and protocol unique identifier; querying the location of a pre-set cached data based on the device barcode and protocol unique identifier to obtain the target location value; and obtaining the target device data corresponding to the product to be queried based on the target location value and responding to a pre-set system interface. In this embodiment of the invention, by querying data using the target location value obtained based on the device barcode and protocol unique identifier, the problem of not being able to directly query device data using location values in multi-condition filtering is solved, thereby improving the efficiency of retrieving device data. Attached Figure Description
[0064] Figure 1 This is a schematic diagram of an embodiment of the device data query method in this invention;
[0065] Figure 2This is a schematic diagram of another embodiment of the device data query method in this invention;
[0066] Figure 3 This is a schematic diagram of one embodiment of the device data query device in this invention;
[0067] Figure 4 This is a schematic diagram of another embodiment of the device data query device in this invention;
[0068] Figure 5 This is a schematic diagram of one embodiment of the device for querying device data in this invention. Detailed Implementation
[0069] This invention provides a method, apparatus, device, and storage medium for querying device data, thereby improving the efficiency of retrieving device data.
[0070] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0071] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 One embodiment of the device data query method in this invention includes:
[0072] 101. Obtain the unique identifier of the product to be queried, and query the preset database through the unique identifier of the product to obtain the device barcode and protocol unique identifier.
[0073] It is understood that the executing entity of this invention can be a device for querying device data, a terminal, or a server; no specific limitation is made here. This embodiment of the invention will be described using a server as an example.
[0074] Users can click the search criteria button for the product to be searched on the display interface or enter the search criteria for the product to be searched. The front end generates the parameters of the search criteria and sends the parameters to the server. Alternatively, users can click or enter the product name and logical operators for the product to be searched on the display interface. The front end generates the corresponding parameters based on the product name for the product to be searched. The parameters include the product unique identifier (ID) and sends the product unique identifier in the parameters to the server.
[0075] After obtaining the product ID, i.e., the product's unique identifier, the server generates a query condition language corresponding to the product's unique identifier. Based on the index of the product list in the pre-built database, it queries the product list to obtain the corresponding device barcode and protocol ID, i.e., the protocol unique identifier (Identity Document, ID). The pre-built database can be a relational database management system like MySQL or a key-value storage system like Redis. The protocol unique identifier is used to indicate the unique identifier of the protocol bound to the product being queried.
[0076] 102. Based on the device barcode and protocol unique identifier, query the locations of the preset cached data to obtain the target location value.
[0077] The location of each data point is used to indicate its position in the storage list. The server can retrieve the target location value by obtaining logical operators, and then using these operators, device barcodes, protocol unique identifiers, and a pre-defined search algorithm (e.g., a sequential (linear) search algorithm, the specific algorithm is not limited here). The target location value indicates the numerical value of the location value field corresponding to the location. The target location value carries the device barcode, location, and location value. The cached data can be Redis cached data; querying through the cached data improves the speed of reading the target location value. The cached data stores all locations and their values under the protocol unique identifier.
[0078] The server can also obtain the user-selected location by receiving the location of the product to be queried from the front end. Combining the device barcode, protocol unique identifier and user-selected location, the server can query the locations in the pre-set cached data to obtain the target location value.
[0079] The server can also use the pre-set cached data to perform a point lookup on the inverted index in the pre-set cached data to obtain the target point value.
[0080] 103. Obtain the target equipment data corresponding to the product to be queried based on the target location value, and respond to the preset system interface.
[0081] The target device data is used to indicate the barcodes of all devices corresponding to the product being queried. After obtaining the target location value, the server retrieves the logical operator selected by the user, combines the user-selected location with the logical operator, and matches the target location value to obtain the target device data corresponding to the product being queried.
[0082] The server can also match the device list in the cached data using the product's unique identifier to obtain the corresponding first device data, retrieve the device data from the target location value to obtain the second device data, and calculate the intersection of the first device data and the second device data to obtain the target device data corresponding to the product to be queried.
[0083] After receiving the target device data, the server sends it to the front end, allowing the front end to render the target device data onto a pre-configured system interface. This pre-configured system interface serves as the user's interface for querying the product.
[0084] In this embodiment of the invention, target device data is obtained by querying the target location value based on the device barcode and protocol unique identifier. This solves the problem that device data cannot be directly queried by location value in multi-condition filtering, thereby improving the efficiency of reading device data.
[0085] Please see Figure 2 Another embodiment of the device data query method in this invention includes:
[0086] 201. Obtain the unique identifier of the product to be queried, and query the preset database through the unique identifier of the product to obtain the device barcode and protocol unique identifier.
[0087] The server receives parameters sent from the front end and retrieves the product's unique identifier from these parameters. The server can then invoke a pre-defined binary search algorithm or other query algorithms to perform a binary search on the product list in a pre-defined database based on the product's unique identifier, obtaining the device barcode and protocol unique identifier. The pre-defined database can be a relational database management system like MySQL or a key-value store like Redis, or a distributed messaging system like Apache Kafka. By using a relational database management system like MySQL, a key-value store like Redis, or a distributed messaging system, the server achieves the efficiency of storing large amounts of data and quickly retrieving device barcodes and protocol unique identifiers.
[0088] In another implementation, after receiving the parameters sent by the front end, the server performs security and integrity checks on the parameters to prevent increased search pressure and decreased search efficiency caused by using insecure or incomplete parameters.
[0089] 202. Obtain the user-selected point and generate the target database key based on the device barcode, protocol unique identifier, and user-selected point.
[0090] The server obtains the user-selected location by receiving the location of the product to be queried from the front end. The front end stores the location of each product. When the front end receives a product query command triggered by the user, it matches the corresponding location, i.e., the user-selected location, and sends the user-selected location to the server.
[0091] The server generates a target database key from the device barcode, protocol unique identifier, and user-selected location. For example, it might be formatted as `devicebarcode_protocol unique identifier_user-selected location` or `#{deviceCode}+"_"+#{protocalId}+"_"+#{address}`, where `deviceCode` represents the device barcode, `protocalId` represents the protocol unique identifier, and `address` represents the user-selected location. The target database key is the concatenated key of the Redis cached location value. This is a precise query key; each of the device barcode, protocol unique identifier, and user-selected location corresponds to a separate key. The server generates these keys and concatenates them to obtain the target database key.
[0092] 203. Match the points in the preset cached data with the target database key to obtain the target point value.
[0093] The server matches the points in the pre-set cached data with the target database key to obtain the corresponding target points, and thus obtains the target point value. Specifically, the server creates a corresponding group table with the target database key, obtains a multi-field key group table, retrieves the multi-dimensional data in the multi-field key group table, builds an index using the multi-dimensional data to obtain the target index, and retrieves the target point value by searching the points in the pre-set cached data using the target index.
[0094] Furthermore, to improve the accuracy of the target point value, if the target database key is a multi-field key, it is converted into a digitized merge key. A corresponding group table is created using the digitized merge key, resulting in a digitized key group table. The points in the pre-set cached data are matched using this digitized key group table to obtain the target point value retrieved by the digitized merge key. The target point value retrieved from the multi-field key group table is compared with the target point value retrieved by the digitized merge key to determine if they are consistent. If they are consistent, the target point value retrieved from the multi-field key group table is determined as the final target point value. If they are inconsistent, a new target database key is obtained, and the points in the pre-set cached data are matched based on this new target database key to obtain the target point value. Alternatively, the inconsistent point values between the target point values retrieved from the multi-field key group table and the target point values retrieved by the digitized merge key are obtained, resulting in inconsistent point values. The final target point value is determined based on these inconsistent point values. Specifically, inconsistent point values can be merged and deduplicated.
[0095] In another implementation, the server can split the data using pre-set cached data to obtain the split data, write the target database key into a multi-threaded process, and use the multi-threaded process to perform parallel point queries on the split data to obtain the target point value. The number of threads is the same as the number of split data parts.
[0096] 204. Obtain the target device data corresponding to the product to be queried based on the target location value, and respond to the preset system interface.
[0097] Optionally, the server obtains the target device data corresponding to the product to be queried based on the target point value and responds to the preset system interface. Specifically, this includes: obtaining the logical operator selected by the user, calling the preset regular expression matching algorithm to generate a regular expression corresponding to the user-selected point and the logical operator; performing logical matching on the target point value through the regular expression to obtain the target device data corresponding to the product to be queried and responding to the preset system interface.
[0098] The logical operators include: equal to, greater than, less than, greater than or equal to, and less than or equal to. A preset regular expression matching algorithm is invoked to generate a regular expression corresponding to the user-selected point and the logical operator. The target point value is then logically matched using the regular expression to obtain the target device data corresponding to the product being queried, and this data is sent to the preset system interface. The target device data is then sent to the front end, allowing the front end to render the target device data onto the preset system interface. This preset system interface serves as the user interface for performing operations on the product being queried.
[0099] By using regular expressions generated based on user-selected points and logical operators to perform logical matching on target point values, this not only enables direct querying of device data by point values in multi-condition filtering, but also achieves precise matching, improving query efficiency and response speed, which meets the requirements of system users and performance.
[0100] Optionally, the server obtains the target device data corresponding to the product to be queried based on the target location value and responds to the preset system interface. Specifically, this includes: querying the device list in the cached data through the product's unique identifier to obtain the first device data; obtaining the device data in the target location value to obtain the second device data; calculating the intersection of the first device data and the second device data to obtain the target device data corresponding to the product to be queried and responding to the preset system interface.
[0101] The server uses the product's unique identifier to query the device list in the cached data to obtain the first device data. For example, it can use a structured query language to generate the product's unique identifier and then use that structured query language to query the device list in the cached data to obtain the first device data. Alternatively, it can use a hash function and the product's unique identifier to query the device list in the cached data to obtain the first device data.
[0102] The server retrieves device data from the target location value to obtain the second device data. Specifically, the server extracts all device barcodes from the target location value to obtain the second device data, where the target location value carries the barcodes of all devices. The intersection of the first and second device data is calculated to obtain the target device data, which is then sent to the preset system interface. By querying the device list in the cached data using the product's unique identifier and calculating the intersection of the first and second device data, the server achieves the effect of directly querying device data by location value in multi-condition filtering.
[0103] Optionally, the server retrieves the target device data corresponding to the product to be queried based on the target location value and responds to the preset system interface, including: retrieving the target device data corresponding to the product to be queried based on the target location value, and retrieving the target filtering conditions, which are used to indicate filtering conditions other than location value filtering; filtering the device data in the cached data based on the target filtering conditions to obtain the device data to be compared; determining whether the target device data is consistent with the device data to be compared; if the target device data is consistent with the device data to be compared, then responding to the preset system interface with the target device data.
[0104] After the server obtains the target device data corresponding to the product to be queried based on the target location value, it obtains the target filtering conditions. The target filtering conditions are used to indicate filtering conditions other than location value filtering, such as the dealer name (unique identifier (Identity Document, ID)) and barcode value. In one implementation, the server filters the device data in the cached data based on the target filtering conditions to obtain the device data to be compared. The execution steps of 201-204 above are similar and will not be repeated here.
[0105] In another implementation, the server can generate multiple structured query languages based on the target filtering conditions, and then concatenate these multiple structured query languages to obtain the target structured query language. The target structured query language is then used to query the device data in the cached data to obtain the device data to be compared.
[0106] In another implementation, the server can also use a pre-built Lowest Common Ancestor (LCA) fast lookup algorithm based on a UML (Unified Model Language) state machine, or an offline LCA algorithm, to search for device data in the cached data based on target filtering conditions to obtain the device data to be compared. The offline LCA algorithm is a Tarjan algorithm based on depth-first search. The device data to be compared consists of the barcodes of all devices for the product being queried.
[0107] After obtaining the data of the device to be compared, the server determines whether the data of the target device is consistent with the data of the device to be compared. If the data of the target device is consistent with the data of the device to be compared, the server sends the data of the target device to the preset system interface.
[0108] The accuracy of the target device data was ensured by verifying the data from the device to be compared.
[0109] Optionally, after the server determines whether the target device data and the comparison device data are consistent, the following steps are also included: if the target device data and the comparison device data are inconsistent, calculate the similarity between the target device data and the comparison device data to obtain the target similarity; determine whether the target similarity is greater than a preset threshold; if the target similarity is greater than the preset threshold, merge and deduplicate the target device data and the comparison device data to obtain composite target device data; and respond to the preset system interface with the composite target device data.
[0110] If the target device data and the comparison device data are inconsistent, the similarity between the target device data and the comparison device data is calculated to obtain the target similarity. Specifically, the similarity between the target device data and the comparison device data can be calculated using a preset target similarity algorithm, such as the Jaccard similarity coefficient algorithm, the cosine similarity algorithm, and the Pearson correlation coefficient algorithm. The target similarity algorithm can be one or more similarity algorithms. For example, the server can use the Manhattan distance algorithm to calculate the similarity between the target device data and the comparison device data to obtain the target similarity. Alternatively, the server can use the Jaccard similarity coefficient algorithm, the cosine similarity algorithm, and the Pearson correlation coefficient algorithm to calculate the similarity between the target device data and the comparison device data respectively to obtain the first similarity, the second similarity, and the third similarity. The weighted average of the first similarity, the second similarity, and the third similarity is then calculated to obtain the target similarity.
[0111] If the target similarity is greater than a preset threshold, the target device data and the data to be compared are merged and deduplicated to obtain composite target device data; the composite target device data is then sent to the preset system interface.
[0112] If the target similarity is less than or equal to a preset threshold, new target device data and new comparison device data are acquired until the similarity between the new target device data and the new comparison device data exceeds the preset threshold. This yields composite target device data, which is then sent to the preset system interface.
[0113] The accuracy of the target device data was ensured by verifying the data from the device to be compared.
[0114] Optionally, the server obtains the target device data corresponding to the product to be queried based on the target location value and responds to the preset system interface, including: obtaining the target device data corresponding to the product to be queried based on the target location value; performing deduplication processing on the target device data to obtain deduplicated target device data; calling the preset response interface to transmit the deduplicated target device data to the front end, so that the front end renders the deduplicated target device data to the preset system interface.
[0115] The server retrieves the target device data corresponding to the queried product based on the target location value. It can use a pre-defined set array deduplication mechanism to process the target device data, obtaining deduplicated target device data, which is a set. Alternatively, the server can call a pre-defined deduplication algorithm, such as the Roaring Bitmap algorithm or the RunContainer algorithm (the specific algorithm is not limited here), to process the target device data and obtain deduplicated target device data.
[0116] After the server obtains the deduplicated target device data, it calls the preset response interface to transmit the deduplicated target device data to the front end, so that the front end can render the deduplicated target device data to the preset system interface in the form of a data response.
[0117] By deduplicating the target equipment data, the logical correctness of the data is maintained, thereby improving the accuracy of equipment data query while enabling direct querying of equipment data by location value in multi-condition filtering.
[0118] In this embodiment of the invention, a target database key is generated based on the device barcode, the unique protocol identifier, and the user-selected point. The target point value is obtained by matching the points in the preset cached data with the target database key, and the target device data is obtained by querying the data based on the target point value. This solves the problem that device data cannot be directly queried by point value in multi-condition filtering, thereby improving the reading efficiency of querying device data.
[0119] The above describes the method for querying device data in embodiments of the present invention. The following describes the device data querying apparatus in embodiments of the present invention. Please refer to [link / reference]. Figure 3 One embodiment of the device data query device in this invention includes:
[0120] The first query module 301 is used to obtain the unique identifier of the product to be queried, and to query the preset database through the unique identifier of the product to obtain the device barcode and protocol unique identifier.
[0121] The second query module 302 is used to query the points of the preset cached data based on the device barcode and the protocol unique identifier to obtain the target point value;
[0122] The response acquisition module 303 is used to acquire the target device data corresponding to the product to be queried based on the target location value and respond to the preset system interface.
[0123] The functions of each module in the above-mentioned device data query device correspond to the steps in the above-mentioned device data query method embodiment, and their functions and implementation processes will not be described in detail here.
[0124] In this embodiment of the invention, target device data is obtained by querying the target location value based on the device barcode and protocol unique identifier. This solves the problem that device data cannot be directly queried by location value in multi-condition filtering, thereby improving the efficiency of reading device data.
[0125] Please see Figure 4 Another embodiment of the device data query device in this invention includes:
[0126] The first query module 301 is used to obtain the unique identifier of the product to be queried, and to query the preset database through the unique identifier of the product to obtain the device barcode and protocol unique identifier.
[0127] The second query module 302 is used to query the points of the preset cached data based on the device barcode and the protocol unique identifier to obtain the target point value;
[0128] Specifically, the second query module 302 includes:
[0129] The generation unit 3021 is used to obtain the user-selected point and generate a target database key based on the device barcode, protocol unique identifier and user-selected point;
[0130] The matching unit 3022 is used to match the points of the preset cached data with the target database key to obtain the target point value;
[0131] The response acquisition module 303 is used to acquire the target device data corresponding to the product to be queried based on the target location value and respond to the preset system interface.
[0132] Optionally, the response acquisition module 303 can also be specifically used for:
[0133] Get the logical operator selected by the user, and call the preset regular expression matching algorithm to generate a regular expression corresponding to the selected point and the logical operator;
[0134] By using regular expressions to logically match the target point values, the target device data corresponding to the product to be queried is obtained and responded to the preset system interface.
[0135] Optionally, the response acquisition module 303 can also be specifically used for:
[0136] By using the product's unique identifier, the device list in the cached data is queried to obtain the first device data;
[0137] Obtain the device data from the target point location value to obtain the second device data;
[0138] The intersection of the first device data and the second device data is calculated to obtain the target device data corresponding to the product to be queried, and then the response is sent to the preset system interface.
[0139] Optionally, the response acquisition module 303 can also be specifically used for:
[0140] Based on the target location value, obtain the target equipment data corresponding to the product to be queried, and obtain the target filter conditions. The target filter conditions are used to indicate the filter conditions other than the location value filter.
[0141] Based on the target filtering criteria, the device data in the cached data is filtered to obtain the device data to be compared;
[0142] Determine whether the data of the target device is consistent with the data of the device to be compared;
[0143] If the target device data matches the data of the device to be compared, the target device data will be sent to the preset system interface.
[0144] Optionally, the response acquisition module 303 can also be specifically used for:
[0145] If the target device data is inconsistent with the comparison device data, the similarity between the target device data and the comparison device data is calculated to obtain the target similarity.
[0146] Determine whether the target similarity is greater than a preset threshold;
[0147] If the target similarity is greater than the preset threshold, the target device data and the data to be compared are merged and deduplicated to obtain composite target device data.
[0148] The composite target device data is then sent to the preset system interface.
[0149] Optionally, the response acquisition module 303 can also be specifically used for:
[0150] Obtain the target equipment data corresponding to the product to be queried based on the target location value;
[0151] The target device data is deduplicated to obtain the deduplicated target device data.
[0152] The pre-defined response interface is called to transmit the deduplicated target device data to the front end, so that the front end can render the deduplicated target device data onto the pre-defined system interface.
[0153] The functions of each module and unit in the above-mentioned device data query device correspond to the steps in the above-mentioned device data query method embodiment, and their functions and implementation processes will not be described in detail here.
[0154] In this embodiment of the invention, a target database key is generated based on the device barcode, the unique protocol identifier, and the user-selected point. The target point value is obtained by matching the points in the preset cached data with the target database key, and the target device data is obtained by querying the data based on the target point value. This solves the problem that device data cannot be directly queried by point value in multi-condition filtering, thereby improving the reading efficiency of querying device data.
[0155] above Figure 3 and Figure 4The device data query device in this embodiment of the invention is described in detail from the perspective of modular functional entities. The device data query device in this embodiment of the invention is described in detail below from the perspective of hardware processing.
[0156] Figure 5 This is a schematic diagram of the structure of a device data query device 500 provided in an embodiment of the present invention. The device data query device 500 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) for storing application programs 533 or data 532. The memory 520 and storage media 530 can be temporary or persistent storage. The program stored in the storage media 530 may include one or more modules (not shown in the diagram), each module including a series of computer program operations on the device data query device 500. Furthermore, the processor 510 may be configured to communicate with the storage media 530 and execute the series of computer program operations in the storage media 530 on the device data query device 500.
[0157] The device data query device 500 may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 5 The device structure shown for querying device data does not constitute a limitation on the device for querying device data. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0158] The present invention also provides a device for querying device data, comprising: a memory and at least one processor, wherein the memory stores a computer program, and the memory and the at least one processor are interconnected via a line; the at least one processor invokes the computer program in the memory to cause the device for querying device data to perform the steps in the above-described device data querying method.
[0159] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein a computer program is stored in the computer program, which, when run on a computer, causes the computer to perform the steps of a device data query method.
[0160] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0161] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several computer programs to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0162] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for querying device data, characterized in that, The methods for querying device data include: Users can click or enter the product name and logical operators of the product to be queried on the display interface. The front end generates a corresponding unique product identifier based on the product name of the product to be queried and sends the unique product identifier to the server. After obtaining the product's unique identifier ID, the server generates a query condition language corresponding to the product's unique identifier. Based on the index of the product list in the pre-set database, it queries the product list to obtain the corresponding device barcode and protocol unique identifier. The pre-set database can be a relational database management system MySQL or a key-value storage system Redis. Based on the device barcode and the protocol unique identifier, the location of the preset cached data is queried to obtain the target location value; the target location value is used to indicate the value of the location value field corresponding to the location, and the target location value carries the device barcode, location, and location value; Based on the target location value, a preset regular expression matching algorithm is invoked to obtain the target device data corresponding to the product to be queried, and the response is sent to the preset system interface.
2. The method for querying equipment data according to claim 1, characterized in that, The step of querying the locations of pre-set cached data based on the device barcode and the protocol unique identifier to obtain the target location value includes: Obtain the user-selected location and generate a target database key based on the device barcode, the protocol unique identifier, and the user-selected location; The target point value is obtained by matching the points in the preset cached data with the target database key.
3. The method for querying equipment data according to claim 2, characterized in that, The step of using the target location value to call a preset regular expression matching algorithm to obtain the target device data corresponding to the product to be queried, and responding to the preset system interface, includes: Obtain the logical operator selected by the user, and call the preset regular expression matching algorithm to generate a regular expression corresponding to the selected point and the logical operator; The target point value is logically matched using the regular expression to obtain the target device data corresponding to the product to be queried, and then the response is sent to the preset system interface.
4. The method for querying equipment data according to claim 2, characterized in that, The step of using the target location value to call a preset regular expression matching algorithm to obtain the target device data corresponding to the product to be queried, and responding to the preset system interface, includes: By using the product's unique identifier, the device list in the cached data is queried to obtain the first device data; Obtain the device data from the target point location value to obtain the second device data; The intersection of the first device data and the second device data is calculated to obtain the target device data corresponding to the product to be queried, and then the response is sent to the preset system interface.
5. The method for querying equipment data according to claim 1, characterized in that, The step of using the target location value to call a preset regular expression matching algorithm to obtain the target device data corresponding to the product to be queried, and responding to the preset system interface, includes: Based on the target location value, obtain the target device data corresponding to the product to be queried, and obtain the target filtering conditions. The target filtering conditions are used to indicate filtering conditions other than location value filtering. Based on the target filtering criteria, the device data in the cached data is filtered to obtain the device data to be compared; Determine whether the target device data is consistent with the comparison device data; If the target device data matches the comparison device data, the target device data will be sent to the preset system interface.
6. The method for querying equipment data according to claim 5, characterized in that, After determining whether the target device data is consistent with the comparison device data, the method further includes: If the target device data is inconsistent with the comparison device data, the similarity between the target device data and the comparison device data is calculated to obtain the target similarity. Determine whether the target similarity is greater than a preset threshold; If the target similarity is greater than a preset threshold, the target device data and the data to be compared are merged and deduplicated to obtain composite target device data. The composite target device data is then sent to the preset system interface.
7. The method for querying equipment data according to any one of claims 1-6, characterized in that, The step of using the target location value to call a preset regular expression matching algorithm to obtain the target device data corresponding to the product to be queried, and responding to the preset system interface, includes: Based on the target location value, obtain the target device data corresponding to the product to be queried; The target device data is deduplicated to obtain the deduplicated target device data; The pre-defined response interface is invoked to transmit the deduplicated target device data to the front end, so that the front end can render the deduplicated target device data onto the pre-defined system interface.
8. A device for querying equipment data, characterized in that, The device for querying device data includes: The first query module is used to generate a corresponding unique product identifier based on the product name and logical operators of the product to be queried by clicking or entering the product name and logical operators on the display interface, and send the unique product identifier to the server; after obtaining the unique product identifier ID, the server generates a query condition language corresponding to the unique product identifier, and queries the product list based on the index of the product list in the preset database to obtain the corresponding device barcode and protocol unique identifier. The preset database can be a relational database management system MySQL or a key-value storage system Redis. The second query module is used to query the locations of the preset cached data based on the device barcode and the protocol unique identifier to obtain the target location value; the target location value is used to indicate the value of the location value field corresponding to the location, and the target location value carries the device barcode, location and location value; The response acquisition module is used to obtain the target device data corresponding to the product to be queried by calling a preset regular expression matching algorithm based on the target point value, and respond to the preset system interface.
9. A device for querying device data, characterized in that, The device for querying device data includes: a memory and at least one processor, wherein the memory stores a computer program; The at least one processor invokes the computer program in the memory to cause the device data querying device to perform the device data querying method as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the device data query method as described in any one of claims 1-7.