CN112818004B - Data storage method, query method and electronic equipment - Google Patents
Data storage method, query method and electronic equipment Download PDFInfo
- Publication number
- CN112818004B CN112818004B CN202110082209.7A CN202110082209A CN112818004B CN 112818004 B CN112818004 B CN 112818004B CN 202110082209 A CN202110082209 A CN 202110082209A CN 112818004 B CN112818004 B CN 112818004B
- Authority
- CN
- China
- Prior art keywords
- target
- data
- early warning
- statistical
- equipment
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/242—Query formulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2453—Query optimisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2477—Temporal data queries
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Computational Linguistics (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Fuzzy Systems (AREA)
- Probability & Statistics with Applications (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Alarm Systems (AREA)
Abstract
The application provides a data storage method, a query method and electronic equipment. In this embodiment, by associating the flow data table with the early warning device, it is achieved that one flow data table stores the collected data of only one early warning device, and the collected data of different early warning devices are stored in different flow data tables, so that even if the flow data table is searched later, the time required for data query is reduced, and the data query rate is improved.
Description
Technical Field
The present disclosure relates to monitoring technologies, and in particular, to a data storage method, a query method, and an electronic device.
Background
In order to effectively reduce potential safety hazards in road traffic, early warning equipment can be erected on a road. Here, the early warning device is, for example, a radar road safety early warning integrated machine, and the like, and can perform deep fusion analysis on data detected by the radar and the camera respectively through an AI algorithm so as to classify various target objects such as motor vehicles, non-motor vehicles, pedestrians and the like, thereby realizing instant detection and effectively achieving the purpose of road safety early warning.
In general, after analyzing the obtained data, the early warning device pushes the obtained data to an electronic device (such as a radar road early warning platform, which may be referred to herein as an early warning platform) for performing unified management and analysis.
At present, after the electronic device receives the data pushed by the early warning device, the received data is stored in a created flow table in the database in real time. If 100 pieces of early warning equipment all have push data in 16-17 days of 9 months and 7 months in 2020, the number of the push data is up to 10 ten thousand, the electronic equipment correspondingly receives 10 ten thousand pieces of data, and stores the received 10 ten thousand pieces of data into the flowmeter, namely 10 ten thousand pieces of flow records are added in the flowmeter. For such huge flow tables, when data records in the flow table need to be queried, the query is slow, and the software response is affected.
Disclosure of Invention
The application provides a data storage method, a query method and electronic equipment, so as to improve the data query speed.
The technical scheme provided by the embodiment of the application comprises the following steps:
a method of data storage, the method comprising:
acquiring acquisition data acquired by early warning equipment; the acquired data at least comprises: collecting a time point, an equipment identification ID of the early warning equipment and at least one attribute parameter of a target object collected by the early warning equipment; adding a flow data table item in the created flow data table corresponding to the equipment identification ID; the flow data table entry is used for recording the acquired data;
Determining early warning data corresponding to the acquisition time point and the equipment identification ID according to the at least one attribute parameter; checking whether a statistical table item corresponding to a target unit time and the equipment identification ID exists in the created statistical table, wherein the target unit time is determined according to the acquisition time point and a designated time unit required by the statistical table, if not, adding the statistical table item into the statistical table, wherein the added statistical table item is used for recording the corresponding relation among the target unit time, the equipment identification ID and the early warning data, and if so, recording the early warning data into the existing statistical table item.
Optionally, the statistics table includes: at least one of the first, second, and third statistics;
wherein the specified time unit required by the first statistical table is smaller than the specified time unit required by the second statistical table; the specified time unit required by the second statistical table is smaller than the specified time unit required by the third statistical table.
Optionally, when the specified time unit required by the first statistics is an hour, the target unit time is a target hour to which the collection time point belongs in a target day, and the target day is a day on which the collection time point belongs;
When the specified time unit required by the second statistical table is a day, the target unit time is the target day;
and when the designated time unit required by the third statistical table is a month, the target unit time is a target month in which the target day is located.
Optionally, the method further comprises:
when a data query condition is received, searching a target statistical table matched with the data query condition in all the created statistical tables; the specified time unit required by the target statistical table is matched with the time information in the data query condition, and/or the target statistical table contains the early warning equipment identification in the data query condition;
and searching a target statistical table item corresponding to the time information in the data query condition in the target statistical table.
Optionally, the method further comprises:
obtaining a target equipment identification ID in the target statistics table entry;
and searching a flow data table item conforming to the time information in the data query condition in the created flow data table corresponding to the target equipment identification ID.
Optionally, the method further comprises:
when a export condition is received, a corresponding target flow data table is searched according to equipment information in the export condition, wherein the equipment information at least comprises: a device identification ID or a point location to which the early warning device belongs;
And exporting the flow data table item which is matched with the time information in the export condition in the searched target flow data table.
Optionally, the flow data table corresponding to the equipment identification ID has an inheritance relationship with a preset main table, and the flow data table corresponding to the equipment identification ID has the same table structure as the main table; the flow data table corresponding to the equipment identification ID is established based on the main table;
the method further comprises the steps of:
when the detected early warning equipment is switched from being used to being stopped, removing the inheritance relationship between the flow data table corresponding to the equipment identification ID and the main table from the recorded inheritance relationship;
when the early warning equipment is detected to be switched from being stopped to being used, the inheritance relation between the flow data table corresponding to the equipment identification ID and the main table is added in the recorded inheritance relation, so that the flow data table corresponding to the equipment identification ID is managed according to the added inheritance relation.
The embodiment of the application also provides a data query method, which is applied to the data storage method, and comprises the following steps:
receiving a data query condition;
Searching a target statistical table matched with the data query condition in all the created statistical tables; the specified time unit required by the target statistical table is matched with the time information in the data query condition, and/or the target statistical table contains the early warning equipment identification in the data query condition;
and searching a target statistical table item corresponding to the early warning equipment identifier and the time information in the data query condition in the target statistical table.
Optionally, the method further comprises:
obtaining a target equipment Identification (ID) in the target statistics table item, and searching a flow data table item conforming to time information in the data query condition in a created flow data table corresponding to the target equipment Identification (ID); and/or the number of the groups of groups,
receiving export conditions, wherein the export conditions at least comprise equipment information and time information; and searching a corresponding target flow data table according to the equipment information in the export condition, wherein the equipment information at least comprises: a device identification ID or a point location to which the early warning device belongs; and exporting the flow data table item which is matched with the time information in the export condition in the searched target flow data table.
The embodiment of the application also provides electronic equipment. The electronic device includes: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor;
the processor is configured to execute machine-executable instructions to perform the steps of the methods disclosed above.
According to the technical scheme, in the method, the flow data table is corresponding to the early warning equipment, so that only the collected data of one early warning equipment is stored in one flow data table, the collected data of different early warning equipment are stored in different flow data tables, and therefore, even if the collected data are searched in the flow data tables later, the time required by data query can be reduced, and the data query rate is improved.
Further, in this embodiment, for different collected data of the same early warning device in the same target unit time, a corresponding statistical table item is added to the statistical table, so that the statistical table item is added in the statistical table based on a time period instead of adding the statistical table item for the collected data of each moment, records of the statistical table item are fewer, statistical efficiency is improved, early warning data of each early warning device in each target unit time is more physical and chemical, simplicity and clarity are achieved, integrity and accuracy of the early warning data of each early warning device are conveniently checked, and comparison of the early warning data of each early warning device is also more convenient.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart of a method provided in an embodiment of the present application;
FIG. 2 is a flow chart of data query provided in an embodiment of the present application;
FIG. 3 is a flow chart for searching flow data entries according to an embodiment of the present application;
FIG. 4 is a flow chart of data export provided in an embodiment of the present application;
FIG. 5 is a block diagram of an apparatus according to an embodiment of the present application;
FIG. 6 is a block diagram of another apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present application as detailed in the accompanying claims.
The terminology used in the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
In order to better understand the technical solutions provided by the embodiments of the present application and make the above objects, features and advantages of the embodiments of the present application more obvious, the technical solutions in the embodiments of the present application are described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart of a method provided in an embodiment of the present application. Alternatively, as one embodiment, the process may be applied to an electronic device. As an embodiment, the electronic device may be a device for performing management control on the early warning device. Taking the early warning device as an example of a lightning road safety early warning integrated machine, the electronic device can be a lightning road early warning platform. The embodiment is not particularly limited to the structural form of the electronic device, and may be a software system implemented by software or a hardware system implemented by hardware.
As an embodiment, in order to increase the data query speed, the embodiment of the present application optimizes the existing data storage manner, and stores the data in a manner as shown in fig. 1, rather than directly storing the data pushed from the early warning device into a large flow table as described in the background art.
Optionally, to implement storing data in the manner shown in fig. 1, the present embodiment introduces the concepts of a traffic data table and a statistics table in the database:
flow data table: the flow data table is bound with the device Identification (ID) of the early warning device, and is used for storing data (recorded as acquisition data) pushed by the corresponding early warning device. In this embodiment, when the electronic device detects that a new early warning device is accessed, it creates a flow data table corresponding to the device identifier of the newly accessed early warning device. The acquisition data in the initially created flow data table is empty. And then, when the electronic equipment receives the acquired data pushed by the early warning equipment, the acquired data are stored into a flow data table corresponding to the equipment identifier of the early warning equipment.
Optionally, the collected data may include at least one attribute parameter of the target object collected by the early warning device, and a device identifier of the early warning device. The acquisition time point may be a time point when the radar and/or the camera detect data. The device identifier of the early warning device may be address information, model number, belonging point location, etc. of the early warning device, and the embodiment is not particularly limited. The at least one attribute parameter of the target object is used to describe a parameter of the target object, for example, taking the target object as an automobile, the at least one attribute parameter of the target object collected by the early warning device may include: color, license plate, model, etc. of the motor vehicle. Optionally, at least one attribute parameter of the target object collected by the early warning device may be obtained by performing a deep fusion analysis on data detected by the radar and the camera respectively by the early warning device through an AI algorithm, and the embodiment is not specifically limited.
Statistics table: the method is used for storing early warning data (the early warning data will be described hereinafter and is not repeated here) according to statistical indexes (required specified time units), so that the stored early warning data are physicochemical, concise and clear, the integrity and accuracy of the data are conveniently checked, and the comparison analysis of the collected data pushed by each early warning device is also convenient. Alternatively, in this embodiment, the statistics table is created at the time of database installation, and the statistics table is not newly added later.
In this embodiment, the number of statistical tables created at the time of database installation is 1 or more. Hereinafter, the description will be given by way of example, and the description will be omitted.
Based on the above description, the flow shown in fig. 1 is described below:
as shown in fig. 1, the process may include the steps of:
and 101, acquiring acquisition data acquired by the early warning equipment.
Here, the early warning device may be an early warning device erected on a specified road, such as a lightning road safety early warning integrated machine. Alternatively, the specified road is a certain road section selected according to actual demands, and the embodiment is not particularly limited.
Optionally, in this embodiment, when the early warning device collects data (i.e. collected data), the collected data is sent to the electronic device, so that the electronic device obtains the collected data collected by the early warning device in this step 101.
As described above, the acquired data here includes at least: the method comprises the steps of collecting a time point, an equipment identification ID of early warning equipment and at least one attribute parameter of a target object collected by the early warning equipment. The collection time point, the device identification ID of the early warning device, and at least one attribute parameter of the target object collected by the early warning device are described above, and are not described herein.
And step 102, adding a flow data table item in the created flow data table corresponding to the equipment identifier, wherein the flow data table item is used for recording the acquired data.
As described above, the electronic device is responsible for managing and controlling the early warning device, and when detecting that a new early warning device is accessed, a flow data table corresponding to the device identifier of the newly accessed early warning device is created. Initially, the data in the traffic data table may be empty. Subsequently, when the acquired data acquired by the early warning device is obtained as described in step 101, a flow data entry is added to the created flow data table corresponding to the device identification ID of the early warning device. The flow data table entry is used for recording the acquired data.
It can be seen that, in this embodiment, the collected data collected by each early warning device is specifically stored in the flow data table corresponding to the device identifier of the early warning device. In other words, one flow data table only stores the acquired data of one early warning device, the acquired data of different early warning devices are stored in different flow data tables, so that the problems that the inquiry is slow, the software response is influenced and the like caused by searching in the flow tables with the acquired data of all the early warning devices as described in the background art can not occur even if the acquired data of different early warning devices are searched in the flow data tables later, the time required for data inquiry is shortened, and the data inquiry rate is improved.
Alternatively, in this embodiment, the step 102 and the step 103 are not in a fixed time sequence, and the step 102 and the step 103 may be performed simultaneously, or the step 103 may be performed first and then the step 102 may be performed, which is not particularly limited.
Optionally, in step 103, there are many implementations of determining the early warning data corresponding to the collection time point and the device identifier according to the at least one attribute parameter, for example, the early warning data may be generated according to an existing early warning data generating manner. Alternatively, the early warning data here may be: the number of targets of the target object to be pre-warned, the number of pre-warned, the speed of the target object to be pre-warned, the number of overspeed of the target object to be pre-warned, the data of speed reduction of the target object to be pre-warned, etc., the embodiment does not emphasize how to determine pre-warning data and the specific form of the pre-warning data.
Once the early warning data corresponding to the collection time point and the device identifier is determined, optionally, as described in step 103, it is checked whether a statistics table item corresponding to the target unit time and the device identifier exists in the created statistics table. Here, the target unit time is determined according to the collection time point and the specified time unit required by the statistics table, and specifically may be: and determining the unit time to which the acquisition time point belongs according to the designated time unit required by the statistical table. For example, when the specified time unit required by the statistics table is hours and the collection time point is 16 hours, 9/7/16 minutes and 15 seconds in 2020, the target unit time is 16 hours, 9/7/2020, to which the collection time point belongs.
As an embodiment, when no statistics table entry corresponding to the target unit time and the device identifier exists in the statistics table, adding a statistics table entry in the statistics table, where the added statistics table entry is used to record a correspondence between the target unit time, the device identifier and the early warning data.
As another embodiment, when the statistics table includes statistics table entries corresponding to the target unit time and the device identifier, the determined early warning data corresponding to the collection time point and the device identifier is recorded into the existing statistics table entries. Optionally, the recording the determined early warning data corresponding to the collection time point and the device identifier into the existing statistics table entry may be: combining the determined early warning data corresponding to the collection time point and the equipment identifier with early warning data in an existing statistical table (for example, increasing the early warning number contained in the early warning data in the existing statistical table by 1, increasing the target number contained in the early warning data in the existing statistical table by the determined target data, etc.).
As can be seen from the above step 103, in this embodiment, for different collected data of the same early warning device in the same target unit time, only one corresponding statistics table entry is added in the statistics table, so that it is realized that the statistics table entry is added in the statistics table based on the time period, instead of adding the statistics table entry for the collected data of each moment, the records of the statistics table entry are fewer, the statistics efficiency is improved, and the early warning data of each early warning device in each target unit time is more physical and chemical, and is simple and clear, so that the integrity and accuracy of the early warning data of each early warning device are conveniently checked, and the early warning data of each early warning device is more conveniently compared.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow shown in fig. 1, in this embodiment, by associating the flow data table with the early warning device, it is realized that one flow data table stores only the collected data of one early warning device, and the collected data of different early warning devices are stored in different flow data tables, so that even if the collected data is searched in the flow data table later, the time required for data query is reduced, and the data query rate is improved.
Further, in this embodiment, for different collected data of the same early warning device in the same target unit time, a corresponding statistical table item is added to the statistical table, so that the statistical table item is added in the statistical table based on a time period instead of adding the statistical table item for the collected data of each moment, records of the statistical table item are fewer, statistical efficiency is improved, early warning data of each early warning device in each target unit time is more physical and chemical, simplicity and clarity are achieved, integrity and accuracy of the early warning data of each early warning device are conveniently checked, and comparison of the early warning data of each early warning device is also more convenient.
Optionally, in this embodiment, the flow data table and the statistics table are stored in a database. Here, the statistics are built at the time of database installation and cannot be added or deleted later.
As an embodiment, in this embodiment, the statistics table may include: at least one of the first, second and third statistics.
Taking the first statistics table as an example, as described in step 103, when the created first statistics table does not have the statistics table entry corresponding to the target unit time (the specified time unit meeting the requirement of the first statistics table, for example, the specified time unit meeting the requirement of the first statistics table is an hour, the target unit time is an hour at which the acquisition time point is located) and the device identifier, the statistics table entry is added in the first statistics table, and the newly added statistics table entry is used for recording the correspondence between the target unit time, the device identifier and the statistics data; otherwise, the statistics are recorded into the existing statistics entries, for example, the statistics are combined with the statistics in the existing statistics entries. Taking the specified time unit required by the first statistics table as an example, if 100 pieces of early warning equipment exist currently, the 100 pieces of early warning equipment push collected data to the electronic equipment from 16 hours to 17 hours of 7 days of 9 months in 2020, and correspondingly, 10 ten thousand pieces of statistics data are generated based on the collected data pushed by the 100 pieces of early warning equipment from 16 hours to 17 hours of 7 days of 9 months in 2020. Based on the above description, only 100 records (each record corresponds to one early warning device, and 100 records correspond to 100 early warning devices) are added in the first statistics table instead of 10 ten thousand records, which obviously reduces the records of the statistics table, improves the statistics efficiency, enables the early warning data of each early warning device in each target unit time to be more physical and chemical, is concise and clear, is convenient for checking the integrity and accuracy of the early warning data of each early warning device, and is also more convenient for comparing the early warning data of each early warning device.
The second statistical table and the third statistical table are similar to the first statistical table in principle, and are not described in detail herein.
Optionally, in this embodiment, the specified time unit required by the first statistics table is smaller than the specified time unit required by the second statistics table; the specified time unit required by the second statistical table is smaller than the specified time unit required by the third statistical table. That is, the specified time units required by the first, second, and third statistics are sequentially increased, for example, the specified time unit required by the first statistics is hours, the specified time unit required by the second statistics is days, and the specified time unit required by the third statistics is months.
Alternatively, in this embodiment, when the specified time unit required by the first statistical table is an hour, the target unit time is a target hour to which the collection time point belongs in a target day, and the target day is a day on which the collection time point belongs. The target unit time is 16 hours of 9/7/2020 when the acquisition time point is 23 minutes and 15 seconds.
Alternatively, in this embodiment, when the specified time unit required by the second statistical table is a day, the target unit time is the target day to which the collection time point belongs. Still, the acquisition time point is 2020, 9, 7, 16, 23 minutes and 15 seconds, and the target unit time is 2020, 9, 7.
Alternatively, in this embodiment, when the specified time unit required by the second statistical table is a month, the target unit time is the target month to which the collection time point belongs. The target unit time is 9 months 2020 when the acquisition time point is 16 minutes and 15 seconds from 9 months 2020.
The foregoing describes the data storage, and the following data query method is provided in the embodiments of the present application:
referring to fig. 2, fig. 2 is a flowchart of data query provided in an embodiment of the present application. The flow is applied to the electronic equipment.
As shown in fig. 2, the process may include the steps of:
in step 201, a data query condition is received.
Alternatively, in this embodiment, the data query condition may be carried by an external sending command, or may be generated by one of the early warning devices displayed on the display interface for triggering, and this embodiment is not particularly limited.
In this embodiment, a corresponding query time may be preset for each statistics table, where the query time may be related according to a time unit required by the statistics table. For example, if the specified time unit required by the first statistics is hours, the query time corresponding to the first statistics may be at least one hour within approximately 24 hours. For another example, the time unit required by the second statistical table is day, and the query time corresponding to the second statistical table may be at least one day in the week, at least one day in the month, etc. For another example, the unit of time required by the third statistical table is month, and the query time corresponding to the third statistical table may be at least one month of the last three months/last half year/last year, etc.
Based on this, in this embodiment, searching the target statistics table matching the data query condition in all the created statistics tables in step 202 above may include: and determining a statistical table corresponding to the time information according to the time information in the data query condition, and determining the statistical table corresponding to the time information in the data query condition as a target statistical table. For example, if the time information is a certain hour in the near 24 hours, and if the query time corresponding to the first statistical table can be at least one hour in the near 24 hours, the statistical table corresponding to the time information in the data query condition is the first statistical table; for example, if the time information is a day of the week, if the query time corresponding to the second statistical table may be at least a day of the week, the statistical table corresponding to the time information in the data query condition is the second statistical table; for example, if the time information is a month in the last half year, if the query time corresponding to the third statistical table may be at least a month in the last half year, the statistical table corresponding to the time information in the data query condition is the third statistical table.
In summary, it can be seen that the specified time unit required by the target statistics table matches the time information in the data query condition.
And 203, searching a target statistical table item corresponding to the time information in the data query condition in the target statistical table.
Optionally, in this embodiment, the time information in the data query condition is used as a key word to search the statistics table entry corresponding to the key word in the target statistics table (i.e. the target statistics table entry). Taking the time information as the next week, in step 203, a statistics table entry including the next week day (for example, each of monday to sunday) may be found in a target statistics table, such as the second statistics table, as the target statistics table entry.
Optionally, in this embodiment, after the target statistics table entry is found, the target statistics table entry may be further displayed through an interface, so that the user performs a comparative analysis based on the displayed target statistics table entry.
Thus, the flow shown in fig. 2 is completed.
As can be seen from the flow shown in fig. 2, in this embodiment, the number of statistics table entries implemented by adding the statistics table entries according to the required specified time unit based on the statistics table described above is small, so when the data query is executed, the query is performed in the smaller number of statistics tables, which obviously improves the query efficiency.
Optionally, in this embodiment, after the process shown in fig. 2 queries the target statistics table entry, the process shown in fig. 3 may also be performed:
referring to fig. 3, fig. 3 is a flow chart of searching a flow data table entry according to an embodiment of the present application. As shown in fig. 3, the process may include the steps of:
Alternatively, in this embodiment, as an embodiment, the target statistics table entry may be the target statistics table entry queried by the flow shown in fig. 2. As another embodiment, the target statistics table entry may be a part of the target statistics table entry queried by the flow shown in fig. 2, which is not particularly limited.
And 302, searching a flow data table item conforming to time information in the data query condition in the created flow data table corresponding to the target equipment identification.
For example, taking the time information as an example of the next week, the traffic data table entries of each time point in the next week are searched in the traffic data table corresponding to the target equipment identifier.
Alternatively, in this embodiment, the flow data entry may be displayed through an interface when found, or may be derived, and this embodiment is not particularly limited.
Thus, the flow shown in fig. 3 is completed.
Further searching of the flow data table entry based on the target statistics table entry is achieved through the flow shown in fig. 3. In view of the fact that the above-mentioned one flow data table only stores the collected data of one early warning device, and the collected data of different early warning devices are stored in different flow data tables, in this embodiment, the flow data table entry is searched in the flow data table, which obviously reduces the time required for data query and increases the data query rate.
Optionally, the present embodiment further provides a flow as shown in fig. 4:
referring to fig. 4, fig. 4 is a flowchart of data export provided in an embodiment of the present application. The flow is applied to the electronic equipment. As shown in fig. 4, the process may include:
Optionally, in this embodiment, more than 1 early warning device may be installed at the same point. According to the embodiment, the device identification of the early warning device installed at each point location is stored in the electronic device in advance, based on the device identification, when the device information is the point location of the early warning device, the device identification of the early warning device installed at the point location of the early warning device is also found according to the pre-stored device identification of the early warning device installed at each point location, and then a corresponding flow data table (marked as a target flow data table) is found according to the device identification.
And step 402, exporting the flow data table item which is consistent with the time information in the export condition in the searched target flow data table.
For example, if the time information in the export condition is 2020, 9, 7, 16, 23 minutes, 15 seconds, then the flow data item whose acquisition time point is 2020, 9, 7, 16, 23 minutes, 15 seconds is queried in the target flow data table, and then the found flow data item is exported.
Thus, the flow shown in fig. 4 is completed.
As can be seen from the flow shown in fig. 4, in view of the above-mentioned one flow data table storing the collected data of only one early warning device, and the collected data of different early warning devices stored in different flow data tables, the present embodiment searches the target flow data table by the export condition, searches the flow data table entry in the target flow data table and exports the flow data table, which obviously reduces the time required for data query, improves the data query rate, and also improves the data export efficiency.
In this embodiment, the traffic data table corresponding to the device identifier has an inheritance relationship with a preset master table (equivalent to a template). Specifically, in this embodiment, when the flow data table corresponding to the device identifier of the early warning device is created, the master table is copied first, and then the copied master table is adaptively modified according to the device identifier of the early warning device, that is, the modified master table is the flow data table corresponding to the device identifier of the early warning device. Based on this, the present embodiment further records the inheritance relationship between the traffic data table corresponding to the device identifier and the preset master table, so as to manage the traffic data table corresponding to the device identifier according to the inheritance relationship (how to manage specifically, the present embodiment is not limited specifically).
The flow data table corresponding to the equipment identifier and the main table have the same table structure; the traffic data table corresponding to the equipment identification ID is established based on the main table.
Based on this, in this embodiment, optionally, when the detected early warning device is switched from being used to being stopped, the inheritance relationship between the traffic data table corresponding to the device identifier of the stopped early warning device and the master table is removed from the recorded inheritance relationship. As one embodiment, there are many implementations for switching the detected early warning device from being used to being stopped, for example, an external stopping instruction is received, and the early warning device corresponding to the device identifier is determined to be switched from being used to being stopped according to the device identifier carried by the external stopping instruction; or, sending a heartbeat message to the accessed early warning device at intervals of a set time, when a response returned by a certain early warning device is not detected, determining that the early warning device is switched from being used to being stopped, and the like, and the embodiment is not particularly limited how to detect that the early warning device is switched from being used to being stopped.
Optionally, in this embodiment, when it is detected that the early warning device is switched from being stopped to being used, an inheritance relationship between the traffic data table corresponding to the device identification ID and the master table is added in the recorded inheritance relationship, so as to manage the traffic data table corresponding to the device identification ID according to the added inheritance relationship. Here, the manner of detecting the switching of the warning device from being used to being used is similar to the above-described manner of detecting the switching of the warning device from being used to being used, and will not be described by way of example.
The method provided by the present application is described above, and the apparatus provided by the present application is described below:
referring to fig. 5, fig. 5 is a block diagram of an apparatus according to an embodiment of the present application. The apparatus corresponds to the flow shown in fig. 1. As shown in fig. 5, the apparatus may include:
the acquisition unit is used for acquiring acquisition data acquired by the early warning equipment; the acquired data at least comprises: collecting a time point, an equipment identification ID of the early warning equipment and at least one attribute parameter of a target object collected by the early warning equipment;
a processing unit, configured to add a flow data table entry in the created flow data table corresponding to the device identifier ID; the flow data table entry is used for recording the acquired data; the method comprises the steps of,
the early warning data corresponding to the acquisition time point and the equipment identification ID are determined according to the at least one attribute parameter; the method comprises the steps of,
and the method is used for checking whether a statistical table item corresponding to a target unit time and the equipment identification ID exists in the created statistical table, the target unit time is determined according to the acquisition time point and a designated time unit required by the statistical table, if not, the statistical table item is added in the statistical table, the added statistical table item is used for recording the corresponding relation among the target unit time, the equipment identification ID and the early warning data, and if so, the early warning data is recorded into the existing statistical table item.
Optionally, the statistics table includes: at least one of the first, second, and third statistics;
wherein the specified time unit required by the first statistical table is smaller than the specified time unit required by the second statistical table; the specified time unit required by the second statistical table is smaller than the specified time unit required by the third statistical table.
Optionally, when the specified time unit required by the first statistics is an hour, the target unit time is a target hour to which the collection time point belongs in a target day, and the target day is a day on which the collection time point belongs;
when the specified time unit required by the second statistical table is a day, the target unit time is the target day;
and when the designated time unit required by the third statistical table is a month, the target unit time is a target month in which the target day is located.
As shown in fig. 5, the apparatus further includes:
the receiving unit is used for receiving the data query condition;
the query unit is used for searching a target statistical table matched with the data query condition in all the created statistical tables; the specified time unit required by the target statistical table is matched with the time information in the data query condition, and/or the target statistical table contains the early warning equipment identification in the data query condition; and searching a target statistical table item corresponding to the time information in the data query condition in the target statistical table.
Optionally, the query unit further obtains a target device identification ID in the target statistics table entry, and searches the created traffic data table corresponding to the target device identification ID for a traffic data table entry conforming to the time information in the data query condition.
Optionally, when the query unit further receives the export condition, the query unit searches the corresponding target flow data table according to the device information in the export condition, where the device information at least includes: a device identification ID or a point location to which the early warning device belongs; and exporting the flow data table item which is matched with the time information in the export condition in the searched target flow data table.
Optionally, the flow data table corresponding to the equipment identification ID has an inheritance relationship with a preset main table, and the flow data table corresponding to the equipment identification ID has the same table structure as the main table; the flow data table corresponding to the equipment identification ID is established based on the main table.
Based on this, the processing unit further removes, in the recorded inheritance relationship, the inheritance relationship between the traffic data table corresponding to the device identification ID and the master table when the detected early warning device is switched from being used to being stopped; when the early warning equipment is detected to be switched from being stopped to being used, the inheritance relation between the flow data table corresponding to the equipment identification ID and the main table is added in the recorded inheritance relation, so that the flow data table corresponding to the equipment identification ID is managed according to the added inheritance relation.
The structural description of the apparatus shown in fig. 5 is thus completed.
Referring to fig. 6, fig. 6 is a schematic diagram of another apparatus according to an embodiment of the present application. The apparatus corresponds to the flow shown in fig. 2. As shown in fig. 6, the apparatus may include:
a receiving unit for receiving a data query condition;
the query unit is used for searching a target statistical table matched with the data query condition in all the created statistical tables; the specified time unit required by the target statistical table is matched with the time information in the data query condition, and/or the target statistical table contains the early warning equipment identification in the data query condition; and searching a target statistical table item corresponding to the early warning equipment identifier and the time information in the data query condition in the target statistical table.
Optionally, the query unit further obtains a target device identifier ID in the target statistics table entry, and searches a created flow data table corresponding to the target device identifier ID for a flow data table entry conforming to time information in the data query condition; and/or the number of the groups of groups,
the query unit further receives a derivation condition, wherein the derivation condition at least comprises equipment information and time information; and searching a corresponding target flow data table according to the equipment information in the export condition, wherein the equipment information at least comprises: a device identification ID or a point location to which the early warning device belongs; and exporting the flow data table item which is matched with the time information in the export condition in the searched target flow data table.
Thus, the structure of the apparatus shown in fig. 6 is completed.
The embodiment of the application also provides a hardware structure of the device shown in fig. 5 or 6. Referring to fig. 7, fig. 7 is a block diagram of an electronic device according to an embodiment of the present application. As shown in fig. 7, the hardware structure may include: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute the machine-executable instructions to implement the methods disclosed in the above examples of the present application.
Based on the same application concept as the above method, the embodiments of the present application further provide a machine-readable storage medium, where a number of computer instructions are stored, where the computer instructions can implement the method disclosed in the above example of the present application when executed by a processor.
By way of example, the machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, and the like. For example, a machine-readable storage medium may be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., hard drive), a solid state drive, any type of storage disk (e.g., optical disk, dvd, etc.), or a similar storage medium, or a combination thereof.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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 flowchart flow or flows and/or block diagram block or blocks.
Moreover, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto 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 flowchart flow or flows and/or block diagram block or blocks.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.
Claims (9)
1. A method of data storage, the method comprising:
acquiring acquisition data acquired by early warning equipment; the acquired data at least comprises: collecting a time point, an equipment identification ID of the early warning equipment and at least one attribute parameter of a target object collected by the early warning equipment; adding a flow data table item in the created flow data table corresponding to the equipment identification ID; the flow data table entry is used for recording the acquired data;
Determining early warning data corresponding to the acquisition time point and the equipment identification ID according to the at least one attribute parameter; checking whether a statistical table item corresponding to a target unit time and the equipment identification ID exists in the created statistical table, wherein the target unit time is determined according to the acquisition time point and a designated time unit required by the statistical table, if not, adding the statistical table item into the statistical table, wherein the added statistical table item is used for recording the corresponding relation among the target unit time, the equipment identification ID and the early warning data, and if so, recording the early warning data into the existing statistical table item;
the statistical table comprises early warning data of different early warning devices;
when a data query condition is received, searching all the created statistical tables for target statistical table items matched with the data query condition; obtaining a target equipment identification ID in the target statistics table entry; and searching a flow data table item conforming to the time information in the data query condition in the created flow data table corresponding to the target equipment identification ID.
2. The method of claim 1, wherein the statistics table comprises: at least one of the first, second, and third statistics;
Wherein the specified time unit required by the first statistical table is smaller than the specified time unit required by the second statistical table; the specified time unit required by the second statistical table is smaller than the specified time unit required by the third statistical table.
3. The method of claim 2, wherein the step of determining the position of the substrate comprises,
when the specified time unit required by the first statistics is an hour, the target unit time is a target hour to which the acquisition time point belongs in a target day, and the target day is a day on which the acquisition time point belongs;
when the specified time unit required by the second statistical table is a day, the target unit time is the target day;
and when the designated time unit required by the third statistical table is a month, the target unit time is a target month in which the target day is located.
4. The method of claim 1, wherein when a data query condition is received, searching all the created statistics for a target statistics entry matching the data query condition, comprising:
when a data query condition is received, searching a target statistical table matched with the data query condition in all the created statistical tables; the specified time unit required by the target statistical table is matched with the time information in the data query condition, and/or the target statistical table contains the early warning equipment identification in the data query condition;
And searching a target statistical table item corresponding to the time information in the data query condition in the target statistical table.
5. The method according to claim 1, characterized in that the method further comprises:
when a export condition is received, a corresponding target flow data table is searched according to equipment information in the export condition, wherein the equipment information at least comprises: a device identification ID or a point location to which the early warning device belongs;
and exporting the flow data table item which is matched with the time information in the export condition in the searched target flow data table.
6. The method according to claim 1, wherein the traffic data table corresponding to the device identification ID has an inheritance relationship with a preset master table, and the traffic data table corresponding to the device identification ID has the same table structure as the master table; the flow data table corresponding to the equipment identification ID is established based on the main table;
the method further comprises the steps of:
when the detected early warning equipment is switched from being used to being stopped, removing the inheritance relationship between the flow data table corresponding to the equipment identification ID and the main table from the recorded inheritance relationship;
When the early warning equipment is detected to be switched from being stopped to being used, the inheritance relation between the flow data table corresponding to the equipment identification ID and the main table is added in the recorded inheritance relation, so that the flow data table corresponding to the equipment identification ID is managed according to the added inheritance relation.
7. A data query method, characterized in that the method is applied to the data storage method as claimed in any one of claims 1 to 6, the method comprising:
receiving a data query condition;
searching a target statistical table matched with the data query condition in all the created statistical tables; the specified time unit required by the target statistical table is matched with the time information in the data query condition, and/or the target statistical table contains the early warning equipment identification in the data query condition;
and searching a target statistical table item corresponding to the early warning equipment identifier and the time information in the data query condition in the target statistical table.
8. The method of claim 7, wherein the method further comprises:
obtaining a target equipment Identification (ID) in the target statistics table item, and searching a flow data table item conforming to time information in the data query condition in a created flow data table corresponding to the target equipment Identification (ID); and/or the number of the groups of groups,
Receiving export conditions, wherein the export conditions at least comprise equipment information and time information; and searching a corresponding target flow data table according to the equipment information in the export condition, wherein the equipment information at least comprises: a device identification ID or a point location to which the early warning device belongs; and exporting the flow data table item which is matched with the time information in the export condition in the searched target flow data table.
9. An electronic device, comprising: a processor and a machine-readable storage medium;
the machine-readable storage medium stores machine-executable instructions executable by the processor;
the processor is configured to execute machine executable instructions to implement the method steps of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110082209.7A CN112818004B (en) | 2021-01-21 | 2021-01-21 | Data storage method, query method and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110082209.7A CN112818004B (en) | 2021-01-21 | 2021-01-21 | Data storage method, query method and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112818004A CN112818004A (en) | 2021-05-18 |
CN112818004B true CN112818004B (en) | 2023-06-27 |
Family
ID=75858402
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110082209.7A Active CN112818004B (en) | 2021-01-21 | 2021-01-21 | Data storage method, query method and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112818004B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017076212A1 (en) * | 2015-11-05 | 2017-05-11 | 阿里巴巴集团控股有限公司 | Data sheet query method and device |
CN107451149A (en) * | 2016-05-31 | 2017-12-08 | 北京京东尚科信息技术有限公司 | The monitoring method and its device of data on flows query task |
US10372708B1 (en) * | 2014-12-31 | 2019-08-06 | Teradata Us, Inc. | Statistic normalization in a data store system |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101349709A (en) * | 2007-07-17 | 2009-01-21 | 深圳市辉煌电子有限公司 | Method and apparatus for detecting vehicle flow information |
CN105224636A (en) * | 2015-09-24 | 2016-01-06 | 沈阳东软医疗***有限公司 | A kind of data access method and device |
CN106682232A (en) * | 2017-01-13 | 2017-05-17 | 西安电子科技大学 | Statistical statement generating method of vehicle monitoring system |
CN109308305B (en) * | 2018-09-30 | 2021-06-08 | 广州圣亚科技有限公司 | Monitoring data query method and device and computer equipment |
-
2021
- 2021-01-21 CN CN202110082209.7A patent/CN112818004B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10372708B1 (en) * | 2014-12-31 | 2019-08-06 | Teradata Us, Inc. | Statistic normalization in a data store system |
WO2017076212A1 (en) * | 2015-11-05 | 2017-05-11 | 阿里巴巴集团控股有限公司 | Data sheet query method and device |
CN107451149A (en) * | 2016-05-31 | 2017-12-08 | 北京京东尚科信息技术有限公司 | The monitoring method and its device of data on flows query task |
Also Published As
Publication number | Publication date |
---|---|
CN112818004A (en) | 2021-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110334111B (en) | Multidimensional track analysis method and device | |
CN105224546B (en) | Data storage and query method and equipment | |
US20140351273A1 (en) | System and method for searching information | |
CN107026881B (en) | Method, device and system for processing service data | |
CN104270605B (en) | A kind of processing method and processing device of video monitoring data | |
CN112131325A (en) | Track determination method, device and equipment and storage medium | |
CN104731816A (en) | Method and device for processing abnormal business data | |
CN102244758A (en) | Video-recording-file-based data acquisition method and equipment | |
CN111061752B (en) | Data processing method and device and electronic equipment | |
CN101882135B (en) | Data processing method and device | |
WO2014106418A1 (en) | Method and apparatus for storing and reading files | |
Yadamjav et al. | Querying recurrent convoys over trajectory data | |
CN114647658A (en) | Data retrieval method, device, equipment and machine-readable storage medium | |
CN112818004B (en) | Data storage method, query method and electronic equipment | |
CN111813773B (en) | Power grid meter reading data storage method, uploading method, device and storage device | |
CN109739854A (en) | A kind of date storage method and device | |
KR20170137756A (en) | Aggregation of large amounts of temporal data from multiple overlapping sources | |
CN110796760B (en) | Traffic accident evidence collection method, vehicle-mounted terminal, server and system | |
CN112632058A (en) | Track determination method, device and equipment and storage medium | |
CN105512564A (en) | Method and device for data tamper-proof verification | |
CN110765221A (en) | Management method and device of space-time trajectory data | |
CN102447589B (en) | Method and device for aggregating records | |
CN110019192B (en) | Database retrieval method and device | |
US20070239794A1 (en) | Method and system for updating logical information in databases | |
CN110928868B (en) | Vehicle data retrieval method, device and computer readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |