WO2020020358A1 - Method and apparatus for determining residence time duration, device, and storage medium - Google Patents
Method and apparatus for determining residence time duration, device, and storage medium Download PDFInfo
- Publication number
- WO2020020358A1 WO2020020358A1 PCT/CN2019/097953 CN2019097953W WO2020020358A1 WO 2020020358 A1 WO2020020358 A1 WO 2020020358A1 CN 2019097953 W CN2019097953 W CN 2019097953W WO 2020020358 A1 WO2020020358 A1 WO 2020020358A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- rfid
- collection
- rfid data
- time
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000013480 data collection Methods 0.000 claims abstract description 40
- 238000005192 partition Methods 0.000 claims description 15
- 238000012545 processing Methods 0.000 claims description 14
- 238000013500 data storage Methods 0.000 claims description 10
- 238000007781 pre-processing Methods 0.000 claims description 10
- 238000013461 design Methods 0.000 claims description 9
- 238000004364 calculation method Methods 0.000 claims description 7
- 238000012546 transfer Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 4
- 238000001914 filtration Methods 0.000 claims description 3
- 238000006243 chemical reaction Methods 0.000 claims description 2
- 238000010586 diagram Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 230000006978 adaptation Effects 0.000 description 2
- 230000001174 ascending effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000001105 regulatory effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K17/00—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
- G06K17/0022—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisions for transferring data to distant stations, e.g. from a sensing device
- G06K17/0029—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations arrangements or provisions for transferring data to distant stations, e.g. from a sensing device the arrangement being specially adapted for wireless interrogation of grouped or bundled articles tagged with wireless record carriers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K17/00—Methods or arrangements for effecting co-operative working between equipments covered by two or more of main groups G06K1/00 - G06K15/00, e.g. automatic card files incorporating conveying and reading operations
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07C—TIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
- G07C1/00—Registering, indicating or recording the time of events or elapsed time, e.g. time-recorders for work people
- G07C1/10—Registering, indicating or recording the time of events or elapsed time, e.g. time-recorders for work people together with the recording, indicating or registering of other data, e.g. of signs of identity
Definitions
- the present application relates to the field of data processing technologies, and in particular, to a method, a device, a device, and a storage medium for determining a residence time.
- RFID Radio Frequency Identification
- front-end collection equipment can collect hundreds of millions of RFID data every day.
- These RFID data are RFID tags carried by the carrier.
- the carrier includes a person or a moving object. Based on these RFID data, the residence time of the carrier in a certain place can be calculated in real time, which provides a basis for subsequent relevant regulatory measures (such as tracking the travel path of the carrier) of the carrier.
- the RFID tag When the RFID tag enters the acquisition area of the acquisition device (for example, the magnetic field area of the acquisition device), the RFID tag can send the first frequency signal to the acquisition device through the transmitter device, and then the acquisition device times the first frequency signal and sends it to the statistics device.
- the second frequency signal is sent, so that the statistical device analyzes the timing information of the second frequency signal, thereby obtaining the residence time of the RFID tag in the above-mentioned collection area.
- the above method can only calculate the residence time of the RFID tag in the acquisition area where it is currently located, and cannot accurately count the residence time of the RFID tag in the acquisition area of each acquisition device.
- the present application provides a method, a device, a device, and a storage medium for determining the dwell time, which can accurately count the dwell time of the RFID tag in the collection area of each collection device.
- a method for determining the length of stay including:
- the dwell time of the target RFID tag in the each collection area is determined according to the difference.
- a device for determining residence time including:
- the query request receiving module is configured to receive a query request for querying a dwell time of a target RFID tag, where the query request includes identification information of the target RFID tag;
- a tag data query module configured to query a plurality of pieces of RFID data of the target RFID tag in each collection area from a database according to the identification information, and each piece of RFID data includes a data collection time;
- a time difference determining module configured to determine a difference between data collection times of each two adjacent data in the plurality of RFID data
- the dwell time determining module is configured to determine a dwell time of the target RFID tag in each acquisition area according to the difference value.
- an electronic device includes:
- Memory configured to store processor-executable instructions
- the processor is configured to execute the method for determining a dwell duration described in the first aspect.
- a computer-readable storage medium on which a computer program is stored.
- the program is processed by a processor, the method for determining the dwell time described in the first aspect is implemented.
- the method, device, device and storage medium for determining the dwell time receive a query request for querying the dwell time of a target RFID tag, and the query request includes identification information of the target RFID tag, and Querying a plurality of pieces of RFID data of the target RFID tag in each collection area from the database according to the identification information, each piece of RFID data including a data collection time, and then determining that among the plurality of pieces of RFID data, each adjacent
- the difference between the data collection time of the two data, and then the residence time of the target RFID tag in each collection area is determined according to the difference, and the target RFID tag can be determined at each of the multiple RFID data collection times.
- the dwell time of the collection area can accurately calculate the dwell time of multiple collection areas of an RFID tag, which is conducive to taking relevant monitoring measures for the target RFID tag carrier based on the dwell time to meet user needs.
- FIG. 1 is a flowchart of a method for determining a dwell time shown in an exemplary embodiment of the present application
- FIG. 2 is a flowchart illustrating how to determine a difference between data collection times of each two adjacent pieces of data in the multiple pieces of RFID data according to an exemplary embodiment of the present application;
- FIG. 3 is a flowchart of a method for determining a dwell time period according to another exemplary embodiment of the present application.
- FIG. 4 is a flowchart illustrating how to transfer RFID data to be stored to a database for storage according to an exemplary embodiment of the present application
- FIG. 5 is a flowchart illustrating how to query the RFID data of a target RFID tag from a database according to an exemplary embodiment of the present application
- FIG. 6 is a structural block diagram of a device for determining a dwell time shown in an exemplary embodiment of the present application.
- FIG. 7 is a structural block diagram of a device for determining a dwell time, shown in still another exemplary embodiment of the present application.
- Fig. 8 is a structural block diagram of an electronic device according to an exemplary embodiment of the present application.
- first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
- first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information.
- word “if” as used herein can be interpreted as “at” or "when” or "in response to determination”.
- FIG. 1 is a flowchart of a method for determining a dwell time shown in an exemplary embodiment of the present application; this embodiment can be used for a server (for example, a server cluster or a server cluster composed of multiple servers), or Used for terminal equipment (such as mobile phones, tablets, PCs, etc.). As shown in Figure 1, the method includes the following steps:
- S101 Receive a query request for querying the dwell time of a target RFID tag.
- the query request includes identification information of the target RFID tag.
- the identification information may include a number, a name, an ID (identifier), and the like, which is not limited in this embodiment.
- the server may receive a query request sent by the user, and the query request may be used to query the residence time of the target RFID tag in the collection area of each collection device.
- the above-mentioned acquisition device may include an RFID-capable device, such as a fixed or handheld RFID tag reader.
- the content of the above query request may be set by the developer according to actual business needs, such as the time range of the query or the minimum expected residence time. Etc. (This value can be used to filter data that the calculation result of the dwell time does not satisfy the minimum value), which is not limited in this embodiment.
- S102 Query a plurality of pieces of RFID data of the target RFID tag in each collection area from the database according to the identification information.
- multiple pieces of RFID data of the target RFID tag in each collection area may be stored in a database in advance.
- a database for specific storage methods, refer to the embodiment shown in FIG. 3 below, which will not be described in detail here.
- the server after the server receives a query request for querying the dwell time of the target RFID tag, it can query the database of the target RFID tag in each collection area according to the identification information of the target RFID tag. RFID data.
- each piece of the RFID data may include identification information of a target RFID tag, identification information of a collection device to which the corresponding collection area belongs, and collection time of the piece of data.
- the identification information of the target RFID tag is "123”
- the identification information of the collection device is "ABC”
- the data collection time is "15:30:00, May 12, 2018”
- the The RFID data is "tag identification information:” 123 “; collection equipment identification information:” ABC “; collection time:” 1526110200000 “, where the collection time is stored in the form of a timestamp.
- the collection device may collect RFID data of the target RFID tag based on a preset time window. Taking the target RFID tag "123" as an example, if the target RFID tag is located in the acquisition area of the acquisition device "ABC" from 15:30:00 on May 12, 2018 to 15:40:00 on May 12, 2018, And the preset time window is 5 minutes, the collection device can collect multiple pieces of RFID data, and transmit the multiple pieces of RFID data to a database for storage.
- the storage manner of the above-mentioned RFID data can also refer to the embodiment shown in FIG. 3 below, which will not be described in detail here.
- the server can query the database for multiple pieces of RFID data of the target RFID tag in the collection area based on the identification information.
- S103 Determine the difference between the data collection times of each two adjacent pieces of data in the plurality of pieces of RFID data.
- the server after the server queries the database for multiple pieces of RFID data of the target RFID tag in each collection area, it can calculate the data collection time of each adjacent two pieces of data in the multiple pieces of RFID data. Difference.
- multiple pieces of RFID data can be queried to determine the time when the target RFID tag "123" is in the acquisition area of the acquisition device "ABC" (that is, the acquisition time of the data is expressed in the form of a timestamp) As follows:
- S104 Determine the dwell time of the target electronic tag in each collection area according to the difference.
- the above-mentioned target RFID tag "123" is still taken as an example.
- the adjacent timestamps can be accumulated.
- the difference and other methods calculate that the residence time of the target electronic tag "123" in the acquisition area of the acquisition device "ABC” is 600s, that is, 10 minutes.
- the traveling path of the target RFID tag can be tracked according to the residence time of the target RFID tag in each collection area.
- the query request includes identification information of the target RFID tag, and queries from a database according to the identification information.
- FIG. 2 is a flowchart illustrating how to determine a difference between data collection times of each two adjacent pieces of data in the multiple pieces of RFID data according to an exemplary embodiment of the present application; based on the foregoing embodiment, How to determine the difference between the data collection time of each two adjacent data among the multiple pieces of RFID data is taken as an example for example.
- determining the difference between the data collection times of each two adjacent data among the multiple pieces of RFID data described in step S103 may include the following steps S201-S202:
- S201 Sort the collection time of the multiple pieces of RFID data in each of the collection areas to obtain the collection time of the sorted pieces of RFID data.
- the collection time of multiple pieces of RFID data of each collection area obtained from the database may not be arranged in order.
- the collection time of the plurality of RFID data of each of the collection areas may be sorted first to obtain the collection time of the sorted multiple pieces of RFID data.
- the collection time of the plurality of pieces of RFID data in each of the collection areas may be arranged in ascending or descending order, which is not limited in this embodiment.
- S202 Calculate the difference between the collection times of two adjacent RFID data among the sorted collection times of the RFID data to form a difference set.
- the difference between the two adjacent data collection times can be calculated, that is, the next data collection time. Subtract the value from the previous data acquisition time.
- the difference between the collection times of the two adjacent RFID data may be calculated, that is, the previous one. Data acquisition time minus the value of the next data acquisition time.
- determining the residence time of the target electronic tag in each collection area according to the difference in step S104 may include:
- the difference values in the difference set that are less than or equal to a preset time threshold are accumulated to obtain a residence time of the target electronic tag in each of the collection areas.
- the difference between the difference values that is less than or equal to a preset time threshold may be accumulated to obtain the target electronic tag at The dwell time of each of the acquisition areas.
- the difference between the two adjacent RFID data collection times can be calculated It is "30 seconds, 40 seconds, 20 seconds", and it can be determined that these differences are less than a preset time threshold. By accumulating these differences, the residence time of the target electronic tag in the acquisition area is 90 seconds.
- the difference between two adjacent RFID data collection times is greater than a preset time threshold, it can be determined that the target RFID tag has left the above-mentioned collection area halfway, and then entered the above-mentioned collection area again, resulting in before and after collection.
- the interval between the two RFID data collection times is too large (that is, the difference is greater than a preset time threshold).
- the time that the target RFID tag leaves the collection area should not be counted as the dwell time, so the difference between the two adjacent RFID data collection times is greater than the preset time threshold and does not meet the preset difference condition.
- this embodiment sorts the collection time of the multiple pieces of RFID data in each of the collection areas to obtain the collection time of the sorted pieces of RFID data, and calculates the sorted pieces of RFID data.
- the acquisition time the difference between the acquisition times of two adjacent RFID data, and then the difference between the difference values that is less than or equal to a preset time threshold is accumulated to obtain the target electronic tag in each of the
- the residence time of the collection area can quickly and accurately determine the residence time of the target electronic tag in each collection area based on the data collection time of multiple pieces of RFID data.
- FIG. 3 is a flowchart of a method for determining a dwell time shown in another exemplary embodiment of the present application; this embodiment may be used for a server (for example, a server cluster or a server cluster composed of multiple servers), and Can be used for terminal equipment (such as mobile phones, tablets, PCs, etc.). As shown in FIG. 1, the method includes steps S301-S308:
- S301 Receive multiple pieces of RFID data of the target RFID tag.
- the multiple pieces of data may be sent to the server.
- the above-mentioned acquisition device sends RFID data to the server in real time, or it can send RFID data to the server according to a preset period.
- the period can be set by the developer according to actual needs. This embodiment does not perform this. limited.
- the server can establish a communication connection with the acquisition device in a wired or wireless manner, and then can receive multiple pieces of RFID data sent by the acquisition device based on the established communication connection.
- S302 Preprocess the received pieces of RFID data to obtain RFID data to be stored in a first preset format.
- the server can pre-process the received multiple pieces of RFID data in the following two ways:
- the server may first perform deduplication processing on the multiple pieces of RFID data, and then filter out interference data from the deduplicated RFID data.
- the second method the server may first filter out interference data from the multiple pieces of RFID data, and then perform deduplication processing on the filtered RFID data.
- the interference data may be set by a developer, and this embodiment is not limited thereto.
- the deduplication processing in the above two manners may include:
- the server may combine multiple pieces of RFID data of the target RFID tag in the same collection area in a preset time window to obtain one piece of combined data.
- the combined data may include the collection time points of the multiple pieces of RFID data, and a new "collection time set" may be added to save the collection time points of multiple pieces of RFID data, and the same collection area corresponds to The same acquisition equipment.
- the foregoing preset time window can be set by a developer according to actual business requirements, such as 2 minutes, 5 minutes, and the like, which is not limited in this embodiment.
- the preset time window is 5 minutes
- the multiple pieces of RFID data received by the server are:
- Identification information of the label "123”; identification information of the collection device: “ABC”; collection time: “1526110200000”;
- Identification information of the label “123”; identification information of the collection device: “ABC”; collection time: “1526110201000”;
- Identification information of the label "123”; identification information of the collection device: “ABC”; collection time: “1526110202000”;
- Identification information of the label “123”; identification information of the collection device: “ABC”; collection time: “1526110499000”;
- Identification information of the label "123”; identification information of the collection device: “ABC”; collection time: “1526110500000”;
- the above data are all RFID data of the same RFID tag collected by the same collection device, that is, the RFID data of the RFID tag "123" is collected by the collection device "ABC", so multiple pieces of RFID data in each preset time window can be combined A piece of data containing the collection time of each piece of RFID data is obtained, and then the combined data of the preset time window can be obtained, as shown below:
- Identification information of the label "123”; identification information of the collection device: “ABC”; collection time: “1526110200000”; collection time collection: “1526110200000, 1526110230000, ..., 1526110500000”;
- S303 Convert the RFID data to be stored from the first preset format to a second preset format.
- the above-mentioned first preset format may include a format that the RFID data sent by the acquisition device to the server has after deduplication processing.
- the second preset format may be a data format for storing in a database
- the data format may be set by a developer according to the characteristics of the database and the storage and query rules of the database. Not limited.
- the RFID data to be stored may be converted from a first preset format to a second preset format for subsequent transmission and storage to a database.
- S304 Transfer the RFID data to be stored in the second preset format to a database for storage.
- the RFID data to be stored in the second preset format may be transferred to a database for storage.
- the server can establish a communication connection with the database in a wired or wireless manner, and can further send the above-mentioned RFID data to be stored in the second preset format to the database based on the established communication connection.
- S305 Receive a query request for querying the dwell time of the target RFID tag, where the query request includes identification information of the target RFID tag.
- S306 Query a plurality of RFID data of the target RFID tag in each collection area from the database according to the identification information;
- each piece of RFID data includes a data collection time.
- S307 Determine the difference between the data collection times of each two adjacent pieces of data in the plurality of pieces of RFID data.
- S308 Determine the dwell time of the target electronic tag in each collection area according to the difference.
- each RFID of the target RFID tag queried from the database in step S306 is processed.
- the data includes a data collection time set, and then in step S307, the target electronic tag may be determined in each of the collections according to a difference set of data collection times of each two adjacent data in the multiple pieces of RFID data that are sorted. The duration of the area.
- the RFID data to be stored in a first preset format is obtained, and then The RFID data to be stored is converted from the first preset format to the second preset format, and the RFID data to be stored in the second preset format is transferred to a database for storage, which can realize the storage of the target RFID tag in the database.
- the RFID data can be used to query multiple RFID data of the target RFID tag in each collection area based on the database, and calculate the residence time of the target electronic tag in each collection area.
- Fig. 4 is a flow chart showing how to transfer RFID data to be stored to a database for storage according to an exemplary embodiment of the present application; on the basis of the above embodiment, this embodiment uses the database as a distributed storage system HBASE.
- the example in which the second preset format is a RowKey format is described as an example.
- transmitting the RFID data to be stored in the second preset format to a database for storage as described in step S304 may include the following steps S401-S402:
- S401 Construct a plurality of regions for storing RFID data according to a preset region region design rule.
- the distributed storage system HBASE since the distributed storage system HBASE is used to store RFID data, multiple regions for storing RFID data may be constructed according to a preset partition region design rule.
- the above region design rules can be set by a developer according to actual business needs and experience of balancing data load.
- multiple regions for storing RFID data may be constructed according to the year and month of collection time and a preset region number. For example, a fixed number of regions can be constructed in advance according to the year, month, and region number of the data collection time. When the region number is less than three digits, they are filled with 0. When the region number exceeds three digits, you can directly follow the year, month, and year The region number constructs a fixed number of regions in advance.
- S402 Store the RFID data to be stored in the second preset format to a target region in the multiple regions that matches the RFID data to be stored.
- a target region matching the RFID data to be stored may be determined from the multiple regions, and the RFID to be stored in the second preset format may be further described.
- the data is stored in the determined target region.
- the second preset format may be a RowKey format
- the format of the RowKey may be as shown in the following formula (1):
- [YyyyMM] is the year and month of the collection time
- [xxx] is the hash value of the identification information of the target RFID tag
- [RFID_id] is the identification information of the target RFID tag
- [collect_time] is the corresponding time of the collection time Timestamp.
- the above [RFID_id] can be completed with 0 to M digits (for example, to 18 digits) to be compatible with ID naming rules of RFID tags manufactured by different manufacturers.
- the above [xxx] may be 0-completion to N-digits (eg, completion to 3 digits).
- a corresponding hash rule may be set so that the calculated hash values [xxx] are between 000 and 019, thereby ensuring data load balance, that is, ensuring that RFID data is stored more uniformly in Among the 20 regions already constructed above.
- multiple regions for storing RFID data are constructed according to a preset design rule of a partitioned region, and the RFID data to be stored in the second preset format is stored in the multiple regions.
- the target region matching the RFID data to be stored can ensure that the RFID data collected by the same RFID tag in the same month is stored in a continuous region of the same region. In this way, when querying the RFID data of the RIFD tag, the entire data of the RFID tag can be quickly obtained through a scan operation, thereby improving the efficiency of subsequent calculation of the dwell time of the RFID tag.
- FIG. 5 is a flowchart showing how to query the RFID data of a target RFID tag from a database according to an exemplary embodiment of the present application; based on the above embodiment, this embodiment uses the query request to further include a start time and The end time is taken as an example for illustrative purposes.
- querying multiple pieces of RFID data of the target RFID tag in each collection area from the database as described in step S102 may include the following steps S501-S504:
- S501 Generate a StartRowKey in the format of the RowKey according to the start time and the identification information.
- the StartRowKey is one of the information identifiers of the corresponding region, that is, the starting RowKey of the region.
- a StartRowKey with a RowKey format can be generated according to the start time in the query request and the identification information of the target RFID tag.
- S502 Generate an EndRowKey in the format of the RowKey according to the end time and the identification information.
- the aforementioned EndRowKey is one of the information identifiers of the corresponding region, that is, the ending RowKey of the region.
- an EndRowKey with a RowKey format can be generated according to the end time in the query request and the identification information of the target RFID tag.
- S503 Generate a scan request for sending to the HBASE according to the StartRowKey and the EndRowKey.
- a scan request for sending to the HBASE may be generated according to the generated StartRowKey and EndRowKey.
- S504 Receive multiple pieces of RFID data of the target RFID tag in each collection area returned by the HBASE based on the Scan request.
- multiple pieces of RFID data of the target RFID tag in each collection area returned by the HBASE based on the Scan request may be received.
- this embodiment generates a StartRowKey in the format of the RowKey according to the start time and the identification information, and generates an EndRowKey in the format of the RowKey according to the end time and the identification information, and then Generating a Scan Scan request for sending to the HBASE according to the StartRowKey and EndRowKey, and then receiving multiple pieces of RFID data of the target RFID tag in each collection area returned by the HBASE based on the Scan request, The full amount of data of the RFID tag can be quickly obtained through a scan operation, thereby improving the efficiency of subsequent calculation of the residence time of the RFID tag.
- FIG. 6 is a structural block diagram of an apparatus for determining a dwell time shown in an exemplary embodiment of the present application; as shown in FIG. 6, the apparatus includes: a query request receiving module 110, a tag data query module 120, and a time difference determination The module 130 and the dwell duration determination module 140.
- the query request receiving module 110 is configured to receive a query request for querying a dwell time of a target RFID tag, where the query request includes identification information of the target RFID tag;
- the tag data query module 120 is configured to query a plurality of pieces of RFID data of the target RFID tag in each collection area from the database according to the identification information, and each piece of the RFID data includes a data collection time;
- a time difference determining module 130 is configured to determine a difference between data collection times of each two adjacent data in the multiple pieces of RFID data.
- the dwell duration determination module 140 is configured to determine a dwell duration of the target electronic tag in each collection area according to the difference value.
- FIG. 7 is a structural block diagram of a device for determining dwell time shown in still another exemplary embodiment of the present application; wherein, a query request receiving module 220, a tag data query module 230, a time difference determination module 240, and a dwell time determination
- the functions of the module 250 are the same as those of the query request receiving module 110, the tag data query module 120, the time difference determination module 130, and the dwell duration determination module 140 in the embodiment shown in FIG. 6 described above, and details are not described herein.
- the time difference determination module 240 may include:
- a collection time acquisition unit 241 is configured to sort the collection times of the multiple pieces of RFID data in each of the collection areas to obtain the collection times of the multiple pieces of RFID data after sorting;
- the time difference calculation unit 242 is configured to calculate a difference between the acquisition times of two adjacent RFID data among the sorted multiple pieces of RFID data to form a difference set.
- the dwell duration determination module 250 may include:
- the dwell duration determination unit 251 is configured to accumulate differences in the difference set that are less than or equal to a preset time threshold to obtain a dwell duration of the target electronic tag in each of the collection areas;
- the content of the above query request may be set by the developer according to actual business needs, such as the time range of the query or the minimum expected residence time. Etc. (This value can be used to filter data that the calculation result of the dwell time does not satisfy the minimum value), which is not limited in this embodiment.
- the above device may further include: a tag data storage module 210;
- the tag data storage module 210 may include:
- a tag data receiving unit 211 configured to receive multiple pieces of RFID data of the target RFID tag
- a data pre-processing unit 212 configured to pre-process the received pieces of RFID data to obtain RFID data to be stored in a first preset format
- a data format conversion unit 213, configured to convert the RFID data to be stored from the first preset format to a second preset format
- the tag data storage unit 214 is configured to transfer the RFID data to be stored in the second preset format to a database for storage.
- the database may include a distributed storage system HBASE, and the second preset format may include a RowKey format;
- the tag data storage unit 214 may also be used for:
- the tag data storage unit 214 may be further configured to:
- a plurality of regions for storing RFID data are constructed according to the year and month of collection time and a preset region number.
- the format of the above-mentioned RowKey may be shown by the following formula (1):
- [YyyyMM] is the year and month of the collection time
- [xxx] is the hash value of the identification information of the target RFID tag
- [RFID_id] is the identification information of the target RFID tag
- [collect_time] is the corresponding time of the collection time Timestamp.
- the query request may further include a start time and an end time
- the tag data query module 230 may include:
- a start row key generating unit 231, configured to generate a StartRowKey in the format of the RowKey according to the start time and the identification information;
- An end row key generating unit 232 configured to generate an EndRowKey in the format of the RowKey according to the end time and the identification information;
- a scan request generating unit 233 configured to generate a scan request for sending to the HBASE according to the StartRowKey and the EndRowKey;
- a tag data receiving unit 234 is configured to receive multiple pieces of RFID data of the target RFID tag in each collection area returned by the HBASE based on the Scan request.
- the data pre-processing unit 212 may be further configured to:
- Interference data is filtered from the multiple pieces of RFID data, and deduplication processing is performed on the filtered RFID data.
- the data pre-processing unit 212 may be further configured to:
- the embodiment of the apparatus for determining the residence time provided in the present application may be applied to a network device.
- the device embodiments may be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory through the processor of the device in which it is located.
- FIG. 8 it is a hardware structure diagram of the device where the device for determining the residence time is located, except for the processor, network interface, memory, and non-volatile memory shown in FIG. 8.
- the device in which the device is located in the embodiment may also generally include other hardware, such as a forwarding chip responsible for processing packets. From the perspective of the hardware structure, the device may also be a distributed device, which may include multiple interface cards. In order to expand the message processing at the hardware level.
- An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored.
- a computer program is stored on a computer-readable storage medium.
- the relevant part may refer to the description of the method embodiment.
- the device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, may be located One place, or it can be distributed across multiple network elements. Some or all of these modules can be selected according to actual needs to achieve the purpose of the solution of this application. Those of ordinary skill in the art can understand and implement without creative efforts.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- General Engineering & Computer Science (AREA)
Abstract
The present application provides a method and apparatus for determining a residence time duration, a device, and a storage medium. The method comprises: receiving a query request used for querying the residence time duration of a target RFID tag, wherein the query request comprises the identification information of the target RFID tag; querying, from a database according to the identification information, multiple pieces of RFID data of the target RFID tag in each collection area, wherein each piece of RFID data comprises a data collection time; determining a difference value between the data collection time of each two adjacent pieces of data in the multiple pieces of RFID data; and determining the residence time duration of the target RFID tag in each collection area according to the difference value.
Description
本申请涉及数据处理技术领域,尤其涉及一种确定驻留时长的方法、装置、设备及存储介质。The present application relates to the field of data processing technologies, and in particular, to a method, a device, a device, and a storage medium for determining a residence time.
随着RFID(Radio Frequency Identification,无线电射频识别)技术的高速发展,在诸如智能交通和安防行业中,前端的采集设备每日可采集到上亿条RFID数据,这些RFID数据由载体携带的RFID标签向采集设备发送,该载体包括人物或移动物体。根据这些RFID数据可实时计算出该载体在某地点的驻留时长,为后续对该载体采取相关监管措施(如追踪载体的行驶路径等)提供依据。With the rapid development of RFID (Radio Frequency Identification) technology, in industries such as intelligent transportation and security, front-end collection equipment can collect hundreds of millions of RFID data every day. These RFID data are RFID tags carried by the carrier. Send to the acquisition device, the carrier includes a person or a moving object. Based on these RFID data, the residence time of the carrier in a certain place can be calculated in real time, which provides a basis for subsequent relevant regulatory measures (such as tracking the travel path of the carrier) of the carrier.
当RFID标签进入采集设备的采集区域(如,采集设备的磁场区域)时,RFID标签可以通过发射器装置向采集设备发送第一频率信号,进而采集设备对第一频率信号计时,并向统计装置发送第二频率信号,以使统计装置通过分析第二频率信号的计时信息,从而,得到RFID标签在上述采集区域的驻留时长。When the RFID tag enters the acquisition area of the acquisition device (for example, the magnetic field area of the acquisition device), the RFID tag can send the first frequency signal to the acquisition device through the transmitter device, and then the acquisition device times the first frequency signal and sends it to the statistics device. The second frequency signal is sent, so that the statistical device analyzes the timing information of the second frequency signal, thereby obtaining the residence time of the RFID tag in the above-mentioned collection area.
然而,上述方法仅能计算RFID标签在当前所处采集区域的驻留时长,无法准确统计RFID标签在各个采集设备的采集区域的驻留时长。However, the above method can only calculate the residence time of the RFID tag in the acquisition area where it is currently located, and cannot accurately count the residence time of the RFID tag in the acquisition area of each acquisition device.
发明内容Summary of the Invention
有鉴于此,本申请提供一种确定驻留时长的方法、装置、设备及存储介质,可以实现准确统计RFID标签在各个采集设备的采集区域的驻留时间。In view of this, the present application provides a method, a device, a device, and a storage medium for determining the dwell time, which can accurately count the dwell time of the RFID tag in the collection area of each collection device.
根据本申请的第一方面,提出了一种确定驻留时长的方法,包括:According to the first aspect of the present application, a method for determining the length of stay is provided, including:
接收用于查询目标RFID标签的驻留时长的查询请求,所述查询请求中包含所述目标RFID标签的标识信息;Receiving a query request for querying the dwell time of a target RFID tag, the query request including identification information of the target RFID tag;
根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据,每条所述RFID数据包含数据采集时间;Querying a plurality of pieces of RFID data of the target RFID tag in each collection area from the database according to the identification information, and each piece of RFID data includes a data collection time;
确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值;Determining a difference between data collection times of each two adjacent pieces of data in the plurality of pieces of RFID data;
根据所述差值确定所述目标RFID标签在所述每个采集区域的驻留时长。The dwell time of the target RFID tag in the each collection area is determined according to the difference.
根据本申请的第二方面,提出了一种确定驻留时长的装置,包括:According to a second aspect of the present application, a device for determining residence time is provided, including:
查询请求接收模块,用于接收用于查询目标RFID标签的驻留时长的查询请求,所述查询请求中包含所述目标RFID标签的标识信息;The query request receiving module is configured to receive a query request for querying a dwell time of a target RFID tag, where the query request includes identification information of the target RFID tag;
标签数据查询模块,用于根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据,每条所述RFID数据包含数据采集时间;A tag data query module, configured to query a plurality of pieces of RFID data of the target RFID tag in each collection area from a database according to the identification information, and each piece of RFID data includes a data collection time;
时间差值确定模块,用于确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值;A time difference determining module, configured to determine a difference between data collection times of each two adjacent data in the plurality of RFID data;
驻留时长确定模块,用于根据所述差值确定所述目标RFID标签在所述每个采集区域的驻留时长。The dwell time determining module is configured to determine a dwell time of the target RFID tag in each acquisition area according to the difference value.
根据本申请的第三方面,提出了一种电子设备,所述电子设备包括:According to a third aspect of the present application, an electronic device is provided. The electronic device includes:
处理器;processor;
被配置为存储处理器可执行指令的存储器;Memory configured to store processor-executable instructions;
其中,所述处理器被配置为执行上述第一方面所述的确定驻留时长的方法。Wherein, the processor is configured to execute the method for determining a dwell duration described in the first aspect.
根据本申请的第四方面,提出了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器处理时实现上述第一方面所述的确定驻留时长的方法。According to a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is processed by a processor, the method for determining the dwell time described in the first aspect is implemented.
本申请提供的确定驻留时长的方法、装置、设备及存储介质,通过接收用于查询目标RFID标签的驻留时长的查询请求,所述查询请求中包含所述目标RFID标签的标识信息,并根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据,每条所述RFID数据包含数据采集时间,然后确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值,进而根据所述差值确定所述目标RFID标签在所述每个采集区域的驻留时长,可以根据多条RFID数据的采集时间确定目标RFID标签在各个采集区域的驻留时长,可以实现对一个RFID标签的多个采集区域的驻留时长进行准确计算,有利于后续基于驻留时长对目标RFID标签的载体采取相关监管措施,满足用户需求。The method, device, device and storage medium for determining the dwell time provided in this application receive a query request for querying the dwell time of a target RFID tag, and the query request includes identification information of the target RFID tag, and Querying a plurality of pieces of RFID data of the target RFID tag in each collection area from the database according to the identification information, each piece of RFID data including a data collection time, and then determining that among the plurality of pieces of RFID data, each adjacent The difference between the data collection time of the two data, and then the residence time of the target RFID tag in each collection area is determined according to the difference, and the target RFID tag can be determined at each of the multiple RFID data collection times. The dwell time of the collection area can accurately calculate the dwell time of multiple collection areas of an RFID tag, which is conducive to taking relevant monitoring measures for the target RFID tag carrier based on the dwell time to meet user needs.
图1是本申请一示例性实施例示出的一种确定驻留时长的方法的流程图;FIG. 1 is a flowchart of a method for determining a dwell time shown in an exemplary embodiment of the present application; FIG.
图2是本申请一示例性实施例示出的如何确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值的流程图;FIG. 2 is a flowchart illustrating how to determine a difference between data collection times of each two adjacent pieces of data in the multiple pieces of RFID data according to an exemplary embodiment of the present application;
图3是本申请又一示例性实施例示出的一种确定驻留时长的方法的流程图;FIG. 3 is a flowchart of a method for determining a dwell time period according to another exemplary embodiment of the present application; FIG.
图4是本申请一示例性实施例示出的如何将待存储RFID数据输送至数据库进行存储的流程图;4 is a flowchart illustrating how to transfer RFID data to be stored to a database for storage according to an exemplary embodiment of the present application;
图5是本申请一示例性实施例示出的如何从数据库中查询目标RFID标签的RFID数据的流程图;5 is a flowchart illustrating how to query the RFID data of a target RFID tag from a database according to an exemplary embodiment of the present application;
图6是本申请一示例性实施例示出的一种确定驻留时长的装置的结构框图;FIG. 6 is a structural block diagram of a device for determining a dwell time shown in an exemplary embodiment of the present application; FIG.
图7是本申请又一示例性实施例示出的一种确定驻留时长的装置的结构框图;FIG. 7 is a structural block diagram of a device for determining a dwell time, shown in still another exemplary embodiment of the present application; FIG.
图8是本申请一示例性实施例示出的一种电子设备的结构框图。Fig. 8 is a structural block diagram of an electronic device according to an exemplary embodiment of the present application.
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this application. Rather, they are merely examples of devices and methods consistent with certain aspects of the application as detailed in the appended claims.
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the application. As used in this application and the appended claims, the singular forms "a", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at" or "when" or "in response to determination".
图1是本申请一示例性实施例示出的一种确定驻留时长的方法的流程图;该实施例可以用于服务端(如,一台服务器或多台服务器组成的服务器集群),也可以用于终端设备(如手机、平板电脑、PC机等)。如图1所示,该方法包括以下步骤:FIG. 1 is a flowchart of a method for determining a dwell time shown in an exemplary embodiment of the present application; this embodiment can be used for a server (for example, a server cluster or a server cluster composed of multiple servers), or Used for terminal equipment (such as mobile phones, tablets, PCs, etc.). As shown in Figure 1, the method includes the following steps:
S101:接收用于查询目标RFID标签的驻留时长的查询请求。S101: Receive a query request for querying the dwell time of a target RFID tag.
其中,该查询请求中包含所述目标RFID标签的标识信息。在一实施例中,该标识信息可以包括编号、名称、ID(identifier)等,本实施例对此不进行限定。The query request includes identification information of the target RFID tag. In an embodiment, the identification information may include a number, a name, an ID (identifier), and the like, which is not limited in this embodiment.
在一实施例中,服务端(或终端设备)可以接收用户发送的查询请求,该查询请求可以用于查询目标RFID标签在各个采集设备的采集区域的驻留时长。In an embodiment, the server (or terminal device) may receive a query request sent by the user, and the query request may be used to query the residence time of the target RFID tag in the collection area of each collection device.
在一实施例中,上述采集设备可以包括具有RFID功能的设备,如固定式或手持式的RFID标签阅读器等。In an embodiment, the above-mentioned acquisition device may include an RFID-capable device, such as a fixed or handheld RFID tag reader.
在一实施例中,上述查询请求的内容中除了包含目标RFID的标识信息外,还可以由开发人员根据实际业务需要进行设置其他内容,例如,查询的时间范围,或期望驻留时长的最小值等(该值可以用于过滤驻留时间计算结果不满足最小值的数据),本实施例对此不进行限定。In an embodiment, in addition to the identification information of the target RFID, the content of the above query request may be set by the developer according to actual business needs, such as the time range of the query or the minimum expected residence time. Etc. (This value can be used to filter data that the calculation result of the dwell time does not satisfy the minimum value), which is not limited in this embodiment.
S102:根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据。S102: Query a plurality of pieces of RFID data of the target RFID tag in each collection area from the database according to the identification information.
在一实施例中,可以在数据库中预先存储所述目标RFID标签在每个采集区域的多条RFID数据,具体存储方式可以参见下述图3所示实施例,在此先不进行详述。In an embodiment, multiple pieces of RFID data of the target RFID tag in each collection area may be stored in a database in advance. For specific storage methods, refer to the embodiment shown in FIG. 3 below, which will not be described in detail here.
在一实施例中,当服务端接收到用于查询目标RFID标签的驻留时长的查询请求后,可以根据目标RFID标签的标识信息,从数据库中查询上述目标RFID标签在每个采集区域的多条RFID数据。In an embodiment, after the server receives a query request for querying the dwell time of the target RFID tag, it can query the database of the target RFID tag in each collection area according to the identification information of the target RFID tag. RFID data.
在一实施例中,上述每条RFID数据中均可以包含目标RFID标签的标识信息、相应采集区域所属的采集设备的标识信息以及该条数据的采集时间。In an embodiment, each piece of the RFID data may include identification information of a target RFID tag, identification information of a collection device to which the corresponding collection area belongs, and collection time of the piece of data.
举例来说,若目标RFID标签的标识信息为“123”、采集设备的标识信息为“ABC”,数据采集时间为“2018年5月12日15:30:00”,则服务端中存储的RFID数据为“标签的标识信息:“123”;采集设备的标识信息:“ABC”;采集时间:“1526110200000”,其中采集时间是以时间戳形式存储的。For example, if the identification information of the target RFID tag is "123", the identification information of the collection device is "ABC", and the data collection time is "15:30:00, May 12, 2018", the The RFID data is "tag identification information:" 123 "; collection equipment identification information:" ABC "; collection time:" 1526110200000 ", where the collection time is stored in the form of a timestamp.
在一实施例中,目标RFID标签处于某一采集设备的采集区域中时,该采集设备可以基于预设的时间窗口采集目标RFID标签的RFID数据。仍以目标RFID标签“123”为例,若该目标RFID标签从2018年5月12日15:30:00~2018年5月12日15:40:00处于采集设备“ABC”的采集区域,且预设的时间窗口为5分钟,则采集设备可以采集到 多条RFID数据,并将该多条RFID数据传输至数据库进行存储。In an embodiment, when the target RFID tag is in a collection area of a collection device, the collection device may collect RFID data of the target RFID tag based on a preset time window. Taking the target RFID tag "123" as an example, if the target RFID tag is located in the acquisition area of the acquisition device "ABC" from 15:30:00 on May 12, 2018 to 15:40:00 on May 12, 2018, And the preset time window is 5 minutes, the collection device can collect multiple pieces of RFID data, and transmit the multiple pieces of RFID data to a database for storage.
在一实施例中,上述RFID数据的存储方式还可以参见下述图3所示实施例,在此先不进行详述。In an embodiment, the storage manner of the above-mentioned RFID data can also refer to the embodiment shown in FIG. 3 below, which will not be described in detail here.
在此基础上,服务端可以根据标识信息,从数据库中查询该目标RFID标签在该采集区域的多条RFID数据。Based on this, the server can query the database for multiple pieces of RFID data of the target RFID tag in the collection area based on the identification information.
S103:确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值。S103: Determine the difference between the data collection times of each two adjacent pieces of data in the plurality of pieces of RFID data.
在一实施例中,当服务端从数据库中查询到目标RFID标签在每个采集区域的多条RFID数据后,可以计算所述多条RFID数据中,每相邻两条数据的数据采集时间的差值。In one embodiment, after the server queries the database for multiple pieces of RFID data of the target RFID tag in each collection area, it can calculate the data collection time of each adjacent two pieces of data in the multiple pieces of RFID data. Difference.
仍以上述目标RFID标签“123”为例,可以查询到多条RFID数据确定目标RFID标签“123”处于采集设备“ABC”的采集区域的时间(即数据的采集时间,以时间戳形式表示)如下所示:Taking the above-mentioned target RFID tag "123" as an example, multiple pieces of RFID data can be queried to determine the time when the target RFID tag "123" is in the acquisition area of the acquisition device "ABC" (that is, the acquisition time of the data is expressed in the form of a timestamp) As follows:
“1526110200000,1526110230000,...,1526110500000,1526110530000,...,1526110800000”。"1526110200000,1526110230000, ..., 1526110500000,1526110530000, ..., 1526110800000".
在此基础上,可以计算上述多条RFID数据中,每相邻两条数据的数据采集时间的差值。Based on this, the difference between the data collection time of each two adjacent data among the above multiple pieces of RFID data can be calculated.
S104:根据所述差值确定所述目标电子标签在所述每个采集区域的驻留时长。S104: Determine the dwell time of the target electronic tag in each collection area according to the difference.
在一实施例中,仍以上述目标RFID标签“123”为例,当计算上述多条RFID数据中,每相邻两条数据的数据采集时间的差值后,可以通过累加相邻的时间戳差值等方式计算出目标电子标签“123”在采集设备“ABC”的采集区域的驻留时长为600s,即10分钟。在步骤S104之后,可以根据目标RFID标签在各个采集区域的驻留时长,追踪目标RFID标签的行驶路径。In one embodiment, the above-mentioned target RFID tag "123" is still taken as an example. After calculating the difference between the data collection times of each two adjacent data in the multiple pieces of RFID data, the adjacent timestamps can be accumulated. The difference and other methods calculate that the residence time of the target electronic tag "123" in the acquisition area of the acquisition device "ABC" is 600s, that is, 10 minutes. After step S104, the traveling path of the target RFID tag can be tracked according to the residence time of the target RFID tag in each collection area.
值得说明的是,上述RFID数据的形式仅用于示例性说明,在实际实施中,开发人员可以根据实际业务需要设置RFID数据的具体形式,本实施例对此不进行限定。It is worth noting that the above forms of RFID data are only for illustrative purposes. In actual implementation, developers can set specific forms of RFID data according to actual business needs, which is not limited in this embodiment.
由上述描述可知,本实施例通过接收用于查询目标RFID标签的驻留时长的查询请求,所述查询请求中包含所述目标RFID标签的标识信息,并根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据,每条所述RFID数据包含数据采集时间,再确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值,进而根据所述差值确定所述目标电子标签在所述每个采集区域的驻留时长,可 以实现对一个RFID标签的多个采集区域的驻留时长进行准确计算,有利于后续基于驻留时长对目标RFID标签的载体采取相关监管措施,满足用户需求。It can be known from the above description that, in this embodiment, by receiving a query request for querying the dwell time of a target RFID tag, the query request includes identification information of the target RFID tag, and queries from a database according to the identification information. Multiple pieces of RFID data of the target RFID tag in each collection area, each piece of RFID data including data collection time, and then determining a difference between the data collection times of each two adjacent data in the plurality of pieces of RFID data , And further determine the residence time of the target electronic tag in each collection area according to the difference value, which can accurately calculate the residence time of multiple collection areas of an RFID tag, which is beneficial to subsequent residence based It takes relevant regulatory measures on the carrier of the target RFID tag to meet user needs.
图2是本申请一示例性实施例示出的如何确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值的流程图;本实施例在上述实施例的基础上,以如何确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值为例进行示例性说明。如图2所示,步骤S103中所述确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值,可以包括以下步骤S201-S202:FIG. 2 is a flowchart illustrating how to determine a difference between data collection times of each two adjacent pieces of data in the multiple pieces of RFID data according to an exemplary embodiment of the present application; based on the foregoing embodiment, How to determine the difference between the data collection time of each two adjacent data among the multiple pieces of RFID data is taken as an example for example. As shown in FIG. 2, determining the difference between the data collection times of each two adjacent data among the multiple pieces of RFID data described in step S103 may include the following steps S201-S202:
S201:对每个所述采集区域的所述多条RFID数据的采集时间进行排序,得到排序后的多条RFID数据的采集时间。S201: Sort the collection time of the multiple pieces of RFID data in each of the collection areas to obtain the collection time of the sorted pieces of RFID data.
在一实施例中,从数据库中获取的每个采集区域的多条RFID数据的采集时间可能不是按照先后顺序排列的,为了快速、准确地计算目标电子标签在每个采集区域的驻留时长,可以先对每个所述采集区域的所述多条RFID数据的采集时间进行排序,得到排序后的多条RFID数据的采集时间。In an embodiment, the collection time of multiple pieces of RFID data of each collection area obtained from the database may not be arranged in order. In order to quickly and accurately calculate the residence time of the target electronic tag in each collection area, The collection time of the plurality of RFID data of each of the collection areas may be sorted first to obtain the collection time of the sorted multiple pieces of RFID data.
在一实施例中,可以对每个所述采集区域的所述多条RFID数据的采集时间进行升序排列或降序排列,本实施例对此不进行限定。In an embodiment, the collection time of the plurality of pieces of RFID data in each of the collection areas may be arranged in ascending or descending order, which is not limited in this embodiment.
S202:计算排序后的多条RFID数据的采集时间中,每相邻两条RFID数据的采集时间的差值以形成差值集合。S202: Calculate the difference between the collection times of two adjacent RFID data among the sorted collection times of the RFID data to form a difference set.
在一实施例中,若对每个所述采集区域的所述多条RFID数据的采集时间进行升序排列,则可以计算上述每相邻两个数据采集时间的差值,即后一个数据采集时间减去前一个数据采集时间的值。In an embodiment, if the collection time of the plurality of RFID data in each of the collection areas is sorted in ascending order, the difference between the two adjacent data collection times can be calculated, that is, the next data collection time. Subtract the value from the previous data acquisition time.
而在另一实施例中,若对每个所述采集区域的所述多条RFID数据的采集时间进行降序排列,则可以计算上述每相邻两个RFID数据采集时间的差值,即前一个数据采集时间减去后一个数据采集时间的值。In another embodiment, if the collection times of the multiple pieces of RFID data in each of the collection areas are arranged in descending order, the difference between the collection times of the two adjacent RFID data may be calculated, that is, the previous one. Data acquisition time minus the value of the next data acquisition time.
在此基础上,步骤S104中所述根据所述差值确定所述目标电子标签在所述每个采集区域的驻留时长,可以包括:Based on this, determining the residence time of the target electronic tag in each collection area according to the difference in step S104 may include:
对所述差值集合中小于或等于预设时间阈值的差值进行累加,得到所述目标电子标签在每个所述采集区域的驻留时长。The difference values in the difference set that are less than or equal to a preset time threshold are accumulated to obtain a residence time of the target electronic tag in each of the collection areas.
在一实施例中,当得到每相邻两个RFID数据采集时间的差值后,可以对所述差值 中小于或等于预设时间阈值的差值进行累加,以得到所述目标电子标签在每个所述采集区域的驻留时长。In one embodiment, after obtaining the difference between each two adjacent RFID data collection times, the difference between the difference values that is less than or equal to a preset time threshold may be accumulated to obtain the target electronic tag at The dwell time of each of the acquisition areas.
举例来说,若排序后的多条RFID数据的采集时间为“1526110200000,152611023000,1526110270000,1526110290000”,且预设时间阈值为120秒,则可以计算出相邻两个RFID数据采集时间的差值为“30秒、40秒、20秒”,且可以确定这些差值均小于预设时间阈值。对这些差值进行累加,得到目标电子标签在该采集区域的驻留时长为90秒。For example, if the sorted collection time of multiple pieces of RFID data is "1526110200000, 152611023000, 1526110270000, 1526110290000" and the preset time threshold is 120 seconds, the difference between the two adjacent RFID data collection times can be calculated It is "30 seconds, 40 seconds, 20 seconds", and it can be determined that these differences are less than a preset time threshold. By accumulating these differences, the residence time of the target electronic tag in the acquisition area is 90 seconds.
值得说明的是,若相邻两个RFID数据采集时间的差值大于预设时间阈值,则可以确定目标RFID标签中途离开过上述采集区域,之后,又再次进入上述采集区域,因而导致离开前后采集的两个RFID数据采集时间的间隔过大(即差值大于预设时间阈值)。然而,目标RFID标签离开采集区域的时间不应该计入驻留时长,因而相邻两个RFID数据采集时间的差值大于预设时间阈值不符合预设差值条件。It is worth noting that if the difference between two adjacent RFID data collection times is greater than a preset time threshold, it can be determined that the target RFID tag has left the above-mentioned collection area halfway, and then entered the above-mentioned collection area again, resulting in before and after collection. The interval between the two RFID data collection times is too large (that is, the difference is greater than a preset time threshold). However, the time that the target RFID tag leaves the collection area should not be counted as the dwell time, so the difference between the two adjacent RFID data collection times is greater than the preset time threshold and does not meet the preset difference condition.
由上述描述可知,本实施例通过对每个所述采集区域的所述多条RFID数据的采集时间进行排序,得到排序后的多条RFID数据的采集时间,并计算排序后的多条RFID数据的采集时间中,每相邻两条RFID数据的采集时间的差值,进而对所述差值中小于或等于预设时间阈值的差值进行累加,得到所述目标电子标签在每个所述采集区域的驻留时长,可以快速、准确地根据多条RFID数据的数据采集时间确定目标电子标签在每个采集区域的驻留时长。As can be seen from the above description, this embodiment sorts the collection time of the multiple pieces of RFID data in each of the collection areas to obtain the collection time of the sorted pieces of RFID data, and calculates the sorted pieces of RFID data. In the acquisition time, the difference between the acquisition times of two adjacent RFID data, and then the difference between the difference values that is less than or equal to a preset time threshold is accumulated to obtain the target electronic tag in each of the The residence time of the collection area can quickly and accurately determine the residence time of the target electronic tag in each collection area based on the data collection time of multiple pieces of RFID data.
图3是本申请又一示例性实施例示出的一种确定驻留时长的方法的流程图;该实施例可以用于服务端(如,一台服务器或多台服务器组成的服务器集群),也可以用于终端设备(如手机、平板电脑、PC机等)。如图1所示,该方法包括步骤S301-S308:FIG. 3 is a flowchart of a method for determining a dwell time shown in another exemplary embodiment of the present application; this embodiment may be used for a server (for example, a server cluster or a server cluster composed of multiple servers), and Can be used for terminal equipment (such as mobile phones, tablets, PCs, etc.). As shown in FIG. 1, the method includes steps S301-S308:
S301:接收所述目标RFID标签的多条RFID数据。S301: Receive multiple pieces of RFID data of the target RFID tag.
在一实施例中,当采集设备采集到目标RFID标签的多条RFID数据后,可以将该多条数据发送给服务端。In an embodiment, after the collection device collects multiple pieces of RFID data of the target RFID tag, the multiple pieces of data may be sent to the server.
在一实施例中,上述采集设备实时向服务端发送RFID数据,也可以根据预设的周期向服务端发送RFID数据,该周期可以由开发人员根据实际需要进行设置,本实施例对此不进行限定。In one embodiment, the above-mentioned acquisition device sends RFID data to the server in real time, or it can send RFID data to the server according to a preset period. The period can be set by the developer according to actual needs. This embodiment does not perform this. limited.
在一实施例中,服务端可以采用有线或无线方式与采集设备建立通信连接,进而可以基于建立的通信连接接收采集设备发送的多条RFID数据。In one embodiment, the server can establish a communication connection with the acquisition device in a wired or wireless manner, and then can receive multiple pieces of RFID data sent by the acquisition device based on the established communication connection.
S302:对接收的所述多条RFID数据进行预处理,得到第一预设格式的待存储RFID数据。S302: Preprocess the received pieces of RFID data to obtain RFID data to be stored in a first preset format.
在一实施例中,服务端可以采取以下两种方式对接收的所述多条RFID数据进行预处理:In one embodiment, the server can pre-process the received multiple pieces of RFID data in the following two ways:
第一种方式:服务端可以先对所述多条RFID数据进行去重处理,再从经过去重处理的RFID数据中过滤掉干扰数据。First method: The server may first perform deduplication processing on the multiple pieces of RFID data, and then filter out interference data from the deduplicated RFID data.
第二种方式:服务端可以先从所述多条RFID数据中过滤掉干扰数据,再对经过过滤的RFID数据进行去重处理。The second method: the server may first filter out interference data from the multiple pieces of RFID data, and then perform deduplication processing on the filtered RFID data.
在一实施例中,上述干扰数据可以由开发人员进行设置,本实施例对此不进行限定。In an embodiment, the interference data may be set by a developer, and this embodiment is not limited thereto.
值得说明的是,在实际实施过程中,本领域技术人员还可以根据实际业务需要添加、删减或修改上述预处理的方式,如添加增补字段、设置字段默认值等,本实施例对此不进行限定。It is worth noting that in the actual implementation process, those skilled in the art can also add, delete or modify the above-mentioned preprocessing methods according to actual business needs, such as adding supplementary fields, setting field default values, etc. This embodiment does not address this. Limitation.
在一实施例中,上述两种方式中的去重处理,可以包括:In an embodiment, the deduplication processing in the above two manners may include:
服务端可以将预设时间窗口中、同一采集区域的所述目标RFID标签的多条RFID数据进行合并,得到一条合并数据。其中,上述合并数据中可以包含所述多条RFID数据的采集时间点,并可以增加一个新的“采集时间集合”,以保存多条RFID数据的采集时间点,且所述同一采集区域对应于同一采集设备。The server may combine multiple pieces of RFID data of the target RFID tag in the same collection area in a preset time window to obtain one piece of combined data. The combined data may include the collection time points of the multiple pieces of RFID data, and a new "collection time set" may be added to save the collection time points of multiple pieces of RFID data, and the same collection area corresponds to The same acquisition equipment.
在一实施例中,上述预设时间窗口可以由开发人员根据实际业务需要进行设置,如设置为2分钟、5分钟等,本实施例对此不进行限定。In one embodiment, the foregoing preset time window can be set by a developer according to actual business requirements, such as 2 minutes, 5 minutes, and the like, which is not limited in this embodiment.
举例来说,若预设时间窗口为5分钟,且服务端接收到的多条RFID数据为:For example, if the preset time window is 5 minutes, and the multiple pieces of RFID data received by the server are:
标签的标识信息:“123”;采集设备的标识信息:“ABC”;采集时间:“1526110200000”;Identification information of the label: "123"; identification information of the collection device: "ABC"; collection time: "1526110200000";
标签的标识信息:“123”;采集设备的标识信息:“ABC”;采集时间:“1526110201000”;Identification information of the label: "123"; identification information of the collection device: "ABC"; collection time: "1526110201000";
标签的标识信息:“123”;采集设备的标识信息:“ABC”;采集时间:“1526110202000”;Identification information of the label: "123"; identification information of the collection device: "ABC"; collection time: "1526110202000";
……...
标签的标识信息:“123”;采集设备的标识信息:“ABC”;采集时间:“1526110499000”;Identification information of the label: "123"; identification information of the collection device: "ABC"; collection time: "1526110499000";
标签的标识信息:“123”;采集设备的标识信息:“ABC”;采集时间:“1526110500000”;Identification information of the label: "123"; identification information of the collection device: "ABC"; collection time: "1526110500000";
由于上述数据都是同一采集设备采集到同一RFID标签的RFID数据,即,采集设 备“ABC”采集到RFID标签“123”的RFID数据,因而可以每个预设时间窗口中的多条RFID数据合并成一条包含各条RFID数据的采集时间的数据,进而可以得到预设时间窗口的合并后的数据,如下所示:The above data are all RFID data of the same RFID tag collected by the same collection device, that is, the RFID data of the RFID tag "123" is collected by the collection device "ABC", so multiple pieces of RFID data in each preset time window can be combined A piece of data containing the collection time of each piece of RFID data is obtained, and then the combined data of the preset time window can be obtained, as shown below:
标签的标识信息:“123”;采集设备的标识信息:“ABC”;采集时间:“1526110200000”;采集时间集合:“1526110200000,1526110230000,...,1526110500000”;Identification information of the label: "123"; identification information of the collection device: "ABC"; collection time: "1526110200000"; collection time collection: "1526110200000, 1526110230000, ..., 1526110500000";
S303:将所述待存储RFID数据由所述第一预设格式转换为第二预设格式。S303: Convert the RFID data to be stored from the first preset format to a second preset format.
在一实施例中,上述第一预设格式可以包括采集设备发送给服务端的RFID数据经过去重处理后具有的格式。In an embodiment, the above-mentioned first preset format may include a format that the RFID data sent by the acquisition device to the server has after deduplication processing.
在一实施例中,上述第二预设格式可以为用于在数据库中存储的数据格式,该数据格式可以由开发人员根据数据库的特点以及数据库的存储和查询规则进行设置,本实施例对此不进行限定。In an embodiment, the second preset format may be a data format for storing in a database, and the data format may be set by a developer according to the characteristics of the database and the storage and query rules of the database. Not limited.
在一实施例中,当得到上述待存储的RFID数据后,可以将该待存储RFID数据由第一预设格式转换为第二预设格式,以供后续向数据库传输并存储。In one embodiment, after the RFID data to be stored is obtained, the RFID data to be stored may be converted from a first preset format to a second preset format for subsequent transmission and storage to a database.
S304:将所述第二预设格式的待存储RFID数据输送至数据库进行存储。S304: Transfer the RFID data to be stored in the second preset format to a database for storage.
在一实施例中,在将待存储RFID数据由第一预设格式转换为第二预设格式后,可以将该第二预设格式的待存储RFID数据输送至数据库进行存储。In one embodiment, after the RFID data to be stored is converted from the first preset format to the second preset format, the RFID data to be stored in the second preset format may be transferred to a database for storage.
在一实施例中,服务端可以采用有线或无线方式与数据库建立通信连接,进而可以基于建立的通信连接向数据库发送上述第二预设格式的待存储RFID数据。In an embodiment, the server can establish a communication connection with the database in a wired or wireless manner, and can further send the above-mentioned RFID data to be stored in the second preset format to the database based on the established communication connection.
S305:接收用于查询目标RFID标签的驻留时长的查询请求,所述查询请求中包含所述目标RFID标签的标识信息。S305: Receive a query request for querying the dwell time of the target RFID tag, where the query request includes identification information of the target RFID tag.
S306:根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据;S306: Query a plurality of RFID data of the target RFID tag in each collection area from the database according to the identification information;
其中,每条所述RFID数据包含数据采集时间。Wherein, each piece of RFID data includes a data collection time.
S307:确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值。S307: Determine the difference between the data collection times of each two adjacent pieces of data in the plurality of pieces of RFID data.
S308:根据所述差值确定所述目标电子标签在所述每个采集区域的驻留时长。S308: Determine the dwell time of the target electronic tag in each collection area according to the difference.
值得说明的是,若采用上述步骤S302中所示的去重处理方式对接收的所述多条RFID数据进行预处理,则步骤S306中从数据库中查询出的所述目标RFID标签的每条 RFID数据均包含数据采集时间集合,进而步骤S307中可以根据排序后的所述多条RFID数据中每相邻两条数据的数据采集时间的差值集合确定所述目标电子标签在所述每个采集区域的驻留时长。It is worth noting that if the received multiple pieces of RFID data are pre-processed by using the deduplication processing method shown in the above step S302, each RFID of the target RFID tag queried from the database in step S306 is processed. The data includes a data collection time set, and then in step S307, the target electronic tag may be determined in each of the collections according to a difference set of data collection times of each two adjacent data in the multiple pieces of RFID data that are sorted. The duration of the area.
其中,步骤S305-S308的相关解释和说明可以参见上述实施例,在此不进行赘述。For related explanations and descriptions of steps S305 to S308, reference may be made to the foregoing embodiments, and details are not described herein.
由上述描述可知,本实施例通过接收所述目标RFID标签的多条RFID数据,并对接收的所述多条RFID数据进行预处理,得到第一预设格式的待存储RFID数据,然后将所述待存储RFID数据由所述第一预设格式转换为第二预设格式,进而将所述第二预设格式的待存储RFID数据输送至数据库进行存储,可以实现在数据库中存储目标RFID标签的RFID数据,进而可以实现后续基于数据库查询目标RFID标签在每个采集区域的多条RFID数据,并计算目标电子标签在每个采集区域的驻留时长。It can be known from the above description that in this embodiment, by receiving multiple pieces of RFID data of the target RFID tag, and preprocessing the received multiple pieces of RFID data, the RFID data to be stored in a first preset format is obtained, and then The RFID data to be stored is converted from the first preset format to the second preset format, and the RFID data to be stored in the second preset format is transferred to a database for storage, which can realize the storage of the target RFID tag in the database. The RFID data can be used to query multiple RFID data of the target RFID tag in each collection area based on the database, and calculate the residence time of the target electronic tag in each collection area.
图4是本申请一示例性实施例示出的如何将待存储RFID数据输送至数据库进行存储的流程图;本实施例在上述实施例的基础上,以所述数据库为分布式存储系统HBASE,所述第二预设格式为RowKey的格式为例进行示例性说明。Fig. 4 is a flow chart showing how to transfer RFID data to be stored to a database for storage according to an exemplary embodiment of the present application; on the basis of the above embodiment, this embodiment uses the database as a distributed storage system HBASE. The example in which the second preset format is a RowKey format is described as an example.
如图4所示,上述步骤S304中所述将所述第二预设格式的待存储RFID数据输送至数据库进行存储,可以包括以下步骤S401-S402:As shown in FIG. 4, transmitting the RFID data to be stored in the second preset format to a database for storage as described in step S304 may include the following steps S401-S402:
S401:根据预设的分区region设计规则构建用于存储RFID数据的多个region。S401: Construct a plurality of regions for storing RFID data according to a preset region region design rule.
在一实施例中,由于采用分布式存储系统HBASE存储RFID数据,因而可以根据预设的分区region设计规则构建用于存储RFID数据的多个region。In one embodiment, since the distributed storage system HBASE is used to store RFID data, multiple regions for storing RFID data may be constructed according to a preset partition region design rule.
在一实施例中,上述region设计规则可以由开发人员根据实际业务需要及均衡数据负载的经验进行设置。In an embodiment, the above region design rules can be set by a developer according to actual business needs and experience of balancing data load.
在一实施例中,可以按照采集时间的年月和预设的region序号构建用于存储RFID数据的多个region。例如,可以按照数据采集时间的年月和region序号预先构建固定数量的region,在region序号不足三位时,用0补齐;当region序号超过三位时,可以直接按照采集时间的年月和region序号预先构建固定数量的region。In one embodiment, multiple regions for storing RFID data may be constructed according to the year and month of collection time and a preset region number. For example, a fixed number of regions can be constructed in advance according to the year, month, and region number of the data collection time. When the region number is less than three digits, they are filled with 0. When the region number exceeds three digits, you can directly follow the year, month, and year The region number constructs a fixed number of regions in advance.
举例来说,可以为2018年4月创建20个region,其中:第一个region的Start Key为201804(默认省略000),End Key是201804001;第二个region的Start Key为201804001,End Key为201804002;以此类推,直到最后一个region的Start Key是201804019,End Key是201804020。For example, you can create 20 regions for April 2018, where the Start Key of the first region is 201804 (000 is omitted by default) and the End Key is 201804001; the Start Key of the second region is 201804001 and the End Key is 201804002; and so on, until the Start key of the last region is 201804019 and End key is 201804020.
S402:将所述第二预设格式的待存储RFID数据存储至所述多个region中与所述待存储RFID数据匹配的目标region。S402: Store the RFID data to be stored in the second preset format to a target region in the multiple regions that matches the RFID data to be stored.
在一实施例中,当构建用于存储RFID数据的多个region后,可以从上述多个region中确定与待存储RFID数据匹配的目标region,进而可以将上述第二预设格式的待存储RFID数据存储至确定的目标region中。In one embodiment, after constructing multiple regions for storing RFID data, a target region matching the RFID data to be stored may be determined from the multiple regions, and the RFID to be stored in the second preset format may be further described. The data is stored in the determined target region.
在一实施例中,上述第二预设格式可以为RowKey的格式,该RowKey的格式可以如下式(1)所示:In an embodiment, the second preset format may be a RowKey format, and the format of the RowKey may be as shown in the following formula (1):
[yyyyMM]+[xxx]+[RFID_id]+[collect_time]; (1)[yyyyMM] + [xxx] + [RFID_id] + [collect_time]; (1)
其中,[yyyyMM]为采集时间的年月,[xxx]为所述目标RFID标签的标识信息的哈希值,[RFID_id]为所述目标RFID标签的标识信息,[collect_time]为采集时间对应的时间戳。[YyyyMM] is the year and month of the collection time, [xxx] is the hash value of the identification information of the target RFID tag, [RFID_id] is the identification information of the target RFID tag, and [collect_time] is the corresponding time of the collection time Timestamp.
在一实施例中,上述[RFID_id]可以用0补全至M位数(如,补全至18位),以兼容不同厂家制造的RFID标签的ID命名规则。In an embodiment, the above [RFID_id] can be completed with 0 to M digits (for example, to 18 digits) to be compatible with ID naming rules of RFID tags manufactured by different manufacturers.
在一实施例中,上述[xxx]可以为0补全至N位数(如,补全至3位)。在一实施例中,可以设置相应的哈希规则,以使计算出的哈希值[xxx]均在000~019之间,从而保证数据的负载均衡,即保证RFID数据较均匀的被存储在上述已经构建的20个region中。In an embodiment, the above [xxx] may be 0-completion to N-digits (eg, completion to 3 digits). In an embodiment, a corresponding hash rule may be set so that the calculated hash values [xxx] are between 000 and 019, thereby ensuring data load balance, that is, ensuring that RFID data is stored more uniformly in Among the 20 regions already constructed above.
采用上述的设计规则,可以保证相同的RFID标签在同一个月内被采集到的RFID数据被存储在同一region的连续区域中。如此,在查询该RIFD标签的RFID数据时,可以通过scan操作快速获取该RFID标签的全量数据,进而可以提高后续计算RFID标签的驻留时长的效率。By adopting the above-mentioned design rules, it can be ensured that the RFID data collected by the same RFID tag within the same month is stored in consecutive regions of the same region. In this way, when querying the RFID data of the RIFD tag, the entire data of the RFID tag can be quickly obtained through a scan operation, thereby improving the efficiency of subsequent calculation of the dwell time of the RFID tag.
由上述描述可知,本实施例通过根据预设的分区region设计规则构建用于存储RFID数据的多个region,并将所述第二预设格式的待存储RFID数据存储至所述多个region中与所述待存储RFID数据匹配的目标region,可以保证相同的RFID标签在同一个月内被采集到的RFID数据被存储在同一region的连续区域中。如此,在查询该RIFD标签的RFID数据时,可以通过scan操作快速获取该RFID标签的全量数据,进而可以提高后续计算RFID标签的驻留时长的效率。It can be known from the foregoing description that in this embodiment, multiple regions for storing RFID data are constructed according to a preset design rule of a partitioned region, and the RFID data to be stored in the second preset format is stored in the multiple regions. The target region matching the RFID data to be stored can ensure that the RFID data collected by the same RFID tag in the same month is stored in a continuous region of the same region. In this way, when querying the RFID data of the RIFD tag, the entire data of the RFID tag can be quickly obtained through a scan operation, thereby improving the efficiency of subsequent calculation of the dwell time of the RFID tag.
图5是本申请一示例性实施例示出的如何从数据库中查询目标RFID标签的RFID数据的流程图;本实施例在上述实施例的基础上,以所述查询请求中还包含起始 时间和结束时间为例进行示例性说明。如图5所示,步骤S102中所述从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据,可以包括以下步骤S501-S504::FIG. 5 is a flowchart showing how to query the RFID data of a target RFID tag from a database according to an exemplary embodiment of the present application; based on the above embodiment, this embodiment uses the query request to further include a start time and The end time is taken as an example for illustrative purposes. As shown in FIG. 5, querying multiple pieces of RFID data of the target RFID tag in each collection area from the database as described in step S102 may include the following steps S501-S504:
S501:根据所述起始时间和所述标识信息生成所述RowKey的格式的StartRowKey。S501: Generate a StartRowKey in the format of the RowKey according to the start time and the identification information.
在一实施例中,上述StartRowKey为相应region的信息标识之一,即该region的起始的RowKey。In one embodiment, the StartRowKey is one of the information identifiers of the corresponding region, that is, the starting RowKey of the region.
在一实施例中,当接收到用于查询目标RFID标签的驻留时长的查询请求后,可以根据查询请求中的起始时间和目标RFID标签的标识信息生成具有RowKey的格式的StartRowKey。In an embodiment, after receiving a query request for querying the dwell time of the target RFID tag, a StartRowKey with a RowKey format can be generated according to the start time in the query request and the identification information of the target RFID tag.
S502:根据所述结束时间和所述标识信息生成所述RowKey的格式的EndRowKey。S502: Generate an EndRowKey in the format of the RowKey according to the end time and the identification information.
在一实施例中,上述EndRowKey为相应region的信息标识之一,即该region的结束的RowKey。In one embodiment, the aforementioned EndRowKey is one of the information identifiers of the corresponding region, that is, the ending RowKey of the region.
在一实施例中,当接收到用于查询目标RFID标签的驻留时长的查询请求后,可以根据查询请求中的结束时间和目标RFID标签的标识信息生成具有RowKey的格式的EndRowKey。In one embodiment, after receiving a query request for querying the dwell time of the target RFID tag, an EndRowKey with a RowKey format can be generated according to the end time in the query request and the identification information of the target RFID tag.
S503:根据所述StartRowKey和所述EndRowKey生成用于向所述HBASE发送的扫描Scan请求。S503: Generate a scan request for sending to the HBASE according to the StartRowKey and the EndRowKey.
在一实施例中,当生成StartRowKey和EndRowKey后,可以根据生成的StartRowKey和EndRowKey,生成用于向所述HBASE发送的扫描Scan请求。In an embodiment, after the StartRowKey and EndRowKey are generated, a scan request for sending to the HBASE may be generated according to the generated StartRowKey and EndRowKey.
S504:接收所述HBASE基于所述Scan请求返回的、所述目标RFID标签在每个采集区域的多条RFID数据。S504: Receive multiple pieces of RFID data of the target RFID tag in each collection area returned by the HBASE based on the Scan request.
在一实施例中,在向所述HBASE发送生成的扫描Scan请求后,可以接收所述HBASE基于所述Scan请求返回的、所述目标RFID标签在每个采集区域的多条RFID数据。In an embodiment, after sending the generated Scan Scan request to the HBASE, multiple pieces of RFID data of the target RFID tag in each collection area returned by the HBASE based on the Scan request may be received.
由上述描述可知,本实施例通过根据所述起始时间和所述标识信息生成所述RowKey的格式的StartRowKey,并根据所述结束时间和所述标识信息生成所述RowKey的格式的EndRowKey,然后根据所述StartRowKey和所述EndRowKey生成用于向所述 HBASE发送的扫描Scan请求,进而接收所述HBASE基于所述Scan请求返回的、所述目标RFID标签在每个采集区域的多条RFID数据,可以通过scan操作快速获取该RFID标签的全量数据,进而可以提高后续计算RFID标签的驻留时长的效率。It can be known from the foregoing description that this embodiment generates a StartRowKey in the format of the RowKey according to the start time and the identification information, and generates an EndRowKey in the format of the RowKey according to the end time and the identification information, and then Generating a Scan Scan request for sending to the HBASE according to the StartRowKey and EndRowKey, and then receiving multiple pieces of RFID data of the target RFID tag in each collection area returned by the HBASE based on the Scan request, The full amount of data of the RFID tag can be quickly obtained through a scan operation, thereby improving the efficiency of subsequent calculation of the residence time of the RFID tag.
图6是本申请一示例性实施例示出的一种确定驻留时长的装置的结构框图;如图6所示,该装置包括:查询请求接收模块110、标签数据查询模块120、时间差值确定模块130以及驻留时长确定模块140。FIG. 6 is a structural block diagram of an apparatus for determining a dwell time shown in an exemplary embodiment of the present application; as shown in FIG. 6, the apparatus includes: a query request receiving module 110, a tag data query module 120, and a time difference determination The module 130 and the dwell duration determination module 140.
查询请求接收模块110,用于接收用于查询目标RFID标签的驻留时长的查询请求,所述查询请求中包含所述目标RFID标签的标识信息;The query request receiving module 110 is configured to receive a query request for querying a dwell time of a target RFID tag, where the query request includes identification information of the target RFID tag;
标签数据查询模块120,用于根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据,每条所述RFID数据包含数据采集时间;The tag data query module 120 is configured to query a plurality of pieces of RFID data of the target RFID tag in each collection area from the database according to the identification information, and each piece of the RFID data includes a data collection time;
时间差值确定模块130,用于确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值A time difference determining module 130 is configured to determine a difference between data collection times of each two adjacent data in the multiple pieces of RFID data.
驻留时长确定模块140,用于根据所述差值确定所述目标电子标签在所述每个采集区域的驻留时长。The dwell duration determination module 140 is configured to determine a dwell duration of the target electronic tag in each collection area according to the difference value.
图7是本申请又一示例性实施例示出的一种确定驻留时长的装置的结构框图;其中,查询请求接收模块220、标签数据查询模块230、时间差值确定模块240以及驻留时长确定模块250与前述图6所示实施例中的查询请求接收模块110、标签数据查询模块120、时间差值确定模块130以及驻留时长确定模块140的功能相同,在此不进行赘述。如图7所示,时间差值确定模块240,可以包括:FIG. 7 is a structural block diagram of a device for determining dwell time shown in still another exemplary embodiment of the present application; wherein, a query request receiving module 220, a tag data query module 230, a time difference determination module 240, and a dwell time determination The functions of the module 250 are the same as those of the query request receiving module 110, the tag data query module 120, the time difference determination module 130, and the dwell duration determination module 140 in the embodiment shown in FIG. 6 described above, and details are not described herein. As shown in FIG. 7, the time difference determination module 240 may include:
采集时间获取单元241,用于对每个所述采集区域的所述多条RFID数据的采集时间进行排序,得到排序后的多条RFID数据的采集时间;A collection time acquisition unit 241 is configured to sort the collection times of the multiple pieces of RFID data in each of the collection areas to obtain the collection times of the multiple pieces of RFID data after sorting;
时间差值计算单元242,用于计算排序后的多条RFID数据的采集时间中,每相邻两条RFID数据的采集时间的差值以形成差值集合。The time difference calculation unit 242 is configured to calculate a difference between the acquisition times of two adjacent RFID data among the sorted multiple pieces of RFID data to form a difference set.
在此基础上,驻留时长确定模块250,可以包括:On this basis, the dwell duration determination module 250 may include:
驻留时长确定单元251,用于对所述差值集合中小于或等于预设时间阈值的差值进行累加,得到所述目标电子标签在每个所述采集区域的驻留时长;The dwell duration determination unit 251 is configured to accumulate differences in the difference set that are less than or equal to a preset time threshold to obtain a dwell duration of the target electronic tag in each of the collection areas;
在一实施例中,上述查询请求的内容中除了包含目标RFID的标识信息外,还可 以由开发人员根据实际业务需要进行设置其他内容,例如,查询的时间范围,或期望驻留时长的最小值等(该值可以用于过滤驻留时间计算结果不满足最小值的数据),本实施例对此不进行限定。In an embodiment, in addition to the identification information of the target RFID, the content of the above query request may be set by the developer according to actual business needs, such as the time range of the query or the minimum expected residence time. Etc. (This value can be used to filter data that the calculation result of the dwell time does not satisfy the minimum value), which is not limited in this embodiment.
在一实施例中,上述装置还可以包括:标签数据存储模块210;In an embodiment, the above device may further include: a tag data storage module 210;
所述标签数据存储模块210,可以包括:The tag data storage module 210 may include:
标签数据接收单元211,用于接收所述目标RFID标签的多条RFID数据;A tag data receiving unit 211, configured to receive multiple pieces of RFID data of the target RFID tag;
数据预处理单元212,用于对接收的所述多条RFID数据进行预处理,得到第一预设格式的待存储RFID数据;A data pre-processing unit 212, configured to pre-process the received pieces of RFID data to obtain RFID data to be stored in a first preset format;
数据格式转换单元213,用于将所述待存储RFID数据由所述第一预设格式转换为第二预设格式;A data format conversion unit 213, configured to convert the RFID data to be stored from the first preset format to a second preset format;
标签数据存储单元214,用于将所述第二预设格式的待存储RFID数据输送至数据库进行存储。The tag data storage unit 214 is configured to transfer the RFID data to be stored in the second preset format to a database for storage.
在一实施例中,所述数据库可以包括分布式存储系统HBASE,所述第二预设格式可以包括RowKey的格式;In an embodiment, the database may include a distributed storage system HBASE, and the second preset format may include a RowKey format;
标签数据存储单元214,还可以用于:The tag data storage unit 214 may also be used for:
根据预设的分区region设计规则构建用于存储RFID数据的多个region;Constructing multiple regions for storing RFID data according to preset regional region design rules;
将所述第二预设格式的待存储RFID数据存储至所述多个region中与所述待存储RFID数据匹配的目标region。Storing the RFID data to be stored in the second preset format to a target region of the plurality of regions that matches the RFID data to be stored.
在一实施例中,标签数据存储单元214,还可以用于:In an embodiment, the tag data storage unit 214 may be further configured to:
按照采集时间的年月和预设的region序号构建用于存储RFID数据的多个region。A plurality of regions for storing RFID data are constructed according to the year and month of collection time and a preset region number.
在一实施例中,上述RowKey的格式可以如下式(1)所示:In an embodiment, the format of the above-mentioned RowKey may be shown by the following formula (1):
[yyyyMM]+[xxx]+[RFID_id]+[collect_time]; (1)[yyyyMM] + [xxx] + [RFID_id] + [collect_time]; (1)
其中,[yyyyMM]为采集时间的年月,[xxx]为所述目标RFID标签的标识信息的哈希值,[RFID_id]为所述目标RFID标签的标识信息,[collect_time]为采集时间对应的时间戳。[YyyyMM] is the year and month of the collection time, [xxx] is the hash value of the identification information of the target RFID tag, [RFID_id] is the identification information of the target RFID tag, and [collect_time] is the corresponding time of the collection time Timestamp.
在一实施例中,查询请求中还可以包含起始时间和结束时间;In an embodiment, the query request may further include a start time and an end time;
标签数据查询模块230,可以包括:The tag data query module 230 may include:
开始行键生成单元231,用于根据所述起始时间和所述标识信息生成所述RowKey的格式的StartRowKey;A start row key generating unit 231, configured to generate a StartRowKey in the format of the RowKey according to the start time and the identification information;
结束行键生成单元232,用于根据所述结束时间和所述标识信息生成所述RowKey的格式的EndRowKey;An end row key generating unit 232, configured to generate an EndRowKey in the format of the RowKey according to the end time and the identification information;
扫描请求生成单元233,用于根据所述StartRowKey和所述EndRowKey生成用于向所述HBASE发送的扫描Scan请求;A scan request generating unit 233, configured to generate a scan request for sending to the HBASE according to the StartRowKey and the EndRowKey;
标签数据接收单元234,用于接收所述HBASE基于所述Scan请求返回的、所述目标RFID标签在每个采集区域的多条RFID数据。A tag data receiving unit 234 is configured to receive multiple pieces of RFID data of the target RFID tag in each collection area returned by the HBASE based on the Scan request.
在一实施例中,数据预处理单元212,还可以用于:In one embodiment, the data pre-processing unit 212 may be further configured to:
对所述多条RFID数据进行去重处理,并从经过去重处理的RFID数据中过滤掉干扰数据;或,Performing deduplication processing on the plurality of pieces of RFID data, and filtering interference data from the deduplicated RFID data; or,
从所述多条RFID数据中过滤掉干扰数据,并对经过过滤的RFID数据进行去重处理。Interference data is filtered from the multiple pieces of RFID data, and deduplication processing is performed on the filtered RFID data.
在一实施例中,数据预处理单元212,还可以用于:In one embodiment, the data pre-processing unit 212 may be further configured to:
将各个预设时间窗口中、同一采集区域的所述目标RFID标签的多条RFID数据进行合并,得到一条合并数据,所述合并数据中包含所述多条RFID数据的采集时间,所述同一采集区域对应于同一采集设备。Combining multiple pieces of RFID data of the target RFID tag in the same collection area in each preset time window to obtain a piece of combined data, where the combined data includes the collection time of the multiple pieces of RFID data, and the same collection The area corresponds to the same acquisition device.
本申请提供的确定驻留时长的装置的实施例可以应用在网络设备上。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图8所示,为本申请的确定驻留时长的装置所在设备的一种硬件结构图,除了图8所示的处理器、网络接口、内存以及非易失性存储器之外,实施例中装置所在的设备通常还可以包括其他硬件,如负责处理报文的转发芯片等等;从硬件结构上来讲该设备还可能是分布式的设备,可能包括多个接口卡,以便在硬件层面进行报文处理的扩展。The embodiment of the apparatus for determining the residence time provided in the present application may be applied to a network device. The device embodiments may be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory through the processor of the device in which it is located. In terms of hardware, as shown in FIG. 8, it is a hardware structure diagram of the device where the device for determining the residence time is located, except for the processor, network interface, memory, and non-volatile memory shown in FIG. 8. In addition, the device in which the device is located in the embodiment may also generally include other hardware, such as a forwarding chip responsible for processing packets. From the perspective of the hardware structure, the device may also be a distributed device, which may include multiple interface cards. In order to expand the message processing at the hardware level.
本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器处理时实现上述图1至图5所示实施例。An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is processed by a processor, the embodiments shown in FIG. 1 to FIG. 5 are implemented.
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法 实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。As for the device embodiment, since it basically corresponds to the method embodiment, the relevant part may refer to the description of the method embodiment. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, may be located One place, or it can be distributed across multiple network elements. Some or all of these modules can be selected according to actual needs to achieve the purpose of the solution of this application. Those of ordinary skill in the art can understand and implement without creative efforts.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。Those skilled in the art will readily contemplate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application. These variations, uses, or adaptations follow the general principles of this application and include common general knowledge or conventional technical means in the technical field not disclosed in this application . It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "including," "including," or any other variation thereof are intended to encompass non-exclusive inclusion, so that a process, method, product, or device that includes a series of elements includes not only those elements but also Other elements not explicitly listed, or those that are inherent to such a process, method, product, or device. Without more restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, product or equipment including the elements.
Claims (18)
- 一种确定驻留时长的方法,包括:A method for determining dwell time, including:接收用于查询目标无线电射频识别RFID标签的驻留时长的查询请求,所述查询请求中包含所述目标RFID标签的标识信息;Receiving a query request for querying the residence time of a target radio frequency identification RFID tag, the query request including identification information of the target RFID tag;根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据,每条所述RFID数据包含数据采集时间;Querying a plurality of pieces of RFID data of the target RFID tag in each collection area from the database according to the identification information, and each piece of RFID data includes a data collection time;确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值;Determining a difference between data collection times of each two adjacent pieces of data in the plurality of pieces of RFID data;根据所述差值确定所述目标RFID标签在所述每个采集区域的驻留时长。The dwell time of the target RFID tag in the each collection area is determined according to the difference.
- 根据权利要求1所述的方法,其特征在于,所述确定所述多条RFID数据中,每相邻两条数据的数据采集时间的差值,包括:The method according to claim 1, wherein the determining a difference in data collection time of each two adjacent data among the plurality of RFID data comprises:对每个所述采集区域的所述多条RFID数据的采集时间进行排序,得到排序后的多条RFID数据的采集时间;Sorting the collection time of the plurality of RFID data of each of the collection areas to obtain the collection time of the sorted multiple pieces of RFID data;计算排序后的多条RFID数据的采集时间中,每相邻两条RFID数据的采集时间的差值以形成差值集合;Calculate the difference between the collection times of two adjacent RFID data in the collection time of the sorted multiple pieces of RFID data to form a difference set;所述根据所述差值确定所述目标RFID标签在所述每个采集区域的驻留时长,包括:The determining the residence time of the target RFID tag in each of the collection areas according to the difference includes:对所述差值集合中小于或等于预设时间阈值的差值进行累加,得到所述目标RFID标签在每个所述采集区域的驻留时长。The difference values in the difference set that are less than or equal to a preset time threshold are accumulated to obtain a dwell time of the target RFID tag in each of the collection areas.
- 根据权利要求1所述的方法,其特征在于,所述方法还包括根据以下步骤在所述数据库中存储所述目标RFID标签的RFID数据:The method according to claim 1, further comprising storing RFID data of the target RFID tag in the database according to the following steps:接收所述目标RFID标签的多条RFID数据;Receiving a plurality of pieces of RFID data of the target RFID tag;对接收的所述多条RFID数据进行预处理,得到第一预设格式的待存储RFID数据;Preprocessing the received pieces of RFID data to obtain RFID data to be stored in a first preset format;将所述待存储RFID数据由所述第一预设格式转换为第二预设格式;Converting the RFID data to be stored from the first preset format to a second preset format;将所述第二预设格式的待存储RFID数据输送至数据库进行存储。And transmitting the RFID data to be stored in the second preset format to a database for storage.
- 根据权利要求3所述的方法,其特征在于,The method according to claim 3, wherein:所述数据库包括分布式存储系统HBASE,The database includes a distributed storage system HBASE,所述第二预设格式包括RowKey的格式;The second preset format includes a format of RowKey;所述将所述第二预设格式的待存储RFID数据输送至数据库进行存储,包括:The transmitting the RFID data to be stored in the second preset format to a database for storage includes:根据预设的分区设计规则构建用于存储RFID数据的多个分区;Construct multiple partitions for storing RFID data according to preset partition design rules;将所述第二预设格式的待存储RFID数据存储至所述多个分区中与所述待存储RFID数据匹配的目标分区。Storing the RFID data to be stored in the second preset format to a target partition of the plurality of partitions that matches the RFID data to be stored.
- 根据权利要求4所述的方法,其特征在于,所述根据预设的分区设计规则构建 用于存储RFID数据的多个分区,包括:The method according to claim 4, wherein the constructing a plurality of partitions for storing RFID data according to a preset partition design rule comprises:按照采集时间的年月和预设的分区序号构建用于存储RFID数据的多个分区。Construct multiple partitions for storing RFID data according to the year and month of collection time and the preset partition sequence number.
- 根据权利要求3所述的方法,其特征在于,所述对接收的所述多条RFID数据进行预处理,包括:The method according to claim 3, wherein the preprocessing the received pieces of RFID data comprises:对所述多条RFID数据进行去重处理,并从经过去重处理的RFID数据中过滤掉干扰数据;或,Performing deduplication processing on the plurality of pieces of RFID data, and filtering interference data from the deduplicated RFID data; or,从所述多条RFID数据中过滤掉干扰数据,并对经过过滤的RFID数据进行去重处理。Interference data is filtered from the multiple pieces of RFID data, and deduplication processing is performed on the filtered RFID data.
- 根据权利要求6所述的方法,其特征在于,所述去重处理,包括:The method according to claim 6, wherein the deduplication processing comprises:将各个预设时间窗口中、同一采集区域的所述目标RFID标签的多条RFID数据进行合并,得到一条合并数据,所述合并数据中包含所述多条RFID数据的采集时间,所述同一采集区域对应于同一采集设备。Combining multiple pieces of RFID data of the target RFID tag in the same collection area in each preset time window to obtain a piece of combined data, where the combined data includes the collection time of the multiple pieces of RFID data, and the same collection The area corresponds to the same acquisition device.
- 根据权利要求4所述的方法,其特征在于,从所述数据库中查询所述目标RFID标签在每个所述采集区域的多条RFID数据,包括:The method according to claim 4, wherein querying a plurality of pieces of RFID data of the target RFID tag in each of the collection areas from the database comprises:根据所述查询请求中包括的起始时间和所述标识信息生成所述RowKey的格式的StartRowKey;Generating a StartRowKey in the format of the RowKey according to the start time included in the query request and the identification information;根据所述查询请求中包括的结束时间和所述标识信息生成所述RowKey的格式的EndRowKey;Generating an EndRowKey in the format of the RowKey according to the end time included in the query request and the identification information;根据所述StartRowKey和所述EndRowKey生成用于向所述HBASE发送的扫描请求;Generating a scan request for sending to the HBASE according to the StartRowKey and the EndRowKey;接收所述HBASE基于所述扫描请求返回的、所述目标RFID标签在每个所述采集区域的多条RFID数据。Receiving a plurality of pieces of RFID data of the target RFID tag in each of the collection areas returned by the HBASE based on the scan request.
- 根据权利要求1所述的方法,其特征在于,还包括:The method according to claim 1, further comprising:根据所述目标RFID标签在所述多个采集区域中的每个所述采集区域内的驻留时长,追踪所述目标RFID标签的行驶路径。Tracking the travel path of the target RFID tag according to the residence time of the target RFID tag in each of the plurality of acquisition areas.
- 一种确定驻留时长的装置,包括:A device for determining dwell time includes:查询请求接收模块,用于接收用于查询目标RFID标签的驻留时长的查询请求,所述查询请求中包含所述目标RFID标签的标识信息;The query request receiving module is configured to receive a query request for querying a dwell time of a target RFID tag, where the query request includes identification information of the target RFID tag;标签数据查询模块,用于根据所述标识信息,从数据库中查询所述目标RFID标签在每个采集区域的多条RFID数据,每条所述RFID数据包含数据采集时间;A tag data query module, configured to query a plurality of pieces of RFID data of the target RFID tag in each collection area from a database according to the identification information, and each piece of RFID data includes a data collection time;时间差值确定模块,用于确定所述多条RFID数据中,每相邻两条数据的数据采集 时间的差值;A time difference determining module, configured to determine a difference between data collection times of each two adjacent data in the plurality of RFID data;驻留时长确定模块,用于根据所述差值确定所述目标RFID标签在所述每个采集区域的驻留时长。The dwell time determining module is configured to determine a dwell time of the target RFID tag in each acquisition area according to the difference value.
- 根据权利要求10所述的装置,其特征在于,所述时间差值确定模块,包括:The apparatus according to claim 10, wherein the time difference determination module comprises:采集时间获取单元,用于对每个所述采集区域的所述多条RFID数据的采集时间进行排序,得到排序后的多条RFID数据的采集时间;A collection time acquisition unit, configured to sort the collection time of the plurality of RFID data of each of the collection areas, to obtain the collection time of the plurality of RFID data after sorting;时间差值计算单元,用于计算排序后的多条RFID数据的采集时间中,每相邻两条RFID数据的采集时间的差值以形成差值集合;A time difference calculation unit, configured to calculate a difference between the collection times of two adjacent RFID data among the sorted multiple pieces of RFID data to form a difference set;所述驻留时长确定模块,包括:The residency determination module includes:驻留时长确定单元,用于对所述差值集合中小于或等于预设时间阈值的差值进行累加,得到所述目标RFID标签在每个所述采集区域的驻留时长。The dwell duration determination unit is configured to accumulate differences in the difference set that are less than or equal to a preset time threshold to obtain a dwell duration of the target RFID tag in each of the collection areas.
- 根据权利要求10所述的装置,其特征在于,所述装置还包括:标签数据存储模块;The device according to claim 10, further comprising: a tag data storage module;所述标签数据存储模块,包括:The tag data storage module includes:标签数据接收单元,用于接收所述目标RFID标签的多条RFID数据;A tag data receiving unit, configured to receive multiple pieces of RFID data of the target RFID tag;数据预处理单元,用于对接收的所述多条RFID数据进行预处理,得到第一预设格式的待存储RFID数据;A data preprocessing unit, configured to preprocess the received pieces of RFID data to obtain RFID data to be stored in a first preset format;数据格式转换单元,用于将所述待存储RFID数据由所述第一预设格式转换为第二预设格式;A data format conversion unit, configured to convert the RFID data to be stored from the first preset format to a second preset format;标签数据存储单元,用于将所述第二预设格式的待存储RFID数据输送至数据库进行存储。The tag data storage unit is configured to transfer the RFID data to be stored in the second preset format to a database for storage.
- 根据权利要求12所述的装置,其特征在于,The device according to claim 12, wherein:所述数据库包括分布式存储系统HBASE,The database includes a distributed storage system HBASE,所述第二预设格式包括RowKey的格式;The second preset format includes a format of RowKey;所述标签数据存储单元,还用于:The tag data storage unit is further configured to:根据预设的分区设计规则构建用于存储RFID数据的多个分区;Construct multiple partitions for storing RFID data according to preset partition design rules;将所述第二预设格式的待存储RFID数据存储至所述多个分区中与所述待存储RFID数据匹配的目标分区。Storing the RFID data to be stored in the second preset format to a target partition of the plurality of partitions that matches the RFID data to be stored.
- 根据权利要求13所述的装置,其特征在于,所述标签数据存储单元,还用于:The device according to claim 13, wherein the tag data storage unit is further configured to:按照采集时间的年月和预设的分区序号构建用于存储RFID数据的多个分区。Construct multiple partitions for storing RFID data according to the year and month of collection time and the preset partition sequence number.
- 根据权利要求12所述的装置,其特征在于,所述数据预处理单元,还用于:The apparatus according to claim 12, wherein the data preprocessing unit is further configured to:对所述多条RFID数据进行去重处理,并从经过去重处理的RFID数据中过滤掉干扰数据;或,Performing deduplication processing on the plurality of pieces of RFID data, and filtering interference data from the deduplicated RFID data; or,从所述多条RFID数据中过滤掉干扰数据,并对经过过滤的RFID数据进行去重处理。Interference data is filtered from the multiple pieces of RFID data, and deduplication processing is performed on the filtered RFID data.
- 根据权利要求15所述的装置,其特征在于,所述数据预处理单元,还用于:The apparatus according to claim 15, wherein the data preprocessing unit is further configured to:将各个预设时间窗口中、同一采集区域的所述目标RFID标签的多条RFID数据进行合并,得到一条合并数据,所述合并数据中包含所述多条RFID数据的采集时间,所述同一采集区域对应于同一采集设备。Combining multiple pieces of RFID data of the target RFID tag in the same collection area in each preset time window to obtain a piece of combined data, where the combined data includes the collection time of the multiple pieces of RFID data, and the same collection The area corresponds to the same acquisition device.
- 一种电子设备,包括:An electronic device includes:处理器;processor;被配置为存储处理器可执行指令的存储器;Memory configured to store processor-executable instructions;其中,所述处理器被配置为执行权利要求1-9中任一项所述的方法。The processor is configured to execute the method according to any one of claims 1-9.
- 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器处理时实现权利要求1-9中任一项所述的方法。A computer-readable storage medium having stored thereon a computer program which, when processed by a processor, implements the method of any one of claims 1-9.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810837641.0A CN110766102B (en) | 2018-07-26 | 2018-07-26 | Method, device, equipment and storage medium for determining residence time |
CN201810837641.0 | 2018-07-26 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020020358A1 true WO2020020358A1 (en) | 2020-01-30 |
Family
ID=69181351
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/097953 WO2020020358A1 (en) | 2018-07-26 | 2019-07-26 | Method and apparatus for determining residence time duration, device, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110766102B (en) |
WO (1) | WO2020020358A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112000893A (en) * | 2020-09-29 | 2020-11-27 | 北京百度网讯科技有限公司 | Resident area prediction method, resident area prediction device, resident area prediction equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103210426A (en) * | 2010-06-21 | 2013-07-17 | 布鲁罗恩有限公司 | Determining a travel time of an entity |
US20130191175A1 (en) * | 2012-01-25 | 2013-07-25 | Haul-It Nationwide Limited | Personnel activity recording terminal, personnel management system and method for controlling such a system |
CN205644663U (en) * | 2016-02-02 | 2016-10-12 | 北京安云科创科技发展有限责任公司 | Long statistical system when regional resident |
CN106303424A (en) * | 2016-08-15 | 2017-01-04 | 深圳市校联宝科技有限公司 | A kind of monitoring method and monitoring system |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1761277B (en) * | 2004-10-11 | 2010-07-14 | 中兴通讯股份有限公司 | Device for dynamic analyzing call ticket and dynamic analyzing method |
US20120242453A1 (en) * | 2006-12-26 | 2012-09-27 | Lockheed Martin Corporation | Energy management in rfid systems with long term active sensing |
US8456282B2 (en) * | 2009-05-01 | 2013-06-04 | L-3 Communications Integrated Systems L.P. | Synchronization of devices in a RFID communications environment |
CN102915346B (en) * | 2012-09-26 | 2015-07-01 | 中国科学院软件研究所 | Data index building and query method for Internet of Things intellisense |
CN203192045U (en) * | 2013-01-08 | 2013-09-11 | 江苏海事职业技术学院 | Radio frequency identification (RFID) attendance management device |
CN103473574B (en) * | 2013-09-01 | 2018-07-31 | 湖南人文科技学院 | A kind of uncertainty RFID data processing method based on sequential relationship |
CN103955722B (en) * | 2014-04-25 | 2016-08-24 | 江苏物联网研究发展中心 | Label management method in indoor locating system based on active RFID |
CN106303370A (en) * | 2015-05-12 | 2017-01-04 | 杭州海康威视数字技术股份有限公司 | Determine the method for target object position, Apparatus and system |
CN105426442B (en) * | 2015-11-06 | 2020-01-14 | 广东湛数大数据有限公司 | Distributed database based message data management method and system |
CN106303420A (en) * | 2016-08-15 | 2017-01-04 | 深圳市校联宝科技有限公司 | A kind of monitoring method being applied to moving target and monitoring system |
-
2018
- 2018-07-26 CN CN201810837641.0A patent/CN110766102B/en active Active
-
2019
- 2019-07-26 WO PCT/CN2019/097953 patent/WO2020020358A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103210426A (en) * | 2010-06-21 | 2013-07-17 | 布鲁罗恩有限公司 | Determining a travel time of an entity |
US20130191175A1 (en) * | 2012-01-25 | 2013-07-25 | Haul-It Nationwide Limited | Personnel activity recording terminal, personnel management system and method for controlling such a system |
CN205644663U (en) * | 2016-02-02 | 2016-10-12 | 北京安云科创科技发展有限责任公司 | Long statistical system when regional resident |
CN106303424A (en) * | 2016-08-15 | 2017-01-04 | 深圳市校联宝科技有限公司 | A kind of monitoring method and monitoring system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112000893A (en) * | 2020-09-29 | 2020-11-27 | 北京百度网讯科技有限公司 | Resident area prediction method, resident area prediction device, resident area prediction equipment and storage medium |
CN112000893B (en) * | 2020-09-29 | 2024-04-12 | 北京百度网讯科技有限公司 | Resident region prediction method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110766102A (en) | 2020-02-07 |
CN110766102B (en) | 2021-04-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102236581B (en) | Mapping reduction method and system thereof for data center | |
US9589004B2 (en) | Data storage method and apparatus | |
US9411829B2 (en) | Image-based faceted system and method | |
CN107992356A (en) | Block chain affairs block processes method, electronic device and readable storage medium storing program for executing | |
WO2017219858A1 (en) | Streaming data distributed processing method and device | |
CN112632129A (en) | Code stream data management method, device and storage medium | |
CN105871585A (en) | Terminal association method and device | |
CN110245155A (en) | Data processing method, device, computer readable storage medium and terminal device | |
CN113987002A (en) | Data exchange method based on mass data analysis platform | |
Xu | The analytics and applications on supporting big data framework in wireless surveillance networks | |
WO2019144803A1 (en) | Traffic statistics method and apparatus, storage medium, and electronic apparatus | |
CN107665229A (en) | Information search method, device and equipment | |
WO2020020358A1 (en) | Method and apparatus for determining residence time duration, device, and storage medium | |
CN115314499A (en) | Multi-terminal cooperative working method and system suitable for electric power field | |
CN110533906A (en) | A kind of acquisition methods and relevant apparatus of traffic information | |
CN112925899B (en) | Ordering model establishment method, case clue recommendation method, device and medium | |
CN106375944A (en) | Data acquisition system based on cloud computing | |
CN106533728A (en) | Server information collecting method and apparatus | |
US20240022507A1 (en) | Information flow recognition method, network chip, and network device | |
CN108197050A (en) | A kind of device identification method, apparatus and system | |
CN110673965A (en) | Method and device for capturing second-killing commodities | |
CN107360098B (en) | Internet of things terminal information addressing method and device | |
CN116089431A (en) | Data processing method and device of data warehouse, electronic equipment and storage medium | |
CN113966602A (en) | Distributed storage of blocks in a blockchain | |
CN115146142A (en) | Multisource data screening system based on internet |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19840299 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19840299 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 24/08/2021) |