Cross-time-zone data processing method, apparatus, device, and storage medium
By receiving user requests, determining the time zone of the cloud database, and performing data conversion, the problem of calculation result deviation in cross-time zone data processing has been solved, achieving accuracy and efficiency in cross-time zone data processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG PHNIX ECO ENERGY SOLUTION
- Filing Date
- 2022-07-15
- Publication Date
- 2026-06-09
AI Technical Summary
In cross-time zone data processing, the calculation results are biased due to different time zones, and users cannot freely choose the data selection range under the time zone and the calculation results are inaccurate.
It receives data retrieval requests from users, determines the time zone information in the cloud database, performs time zone conversion and manages the data collection table to ensure that data storage and computation are in a unified time zone, and extracts and calculates data according to user requests.
It improves the accuracy of cross-time zone data processing, ensuring that users in different time zones obtain accurate equipment operation statistics, and optimizes data collection rules and calculation efficiency.
Smart Images

Figure CN115455068B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing, and more particularly to a method, apparatus, device, and storage medium for cross-time zone data processing. Background Technology
[0002] In cross-timezone data acquisition and computation, differing user requirements, server timezones, and data acquisition timezones often lead to conflicting results. Alternatively, server settings may prevent users from freely selecting data ranges and computational results across different timezones, resulting in unsatisfactory data processing outcomes. This is particularly problematic in multi-device cross-timezone applications, where the intermingling of device, server, and user timezones can easily cause misinterpretations of user data requests due to timezone inconsistencies, leading to the selection of incorrect time information and significant deviations in the output computational results. Summary of the Invention
[0003] The main objective of this invention is to solve the technical problem of calculation result deviations due to different time zones in existing multi-time zone data processing.
[0004] The first aspect of the present invention provides a cross-time zone data processing method, the cross-time zone data processing method comprising: receiving a data retrieval request sent by a user, and determining a first time zone and a query time period for the source data to be retrieved based on the data retrieval request; determining whether a data collection table with the first time zone as a timestamp exists in a cloud database; if not, determining a second time zone of the data collection table in the cloud database, and determining time period information of the source data in the second time zone based on the first time zone, the second time zone and the query time period; and extracting the corresponding source data from the data collection table based on the time period information.
[0005] Optionally, in a first implementation of the first aspect of the present invention, after determining whether a data storage table with the first time zone as the timestamp exists in the cloud database, the method further includes: if a data collection table with the first time zone as the timestamp exists in the cloud database, then using the first time zone as the retrieval index, querying the corresponding data collection table from the cloud database; and extracting the corresponding source data from the data collection table based on the query time period.
[0006] Optionally, in a second implementation of the first aspect of the present invention, the cloud database stores a data storage table with at least one time zone as the timestamp; before receiving the data retrieval request sent by the user side and determining the first time zone and query time period of the source data to be retrieved based on the data retrieval request, the method further includes: acquiring the source data collected in real time by the acquisition device and the working time zone of the acquisition device; determining whether the working time zone is the same as the second time zone of the cloud database; if not, converting the acquisition time of the source data to the time corresponding to the second time zone, and storing the source data in the data storage table based on the converted time; using the data acquisition table with the second time zone as the timestamp as the standard data table, converting the timestamp based on the time difference of different time zones, and copying the source data to obtain multiple data acquisition tables with different time zones.
[0007] Optionally, in a third implementation of the first aspect of the present invention, determining the second time zone of the data collection table in the cloud database, and determining the time period information of the source data in the second time zone based on the first time zone, the second time zone, and the query time period, includes: determining the second time zone of the data collection table in the cloud database; calculating the difference between the second time zone and the first time zone to obtain the time zone difference; and adjusting the query time period based on the time zone difference to obtain the time period information in the second time zone.
[0008] Optionally, in the fourth implementation of the first aspect of the present invention, after extracting the corresponding source data from the data collection table based on the time period information, the method further includes: determining whether the data retrieval request is the first request; if so, obtaining the data operation rules corresponding to the data retrieval request, and calculating the source data based on the data operation rules to obtain statistical data; generating corresponding statistical charts based on the statistical data according to a preset format; summarizing the statistical charts and the statistical data to obtain statistical results, and returning the statistical results to the user side.
[0009] Optionally, in a fifth implementation of the first aspect of the present invention, the cloud database further includes the data statistics table. After summarizing the statistical charts and the statistical data to obtain statistical results and returning the statistical data to the user side, the method further includes: treating the data retrieval request as a historical data retrieval request and constructing a mapping table with the statistical results; and storing the mapping table in the data statistics table.
[0010] Optionally, in the sixth implementation of the first aspect of the present invention, after determining whether the data retrieval request is the first request, the method further includes: if it is not the first request, then searching the mapping table from the data statistics table to determine whether there is a historical data retrieval request identical to the data retrieval request; if it exists, then based on the mapping relationship of the historical data retrieval requests in the mapping table, returning the corresponding statistical result to the user side; if it does not exist, then calculating the source data based on the data operation rules, and returning the new statistical result to the user side after the calculation.
[0011] A second aspect of the present invention provides a cross-time zone data processing apparatus, comprising: a request receiving module, configured to receive a data retrieval request sent by a user, and determine a first time zone and a query time period for the source data to be retrieved based on the data retrieval request; a first time zone determination module, configured to determine whether a data collection table with the first time zone as a timestamp exists in a cloud database; a time zone information determination module, configured to determine a second time zone of the data collection table in the cloud database if the first time zone does not exist, and determine the time period information of the source data in the second time zone based on the first time zone, the second time zone, and the query time period; and a source data return module, configured to extract the corresponding source data from the data collection table based on the time period information.
[0012] Optionally, in the first implementation of the second aspect of the present invention, the cross-time zone data processing device further includes a multi-time zone storage module, which is specifically used for: if a data collection table with the first time zone as the timestamp exists in the cloud database, then using the first time zone as the retrieval index, querying the corresponding data collection table from the cloud database; and extracting the corresponding source data from the data collection table based on the query time period.
[0013] Optionally, in a second implementation of the second aspect of the present invention, the cross-time zone data processing device further includes a source data storage module, which is specifically used for: acquiring source data collected in real time by the acquisition device and the working time zone of the acquisition device; determining whether the working time zone is the same as the second time zone of the cloud database; if not, converting the acquisition time of the source data into a time corresponding to the second time zone, and storing the source data in a data storage table based on the converted time; using the data acquisition table with the second time zone as the timestamp as the standard data table, converting the timestamp based on the time difference of different time zones, and copying the source data to obtain multiple data acquisition tables with different time zones.
[0014] Optionally, in a third implementation of the second aspect of the present invention, the time zone information determination module is specifically used to: determine the second time zone of the data collection table in the cloud database; calculate the difference between the second time zone and the first time zone to obtain the time zone difference; and adjust the query time period based on the time zone difference to obtain the time period information under the second time zone.
[0015] Optionally, in a fourth implementation of the second aspect of the present invention, the cross-time zone data processing device further includes a result output module, which is specifically used for: a first request judgment unit, which determines whether the data retrieval request is a first request; a source data calculation unit, which, if so, obtains the data calculation rules corresponding to the data retrieval request and calculates the source data based on the data calculation rules to obtain statistical data; a statistical chart generation unit, which generates corresponding statistical charts based on the statistical data according to a preset format; and a statistical result data unit, which summarizes the statistical charts and the statistical data to obtain statistical results and returns the statistical results to the user side.
[0016] Optionally, in a fifth implementation of the second aspect of the present invention, the result output module further includes a result storage unit, which is specifically used for: treating the data retrieval request as a historical data retrieval request and constructing a mapping table with the statistical results; and storing the mapping table in a data statistics table.
[0017] Optionally, in a sixth implementation of the second aspect of the present invention, the result output module further includes a result reuse unit, which is specifically used for: if it is not the first request, retrieving from the data statistics table and the mapping table whether there is a historical data retrieval request identical to the data retrieval request; if there is, returning the corresponding statistical result to the user side based on the mapping relationship of the historical data retrieval request in the mapping table; if there is not, calculating the source data based on the data operation rules, and returning a new statistical result to the user side after calculation.
[0018] A third aspect of the present invention provides a cross-time zone data processing device, comprising: a memory and at least one processor, wherein the memory stores a request, and the memory and the at least one processor are interconnected via a line; the at least one processor invokes the request in the memory to cause the cross-time zone data processing device to perform the steps of the cross-time zone data processing method described above.
[0019] A fourth aspect of the present invention provides a computer-readable storage medium storing a request that, when executed on a computer, causes the computer to perform the steps of the cross-time zone data processing method described above.
[0020] In the technical solution of this invention, a data retrieval request sent by the user is received, and a first time zone and query time period of the source data to be retrieved are determined based on the data retrieval request; it is determined whether a data collection table with the first time zone as the timestamp exists in the cloud database; if not, a second time zone of the data collection table in the cloud database is determined, and the time period information of the source data in the second time zone is determined based on the first time zone, the second time zone, and the query time period; the corresponding source data is extracted from the data collection table based on the time period information. This method unifies the time zone stored in the data storage table by converting the time zone of the source data uploaded by the acquisition device, and converts the time zone and specified time period specified in the user's data retrieval request. This greatly reduces the configuration of data acquisition rules and ensures that customers in different time zones at home and abroad can obtain the most accurate device operation statistics. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the first embodiment of the cross-time zone data processing method in this invention;
[0022] Figure 2 This is a schematic diagram of a second embodiment of the cross-time zone data processing method in this invention;
[0023] Figure 3 This is a schematic diagram of a third embodiment of the cross-time zone data processing method in this invention;
[0024] Figure 4 This is a schematic diagram of one embodiment of the cross-time zone data processing device in this invention;
[0025] Figure 5 This is a schematic diagram of another embodiment of the cross-time zone data processing device in this invention;
[0026] Figure 6 This is a schematic diagram of one embodiment of the cross-time zone data processing device in this invention. Detailed Implementation
[0027] In the technical solution of this invention, a data retrieval request sent by the user is received, and a first time zone and query time period of the source data to be retrieved are determined based on the data retrieval request; it is determined whether a data collection table with the first time zone as the timestamp exists in the cloud database; if not, a second time zone of the data collection table in the cloud database is determined, and the time period information of the source data in the second time zone is determined based on the first time zone, the second time zone, and the query time period; the corresponding source data is extracted from the data collection table based on the time period information. This method unifies the time zone stored in the data storage table by converting the time zone of the source data uploaded by the acquisition device, and converts the time zone and specified time period specified in the user's data retrieval request. This greatly reduces the configuration of data acquisition rules and ensures that customers in different time zones at home and abroad can obtain the most accurate device operation statistics.
[0028] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar elements and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” or “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of the cross-time zone data processing method in this invention includes:
[0030] 101, Receive data retrieval requests sent by the user side;
[0031] In this embodiment, the user sends a data retrieval request to the server, thereby enabling the user to query relevant data of the device bound to their own account.
[0032] Specifically, the data retrieval request sent should include the specified device number, the specified query time period, the specified source data processing rules, and the specified time zone for presentation.
[0033] 102. Determine if a data collection table with the first time zone as the timestamp exists in the cloud database;
[0034] In this embodiment, the system determines whether a data acquisition table exists in the cloud database within the server, storing source data with the device's time zone as the first time zone. That is, based on the cloud database's settings, it can use only the second time zone as the base time zone, and store the source data uploaded by devices in each time zone after time zone conversion. Similarly, if the cloud database has sufficient storage space to simultaneously store source data from several time zones, it indicates the existence of data acquisition tables corresponding to several time zones.
[0035] By checking whether a data collection table with the first time zone as the timestamp exists in the cloud database, it can be determined whether to perform time zone conversion on the source data in subsequent steps.
[0036] If it exists, the source data will be stored in the data acquisition table corresponding to the first time zone of the source data as the timestamp.
[0037] On the other hand, if it is determined that the cloud database only contains source data stored with the second time zone as the base time zone, then this judgment step 102 can be optimized. After obtaining the source data of each time zone, the source data can be converted to source data with the second time zone as the timestamp and stored in the data collection table.
[0038] 103. If it does not exist, determine the second time zone of the data collection table in the cloud database, and determine the time period information of the source data in the second time zone based on the first time zone, the second time zone and the query time period.
[0039] In this embodiment, if the cloud database does not have a data collection table with the first time zone as the timestamp, the source data from each time zone is directly obtained, and then time zone conversion processing is performed on the source data to convert it to source data with the second time zone as the timestamp and store it in the data collection table. Based on the relevant parameters in the data retrieval request, the time period information of the source data in the second time zone is determined.
[0040] 104. Extract the corresponding source data from the data collection table based on the time period information.
[0041] In this embodiment, the specified presentation time zone and specified query time period in the data retrieval request are converted into a time period corresponding to the time zone applied in the data acquisition table, such as the second time zone. Based on the converted time period information, the corresponding source data is extracted from the data acquisition table.
[0042] In this embodiment, a data retrieval request sent by the user is received, and the first time zone and query time period of the source data to be retrieved are determined based on the data retrieval request. It is then determined whether a data collection table with the first time zone as its timestamp exists in the cloud database. If not, the second time zone of the data collection table in the cloud database is determined, and the time period information of the source data in the second time zone is determined based on the first time zone, the second time zone, and the query time period. The corresponding source data is extracted from the data collection table based on the time period information. This method unifies the time zone stored in the data storage table by converting the time zone of the source data uploaded by the acquisition device, and converts the time zone and specified time period specified in the user's data retrieval request. This significantly reduces the configuration of data acquisition rules and ensures that customers in different time zones, both domestically and internationally, can obtain the most accurate device operation statistics.
[0043] Please see Figure 2 The second embodiment of the cross-time zone data processing method in this invention includes:
[0044] 201. Obtain the source data collected in real time by the acquisition device and the operating time zone of the acquisition device;
[0045] In this embodiment, the data collection rules can be customized according to different user requirements, and the collection frequency needs to be selected according to the required minimum granularity (minute, hour, day, week, month, year).
[0046] The data collection rules can be further divided into scheduled data collection rules and real-time data collection rules. The execution process of scheduled data collection rules is as follows: the server periodically queries the cloud database for source data reported by the device according to the time period configured in the data collection rules and stores it in the data collection table;
[0047] On the other hand, the execution process of real-time data collection rules is as follows: after the server parses the source data reported by the device, it directly stores it into the data collection table, and stores it once every time it is reported.
[0048] 202. Determine if the working time zone is the same as the second time zone of the cloud database;
[0049] In this embodiment, the working time zone of the data acquisition device is determined to see if the working time zone corresponding to the source data uploaded by the acquisition device is the same as the second time zone of the data acquisition table in the cloud database. If there are several data acquisition tables corresponding to different time zones in the cloud database, it is necessary to determine whether the working time zone of the acquisition device is the same as the time zone in any of the data acquisition tables.
[0050] 203. If not, convert the acquisition time of the source data to the time corresponding to the second time zone, and store the source data in the data storage table based on the converted time.
[0051] In this embodiment, if the working time zone is different from the second time zone corresponding to the data acquisition table, the acquisition time of the source data needs to be converted to the time zone applied in the data acquisition table. That is, the time zone information of the source data is converted to the time zone information of the second time zone corresponding to the data acquisition table. The source data converted to the second time zone as the timestamp is then stored in the data acquisition table that also uses the second time zone as the timestamp.
[0052] 204. Using the data collection table with the second time zone as the timestamp as the standard data table, the timestamps are converted based on the time difference between different time zones, and the source data is copied to obtain multiple data collection tables with different time zones.
[0053] In this embodiment, if there are several data acquisition tables, the data acquisition table with the second time zone as the timestamp is used as the standard data table. After the source data is processed by time zone conversion and stored in the standard data table, the source data in the standard data table is then processed by time zone conversion based on the time zone corresponding to the standard data table and the time zones corresponding to other data acquisition tables, so as to realize the storage of source data in several time zones in multiple data acquisition tables.
[0054] Preferably, the system can provide users with data collection tables in several time zones to store the source data uploaded by the device. The first time zone is the working time zone for the source data collected by the collection device; the second time zone is the time zone where the server performs unified storage and calculations; and the third time zone is the time zone specified by the user in the data retrieval request. For example, after the collection device collects a certain amount of source data in the first time zone, it sends it back to the server located in the second time zone, storing it with the second time zone as the timestamp. When a user in the third time zone initiates a data retrieval request to the collection device located in the first time zone, the server can provide data collection tables in the first, second, and third time zones respectively to process the source data, perform targeted calculations, and display the different calculation results of the source data in several time zones.
[0055] 205, Receive data retrieval requests sent by the user side;
[0056] 206. Determine if a data collection table with the first time zone as the timestamp exists in the cloud database;
[0057] 207. If a data collection table with the first time zone as the timestamp exists in the cloud database, then the first time zone is used as the retrieval index to query the corresponding data collection table from the cloud database.
[0058] In this embodiment, if a data collection table with the first time zone as the timestamp exists in the cloud database, or if the first time zone is the same as the second time zone, the source data is directly stored in the data collection table with the second time zone as the timestamp and the same as the first time zone.
[0059] 208. Extract the corresponding source data from the data collection table based on the query time period;
[0060] In this embodiment, the corresponding source data will be directly extracted from the data collection table by specifying the query time zone and query time period in the data retrieval request submitted by the user.
[0061] 209. If it does not exist, then determine the second time zone of the data collection table in the cloud database;
[0062] In this embodiment, if there is no second time zone that is the same as the user-specified time zone (i.e., the first time zone), the time zone difference between the specified time zone and the second time zone is calculated, and the first time zone and the specified query time period are converted into time period information corresponding to the second time zone under the server. The source data located in the second time zone and stored as timestamps in the data collection table are extracted from the server.
[0063] 210. Calculate the difference between the second time zone and the first time zone to obtain the time zone difference;
[0064] 211. Adjust the query time period based on the time zone difference to obtain the time period information under the second time zone;
[0065] 212. Extract the corresponding source data from the data collection table based on the time period information.
[0066] This embodiment, based on the previous embodiment, describes in detail the process of acquiring source data collected in real time by the acquisition device and the working time zone of the acquisition device; determining whether the working time zone is the same as the second time zone of the cloud database; if not, converting the acquisition time of the source data to the time corresponding to the second time zone, and storing the source data in the data storage table based on the converted time; using the data acquisition table with the second time zone as the timestamp as the standard data table, converting the timestamp based on the time difference of different time zones, and copying the source data to obtain multiple data acquisition tables with different time zones. Compared with traditional methods, this embodiment clarifies the specific methods for calling and calculating source data in the data storage table under the conditions of multiple time zones and a single time zone as the timestamp in the cloud database, realizing the specific application methods of source data when configuring single or multiple data acquisition tables under different conditions, and thereby achieving refined storage and calculation of source data.
[0067] Please see Figure 3 A third embodiment of the cross-time zone data processing method in this invention includes:
[0068] 301, Receive data retrieval request sent by the user side;
[0069] 302. Determine if a data collection table with the first time zone as the timestamp exists in the cloud database;
[0070] 303. If it does not exist, determine the second time zone of the data collection table in the cloud database, and determine the time period information of the source data in the second time zone based on the first time zone, the second time zone and the query time period.
[0071] 304, the corresponding source data is extracted from the data collection table based on the time period information;
[0072] 305, determine if the data retrieval request is the first request;
[0073] In this embodiment, when a user initiates a data retrieval request to the server, it is necessary to determine whether the data retrieval request is the first request, and to implement multiple processing methods for the data retrieval request.
[0074] 306. If so, obtain the data operation rules corresponding to the data retrieval request, and perform calculations on the source data based on the data operation rules to obtain statistical data.
[0075] In this embodiment, the source data has different time granularities. The server collects data at the minimum required granularity according to the actual situation. When the front end requests data, it only needs to include the customer's time zone. The back end can then filter out the data in the required time zone based on the front end's time zone parameters, calculate and store it, and then return it. This ensures that the data can be accurately calculated and returned to the customer even when the customer is in a different time zone.
[0076] Furthermore, the query command issued by the user also includes the user's time zone identification data, and the data stored in the database also matches the time zone data. When the user sends a query command, the query command also carries the user's time zone data. The database matches the user's time zone data with the user's time zone data stored in the database. When the user's time zone data matches, the data is called for calculation.
[0077] 307. Generate corresponding statistical charts based on statistical data according to a preset format;
[0078] 308. The system summarizes statistical charts and data to obtain statistical results and returns them to the user.
[0079] 309. Treat the data retrieval request as a historical data retrieval request and construct a mapping table with the statistical results;
[0080] In this embodiment, after returning the statistical results to the user, the data retrieval request and the corresponding statistical results should be stored. The data retrieval request and statistical results, as well as the mapping relationship between them, should be stored in a mapping table. The mapping table should be stored within the data statistics table. When there is a secondary data retrieval request, it is used to determine whether the corresponding statistical results in the mapping table can be reused.
[0081] 310. Store the mapping table in the data statistics table;
[0082] 311. If it is not the first request, then search the mapping table from the data statistics table to determine if there is a historical data retrieval request that is the same as the data retrieval request.
[0083] In this embodiment, it can be further divided into two application scenarios: the same user making two identical requests to the same device, and different users making two identical requests to the same device.
[0084] For example, two users, a and b, are bound to the same device c. User a retrieves device c's electricity consumption data for January via data retrieval request a1. User b retrieves device c's electricity consumption data for January via data retrieval request b1. The server compares requests a1 and b1; if the request content is the same, it matches the result of request a1 with request b1 and sends the result back to user b. Alternatively, user a is bound to device c. User a retrieves device c's electricity consumption data for January via data retrieval request a1 on the first day, and then retrieves the same data again via data retrieval request a2 on the second day. The server compares requests a1 and a2; if the request content is the same, it matches the results of requests a1 and a2 and sends the result back to user a.
[0085] 312. If it exists, then based on the mapping relationship of historical data retrieval requests in the mapping table, the corresponding statistical results will be returned to the user side.
[0086] 313. If it does not exist, the source data will be calculated based on the data operation rules, and the new statistical results will be returned to the user side after the calculation.
[0087] In this embodiment, if there is no data retrieval request that is the same as the historical data retrieval request, the source data is processed accordingly based on the process of steps 306 to 308.
[0088] This embodiment, based on the previous embodiment, describes in detail the process of determining whether a historical data retrieval request identical to the first request exists in the mapping table by searching the data statistics table if it is not the first request; if it exists, the corresponding statistical result is returned to the user based on the mapping relationship of the historical data retrieval requests in the mapping table; if it does not exist, the source data is calculated based on the data operation rules, and a new statistical result is returned to the user after the calculation. Compared with the traditional method, this embodiment refines the processing of secondary requests. By constructing a mapping table between the request and the result after each request, the calculation process is reduced and the server's operating efficiency is optimized when the same data is requested twice.
[0089] The cross-time zone data processing method in the embodiments of the present invention has been described above. The cross-time zone data processing apparatus in the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 4 One embodiment of the cross-time zone data processing device in this invention includes:
[0090] The request receiving module 401 is used to receive a data retrieval request sent by the user side, and determine the first time zone and query time period of the source data to be retrieved based on the data retrieval request.
[0091] The first time zone determination module 402 is used to determine whether a data collection table with the first time zone as the timestamp exists in the cloud database.
[0092] The time zone information determination module 403 is used to determine the second time zone of the data collection table in the cloud database if it does not exist, and to determine the time period information of the source data in the second time zone based on the first time zone, the second time zone and the query time period.
[0093] The source data return module 404 is used to extract the corresponding source data from the data collection table based on the time period information.
[0094] In this embodiment of the invention, the cross-time zone data processing device operates the aforementioned cross-time zone data processing method, including: receiving a data retrieval request sent by the user side, and determining the first time zone and query time period of the source data to be retrieved based on the data retrieval request; determining whether a data collection table with the first time zone as the timestamp exists in the cloud database; if not, determining the second time zone of the data collection table in the cloud database, and determining the time period information of the source data in the second time zone based on the first time zone, the second time zone, and the query time period; and extracting the corresponding source data from the data collection table based on the time period information. This method unifies the time zone stored in the data storage table by converting the time zone of the source data uploaded by the acquisition device, and converts the time zone and specified time period specified in the user-submitted data retrieval request. This significantly reduces the configuration of data acquisition rules and ensures that customers in different time zones at home and abroad can obtain the most accurate equipment operation statistics.
[0095] Please see Figure 5 A second embodiment of the cross-time zone data processing device in this invention includes:
[0096] The request receiving module 401 is used to receive a data retrieval request sent by the user side, and determine the first time zone and query time period of the source data to be retrieved based on the data retrieval request.
[0097] The first time zone determination module 402 is used to determine whether a data collection table with the first time zone as the timestamp exists in the cloud database.
[0098] The time zone information determination module 403 is used to determine the second time zone of the data collection table in the cloud database if it does not exist, and to determine the time period information of the source data in the second time zone based on the first time zone, the second time zone and the query time period.
[0099] The source data return module 404 is used to extract the corresponding source data from the data collection table based on the time period information.
[0100] In this embodiment, the cross-time zone data processing device further includes a multi-time zone storage module 405, which is specifically used for:
[0101] If a data collection table with the first time zone as the timestamp exists in the cloud database, then the first time zone is used as the retrieval index to query the corresponding data collection table from the cloud database; and the corresponding source data is extracted from the data collection table based on the query time period.
[0102] In this embodiment, the cross-time zone data processing device further includes a source data storage module 406, which is specifically used for:
[0103] The system acquires the source data collected in real time by the acquisition device and the working time zone of the acquisition device; it determines whether the working time zone is the same as the second time zone of the cloud database; if not, it converts the acquisition time of the source data to the time corresponding to the second time zone, and stores the source data in the data storage table based on the converted time; it uses the data acquisition table with the second time zone as the timestamp as the standard data table, converts the timestamp based on the time difference of different time zones, and copies the source data to obtain multiple data acquisition tables with different time zones.
[0104] In this embodiment, the time zone information determination module 403 is specifically used for:
[0105] Determine the second time zone of the data collection table in the cloud database; calculate the difference between the second time zone and the first time zone to obtain the time zone difference; adjust the query time period based on the time zone difference to obtain the time period information under the second time zone.
[0106] In this embodiment, the cross-time zone data processing device further includes a result output module 407, which is specifically used for:
[0107] The initial request determination unit 4071 determines whether the data retrieval request is the first request; the source data processing unit 4072, if so, obtains the data processing rules corresponding to the data retrieval request, and performs calculations on the source data based on the data processing rules to obtain statistical data; the statistical chart generation unit 4073 generates corresponding statistical charts based on the statistical data according to a preset format; the statistical result data unit 4074 summarizes the statistical charts and the statistical data to obtain statistical results, and returns the statistical results to the user side.
[0108] In this embodiment, the result output module further includes a result storage unit 4075, which is specifically used for:
[0109] The data retrieval request is treated as a historical data retrieval request, and a mapping table is constructed with the statistical results; the mapping table is stored in the data statistics table.
[0110] In this embodiment, the result output module further includes a result multiplexing unit 4076, which is specifically used for:
[0111] If it is not the first request, the system retrieves the mapping table from the data statistics table to determine if there is a historical data retrieval request that is the same as the data retrieval request. If there is, the corresponding statistical result is returned to the user side based on the mapping relationship of the historical data retrieval request in the mapping table. If there is no such request, the source data is calculated based on the data operation rules, and a new statistical result is returned to the user side after the calculation.
[0112] Based on the previous embodiment, this embodiment describes in detail the specific functions of each module and the unit composition of some modules. Through the above modules, the specific functions of the original modules are refined, the operation of the cross-time zone data processing device is improved, its operational reliability is enhanced, and the actual logic between each step is clarified, thereby improving the practicality of the device.
[0113] above Figure 4 and Figure 5 The cross-time zone data processing device in this embodiment of the invention will be described in detail from the perspective of modular functional entities. The cross-time zone data processing device in this embodiment of the invention will be described in detail from the perspective of hardware processing.
[0114] Figure 6 This is a schematic diagram of a cross-time zone data processing device 600 provided in an embodiment of the present invention. The cross-time zone data processing device 600 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 610 (e.g., one or more processors) and a memory 620, and one or more storage media 630 (e.g., one or more mass storage devices) for storing application programs 633 or data 632. The memory 620 and storage media 630 can be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module may include a series of request operations on the cross-time zone data processing device 600. Furthermore, the processor 610 may be configured to communicate with the storage media 630 and execute the series of request operations on the storage media 630 on the cross-time zone data processing device 600 to implement the steps of the aforementioned cross-time zone data processing method.
[0115] The cross-time zone data processing device 600 may also include one or more power supplies 640, one or more wired or wireless network interfaces 650, one or more input / output interfaces 660, and / or one or more operating systems 631, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 6The illustrated cross-time zone data processing device structure does not constitute a limitation on the cross-time zone data processing device provided in this application. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0116] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores a request that, when the request is executed on a computer, causes the computer to perform the steps of the cross-time zone data processing method.
[0117] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0118] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several requests to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0119] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for processing cross-time zone data, characterized in that, The cross-time zone data processing method includes: The cloud database stores data storage tables with timestamps in at least one time zone; Acquire the source data collected in real time by the acquisition device and the operating time zone of the acquisition device; Determine whether the working time zone is the same as the second time zone of the cloud database; If not, the acquisition time of the source data is converted to the time corresponding to the second time zone, and the source data is stored in the data storage table based on the converted time. Using the data collection table with the second time zone as the timestamp as the standard data table, the timestamp is converted based on the time difference between different time zones, and the source data is copied to obtain multiple data collection tables with different time zones; Receive a data retrieval request sent by the user, and determine the first time zone and query time period of the source data to be retrieved based on the data retrieval request; Determine whether a data collection table with the first time zone as the timestamp exists in the cloud database; If it does not exist, then determine the second time zone of the data collection table in the cloud database, and based on the first time zone, the second time zone and the query time period, determine the time period information of the source data in the second time zone; including determining the second time zone of the data collection table in the cloud database; calculating the difference between the second time zone and the first time zone to obtain the time zone difference; adjusting the query time period based on the time zone difference to obtain the time period information in the second time zone; Based on the time period information, extract the corresponding source data from the data collection table; If a data collection table with the first time zone as the timestamp exists in the cloud database, then the first time zone is used as the retrieval index to query the corresponding data collection table from the cloud database; Based on the query time period, the corresponding source data is extracted from the data collection table.
2. The cross-time zone data processing method according to claim 1, characterized in that, After extracting the corresponding source data from the data collection table based on the time period information, the method further includes: Determine whether the data retrieval request is the first request; If so, the data operation rules corresponding to the data retrieval request are obtained, and the source data is calculated based on the data operation rules to obtain statistical data. Based on the statistical data, corresponding statistical charts are generated according to a preset format; The statistical results are obtained by summarizing the statistical charts and statistics, and then the statistical results are returned to the user.
3. The cross-time zone data processing method according to claim 2, characterized in that, The cloud database also includes a data statistics table. After summarizing the statistical charts and statistics to obtain statistical results and returning the statistical data to the user side, the database further includes: The data retrieval request is treated as a historical data retrieval request, and a mapping table is constructed with the statistical results; Store the mapping table in a data statistics table.
4. The cross-time zone data processing method according to claim 3, characterized in that, After determining whether the data retrieval request is the first request, the process also includes: If it is not the first request, then the mapping table is searched from the data statistics table to determine whether there is a historical data retrieval request that is the same as the data retrieval request. If it exists, the corresponding statistical result will be returned to the user side based on the mapping relationship of the historical data retrieval request in the mapping table; If it does not exist, the source data is calculated based on the data operation rules, and a new statistical result is returned to the user side after the calculation.
5. A cross-time zone data processing device, characterized in that, The cross-time zone data processing device includes: The request receiving module is used to: store data storage tables in a cloud database that use at least one time zone as timestamp; acquire source data collected in real time by a collection device and the working time zone of the collection device; determine whether the working time zone is the same as the second time zone of the cloud database; if not, convert the collection time of the source data to the time corresponding to the second time zone, and store the source data in the data storage table based on the converted time; use the data collection table with the second time zone as timestamp as a standard data table, convert the timestamp based on the time difference of different time zones, and copy the source data to obtain multiple data collection tables with different time zones; receive data retrieval requests sent by the user side, and determine the first time zone and query time period of the source data to be retrieved based on the data retrieval request; The first time zone determination module is used to determine whether a data collection table with the first time zone as the timestamp exists in the cloud database. The time zone information determination module is used to determine the second time zone of the data collection table in the cloud database if it does not exist, and to determine the time period information of the source data in the second time zone based on the first time zone, the second time zone, and the query time period; including determining the second time zone of the data collection table in the cloud database; calculating the difference between the second time zone and the first time zone to obtain the time zone difference; and adjusting the query time period based on the time zone difference to obtain the time period information in the second time zone; The source data return module is used to extract the corresponding source data from the data collection table based on the time period information; if a data collection table with the first time zone as the timestamp exists in the cloud database, the corresponding data collection table is queried from the cloud database using the first time zone as the retrieval index; and the corresponding source data is extracted from the data collection table based on the query time period.
6. A cross-time zone data processing device, characterized in that, The cross-time zone data processing device includes: a memory and at least one processor, wherein the memory stores requests, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the request in the memory to cause the cross-time zone data processing device to perform the steps of the cross-time zone data processing method as described in any one of claims 1-4.
7. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the various steps of the cross-time zone data processing method as described in any one of claims 1-4.