Data query processing method and device
By aggregating datasets in an IoT network and calculating a query accuracy threshold, queries are only performed when the sample deviation index does not exceed the threshold, thus solving the problems of accuracy and efficiency in data querying in IoT networks and achieving efficient and low-cost data query processing.
Patent Information
- Application Number
- CN202510933704.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-11-07
AI Technical Summary
In the context of IoT networks, how to efficiently and accurately extract, query, and analyze massive amounts of data, especially when the amount of data increases significantly, is a challenge that existing technologies struggle to effectively address the issues of accuracy and efficiency in data querying.
By obtaining query accuracy parameters, the sample datasets uploaded by various IoT devices in the IoT network are aggregated, and the sample deviation index and query accuracy threshold are calculated. Range counting queries are performed only when the sample deviation index does not exceed the query accuracy threshold to obtain query results that meet the accuracy requirements.
It improves the accuracy and efficiency of data retrieval, reduces data transmission costs, and ensures the precision and reliability of query results.
Smart Images

Figure CN120910337A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present document relates to the technical field of data processing, and in particular to a data query processing method and device. BACKGROUND
[0002] With the continuous development and popularization of Internet of Things technology, various Internet of Things devices have been widely applied in many fields. For example, based on Internet of Things, the level of particulate matter in the environment, traffic flow or weather data is estimated by range counting. In this case, with the rapid growth of the number of Internet of Things devices and the continuous improvement of data collection frequency, the amount of data generated in the Internet of Things network increases greatly. Therefore, in the face of massive data, how to efficiently and accurately extract, query and analyze data has become the focus of attention. SUMMARY
[0003] One or more embodiments of the present specification provide a data query processing method, comprising: obtaining a query precision parameter for querying data from an Internet of Things network. Aggregating sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set. Calculating a sample deviation index of the aggregated data set according to a query range parameter and a sampling probability, and calculating a query precision threshold value based on the query precision parameter. If the sample deviation index does not exceed the query precision threshold value, performing range counting query on the aggregated data set according to the query range parameter to obtain a query result.
[0004] One or more embodiments of the present specification provide a data query processing device, comprising: a parameter acquisition module configured to obtain a query precision parameter for querying data from an Internet of Things network. A data aggregation module configured to aggregate sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set. An index calculation module configured to calculate a sample deviation index of the aggregated data set according to a query range parameter and a sampling probability, and calculate a query precision threshold value based on the query precision parameter. A query module configured to, if the sample deviation index does not exceed the query precision threshold value, perform range counting query on the aggregated data set according to the query range parameter to obtain a query result.
[0005] The one or more embodiments of the specification provide a data query processing device, comprising: a processor; and a memory configured to store computer executable instructions which, when executed, cause the processor to: obtain a query precision parameter for a data query to an Internet of Things network. Aggregate sample data sets uploaded by Internet of Things devices in the Internet of Things network to obtain an aggregated data set. Calculate a sample deviation index of the aggregated data set according to a query range parameter and a sampling probability, and calculate a query precision threshold based on the query precision parameter. If the sample deviation index does not exceed the query precision threshold, perform a range counting query on the aggregated data set according to the query range parameter to obtain a query result.
[0006] The one or more embodiments of the specification provide a computer readable storage medium for storing computer executable instructions, which, when executed, implement the following processes: obtaining a query precision parameter for a data query to an Internet of Things network. Aggregate sample data sets uploaded by Internet of Things devices in the Internet of Things network to obtain an aggregated data set. Calculate a sample deviation index of the aggregated data set according to a query range parameter and a sampling probability, and calculate a query precision threshold based on the query precision parameter. If the sample deviation index does not exceed the query precision threshold, perform a range counting query on the aggregated data set according to the query range parameter to obtain a query result. BRIEF DESCRIPTION OF DRAWINGS
[0007] In order to more clearly illustrate the technical solutions in the one or more embodiments of the specification or the prior art, the drawings needed in the embodiment or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the specification, and those skilled in the art can also obtain other drawings according to these drawings without creative labor; Figure 1 A schematic diagram of an implementation environment of a data query processing method provided by the one or more embodiments of the specification; Figure 2 A processing flowchart of a data query processing method provided by the one or more embodiments of the specification; Figure 3 A processing flowchart of a data query processing method applied to a data query scenario provided by the one or more embodiments of the specification; Figure 4 A schematic diagram of an embodiment of a data query processing device provided by the one or more embodiments of the specification; Figure 5 A structural schematic diagram of a data query processing device provided by the one or more embodiments of the specification. DETAILED DESCRIPTION
[0008] In order to make the person skilled in the art better understand the technical solutions in one or more embodiments of the present specification, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of the present specification. Obviously, the described embodiments are only a part of the embodiments of the present specification, rather than all the embodiments. Based on one or more embodiments of the present specification, all other embodiments obtained by those skilled in the art without creative labor should belong to the protection scope of the present document.
[0009] The data query processing method provided by one or more embodiments of the present specification can be applied to the implementation environment of a data query processing system, which is described with reference to Figure 1 The implementation environment at least includes an Internet of Things network 101, an Internet of Things device 102-1, an Internet of Things device 102-2,..., an Internet of Things device 102-n, and a data base station 103. The Internet of Things network 101 collects data through the Internet of Things device and transmits the collected data to the data base station 103. The Internet of Things device 102-1 to the Internet of Things device 102-n can collect data to obtain Internet of Things data and / or third-party data. The data base station 103 is used to receive, aggregate and / or analyze sample data from the Internet of Things device, and perform data query processing based on the sample data. The implementation environment can also include a query terminal 104 of a data query party. The query terminal 104 is used to submit a query instruction for data query and obtain a query result returned by the data base station 103. The query terminal 104 can be a mobile phone, a personal computer, a tablet computer, an electronic book reader, a device for information interaction based on VR (Virtual Reality), AR (Augmented Reality), a vehicle-mounted terminal, a wearable smart device, a laptop computer and a desktop computer, etc.
[0010] In the implementation environment, in the process of data query processing, each Internet of Things device collects data to obtain Internet of Things data and / or third-party data, and performs data packaging and data uploading on sample data obtained by sampling based on the Internet of Things data and / or the third-party data. Correspondingly, the data base station 103 aggregates the sample data set uploaded by each Internet of Things device in the Internet of Things network 101 to obtain an aggregated data set, obtains a query precision parameter for data query of the Internet of Things network 101, then calculates a sample deviation index of the aggregated data set according to the query range parameter and the sampling probability, and calculates a query precision threshold value based on the query precision parameter. In the case where the sample deviation index does not exceed the query precision threshold value, the aggregated data set is subjected to range counting query according to the query range parameter, so as to obtain a query result satisfying the query precision condition.
[0011] One or more embodiments of the data query processing method provided in the specification are as follows: Referring to Figure 2 The data query processing method provided in the embodiment specifically includes steps S202 to S208.
[0012] Step S202: Obtain a query precision parameter for data query of the Internet of Things network.
[0013] The Internet of Things network in the embodiment refers to a network system composed of at least one Internet of Things device. Each Internet of Things device can interact with other Internet of Things devices and a data base station to realize data collection and uploading processing. Specifically, each Internet of Things device can collect data and upload the data to the data base station. In addition, in order to reduce unnecessary data transmission volume, each Internet of Things device can also perform sampling processing on the collected data and upload the sampled data to the data base station to provide data basis for subsequent data query process.
[0014] In actual application, in the process of data query by the data query party, in order to improve the accuracy of data query, the query precision of data query can be introduced to set the query condition of data query. Specifically, the query condition of data query can be set by inputting the query precision parameter.
[0015] The query precision parameter refers to an index parameter for quantifying the accuracy of range counting query result. For example, the query precision parameter can include a deviation precision parameter and a deviation constraint ratio. The deviation precision parameter refers to an allowable error ratio parameter, which can be used to measure the acceptable relative error size between the estimated value and the true value. The deviation constraint ratio refers to the probability that the estimated value is within the specified error range.
[0016] Optionally, the query precision parameter is obtained from the calling input parameter of the data query interface called by the data query party or the data proxy party for data query.
[0017] In implementation, the data querying party or the data proxy party calls the data query interface opened by the data base station, and transmits the calling input parameter containing the query precision parameter when calling the data query interface, and based on this, the query precision parameter for querying data from the Internet of Things network is obtained from the calling input parameter.
[0018] Specifically, in the process of data query processing, when the data querying party or the data proxy party wants to obtain specific query results, the data querying party or the data proxy party first initiates a request for data query by calling the data query interface provided by the data base station, and in this process, the query precision parameter can be embedded in the calling input parameter of the interface call, and the query precision parameter is transmitted as part of the data query interface call, and based on this, the query precision parameter for querying data from the Internet of Things network is obtained from the calling input parameter.
[0019] In step S204, the sample data sets uploaded by the Internet of Things devices in the Internet of Things network are aggregated to obtain an aggregated data set.
[0020] As described above, the Internet of Things devices further upload the sample data set to the data base station after sampling the collected data; accordingly, the sample data sets uploaded by the Internet of Things devices are aggregated; in addition, the Internet of Things devices can directly upload the collected data to the data base station, in which case the data uploaded by the Internet of Things devices can be referred to as device data sets collected by the Internet of Things devices, and accordingly, the device data sets uploaded by the Internet of Things devices are aggregated.
[0021] In implementation, after the Internet of Things devices complete sample data collection and upload the sample data set, in order to reduce communication cost and improve computing efficiency in subsequent data query processing, the sample data set can be aggregated; specifically, the sample data sets uploaded by the Internet of Things devices in the Internet of Things network can be received first, and then the obtained sample data sets are aggregated to obtain an aggregated data set.
[0022] Optionally, the sample data sets uploaded by the Internet of Things devices are stored in the data base station; the data base station opens a data query interface to the data querying party or the data proxy party; accordingly, when the data querying party or the data proxy party initiates a query request, that is, sends a query request to the data base station, based on this, the data query performed by the data querying party or the data proxy party is a data query performed in the data base station.
[0023] In the process of uploading the sample data set on each Internet of Things device, in order to reduce unnecessary data transmission and improve data processing efficiency, the data obtained by data collection can be sampled, and only the sample data obtained by sampling is uploaded. In an optional implementation provided in this embodiment, the sample data set is uploaded in the following manner: Obtain Internet of Things data by data collection through the Internet of Things device, and obtain third-party data through the Internet of Things device; Sample the Internet of Things data and the third-party data, and package and upload the sample data obtained.
[0024] Specifically, in the process of uploading the sample data set, on the one hand, Internet of Things data can be obtained by data collection through the Internet of Things device, and on the other hand, third-party data can be obtained through the Internet of Things device, such as data from other Internet of Things devices, external services or public databases. After data collection is completed, the Internet of Things data and the third-party data are sampled, such as based on a sampling strategy or a preset sampling probability, and then the sample data obtained is packaged and uploaded.
[0025] It should be noted that in the implementation manner of uploading the sample data set provided above, the implementation manner of obtaining Internet of Things data by data collection through the Internet of Things device and sampling the Internet of Things data, and the implementation manner of obtaining third-party data through the Internet of Things device and sampling the third-party data, in addition to the combination of the two implementation manners provided above, can also be implemented according to actual needs, such as obtaining Internet of Things data by data collection through the Internet of Things device and sampling the Internet of Things data, packaging and uploading the sample data obtained. For example, third-party data is obtained through the Internet of Things device and sampled, and the sample data obtained is packaged and uploaded.
[0026] It should be further noted that in the process of data query processing, the execution order of the process of obtaining the query precision parameter for querying the Internet of Things network and the process of aggregating the sample data set uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set can also be adjusted according to actual processing needs, such as first obtaining the query precision parameter for querying the Internet of Things network, and then aggregating the sample data set uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set. For example, the sample data set uploaded by each Internet of Things device in the Internet of Things network can also be aggregated to obtain an aggregated data set first, and then the query precision parameter for querying the Internet of Things network can be obtained. In addition, in order to improve the response speed and processing efficiency, the two processes can also be processed in parallel, and this embodiment does not limit this.
[0027] In step S206, a sample deviation index of the aggregated data set is calculated according to the query range parameter and the sampling probability, and a query accuracy threshold is calculated based on the query accuracy parameter.
[0028] In implementation, in order to effectively evaluate whether the current sample set is sufficient to provide a query result meeting the accuracy requirement, first, a sample deviation index of the aggregated data set is calculated according to the query range parameter and the sampling probability, and then a query accuracy threshold is further calculated based on the obtained query accuracy parameter, so as to provide a data basis for subsequent judgment of whether the existing sample meets the accuracy requirement of the data query party.
[0029] The query range parameter refers to a data interval of the query, for example, the query range parameter [l, u] is composed of two values of lower bound l and upper bound u to limit the numerical interval; the sampling probability refers to a probability of extracting a part of all data collected from the Internet of Things device as a sample, and the sampling probability is used to represent the possibility of each data point being selected as a sample; the sample deviation index refers to an index for measuring the difference between the sample data and the overall data, for example, the sample deviation index can be expressed in the form of variance or standard deviation; and the query accuracy threshold refers to a parameter for judging whether the sample deviation index reaches a predetermined accuracy standard.
[0030] Optionally, the query range parameter is obtained from an interface call parameter input by interface call of the data query party or the data proxy party. It should be further supplemented that the query range parameter can be preset or input by the data query party, and the embodiment does not limit this.
[0031] In the process of calculating the sample deviation index of the aggregated data set, in an optional implementation provided by the embodiment, the sample deviation index of the aggregated data set is calculated according to the query range parameter and the sampling probability, including: Performing range counting query on the aggregated data set according to the query range parameter to obtain a query value; Calculating the sample deviation index according to the query value and the sampling probability.
[0032] For example, the sample deviation index can be calculated by the following formula: Var[γ]=
[0033] Wherein, represents the number of element values in the sample set S falling within the query range parameter [l, u], l represents the lower bound in the query range parameter, u represents the upper bound in the query range parameter, and p represents the sampling probability; Var[γ] represents the sample deviation index, and the smaller the sample deviation index Var[γ], the closer the estimated value γ to the true value γ', that is, the smaller the sample deviation index Var[γ], the higher the accuracy; For the data set D, the size of the data set D is |D|=1000, the sampling probability p=0.1, the sample size |S|=100, if the query range parameter is [0.25, 0.75], and it is found that there are 40 data points in the sample set S falling within the query range parameter, first, the range counting query is performed on the aggregated data set according to the query range parameter [l, u], and the query value 40 is obtained, and then the sample deviation index is calculated based on the above formula: Var[γ]=40×(1-0.1) / 0.1=360, that is, the obtained sample deviation index is 360.
[0034] In the process of calculating the query precision threshold, in an optional implementation provided by the embodiment, the query precision threshold is calculated based on the query precision parameter, comprising: calculating a data deviation value based on the deviation precision parameter contained in the query precision parameter and the data set size of the aggregated data set; calculating the query precision threshold based on the data deviation value and the deviation constraint ratio contained in the query precision parameter.
[0035] The deviation precision parameter refers to an allowed error ratio parameter, and the deviation precision parameter can be used to measure the acceptable relative error size between the estimated value and the true value; the deviation constraint ratio refers to the probability that the estimated value is within a specified error range.
[0036] Specifically, first, the data deviation value for measuring the allowed deviation between the estimated value and the true value is determined based on the deviation precision parameter and the data set size of the aggregated data set, and then the query precision threshold is calculated based on the data deviation value and the deviation constraint ratio contained in the query precision parameter, to determine whether the sample estimate meets the threshold of the precision requirement.
[0037] Further, in the process of calculating the query precision threshold, the query precision threshold can be calculated according to the deviation constraint ratio and the data deviation value; in an optional implementation provided by the embodiment, the query precision threshold is calculated based on the data deviation value and the deviation constraint ratio contained in the query precision parameter, comprising: determining a deviation out threshold ratio according to the deviation constraint ratio; calculating the ratio of the square of the data deviation value to the deviation out threshold ratio as the query precision threshold.
[0038] For example, the query precision threshold can be calculated by the following formula: T=
[0039] Wherein, T represents the query precision threshold, represents the deviation constraint ratio, 1- represents the deviation out threshold ratio, represents the data deviation value.
[0040] In step S208, if the sample deviation index does not exceed the query accuracy threshold, a range counting query is performed on the aggregated data set according to the query range parameter to obtain a query result.
[0041] In implementation, after the sample deviation index and the query accuracy threshold are obtained, the sample deviation index and the query accuracy threshold can be compared to determine whether the accuracy requirement of the query result is met. If the sample deviation index does not exceed the query accuracy threshold, a range counting query is performed on the aggregated data set according to the query range parameter, and the obtained counting value is taken as the query result. Based on this, the query result is obtained.
[0042] In the above example, if the data query party requires Pr , the obtained sample deviation index Var[γ] and the query accuracy threshold T are compared. If the sample deviation index does not exceed the query accuracy threshold, that is, in the case of Var[γ] T, that is, in the case of Var[γ] , it is determined that the accuracy requirement is met. In the case of meeting the accuracy requirement, a range counting query is further performed on the aggregated data set according to the query range parameter to obtain a query result.
[0043] In the process of performing the range counting query, in order to improve the accuracy and reliability of data analysis, the sample data can be converted into corresponding sequence parameters, and data analysis is performed based on the sequence parameters. In an optional implementation provided in this embodiment, the range counting query is performed on the aggregated data set according to the query range parameter to obtain a query result, including: The sequence parameters of each sample data in the aggregated data set are determined, and the sequence data set is obtained by replacing the corresponding sample data in the aggregated data set based on the sequence parameters; The sequence parameter count of the aggregated data set that meets the query range parameter is estimated by an estimation algorithm as a query result.
[0044] Specifically, first, the sequence parameters of each sample data in the aggregated data set are determined, such as the relative position or ranking of the sample data in the aggregated data set to which it belongs, and the original sample data in the aggregated data set is replaced based on the determined sequence parameters to construct a sequence data set. Then, the sequence data set and the query range parameter are used to estimate the number of data points that meet the condition by an estimation algorithm, so as to take the sequence parameter count that meets the query range parameter as the query result.
[0045] In actual application, in order to obtain more accurate query result without increasing the calculation complexity, the global query count can be calculated based on the sequence parameter count and the sampling probability; in an optional embodiment provided by the embodiment, if the sample deviation index does not exceed the query accuracy threshold, the range counting query is performed on the aggregated data set according to the query range parameter, and after the query result is obtained, the method further comprises: calculating the global query count of the Internet of Things network according to the sequence parameter count and the sampling probability, and returning the global query count to the data query party or the data proxy party; wherein the global query count comprises the ratio of the sequence parameter count and the sampling probability.
[0046] Specifically, if the sample deviation index does not exceed the query accuracy threshold, and after the query result is obtained by performing the range counting query on the aggregated data set according to the query range parameter, firstly, the global query count of the entire Internet of Things network is calculated based on the sequence parameter count and the sampling probability, and the result is returned to the data query party or the data proxy party which initiates the request as the global query count.
[0047] In addition, if the comparison result of the comparison between the sample deviation index and the query accuracy threshold is that the sample deviation index exceeds the query accuracy threshold, in order to ensure that the finally provided query result meets the expected accuracy requirement, the sample data can be supplemented; in another optional embodiment provided by the embodiment, after the sample deviation index of the aggregated data set is calculated according to the query range parameter and the sampling probability, and the query accuracy threshold is calculated based on the query accuracy parameter, the method further comprises: if the sample deviation index exceeds the query accuracy threshold, sending a sample uploading instruction to each Internet of Things device, and adding the uploaded sample data to the corresponding sample data set stored by the data base station.
[0048] Specifically, after the comparison between the sample deviation index and the query accuracy threshold, if the sample deviation index exceeds the query accuracy threshold, the base station sends a sample uploading instruction to each Internet of Things device to instruct each Internet of Things device to upload more sample data, after each Internet of Things device uploads additional sample data according to the sample uploading instruction, the sample data is received and added to the corresponding sample data set stored by the data base station to update the existing sample data set.
[0049] To sum up, the data query processing method provided in the embodiment, in the process of data query processing, the data query party or the data proxy party calls the data query interface opened by the data base station, and transmits the calling input parameter containing the query precision parameter when calling the data query interface. Correspondingly, the query precision parameter for querying data from the Internet of Things network is obtained from the calling input parameter. Then, in the case that each Internet of Things device completes sample data collection and uploads a sample data set, in order to reduce the communication cost and improve the calculation efficiency in the subsequent data query processing process, the sample data set uploaded by each Internet of Things device in the Internet of Things network is aggregated to obtain an aggregated data set. Thereafter, in order to effectively evaluate whether the current sample set is sufficient to provide a query result meeting the accuracy requirement, the sample deviation index of the aggregated data set is calculated according to the query range parameter and the sampling probability, and the query precision threshold is calculated based on the query precision parameter. Finally, in the case that the sample deviation index and the query precision threshold are calculated, the sample deviation index and the query precision threshold can be compared, and in the case that the sample deviation index does not exceed the query precision threshold, the range counting query is performed on the aggregated data set according to the query range parameter, and a query result is obtained. In this way, the data transmission cost is reduced and the data query efficiency is improved while ensuring the data query accuracy.
[0050] The application of the data query processing method provided in the embodiment in the data query scene is taken as an example, and the data query processing method provided in the embodiment is further described in combination with Figure 3 Figure 3 The data query processing method applied in the data query scene specifically includes the following steps.
[0051] Step S302, obtaining a query precision parameter for querying data from the Internet of Things network.
[0052] Step S304, aggregating the sample data set uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set.
[0053] The sample data set is uploaded in the following manner: obtaining Internet of Things data through data collection by the Internet of Things device, and obtaining third-party data through the Internet of Things device; sampling the Internet of Things data and the third-party data, and data packaging and data uploading of the obtained sample data.
[0054] Step S306, performing range counting query on the aggregated data set according to the query range parameter to obtain a query value.
[0055] Step S308, calculating a sample deviation index according to the query value and the sampling probability.
[0056] Step S310, calculating a data deviation value based on the deviation precision parameter contained in the query precision parameter and the data set size of the aggregated data set.
[0057] In step S312, the deviation threshold proportion is determined according to the data deviation value and the deviation constraint proportion contained in the query accuracy parameter.
[0058] In step S314, the square of the data deviation value is divided by the deviation threshold proportion to obtain the query accuracy threshold.
[0059] In step S316, it is determined whether the sample deviation index exceeds the query accuracy threshold. If not, steps S318 to S322 are executed; if yes, steps S324 to S326 are executed.
[0060] In step S318, the sequence parameter of each sample data in the aggregated data set is determined.
[0061] In step S320, the sequence data set is obtained by replacing the corresponding sample data in the aggregated data set based on the sequence parameter.
[0062] In step S322, the sequence parameter count satisfying the query range parameter in the aggregated data set is estimated by an estimation algorithm as the query result.
[0063] In step S324, the sample upload instruction is sent to each Internet of Things device.
[0064] In step S326, the uploaded sample data is added to the corresponding sample data set stored in the data base station.
[0065] It should be noted that any one step or combination of multiple steps in steps S302 to S322 can be combined with any one step or multiple steps in steps S202 to S208 to form a new implementation mode according to the needs of implementation and deployment; in addition, any one or more technical features in steps S302 to S322 can be combined with any one or more technical features provided in steps S202 to S208 to form a new implementation mode according to the actual needs of deployment; or, any one or more technical features in steps S302 to S322 can also be replaced by any one or more technical features provided in steps S202 to S208 to form a new implementation mode according to the actual needs of deployment, which will not be described one by one here.
[0066] It should be noted that any one of steps S302 to S316 and steps S324 to S326 or a combination of any multiple steps can be combined with any one of steps S202 to S208 or a combination of any multiple steps to form a new implementation manner according to the needs of implementation deployment. In addition, any one or any multiple technical features in steps S302 to S316 and steps S324 to S326 can be combined with any one or multiple technical features provided in steps S202 to S208 to form a new implementation manner according to the actual deployment needs. Or, any one or any multiple technical features in steps S302 to S316 and steps S324 to S326 can be replaced by a combination of any one or multiple technical features provided in steps S202 to S208 to form a new implementation manner according to the actual deployment needs, which will not be repeated here.
[0067] The data query processing apparatus provided in the specification implements, for example: In the above embodiment, a data query processing method is provided, and a data query processing apparatus corresponding thereto is also provided, which will be described below with reference to the accompanying drawings.
[0068] Reference Figure 4 which shows a schematic diagram of a data query processing apparatus embodiment provided in the embodiment.
[0069] Since the apparatus embodiment corresponds to the method embodiment, the description is relatively simple, and the related parts can be referred to the corresponding description of the method embodiment provided above. The apparatus embodiments described below are only illustrative.
[0070] The data query processing apparatus provided in the embodiment includes: The parameter acquisition module 402 is configured to acquire a query precision parameter for querying data from the Internet of Things network; The data aggregation module 404 is configured to aggregate sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set; The index calculation module 406 is configured to calculate a sample deviation index of the aggregated data set according to the query range parameter and the sampling probability, and calculate a query precision threshold based on the query precision parameter; The query module 408 is configured to, if the sample deviation index does not exceed the query precision threshold, perform range counting query on the aggregated data set according to the query range parameter to obtain a query result.
[0071] The data query processing apparatus provided in the specification implements, for example: Corresponding to the above-described data query processing method, based on the same technical concept, one or more embodiments of the present specification also provide a data query processing device for executing the above-described data query processing method, Figure 5 A structural schematic diagram of a data query processing device provided by one or more embodiments of the present specification.
[0072] The data query processing device provided by the embodiment includes: As Figure 5 shown, the data query processing device can be greatly different due to different configurations or performances, and can include one or more processors 501 and memories 502, and the memories 502 can store one or more storage applications or data. Among them, the memory 502 can be temporary storage or persistent storage. The application stored in the memory 502 can include one or more modules (not shown in the figure), and each module can include a series of computer executable instructions in the data query processing device. Further, the processor 501 can be configured to communicate with the memory 502 and execute a series of computer executable instructions in the memory 502 on the data query processing device. The data query processing device can also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input / output interfaces 505, and one or more keyboards 506, etc.
[0073] In one specific embodiment, the data query processing device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and the one or more programs can include one or more modules, and each module can include a series of computer executable instructions in the data query processing device, and the one or more processors are configured to execute the one or more programs include computer executable instructions for: Obtaining a query precision parameter for querying data from an Internet of Things network; Aggregating sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set; According to the query range parameter and the sampling probability, calculate the sample deviation index of the aggregated data set, and calculate the query precision threshold based on the query precision parameter; If the sample deviation index does not exceed the query precision threshold, perform range counting query on the aggregated data set according to the query range parameter to obtain a query result.
[0074] The computer readable storage medium implementation provided by the present specification is as follows: Corresponding to the data query processing method described above, based on the same technical concept, one or more embodiments of the present specification also provide a computer-readable storage medium.
[0075] The computer-readable storage medium provided by the embodiment provides computer executable instructions for storing, and the computer executable instructions realize the following processes when executed. Obtain a query precision parameter for querying data from an Internet of Things network. Aggregate sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set. Calculate a sample deviation index of the aggregated data set according to the query range parameter and the sampling probability, and calculate a query precision threshold value based on the query precision parameter. If the sample deviation index does not exceed the query precision threshold value, perform range counting query on the aggregated data set according to the query range parameter to obtain a query result.
[0076] It should be noted that the embodiments of the computer-readable storage medium in the present specification and the embodiments of the data query processing method in the present specification are based on the same inventive concept, so the specific implementation of the embodiments can be referred to the implementation of the corresponding method described above, and the repeated parts will not be described again.
[0077] The computer program product provided by the present specification has the following embodiments: Corresponding to the data query processing method described above, based on the same technical concept, one or more embodiments of the present specification also provide a computer program product.
[0078] A computer program product includes computer programs / instructions that are executed by a processor to implement the following steps: Obtain a query precision parameter for querying data from an Internet of Things network. Aggregate sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set. Calculate a sample deviation index of the aggregated data set according to the query range parameter and the sampling probability, and calculate a query precision threshold value based on the query precision parameter. If the sample deviation index does not exceed the query precision threshold value, perform range counting query on the aggregated data set according to the query range parameter to obtain a query result.
[0079] It should be noted that the embodiments of the computer-readable storage medium in the present specification and the embodiments of the data query processing method in the present specification are based on the same inventive concept, so the specific implementation of the embodiments can be referred to the implementation of the corresponding method described above, and the repeated parts will not be described again.
[0080] Each of the embodiments in the specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each of the embodiments focuses on the difference from other embodiments, such as the device embodiment, the equipment embodiment, the computer readable storage medium embodiment, the computer program product embodiment, which are similar to the method embodiment, so the description is relatively simple, and the related content in the device embodiment, the equipment embodiment, the computer readable storage medium embodiment and the computer program product embodiment can be referred to the part of the description of the method embodiment.
[0081] The above describes specific embodiments of the specification. Other embodiments are within the scope of the appended claims. In some cases, the acts or steps recited in the claims can be performed in a different order than the order in which the embodiments are presented and still achieve the desired result. Also, the process depicted in the figures does not necessarily require the particular order or sequential order shown or other specific arrangement in order to achieve the desired results. In some implementations, multitasking and parallel processing can be advantageous or possible.
[0082] In the 1930s, it was clear to distinguish whether an improvement in a technology was in hardware (e.g., improvement in circuit structures of diodes, transistors, switches, etc.) or in software (e.g., improvement in method flow). However, as technology has evolved, many improvements in method flow today can be considered as direct improvements in hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structures by programming the improved method flow into hardware circuits. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using hardware entity modules. For example, a programmable logic device (PLD) (e.g., a field programmable gate array (FPGA)) is an integrated circuit whose logic function is determined by user programming of the device. A digital system is "integrated" on a piece of PLD by the designer programming it by himself, without having to ask a chip manufacturer to design and manufacture a special integrated circuit chip. Moreover, instead of manually fabricating integrated circuit chips, this programming is now mostly implemented using "logic compiler" software, which is similar to the software compiler used when developing programs, and the original code before compilation also has to be written in a specific programming language, which is called a hardware description language (HDL), and there are many such languages, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., and the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that it is easy to obtain hardware circuits that implement the logic method flow by simply logically programming the method flow in the above-mentioned hardware description languages and programming it into an integrated circuit.
[0083] The controller can be implemented in any suitable way, for example, the controller can take the form of a microprocessor or processor and a computer readable medium storing computer readable program code, such as software or firmware, executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller and an embedded microcontroller, examples of which include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that, in addition to implementing the controller in pure computer readable program code, it is possible to implement the same functionality in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Such a controller can therefore be considered to be a hardware component, and the means included therein for implementing the various functions can also be considered to be structures within the hardware component. Alternatively, or even additionally, the means for implementing the various functions can be considered to be both a software module implementing the method and a structure within a hardware component.
[0084] The systems, apparatuses, modules or units illustrated by the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0085] For the sake of description, the above apparatuses are described in functional division and are described respectively. Of course, the functions of the units can be implemented in the same or multiple software and / or hardware when implementing the embodiments of the present specification.
[0086] Those skilled in the art will understand that one or more embodiments of the present specification can be provided as a method, a system or a computer program product. Therefore, one or more embodiments of the present specification can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present specification can take the form of a computer program product implemented on one or more computer readable storage media (including but not limited to disk storage, CD-ROMs, optical storage devices, etc.) containing computer usable program code.
[0087] The specification is presented with reference to flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus (system) and / or computer program product according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus (system) and / or computer program product according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks.
[0088] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus (system) and / or computer program product according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus (system) and / or computer program product according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks.
[0089] These computer program instructions can also be loaded into a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus (system) and / or computer program product according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 The flow diagrams and / or block diagrams in the specification can present a method, apparatus (system) and / or computer program product according to embodiments of the specification. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks.
[0090] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0091] The memory can include non-persistent memory, Random Access Memory (RAM), and / or non-volatile memory, such as Read Only Memory (ROM) or flash memory, among others. The memory is an example of computer-readable media.
[0092] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0093] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, such that a process, method, article or apparatus that comprises a list of elements does not only include those elements, but also other elements not explicitly listed or inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the phrase "comprising at least one" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0094] One or more embodiments of the present specification can be described in the general context of computer-executable instructions being executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform particular tasks or implement particular abstract data types. One or more embodiments of the present specification can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices that are connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0095] The above only describes the embodiments of the present document and is not intended to limit the present document. For those skilled in the art, the present document can have various changes and variations. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present document shall be included in the scope of claims of the present document.
Claims
1. A data query processing method, comprising: obtaining a query precision parameter for querying data from an Internet of Things network; aggregating sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set; calculating a sample deviation index of the aggregated data set according to a query range parameter and a sampling probability, and calculating a query precision threshold based on the query precision parameter; if the sample deviation index does not exceed the query precision threshold, performing a range counting query on the aggregated data set according to the query range parameter to obtain a query result. 2.The data query processing method of claim 1, wherein the sample data set is uploaded in the following manner: obtaining Internet of Things data by data collection through the Internet of Things device, and / or obtaining third-party data through the Internet of Things device; sampling the Internet of Things data and / or the third-party data, and data packaging and uploading the obtained sample data. 3.The data query processing method of claim 1, wherein the calculating a sample deviation index of the aggregated data set according to a query range parameter and a sampling probability comprises: performing a range counting query on the aggregated data set according to the query range parameter to obtain a query value; calculating the sample deviation index according to the query value and the sampling probability. 4.The data query processing method of claim 1, wherein the calculating a query precision threshold based on the query precision parameter comprises: calculating a data deviation value based on a deviation precision parameter contained in the query precision parameter and a data set size of the aggregated data set; calculating the query precision threshold according to the data deviation value and a deviation constraint ratio contained in the query precision parameter. 5.The data query processing method of claim 4, wherein the calculating the query precision threshold according to the data deviation value and the deviation constraint ratio contained in the query precision parameter comprises: determining a deviation out threshold ratio according to the deviation constraint ratio; calculating a ratio of a square of the data deviation value to the deviation out threshold ratio as the query precision threshold. 6.The data query processing method of claim 1, wherein the sample data set uploaded by the Internet of Things device is stored in a data base station; the query precision parameter is obtained from a calling input parameter of a data query interface called by a data query party or a data proxy party for data query. 7.The data query processing method of claim 1, wherein the performing a range counting query on the aggregated data set according to the query range parameter to obtain a query result comprises: determining a sequence parameter of each sample data in the aggregated data set, and replacing the corresponding sample data in the aggregated data set based on the sequence parameter to obtain a sequence data set; estimating a sequence parameter count of the aggregated data set that satisfies the query range parameter by an estimation algorithm as the query result.
8. The data query processing method of claim 7, after the step of performing a range counting query on the aggregated data set according to the query range parameter to obtain a query result, further comprising: calculating a global query count of the Internet of Things network according to the sequence parameter count and the sampling probability, and returning the global query count to a data query party or a data proxy party; wherein the global query count comprises a ratio of the sequence parameter count to the sampling probability.
9. The data query processing method of claim 7, after the step of calculating a sample deviation indicator of the aggregated data set according to a query range parameter and a sampling probability, and calculating a query precision threshold value based on a query precision parameter, further comprising: if the sample deviation indicator exceeds the query precision threshold value, sending a sample uploading instruction to each Internet of Things device, and adding the uploaded sample data to a corresponding sample data set stored by a data base station.
10. A data query processing apparatus, comprising: a parameter acquisition module configured to acquire a query precision parameter for data query of an Internet of Things network; a data aggregation module configured to aggregate sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set; an indicator calculation module configured to calculate a sample deviation indicator of the aggregated data set according to a query range parameter and a sampling probability, and calculate a query precision threshold value based on a query precision parameter; a query module configured to perform a range counting query on the aggregated data set according to the query range parameter to obtain a query result if the sample deviation indicator does not exceed the query precision threshold value.
11. A data query processing device, comprising: a processor; and a memory configured to store computer executable instructions which, when executed, cause the processor to: acquire a query precision parameter for data query of an Internet of Things network; aggregate sample data sets uploaded by each Internet of Things device in the Internet of Things network to obtain an aggregated data set; calculate a sample deviation indicator of the aggregated data set according to a query range parameter and a sampling probability, and calculate a query precision threshold value based on a query precision parameter; perform a range counting query on the aggregated data set according to the query range parameter to obtain a query result if the sample deviation indicator does not exceed the query precision threshold value.
12. A computer readable storage medium for storing computer executable instructions which, when executed, implement the steps of the method of claim 1.