Time data processing method, device, computing equipment and storage medium

By converting time periods into element sets and comparing, the problem of the time period cannot be determined in the prior art, and the effect of improving user experience and processing speed is achieved.

CN114064761BActive Publication Date: 2025-05-09BEIJING ANTIY NETWORK SAFETY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111399831.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-19
Publication Date
2025-05-09
Estimated Expiration
2041-11-19

AI Technical Summary

Technical Problem

The prior art cannot determine the overlapping time period of time period, resulting in poor user experience.

Method used

Determine the overlapping time period by converting the time period to be added and the time period added to the element set and comparing whether the same element exists in the two sets.

Benefits of technology

In the process of judging whether the time period overlaps, the overlapping time period can be determined at the same time to improve user experience and processing speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064761B_ABST
    Figure CN114064761B_ABST
Patent Text Reader

Abstract

The present invention provides a time data processing method, device, computing equipment and storage medium, wherein the method comprises: obtaining a time period to be added; determining an already added time period according to the time period to be added; performing element conversion on the time period to be added and the already added time period respectively to obtain a corresponding set of elements to be added and a set of elements to be added; determining whether the set of elements to be added and the set of elements to be added have the same elements, and determining an overlapping time period according to the determination result. This solution can simultaneously determine the overlapping time period in the process of determining whether two time periods have an overlapping time period, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of data processing technology, and in particular to a time data processing method, apparatus, computing device and storage medium. Background Art

[0002] In some application scenarios, adding time periods is often involved. When adding a time period, it is necessary to determine whether it overlaps with the set time period to verify the correctness of the time data. At present, it is generally determined whether two time periods overlap by comparing whether the start time and / or end time of one time period is between the start time and end time of another time period. However, this method can only determine whether there is an overlap, but cannot determine the overlapping time period, resulting in a poor user experience. Summary of the invention

[0003] Based on the problem in the prior art that the overlapping time periods cannot be determined, resulting in poor user experience, the embodiments of the present invention provide a time data processing method, apparatus, computing device and storage medium, which can determine the overlapping time periods to improve the user experience.

[0004] In a first aspect, an embodiment of the present invention provides a time data processing method, including:

[0005] Get the time period to be added;

[0006] Determine the added time period according to the time period to be added;

[0007] Perform element conversion on the time period to be added and the time period already added respectively to obtain a corresponding set of elements to be added and a set of elements already added;

[0008] Determine whether the to-be-added element set and the added element set have the same elements, and determine the overlapping time period according to the determination result.

[0009] Preferably, determining the added time period according to the time period to be added includes: determining the added time period that belongs to the same day as the time period to be added.

[0010] Preferably, before performing element conversion on the time period to be added and the time period already added, the method further includes: constructing an element library, wherein the element library includes a plurality of elements;

[0011] The performing element conversion on the time period to be added and the time period already added respectively includes:

[0012] Determine the time points respectively included in the time period to be added and the time period already added according to the preset time division granularity;

[0013] Determine that each time point corresponds to an element in the element library, and convert each time point into a corresponding element.

[0014] Preferably, the time division granularity is hours or minutes.

[0015] Preferably, the plurality of elements in the element library have an arrangement order;

[0016] The determining that each time point corresponds to an element in the element library includes:

[0017] Determine the distance of each time point from the initial time point;

[0018] Determine the arrangement position of the element corresponding to each time point in the element library according to the distance between each time point and the initial time point and the arrangement order;

[0019] The elements at the corresponding arrangement positions in the element library are determined as the elements at the corresponding time points.

[0020] Preferably, the determining whether there are identical elements in the set of elements to be added and the set of elements already added comprises:

[0021] Determine the lengths of the to-be-added element set and the added element set respectively;

[0022] Traverse each target element in the shorter element set, determine whether the target element is included in the longer element set, and if so, add the target element to the repeated element set;

[0023] Determine whether the set of repeated elements is empty. If so, determine that the set of elements to be added and the set of elements already added do not have identical elements. If not, determine that the set of elements to be added and the set of elements already added have identical elements.

[0024] Preferably, determining the overlapping time period according to the determination result includes:

[0025] If the determination result is that the same element exists, the time point corresponding to the same element is determined as the overlapping time point, and the overlapping time period is determined according to the overlapping time point.

[0026] In a second aspect, an embodiment of the present invention further provides a time data processing device, including:

[0027] A time period acquisition unit, used to acquire a time period to be added, and determine an added time period according to the time period to be added;

[0028] An element conversion unit, used to perform element conversion on the time period to be added and the time period already added, respectively, to obtain a corresponding set of elements to be added and a set of elements already added;

[0029] The overlap time period determination unit is used to determine whether there are identical elements in the set of elements to be added and the set of elements that have been added, and determine the overlap time period according to the determination result.

[0030] In a third aspect, an embodiment of the present invention further provides a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of this specification is implemented.

[0031] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method described in any embodiment of this specification.

[0032] The embodiment of the present invention provides a time data processing method, apparatus, computing device and storage medium, which determines whether the two time periods have overlapping time periods by converting the time period to be added and the time period that has been added into elements, and by determining whether there are the same elements in the two element sets obtained. It can be understood that the time period corresponding to the same element is the overlapping time period. It can be seen that this solution can determine the overlapping time period while determining whether the two time periods have overlapping time periods, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 is a flow chart of a time data processing method provided by one embodiment of the present invention;

[0035] Figure 2 is a flow chart of an element conversion method provided by an embodiment of the present invention;

[0036] Figure 3 is a hardware architecture diagram of a computing device provided by an embodiment of the present invention;

[0037] Figure 4 is a structural diagram of a time data processing device provided by an embodiment of the present invention;

[0038] Figure 5 It is a structural diagram of another time data processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0040] As mentioned above, the method of determining whether two time periods overlap by comparing whether the start time and / or end time of one time period is between the start time and end time of another time period can only determine whether there is an overlap, but cannot determine the overlapping time period, resulting in a poor user experience. If the overlapping time period can be directly determined in the process of determining whether the time periods overlap, not only can the processing speed be improved, but the user experience can also be greatly improved. Based on this, it can be considered to take the time point within the time period as an element, and determine whether the two time periods overlap by comparing whether they have the same elements, and when it is determined that they have the same elements, the time point corresponding to the same element is the overlapping time point. In this way, the overlapping time period can be directly determined in the process of determining whether two time periods have an overlapping time period.

[0041] The specific implementation of the above concept is described below.

[0042] Please refer to Figure 1 , an embodiment of the present invention provides a time data processing method, the method comprising:

[0043] Step 100, obtaining the time period to be added;

[0044] Step 102, determining the added time period according to the time period to be added;

[0045] Step 104, performing element conversion on the time period to be added and the time period already added, respectively, to obtain a corresponding set of elements to be added and a set of elements already added;

[0046] Step 106: determine whether there are identical elements in the set of elements to be added and the set of elements already added, and determine the overlapping time period according to the determination result.

[0047] In the embodiment of the present invention, by converting the time period to be added and the time period that has been added into elements, and determining whether the two time periods have overlapping time periods by determining whether the same elements exist in the two element sets obtained, it can be understood that the time period corresponding to the same elements is the overlapping time period. It can be seen that in the process of determining whether the two time periods have overlapping time periods, the overlapping time period can be determined at the same time, thereby improving the user experience.

[0048] Described below Figure 1 How the various steps are performed.

[0049] First, step 100 “obtaining a time period to be added” and step 102 “determining an added time period according to the time period to be added” are described simultaneously.

[0050] In a scenario where multiple time periods need to be added, time periods can be added as needed. For example, the operating time period of a certain device can be set as needed. In an embodiment of the present invention, the time period setting can be a periodic setting or a non-periodic setting. When it is a periodic setting, the cycle can be a day, a week, a month, etc. As an example, assuming that the operating time period of the device has been set as follows: Monday 0-6 o'clock, 12-14 o'clock, 2-24 o'clock, Tuesday 0-2 o'clock, 8-12 o'clock, Wednesday... It can be understood that these set time periods are added time periods.

[0051] In the embodiment of the present invention, the time period to be added is a time period newly set by the user according to the needs. For example, the time period to be added is 4-10 o'clock on Monday.

[0052] If the time period to be added overlaps with the time period already added, then during the operation, the existence of the overlapping time period may cause operation data errors, so it is necessary to compare whether the time period to be added overlaps with the time period already added.

[0053] In this step 102, when determining the added time period, all the currently set time periods can be determined as the added time period. However, considering that some of the set time periods do not belong to the same day as the time period to be added, these time periods that do not belong to the same day as the time period to be added must not have overlapping time periods with the time period to be added. Therefore, in one embodiment of the present invention, in order to reduce the amount of calculation, when determining the added time period for comparison with the time period to be added, this step 102 may include: determining the added time period that belongs to the same day as the time period to be added.

[0054] According to the above example, the time period to be added is Monday 4-10 o'clock, then the added time periods belonging to the same day as the time period to be added are Monday 0-6 o'clock, 12-14 o'clock, and 22-24 o'clock.

[0055] Then, for step 104, the time period to be added and the time period already added are respectively converted into elements to obtain a corresponding set of elements to be added and a set of elements already added.

[0056] In one embodiment of the present invention, please refer to Figure 2 , this step 104 may include steps 200-202:

[0057] Step 200: determining the time points respectively included in the time period to be added and the time period already added according to the preset time division granularity.

[0058] The time division granularity may be hours, minutes, or seconds. Preferably, the time division granularity is hours or minutes.

[0059] In one embodiment of the present invention, the unit of the time point determined in step 200 is the same as the unit of the time division granularity. If the time division granularity is hour, the time points respectively included in the time period to be added and the time period already added in step 200 are determined in hours; if the time division granularity is minute, the time points respectively included in the time period to be added and the time period already added in step 200 are determined in minutes.

[0060] For example, when the time division granularity is hours, the time points included in the time period to be added from 4 to 10 o'clock are: 4 o'clock, 5 o'clock, 6 o'clock, 7 o'clock, 8 o'clock, 9 o'clock and 10 o'clock. When the time division granularity is minutes, the time points included in the time period to be added from 4 to 10 o'clock are: 4:00, 4:01, 4:02, ..., 10:59.

[0061] In the embodiment of the present invention, the finer the time division granularity, the more configurable situations there are when setting the time period, the more time points included in the time period, and correspondingly the greater the amount of calculation in determining the overlapping time periods. Most preferably, the time division granularity is minutes, so that the number of time points included in the time period and the amount of calculation in determining the overlapping time periods are both at an optimal stage.

[0062] In one embodiment of the present invention, in order to realize the element conversion of the time period, an element library can be pre-built, and the element library includes multiple elements. The elements are objects that constitute a set, which can be numbers or characters.

[0063] The elements included in the constructed element library need to be able to cover all time points included in the set time period. The set time period can be determined based on a time period that has a comparative significance between the time period to be added and the time period that has been added. According to step 102, the time period that has been added and belongs to the same day as the time period to be added has a comparative significance with the time period to be added. Therefore, the set time period is a time period corresponding to a natural day, that is, 00:00-24:00.

[0064] Taking the time division granularity as hours as an example, for the time period 00:00-24:00 corresponding to a natural day, the time points included therein are 0 o'clock, 1 o'clock, 2 o'clock, ... 23 o'clock, a total of 24 time points, so the element library includes at least 24 elements.

[0065] Step 202: determine the element in the element library corresponding to each time point, and convert each time point into a corresponding element.

[0066] In one embodiment of the present invention, in order to facilitate element conversion, the element library may be processed in the following two ways:

[0067] Method 1: multiple elements in the element library are arranged in order;

[0068] Method 2: establishing a corresponding relationship between time points and elements for multiple elements in the element library.

[0069] When the element library is processed in the above-mentioned different ways, the implementation methods of step 202 are different. The above-mentioned two ways are respectively described below.

[0070] In method 1, multiple elements in the element library are arranged in order. When the elements are numbers, they can be arranged in order of numbers, such as 1, 2, 3...; when the elements are characters, they can be arranged in a set order, such as a, b, c,...

[0071] In method one, this step 202 of determining the elements in the element library corresponding to each time point may include: determining the distance between each time point and the initial time point; determining the arrangement position of the element corresponding to each time point in the element library based on the distance between each time point and the initial time point and the arrangement order; and determining the element at the corresponding arrangement position in the element library as the element of the corresponding time point.

[0072] The initial time point is the time point at the front of the set time period. In this embodiment, the set time period is 00:00-24:00, so the initial time point is 00:00.

[0073] Continuing to explain the time period to be added in the above example, for each of the time points "4 o'clock, 5 o'clock, 6 o'clock, 7 o'clock, 8 o'clock, 9 o'clock and 10 o'clock" included in the time period to be added 4-10 o'clock, for example, the time point 4 o'clock, the distance between the time point 4 o'clock and the initial time point 00:00 is 4, then the arrangement position of the element corresponding to the time point 4 o'clock in the element library is the 5th (4+1) element, for example, the 5th element is the number 5, then the time point 4 o'clock is converted to element 5.

[0074] Similarly, if the time division granularity is minutes, the distance between time point 4 and the initial time point 00:00 is 240, then the arrangement position of the element corresponding to time point 4 in the element library is the 241st (240+1)th element. For example, if the 241st element is the number 241, then the time point 4 is converted to element 241.

[0075] In the first method, the data stored locally only includes multiple elements in the element library, and occupies less space.

[0076] In method 2, a correspondence between time points and elements is established for multiple elements in the element library. Similarly, a correspondence between time points and elements within a set time period is established. For example, the correspondence includes: time point 00:00 corresponds to element 1, time point 01:00 corresponds to element 2, time point 02:00 corresponds to element 3, ..., time point 23:00 corresponds to element 24.

[0077] In the second method, this step 202 can directly determine the element corresponding to each time point by searching the corresponding relationship.

[0078] In the second method, by establishing a correspondence between a time point and an element, the element corresponding to each time point can be determined by directly searching the correspondence, which can improve the element conversion speed.

[0079] It should be noted that in addition to constructing an element library and using the element library to perform element conversion in the above method for realizing element conversion, other methods can also be used, such as presetting element conversion rules and using the element conversion rules to perform element conversion. When performing element conversion according to the element conversion rule, the element is a number, and the element conversion rule is: the distance between each time point and the initial time point is determined as the element of the time point.

[0080] Finally, for step 106, it is determined whether there are identical elements in the set of elements to be added and the set of elements already added, and the overlapping time period is determined according to the determination result.

[0081] In the embodiment of the present invention, in step 106, it is determined whether there are identical elements in the to-be-added element set and the added element set, and the two element sets may be directly traversed to compare whether there are identical elements.

[0082] In order to improve the speed of determining the same elements, in one embodiment of the present invention, determining whether there are the same elements in the set of elements to be added and the set of elements that have been added in this step 106 may include: determining the lengths corresponding to the set of elements to be added and the set of elements that have been added respectively; traversing each target element in the set of elements with a shorter length, and determining whether the set of elements with a longer length includes the target element, and if so, adding the target element to the set of repeated elements; determining whether the set of repeated elements is empty, and if so, determining that there are no identical elements in the set of elements to be added and the set of elements that have been added, and if not, determining that there are identical elements in the set of elements to be added and the set of elements that have been added.

[0083] The length of the element set can be the number of elements included in the element set. For example, if the length of the element set to be added is 7 and the length of the element set already added is 12, then each element in the element set to be added can be traversed, and each traversed element can be used as a target element to determine whether the target element is included in the element set already added. In this way, only traversal is required 7 times, and the element set already added is determined 7 times to complete the comparison of the two sets. This method has a low computational complexity and a fast computational speed.

[0084] In one embodiment of the present invention, determining the overlapping time period according to the determination result in step 106 may include: if the determination result is that the same element exists, then determining the time point corresponding to the same element as the overlapping time point, and determining the overlapping time period according to the overlapping time point.

[0085] For example, if the elements included in the overlapping element set are 5 and 6, then when the elements are converted into time points, the converted time points are time point 4 o'clock and time point 5 o'clock, and the overlapping time period is 04:00-06:00.

[0086] When it is determined that the time period to be added overlaps with the time period already added, the user may be prompted that there is an overlapping time period and / or which time period the overlapping time period is, thereby instructing the user to modify the time period to be added.

[0087] like Figure 3 , Figure 4 As shown, an embodiment of the present invention provides a time data processing device. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, Figure 3FIG. 1 is a hardware architecture diagram of a computing device where a time data processing device provided by an embodiment of the present invention is located, except Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown in the figure, the computing device in which the device is located in the embodiment may also generally include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, Figure 4 As shown, as a device in a logical sense, the CPU of the computing device in which it is located reads the corresponding computer program in the non-volatile memory into the memory and runs it. This embodiment provides a time data processing device, including:

[0088] The time period acquisition unit 401 is used to acquire the time period to be added, and determine the added time period according to the time period to be added;

[0089] An element conversion unit 402 is used to perform element conversion on the time period to be added and the time period already added, respectively, to obtain a corresponding set of elements to be added and a set of elements already added;

[0090] The overlap time period determination unit 403 is used to determine whether there are identical elements in the to-be-added element set and the added element set, and determine the overlap time period according to the determination result.

[0091] In one embodiment of the present invention, when determining the added time period according to the time period to be added, the time period acquisition unit 401 is specifically configured to determine the added time period that belongs to the same day as the time period to be added.

[0092] In one embodiment of the present invention, please refer to Figure 5 , the time data processing device may also include:

[0093] An element library construction unit 404 is used to construct an element library, wherein the element library includes a plurality of elements;

[0094] The element conversion unit 402 is specifically used to determine the time points included in the to-be-added time period and the added time period according to the preset time division granularity; determine that each time point corresponds to an element in the element library, and convert each time point into a corresponding element.

[0095] In one embodiment of the present invention, the time division granularity is hours or minutes.

[0096] In one embodiment of the present invention, the plurality of elements in the element library have an arrangement order;

[0097] When determining that each time point corresponds to an element in the element library, the element conversion unit 402 is specifically used to determine the distance between each time point and the initial time point; determine the arrangement position of the element corresponding to each time point in the element library based on the distance between each time point and the initial time point and the arrangement order; and determine the element at the corresponding arrangement position in the element library as the element of the corresponding time point.

[0098] In one embodiment of the present invention, when determining whether there are identical elements in the set of elements to be added and the set of elements that have been added, the overlapping time period determination unit 403 is specifically used to determine the lengths corresponding to the set of elements to be added and the set of elements that have been added respectively; traverse each target element in the set of elements with a shorter length, and determine whether the set of elements with a longer length includes the target element, and if so, add the target element to the set of repeated elements; determine whether the set of repeated elements is empty, and if so, determine that there are no identical elements in the set of elements to be added and the set of elements that have been added, and if not, determine that there are identical elements in the set of elements to be added and the set of elements that have been added.

[0099] In one embodiment of the present invention, when determining the overlapping time period based on the determination result, the overlapping time period determination unit 403 is specifically used to determine the time point corresponding to the same element as the overlapping time point if the determination result is that the same element exists, and determine the overlapping time period based on the overlapping time point.

[0100] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on a time data processing device. In other embodiments of the present invention, a time data processing device may include more or fewer components than those illustrated, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0101] The information interaction, execution process and other contents between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention. For the specific contents, please refer to the description in the embodiment of the method of the present invention, and no further description is given here.

[0102] An embodiment of the present invention further provides a computing device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, a time data processing method in any embodiment of the present invention is implemented.

[0103] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the processor executes a time data processing method in any embodiment of the present invention.

[0104] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.

[0105] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.

[0106] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.

[0107] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.

[0108] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.

[0109] Each embodiment of the present invention has at least the following beneficial effects:

[0110] 1. In one embodiment of the present invention, by converting the time period to be added and the time period that has been added into elements, and determining whether the two time periods have overlapping time periods by determining whether there are identical elements in the two element sets obtained, it is determined that the time period corresponding to the identical elements is the overlapping time period. It can be seen that this solution can simultaneously determine the overlapping time period in the process of determining whether the two time periods have overlapping time periods, thereby improving the user experience.

[0111] 2. In one embodiment of the present invention, some of the time periods that have been set do not belong to the same day as the time period to be added. In this case, these time periods that do not belong to the same day as the time period to be added must not have overlapping time periods with the time period to be added. Based on this, when determining the added time period, the added time period that belongs to the same day as the time period to be added is determined, and the set time periods that do not belong to the same day as the time period to be added can be screened out, thereby reducing the amount of comparison with the time period to be added, thereby reducing the amount of calculation.

[0112] 3. In one embodiment of the present invention, the finer the time division granularity, the more configurable situations there are when setting the time period, the more time points included in the time period, and correspondingly the greater the amount of calculation in determining the overlapping time periods. Most preferably, the time division granularity is minutes, so that the number of time points included in the time period and the amount of calculation in determining the overlapping time periods are both at an optimal stage.

[0113] 4. In one embodiment of the present invention, multiple elements in the element library are arranged in an arrangement order. When determining the element in the element library corresponding to each time point, the corresponding element of each time point is determined based on the distance between each time point and the initial time point and the arrangement order of the elements in the element library. In this way, the data stored locally only includes multiple elements in the element library, and occupies less space.

[0114] 5. In one embodiment of the present invention, by establishing a correspondence between time points and elements for multiple elements in the element library, when determining the element in the element library corresponding to each time point, the correspondence can be directly searched to determine the element corresponding to each time point, which can improve the element conversion speed.

[0115] 6. In one embodiment of the present invention, by determining the lengths of two element sets, the element set with a shorter length is traversed, and for each target element traversed, it is determined whether the target element is included in the element set with a longer length, so as to determine whether the two element sets have the same set. In this way, the number of determinations is the length of the element set with a shorter length, so the amount of calculation is lower and the calculation speed is faster.

[0116] It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical factors in the process, method, article or device including the elements.

[0117] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A time data processing method, characterized in that: include: Constructing an element library, wherein the element library includes a plurality of elements; the plurality of elements in the element library have an arrangement order; the elements included in the constructed element library need to be able to cover all time points included in a set time period; the set time period may be determined based on a time period that has a comparative significance between the time period to be added and the time period that has been added; Get the time period to be added; Determine the added time period according to the time period to be added; According to the preset time division granularity, determine the time points included in the time period to be added and the time period already added respectively; determine the element in the element library corresponding to each time point, and convert each time point into a corresponding element to obtain a corresponding set of elements to be added and a set of elements already added; Determine whether there are identical elements in the set of elements to be added and the set of elements that have been added, and determine an overlapping time period according to the determination result; Determining that each time point corresponds to an element in the element library includes: determining a distance between each time point and an initial time point; According to the distance between each time point and the initial time point and the arrangement order, the arrangement position of the element corresponding to each time point in the element library is determined; the element at the corresponding arrangement position in the element library is determined as the element of the corresponding time point; the initial time point is the frontmost time point in the set time period.

2. The method according to claim 1, characterized in that Determining the added time period according to the time period to be added includes: determining the added time period that belongs to the same day as the time period to be added.

3. The method according to claim 1, characterized in that The time division granularity is hours or minutes.

4. The method according to claim 1, characterized in that: The determining whether the to-be-added element set and the added element set have the same elements comprises: Determine the lengths of the to-be-added element set and the added element set respectively; Traverse each target element in the shorter element set, determine whether the target element is included in the longer element set, and if so, add the target element to the repeated element set; Determine whether the set of repeated elements is empty. If so, determine that the set of elements to be added and the set of elements already added do not have identical elements. If not, determine that the set of elements to be added and the set of elements already added have identical elements.

5. The method according to any one of claims 1 to 4, characterized in that: Determining the overlapping time period according to the determination result includes: If the determination result is that the same element exists, the time point corresponding to the same element is determined as the overlapping time point, and the overlapping time period is determined according to the overlapping time point.

6. A time data processing device, characterized in that: include: An element library construction unit is used to construct an element library, wherein the element library includes a plurality of elements; the plurality of elements in the element library have an arrangement order; the elements included in the constructed element library need to be able to cover all time points included in a set time period; the set time period can be determined based on a time period that has a comparative significance between the time period to be added and the time period that has been added; A time period acquisition unit, used to acquire a time period to be added, and determine an added time period according to the time period to be added; An element conversion unit is used to determine the time points included in the time period to be added and the time period to be added according to the preset time division granularity; determine the element in the element library corresponding to each time point, and convert each time point into a corresponding element to obtain a corresponding set of elements to be added and a set of elements to be added; An overlap time period determination unit, used to determine whether the set of elements to be added and the set of elements already added have the same elements, and determine the overlap time period according to the determination result; When determining that each time point corresponds to an element in the element library, the element conversion unit is specifically used to determine the distance between each time point and the initial time point; determine the arrangement position of the element corresponding to each time point in the element library according to the distance between each time point and the initial time point and the arrangement order; determine the element at the corresponding arrangement position in the element library as the element of the corresponding time point; the initial time point is the frontmost time point in the set time period.

7. A computing device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for calculating number of duplicate users of IPTV

    CN107948738A

  • Video analysis method and device, computer equipment and storage medium

    CN112650880A