Data processing method and system based on sliding time window

By using sliding time window and interpolation algorithm in the attendance system, the attendance time duration of the terminal equipment within the attendance range is calculated in real time, and the problems of statistical errors and results lag in the existing system are solved, achieving high-precision and real-time attendance data management.

CN120087929AInactive Publication Date: 2025-06-03FOSHAN UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510563842.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-06-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing attendance system cannot monitor user location in real time, resulting in statistical errors, and the GPS data processing relies on the server to cause attendance results to be lagged and cannot be feedback in real time.

Method used

The data processing method based on the sliding time window is adopted to obtain the position information of the terminal device in real time, and the attendance time duration is counted in real time through the sliding time window. When the terminal device moves at the edge of the attendance range, a virtual boundary point is generated using an interpolation algorithm to compensate for discontinuous timestamps.

Benefits of technology

It improves the accuracy of attendance data statistics, realizes real-time statistics and data processing, reduces statistical errors, and improves the efficiency of attendance data management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120087929A_ABST
    Figure CN120087929A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and system based on a sliding time window, and relates to the technical field of data processing.The method comprises the steps that parameters preset by a user are obtained; acquiring position information of the terminal equipment in real time; and counting the attendance duration of the terminal equipment in the attendance range in real time by adopting a sliding time window, updating the window range once for each timestamp by taking the current moment as a reference, and if the positioning point of the terminal equipment corresponding to each timestamp in the current window is in the attendance range, judging that the terminal equipment is in the attendance range, and if the positioning point of the terminal equipment corresponding to each timestamp in the current window is in the attendance range, judging that the terminal equipment is in the attendance range. The time window size is accumulated to the attendance time length and the interval between the adjacent timestamps does not exceed a preset time threshold value; if it is monitored that the terminal equipment moves at the edge of the attendance range, virtual boundary points are generated through an interpolation algorithm, and the attendance duration of the terminal equipment in the attendance range is counted. According to the invention, the acquired position information of the terminal equipment is processed by adopting the sliding time window and the interpolation algorithm, so that the attendance data statistical accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and particularly relates to a data processing method and system based on a sliding time window. Background Art

[0002] Existing attendance systems generally only have the functions of single positioning and cumulative attendance duration for the whole day. Usually, a time difference obtained by subtracting the work start punching time from the work end punching time is used as the attendance time, and the user's location is not monitored in real time. When the user leaves the attendance range, the time when the user leaves the attendance range is still included in the attendance duration, which is likely to cause statistical errors and cannot effectively manage the user's attendance data. In addition, the GPS data processing of existing attendance systems relies on the server for batch calculation, which is likely to cause a lag in the attendance result and cannot provide real-time feedback.

[0003] Therefore, the present invention proposes a data processing method based on a sliding time window to effectively monitor and manage the user's attendance data. Summary of the Invention

[0004] In order to overcome one or more of the above technical defects, the present invention provides a data processing method and system based on a sliding time window to effectively monitor and manage the user's attendance data.

[0005] To solve the above problems, a first aspect of the present invention discloses a data processing method based on a sliding time window, including: Obtaining parameters preset by a user, where the parameters include an attendance range, a sliding time window size, and a sliding time window step; Obtaining the location information of a terminal device in real time, where the location information includes a positioning point coordinate, a timestamp, a date, and a terminal device ID; Using a sliding time window to statistically calculate the attendance duration of the terminal device within the attendance range in real time; If it is monitored that the timestamps in the location information are discontinuous and the terminal device moves at the edge of the attendance range, an interpolation algorithm is used to generate virtual boundary points, and the attendance duration of the terminal device within the attendance range is statistically calculated.

[0006] Further, after obtaining the location information of the terminal device in real time, the method further includes the steps of: Comparing the timestamps of each location information with the terminal device ID respectively to filter out duplicate location information.

[0007] Further, the step of using a sliding time window to statistically calculate the attendance duration of the terminal device within the attendance range in real time includes: Based on the current moment, the window range is updated once for each timestamp. If the positioning points of the terminal device corresponding to each timestamp within the current window are all within the attendance range, and the intervals between adjacent timestamps do not exceed the preset time threshold, the size of this time window is accumulated into the attendance duration. If there is a positioning point of the terminal device corresponding to a timestamp within the window at the edge of the attendance range, the time when the positioning point is within the attendance range is statistically calculated in real time and accumulated into the attendance duration.

[0008] Further, when it is detected that the timestamps in the location information are discontinuous and the terminal device moves at the edge of the attendance range, an interpolation algorithm is used to generate virtual boundary points, and the attendance duration of the terminal device within the attendance range is statistically calculated, including: Traverse the location information within the time window; If the timestamps in the location information are discontinuous, determine the positional relationship between two adjacent positioning points and the attendance range; If the first positioning point of two adjacent positioning points is within the attendance range, the second positioning point is outside the attendance range, and the time difference between the two positioning points does not exceed the size of the sliding time window, then a virtual boundary point is inserted and generated. The timestamp of the virtual boundary point is the previous moment of the timestamp of the second positioning point, calculate the time difference between the virtual boundary point and the first positioning point, and accumulate it into the attendance duration.

[0009] Further, it also includes: Use the IsDateChanged function to determine whether the date corresponding to the timestamp within the window has changed; If the date corresponding to the timestamp within the window has changed, save the attendance duration of the previous day and automatically update the date.

[0010] The second aspect of the present invention discloses a data processing system based on a sliding time window for implementing the above-mentioned data processing method based on a sliding time window, including: An acquisition module, used to acquire the parameters preset by the user and the location information of the terminal device. Among them, the parameters include the attendance range, the size of the sliding time window, and the step size of the sliding time window. The location information includes the positioning point coordinates, timestamp, date, and terminal device ID; A monitoring module, used to statistically calculate the attendance duration of the terminal device within the attendance range in real time using a sliding time window; A boundary compensation module, used to generate virtual boundary points using an interpolation algorithm and statistically calculate the attendance duration of the terminal device within the attendance range when it is detected that the terminal device moves at the edge of the attendance range.

[0011] Further, it also includes a preprocessing module, used to perform format checks on the real-time acquired location information of the terminal device and filter out duplicate data.

[0012] Further, the boundary compensation module includes: A boundary detection unit, configured to traverse the list of positioning point coordinate information within a time window. If the timestamps in the position information are not continuous, determine the positional relationship between two adjacent positioning points and the attendance range; A virtual boundary point generation unit, configured to generate a virtual boundary point when the first positioning point among two adjacent positioning points is within the attendance range and the second positioning point is outside the attendance range, and calculate the time difference between the virtual boundary point and the first positioning point.

[0013] A third aspect of the present invention discloses a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.

[0014] A fourth aspect of the present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method are implemented.

[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention discloses a data processing method and system based on a sliding time window. The method includes obtaining parameters preset by a user, where the parameters include an attendance range, a sliding time window size, and a sliding time window step; obtaining the position information of a terminal device in real time, where the position information includes a positioning point coordinate, a timestamp, a date, and a terminal device ID; using the sliding time window to statistically calculate the attendance duration of the terminal device within the attendance range in real time. Taking the current moment as a reference, the window range is updated once for each timestamp. If the positioning points of the terminal device corresponding to each timestamp within the current window are all within the attendance range, and the interval between adjacent timestamps does not exceed a preset time threshold, the size of the time window is accumulated into the attendance duration; if it is detected that the timestamps in the position information are not continuous and the terminal device moves at the edge of the attendance range, an interpolation algorithm is used to generate virtual boundary points, and the attendance duration of the terminal device within the attendance range is statistically calculated. By using the sliding time window and the interpolation algorithm to process the obtained position information of the terminal device, the accuracy of attendance data statistics is improved; only the data stream within the sliding time window size is processed, and the scale of the processed data is small, realizing real-time statistics and improving the accuracy of data processing, and improving the management efficiency of attendance data. Description of the Drawings

[0016] The following further describes in detail the specific embodiments of the present invention with reference to the drawings, where: Figure 1 It is a flowchart of the data processing method based on a sliding time window described in Embodiment 1; Figure 2 Schematic structural diagram of the data processing system based on a sliding time window described in Embodiment 2; Figure 3 Internal structural diagram of the computer device described in Embodiment 3; Marking description: 100, acquisition module; 200, monitoring module; 300, boundary compensation module; 310, boundary detection unit; 320, virtual boundary point generation unit; 400, preprocessing module; 500, display module. Specific embodiments

[0017] The following describes the preferred embodiments of the present invention with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are only for the purpose of illustrating and explaining the present invention, and are not used to limit the present invention.

[0018] Embodiment 1 This embodiment discloses a data processing method based on a sliding time window, as Figure 1 , including: S1. Obtain the parameters preset by the user. The parameters include the attendance range, the size of the sliding time window, and the step size of the sliding time window. In this implementation, the radius of the attendance range is set to R, the size of the sliding time window is 3 minutes, and the step size of the sliding time window is 1 second to process each piece of location information.

[0019] S2. Obtain the location information of the terminal device in real time. The location information includes the positioning point coordinates, timestamp, date, and terminal device ID. The positioning point coordinates include geographic coordinates and geodetic coordinates. In this embodiment, the positioning point coordinates are longitude and latitude data.

[0020] Specifically, it further includes the steps: Compare the timestamps of each piece of location information with the terminal device ID respectively to filter out duplicate location information. For the timestamps of each piece of location information, an error of ±500 ms can be set. If the difference between the timestamps of two adjacent pieces of location information does not exceed ±500 ms and the terminal device IDs are the same, it is considered that these two pieces of location information are actually the same piece of location information, and one of them is filtered out. This avoids data distortion caused by network retransmission or repeated submission of the terminal device.

[0021] S3. Use a sliding time window to statistically calculate the attendance duration of the terminal device within the attendance range in real time.

[0022] Specifically, step S3 includes: Taking the current moment as a reference, create a time window according to the size of the time window and the step size of the time window . The time window follows Slide forward, update the window range once per timestamp. If the positioning points of the terminal device corresponding to each timestamp within the current window are all within the attendance range, and the interval between adjacent timestamps does not exceed 500 ms, it can be known that the terminal device has been within the attendance range during the current time window, and the size of this time window is accumulated into the attendance duration. 。

[0023] After each window slide, if there is a positioning point of the terminal device corresponding to a timestamp within the window at the edge of the attendance range, the time when the positioning point is within the attendance range is statistically counted in real time and accumulated into the attendance duration. : (1) Among them, is the timestamp when the terminal device leaves the attendance range for the i th time, and is the timestamp when the terminal device enters the attendance range for the i th time.

[0024] When the terminal device normally feeds back data, the attendance duration is statistically counted using step S3; since the data processing method based on the sliding time window provided in this embodiment requires the terminal device to always turn on the positioning function and heartbeat function, this causes the terminal device to have a high power consumption situation. Some terminal devices, due to their own performance optimization and protection mechanisms, will start to sleep or respond slowly during high power consumption situations, resulting in inaccurate or discontinuous position information feedback, which brings a time difference impact to the attendance data processing. Therefore, this embodiment also provides the following step S4 to solve this problem.

[0025] S4. If it is detected that the timestamps of the position information are discontinuous and the terminal device is moving at the edge of the attendance range, an interpolation algorithm is used to generate virtual boundary points, and the attendance duration of the terminal device within the attendance range is statistically counted.

[0026] Specifically, step S4 includes: Traverse the position information within 3 minutes.

[0027] If the timestamps in the position information are discontinuous, judge the position relationship between two adjacent positioning points and the attendance range. Specifically, let the center point of the attendance range be , the radius be R, the positioning point be , use the Haversine formula to calculate the distance between the positioning point and the attendance center point, and judge whether isInRange() is within the attendance range through : (2) If , it is considered that the positioning point is within the attendance range, otherwise it is outside the attendance range.

[0028] The code for obtaining the longitude and latitude data of the positioning point and the center point is as follows: isInRange() It is a custom Java function: @override public boolean isInRange(PositionInfo p, Department department){ double lat1 = department.getLatitude(); / / Obtain the latitude data of the center point of the attendance range double lon1 = department.getLongitude(); / / Obtain the longitude data of the center point of the attendance range double lon2 = p.getLongitude(); / / Obtain the longitude data of the positioning point double lat2 = p.getLatitude(); / / Obtain the latitude data of the positioning point double d = getDistance(lon1,lat1,lon2,lat2); / / Calculate the distance between the positioning point and the center of the attendance range return d<=100; / / When the calculation result is less than the preset value, return the calculation result } The code for calculating the distance between the positioning point and the center of the attendance range is as follows: @override public double getDistance(double lon1, double lat1, double lon2,double lat2){ double R=6371000; / / Earth radius (unit: meters) double latDistance = Math.toRadians(lat2 - lat1); / / Convert the latitude difference to radians double lonDistance = Math.toRadians(lon2 - lon1); / / Convert the longitude difference to radians / / Core calculation part of the Haversine formula, a and c are intermediate parameters double a = Math.sin(latDistance / 2)*Math.sin(latDistance / 2) + Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) * Math.sin(lonDistance / 2) * Math.sin(lonDistance / 2); / / Math.cos(Math.toRadians(lat1)) is the cosine value of the starting latitude, Math.cos(Math.toRadians(lat2)) is the cosine value of the ending latitude double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 – a)); / / Calculate the intermediate angle parameter double distance = R * c; / / Calculate the final spherical distance (unit: meter) return distance; / / Return the calculation result of the distance } If the previous positioning point of two adjacent positioning points is within the attendance range, the latter positioning point is outside the attendance range, and the time difference between the two positioning points does not exceed 3 minutes, then it is considered that the previous moment of the latter positioning point is within the circle. Taking the previous moment of the time stamp of the latter positioning point as the boundary, insert and generate a virtual boundary point. The time stamp of the virtual boundary point is the previous moment of the time stamp of the latter positioning point. Calculate the time difference between the virtual boundary point and the previous positioning point, and accumulate it into the attendance duration. Specifically, the time stamp calculation formula of the virtual boundary point is: Let the time stamp of the latter positioning point be , then the virtual boundary point time stamp is: (3) Then the cumulative attendance duration formula is: Let the time stamp of the previous positioning point be , the increment of the attendance duration is: , then the total attendance duration is: (4)。

[0029] If the previous positioning point of two adjacent positioning points is within the attendance range, the latter positioning point is outside the attendance range, and the time difference between the two positioning points exceeds 3 minutes, then do not count the time period between the two positioning points, and reset the attendance range entry point and the attendance range exit point, and process the relevant position information of the next positioning point. In this embodiment, it further includes: Use the IsDateChanged function to determine whether the date corresponding to the timestamp within the window has changed. The IsDateChanged function is a custom Java function.

[0030] If the date corresponding to the timestamp within the window changes, save the attendance duration of the previous day and automatically update the date, so as to automatically process the attendance data across dates and ensure the continuity of data statistics.

[0031] The data processing method based on the sliding time window provided in this embodiment processes the position information including timestamp, longitude and latitude data, date, etc. within 3 minutes provided by the terminal device. The data scale is small, the processing accuracy is high, and the timestamp when the longitude and latitude data is obtained by calling the API is used as one of the data processing objects. By using the sliding time window to count the attendance duration and using the interpolation algorithm to generate virtual boundary points for boundary compensation, the real-time processing of attendance data is realized, and the statistical accuracy and management efficiency of attendance data are improved.

[0032] Embodiment 2 This embodiment discloses a data processing system based on a sliding time window for implementing the data processing method based on the sliding time window described in Embodiment 1, such as Figure 2 , the data processing system based on the sliding time window includes an acquisition module 100, a monitoring module 200 and a boundary compensation module 300. The acquisition module 100 is used to acquire the parameters preset by the user and the position information of the terminal device. Among them, the parameters include the attendance range, the size of the sliding time window, and the step size of the sliding time window. The position information includes the positioning point coordinates, timestamp, date, and terminal device ID; the monitoring module 200 is used to use the sliding time window to count the attendance duration of the terminal device within the attendance range in real time; the boundary compensation module 300 is used to generate virtual boundary points by using the interpolation algorithm when it is detected that the terminal device moves at the edge of the attendance range, and count the attendance duration of the terminal device within the attendance range.

[0033] In this embodiment, a preprocessing module 400 is further included, which is used to perform format check on the real-time acquired terminal device position information and filter out duplicate data.

[0034] In this embodiment, the boundary compensation module 300 includes a boundary detection unit 310 and a virtual boundary point generation unit 320. The boundary detection unit 310 is used to traverse the list of positioning point coordinate information within the time window. If the timestamps of the position information are not continuous, judge the position relationship between two adjacent positioning points and the attendance range; the virtual boundary point generation unit 320 is used to generate virtual boundary points when the first positioning point among two adjacent positioning points is within the attendance range and the second positioning point is outside the attendance range, and calculate the time difference between the virtual boundary point and the first positioning point.

[0035] Specifically, it further includes a display module 500, which is used to display the attendance personnel ID, the attendance center, the attendance duration, the positional relationship between the positioning point and the attendance range, and when the positioning point is not within the attendance range, display the distance between the positioning point and the attendance center.

[0036] Each module in the above data processing system based on a sliding time window can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.

[0037] For other specific implementation details, please refer to Embodiment 1, which will not be elaborated here.

[0038] Embodiment 3 This embodiment provides a computer device, which can be a server or a terminal integrated with a scheduler, and its internal structure diagram can be as Figure 3 shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a data processing method based on a sliding time window.

[0039] Those skilled in the art can understand that Figure 3 the structure shown in

[0040] merely shows the block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements. In this embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented: Obtain parameters preset by the user, where the parameters include an attendance range, a sliding time window size, and a sliding time window step; Obtain the position information of the terminal device in real time, where the position information includes a positioning point coordinate, a timestamp, a date, and a terminal device ID; If it is detected that the terminal device is moving at the edge of the attendance range, an interpolation algorithm is used to generate virtual boundary points, and the attendance duration of the terminal device within the attendance range is counted.

[0041] Specifically, when the processor executes the computer program, the following steps are also implemented: Compare the timestamps of each location information with the terminal device ID respectively to filter out duplicate location information.

[0042] Specifically, when the processor executes the computer program, the following steps are also implemented: If the positioning points of the terminal device are all within the attendance range and the interval between adjacent timestamps does not exceed the preset time threshold, the size of this time window is accumulated into the attendance duration; If there is a positioning point of the terminal device corresponding to a timestamp within the attendance range edge within the window, the time when the positioning point is within the attendance range is counted in real time and accumulated into the attendance duration.

[0043] Specifically, when the processor executes the computer program, the following steps are also implemented: Traverse the list of positioning point coordinate information within the time window; Judge the positional relationship between two adjacent positioning points and the attendance range; If the first positioning point of two adjacent positioning points is within the attendance range, the second positioning point is outside the attendance range, and the time difference between the two positioning points does not exceed the size of the sliding time window, insert and generate a virtual boundary point. The timestamp of the virtual boundary point is the previous moment of the timestamp of the second positioning point, calculate the time difference between the virtual boundary point and the first positioning point, and accumulate it into the attendance duration.

[0044] Specifically, when the processor executes the computer program, the following steps are also implemented: Use the IsDateChanged function to judge whether the date corresponding to the timestamp within the window has changed; If the date corresponding to the timestamp within the window has changed, save the attendance duration of the previous day and automatically update the date.

[0045] Embodiment 4 This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: Obtain the parameters preset by the user, and the parameters include the attendance range, the size of the sliding time window, and the step size of the sliding time window; Obtain the location information of the terminal device in real time, and the location information includes the positioning point coordinates, timestamps, dates, and terminal device IDs; Use the sliding time window to count the attendance duration of the terminal device within the attendance range in real time; If it is detected that the terminal device moves at the edge of the attendance range, an interpolation algorithm is used to generate virtual boundary points, and the attendance duration of the terminal device within the attendance range is counted.

[0046] Specifically, when the computer program is executed by the processor, the following steps are also implemented: The timestamps of each location information are compared with the terminal device ID respectively to filter out duplicate location information.

[0047] Specifically, when the computer program is executed by the processor, the following steps are also implemented: Based on the current moment, the window range is updated once for each timestamp. If the positioning points of the terminal device corresponding to each timestamp within the current window are all within the attendance range, and the interval between adjacent timestamps does not exceed the preset time threshold, the size of this time window is accumulated into the attendance duration; If there is a positioning point of the terminal device corresponding to a timestamp within the window at the edge of the attendance range, the time when the positioning point is within the attendance range is counted in real time and accumulated into the attendance duration.

[0048] Specifically, when the computer program is executed by the processor, the following steps are also implemented: Traverse the list of positioning point coordinate information within the time window; Judge the positional relationship between two adjacent positioning points and the attendance range; If the first positioning point of two adjacent positioning points is within the attendance range, the second positioning point is outside the attendance range, and the time difference between the two positioning points does not exceed the size of the sliding time window, a virtual boundary point is inserted. The timestamp of the virtual boundary point is the previous moment of the timestamp of the second positioning point, and the time difference between the virtual boundary point and the first positioning point is calculated and accumulated into the attendance duration.

[0049] Specifically, when the computer program is executed by the processor, the following steps are also implemented: Use the IsDateChanged function to judge whether the date corresponding to the timestamp within the window has changed; If the date corresponding to the timestamp within the window has changed, save the attendance duration of the previous day and automatically update the date.

[0050] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.

[0051] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0052] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

[0053] As described above, it is only the preferred embodiment of the present invention and does not impose any formal restrictions on the present invention. Therefore, any modifications, equivalent changes, and decorations made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.

Claims

1. A data processing method based on a sliding time window, characterized in that: include: Obtain user preset parameters, including attendance range, sliding time window size, and sliding time window step size; Acquire the location information of the terminal device in real time, the location information including the positioning point coordinates, timestamp, date and terminal device ID; A sliding time window is used to count the attendance duration of the terminal device within the attendance range in real time. The window range is updated once for each timestamp based on the current time. If the positioning point of the terminal device corresponding to each timestamp in the current window is within the attendance range, and the interval between adjacent timestamps does not exceed the preset time threshold, the time window size is accumulated to the attendance duration. If the timestamp of the monitored location information is discontinuous and the terminal device moves at the edge of the attendance range, an interpolation algorithm is used to generate virtual boundary points, and the attendance time of the terminal device within the attendance range is counted.

2. The data processing method based on a sliding time window according to claim 1 is characterized in that: After the real-time acquisition of the location information of the terminal device, the following steps are also included: The timestamp of each location information is compared with the terminal device ID respectively to filter out duplicate location information.

3. The data processing method based on sliding time window according to claim 1 is characterized in that: The method of using a sliding time window to count the attendance time of the terminal device in the attendance range in real time also includes: If there is a location point of the terminal device corresponding to the timestamp in the window that is at the edge of the attendance range, the time the location point is within the attendance range is counted in real time and accumulated to the attendance duration.

4. The data processing method based on a sliding time window according to claim 1 is characterized in that: If the timestamp of the monitored location information is discontinuous and the terminal device moves at the edge of the attendance range, an interpolation algorithm is used to generate a virtual boundary point, and the attendance time of the terminal device within the attendance range is counted, including: Traverse the location information within the time window; If the timestamps of the location information are not continuous, determine the positional relationship between two adjacent positioning points and the attendance range; If the first of two adjacent positioning points is within the attendance range, and the second positioning point is outside the attendance range, and the time difference between the two positioning points does not exceed the size of the sliding time window, a virtual boundary point is inserted and generated, and the timestamp of the virtual boundary point is the previous moment of the timestamp of the second positioning point. The time difference between the virtual boundary point and the first positioning point is calculated and accumulated into the attendance duration.

5. The data processing method based on sliding time window according to claim 1 is characterized in that: Also includes: Use the IsDateChanged function to determine whether the date corresponding to the timestamp in the window has changed; If the date corresponding to the timestamp in the window changes, the attendance time of the previous day will be saved and the date will be automatically updated.

6. A data processing system based on a sliding time window, used to implement the data processing method based on a sliding time window according to any one of claims 1 to 5, characterized in that: include; An acquisition module is used to acquire user preset parameters and location information of the terminal device, wherein the parameters include attendance range, sliding time window size, sliding time window step, and the location information includes positioning point coordinates, timestamp, date, and terminal device ID; A monitoring module, used to use a sliding time window to count the attendance time of the terminal device within the attendance range in real time; The boundary compensation module is used to generate virtual boundary points by using an interpolation algorithm when it is detected that the terminal device moves at the edge of the attendance range, and to count the attendance time of the terminal device within the attendance range.

7. The data processing system based on sliding time window according to claim 6, characterized in that: It also includes a preprocessing module for checking the format of the terminal device location information obtained in real time and filtering duplicate data.

8. The data processing system based on sliding time window according to claim 6, characterized in that: The boundary compensation module comprises: The boundary detection unit is used to traverse the coordinate information list of the positioning points within the time window, and if the timestamps of the position information are not continuous, determine the positional relationship between two adjacent positioning points and the attendance range; The virtual boundary point generating unit is used to generate a virtual boundary point when a first positioning point of two adjacent positioning points is within the attendance range and a second positioning point is outside the attendance range, and calculate the time difference between the virtual boundary point and the first positioning point.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Outworker operation site detection method and device

    CN111652996A

  • Real-time multi-mode attendance collection platform and method supporting elastic assessment

    CN118470814A

  • Operation machine, operation area boundary generation method and device thereof, medium and product

    CN119847166A

  • Positioning-based attendance recording method and system

    WO2018223354A1