CN115640469B - Activity duration calculation method and device, electronic equipment and storage medium - Google Patents

Activity duration calculation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115640469B
CN115640469B CN202211376998.6A CN202211376998A CN115640469B CN 115640469 B CN115640469 B CN 115640469B CN 202211376998 A CN202211376998 A CN 202211376998A CN 115640469 B CN115640469 B CN 115640469B
Authority
CN
China
Prior art keywords
state change
time
change information
duration
condition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211376998.6A
Other languages
Chinese (zh)
Other versions
CN115640469A (en
Inventor
于志杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Bailong Mayun Technology Co ltd
Original Assignee
Beijing Bailong Mayun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Bailong Mayun Technology Co ltd filed Critical Beijing Bailong Mayun Technology Co ltd
Priority to CN202211376998.6A priority Critical patent/CN115640469B/en
Publication of CN115640469A publication Critical patent/CN115640469A/en
Application granted granted Critical
Publication of CN115640469B publication Critical patent/CN115640469B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Traffic Control Systems (AREA)

Abstract

The invention discloses an activity duration calculation method, an activity duration calculation device, electronic equipment and a storage medium, wherein the method comprises the following steps: sequencing the acquired state change information of different classes of drivers in one period according to a time sequence to obtain a time sequence state change list; traversing the time sequence state change list in sequence, and subtracting the starting time from the ending time to obtain effective duration; the starting time represents the time corresponding to the last state change information in the state change information meeting the calculation conditions in different continuous categories; the ending time is used for representing the time corresponding to the state change information which does not meet the condition next to the last state change information as the ending time; repeating the steps, and under the condition that the time sequence state change list is traversed, carrying out accumulated operation on the effective duration to obtain the activity duration. The technical scheme provided by the invention can improve the accuracy of calculating the activity duration of the driver under the constraint of the set condition.

Description

Activity duration calculation method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of big data, in particular to an activity duration calculation method, an activity duration calculation device, electronic equipment and a storage medium.
Background
The network taxi company/taxi company needs to make a certain calculation on the effective activity duration of the driver accessing the platform of the company. The effective activity duration can comprise the state information of a ticket of a driver, the information of the delivery and receiving of the driver, whether the driver is in the range of an electronic fence or not and the like. In the prior art, the calculation mode of the effective duration of the driver is to realize consumption and pre-calculation of different message contents at the minute level according to the timing task, and store the calculation result for inquiry. However, this solution depends strongly on the stability of the timing task, and for the situations of mq delay, backlog, disorder, etc., errors occur in the state of a certain minute, so that all errors are calculated in the subsequent time period, and recovery is difficult.
Disclosure of Invention
In view of the above, the embodiment of the invention provides a method, a device, an electronic device and a storage medium for calculating the activity duration, which can improve the accuracy of counting the activity duration of a driver to a certain extent.
In one aspect, the present invention provides a method for calculating an activity duration, where the method includes: sequencing the acquired state change information of different classes of drivers in one period according to a time sequence to obtain a time sequence state change list; traversing the time sequence state change list in sequence, and subtracting the starting time from the ending time to obtain effective duration; the starting time represents the time corresponding to the last state change information in the state change information meeting the calculation conditions in different continuous categories; the ending time is used for representing the time corresponding to the state change information which does not meet the condition next to the last state change information as the ending time; repeating the steps, and under the condition that the time sequence state change list is traversed, carrying out accumulated operation on the effective duration to obtain the activity duration.
In one embodiment, the method for calculating the activity duration further includes: if two or more pieces of same state change information continuously appear in the time sequence state change list, the first piece of state change information is reserved in the time sequence state change list, and duplicate removal processing is carried out on the state change information.
In one embodiment, the categories of the status information of the different categories include at least two categories: the driver listens to the state information, the driver position information and the driver gets out and receives the vehicle information; the driver ticket state information comprises a real-time ticket state, a reservation ticket state and a full-listening state; the driver position information includes being within and outside the electronic fence range; the driver vehicle-out and vehicle-in information comprises a vehicle-out state and a vehicle-in state.
In one embodiment, the method for calculating the activity duration further includes: if the state change information of different types appearing for the first time in the time sequence state change list does not meet the time length calculation condition, and the time corresponding to the state change information is different from the starting time of the period, setting the state change information of the starting time as the state change information meeting the time length calculation condition of different types, and adding the state change information into the time sequence state change list.
In one embodiment, the method for calculating the activity duration further includes: if the state change information of different types in the last occurrence of the time sequence state change type meets the time length calculation condition and the corresponding time of the state change information is different from the ending time of the period, setting the state change information of the ending time as the state change information which does not meet the time length calculation condition of different types, and adding the state change information into the time sequence state change list.
In one embodiment, the method for calculating the activity duration further includes: acquiring state change information of different classes of drivers according to set time intervals; and storing the state change information and the time corresponding to the state change information into a message middleware in a key-value pair mode under the condition that the state change information of different types is changed compared with the previous moment.
In one embodiment, the method for calculating the activity duration further includes: and if the time corresponding to the state change information is earlier than the time corresponding to the previous state change information, regenerating the state change information of the driver, and storing the state change information and the time corresponding to the state change information into the message middleware in a key-value pair mode.
The invention also provides an activity duration calculating device, which comprises: the time sequence state change list generation unit is used for sequencing the acquired state change information of different classes of drivers in one period according to the time sequence to obtain a time sequence state change list; the effective active duration calculation unit is used for traversing the time sequence state change list in sequence and subtracting the starting time from the ending time to obtain effective duration; the starting time represents the time corresponding to the last state change information in the state change information meeting the calculation conditions in different continuous categories; the ending time is used for representing the time corresponding to the state change information which does not meet the condition next to the last state change information as the ending time; and the active duration accumulating unit is used for repeating the steps, and accumulating the effective duration under the condition that the time sequence state change list is traversed, so as to obtain the active duration.
The invention also provides an electronic device, which comprises a processor and a memory, wherein the memory is used for storing a computer program, and the computer program realizes the method for calculating the activity duration when being executed by the processor.
The invention also provides a computer readable storage medium for storing a computer program, which when executed by a processor, implements the method for calculating the activity duration.
The time sequence state change list is obtained by projecting the driver state change information of different categories onto a time axis according to time sequence, then the continuous each category meets the duration calculation condition as the starting time, the next condition which does not meet the duration calculation condition is used as the ending time and is used as one effective duration, and the effective duration is accumulated and calculated until the time sequence state change list is traversed to be completed, so that the driver activity duration is obtained, and the accuracy of calculating the driver activity duration can be improved to a certain extent.
Drawings
The features and advantages of the present invention will be more clearly understood by reference to the accompanying drawings, which are illustrative and should not be construed as limiting the invention in any way, in which:
FIG. 1 is a flow chart of a method for calculating an activity duration according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an activity duration calculation device according to an embodiment of the present invention;
fig. 3 shows a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments, based on the embodiments of the invention, which a person skilled in the art would obtain without making any inventive effort, are within the scope of the invention.
In some cases, the network taxi/taxi company needs to count the activity duration of the driver operating through its own platform under specific conditions, so as to give the driver corresponding subsidy or rewards. In the prior art, a common method for calculating the activity duration of a driver obtains corresponding state information of the driver under different conditions once every a period of time, stores the period of time and performs accumulated pre-calculation under the condition that all conditions are met, and stores the calculation result, so that the calculation result is provided for relevant responsible persons of network taxi-taking/taxi companies for inquiry. However, this approach relies strongly on the stability of the timed task output, once a certain period of time has occurred the loss of a status point or the delay of data due to network reasons, so that the subsequent time period is totally erroneous in calculation and difficult to recover. On the other hand, the whole data calculation process has longer links, and more dependent middleware, such as a task timer schedule, a message middleware mq and an information storage middleware mysql, redis, es, hbase, increase difficulty in ensuring high availability of the whole system. And the cost of the whole system is high. Therefore, it is necessary to construct an activity duration query system that is not prone to errors.
Referring to fig. 1, a method for calculating an activity duration according to an embodiment of the present application may include the following steps.
S110: and sequencing the acquired state change information of different classes of drivers in one period according to the time sequence to obtain a time sequence state change list.
In this embodiment, in order to calculate the effective activity duration of the taxi/internet taxi driver in a certain time range, the cumulative calculation needs to be performed according to the driver state change information, so that the state change information of different types of drivers can be stored in a driver state change information list according to time sequence. Specifically, for example, the effective working time of a driver in one day needs to be counted, wherein the state change information of the driver comprises 1:00, and the vehicle is received; 6:00, taking out; 13:00, collecting vehicles; 17:30, taking out; 5:30, listening to the real-time bill; 9:00, hearing completely; listening to the reservation list at 12:50; 17:25, full hearing; 22:00, listen to the reservation list; 0:40, out of the fence; 6:10, entering a fence; 9:30, taking out the fence; 10:10, entering a fence; 12:30, taking out the fence; 17:40, into the fence. Then, the state change information can be sorted according to time sequence and stored in a time sequence state change list [0:40 ] to be output from the fence; 1:00, collecting vehicles; 5:30, listening to the real-time bill; 6:00, taking out; 6:10, entering a fence; 9:00, hearing completely; 9:30, taking out the fence; 10:10, entering a fence; 12:30, taking out the fence; listening to the reservation list at 12:50; 13:00, collecting vehicles; 17:25, full hearing; 17:30, taking out; 17:40, fence entering; 22:00, listen to appointment list ].
S120: traversing the time sequence state change list in sequence, and subtracting the starting time from the ending time to obtain effective duration; the starting time represents the time corresponding to the last state change information in the state change information meeting the calculation conditions in different continuous categories; the end time indicates a time corresponding to the state change information that does not satisfy the condition next to the last state change information as an end time.
In this embodiment, it is necessary to make segment statistics on the effective activity duration of the driver for a certain period of time. The statistical rule is to start calculating the duration under the condition that all the state change information of all the categories meet the corresponding conditions, and stop calculating the duration until any one of the state change information of all the categories does not meet the conditions, wherein the duration experienced in the middle is taken as the effective duration. Specifically, for example, since the state change information of different categories is 3 categories, when the condition is satisfied in each of three consecutive categories in the time series state change list, the time corresponding to the state change information that satisfies the condition last is set as the start time. For example, an existing class A, B, C in which A1, A2 belong to a class in which the condition is satisfied and A3 belongs to a class in which the condition is not satisfied; b1 belongs to the B category and meets the condition, and B2 belongs to the B category and does not meet the condition; c1 belongs to the C category and satisfies the condition, and C2 belongs to the C category and does not satisfy the condition. Then the time corresponding to C1 can be taken as the starting time in [ A1, A2, B1, C1, A3], and the time corresponding to the second B1 can be taken as the starting time in [ A1, A2, B1, A3, B2, A1, C1, B1, A2, B2 ]. Then traversing the time sequence state change list in turn until the time corresponding to the state change information is taken as the end time under the condition that any one of the state change information does not meet the condition, and subtracting the start time from the end time to obtain the effective duration. For example, a period of time from the time corresponding to C1 to the time corresponding to A3 in [ A1, A2, B1, C1, A3] is taken as the effective duration; the effective duration in [ A1, A2, B1, A3, B2, A1, C1, B1, A2, B2] is a period of time from the second occurrence of B1 to the last occurrence of B2 as the effective duration.
S130: repeating the steps, and under the condition that the time sequence state change list is traversed, carrying out accumulated operation on the effective duration to obtain the activity duration.
In this embodiment, the effective time calculated in the above step is required to be accumulated to obtain an effective result in a certain period. Specifically, for example, in the above embodiment, in [ A1, B1, C1, B2, B1, C2, C3], the effective activity duration is the sum of a period of time from the first C1 to the first B2 and a period of time from the second B1 to the first C2 as the activity duration of the driver.
In one embodiment, the method for calculating the activity duration may further include: if two or more pieces of same state change information appear continuously for the same category of state change information in the time sequence state change list, the first piece of state change information is reserved in the time sequence state change list, and the state change information is subjected to de-duplication processing.
In this embodiment, if two or more pieces of the same state change information are present at the same time for the same type of state change information, it is described that the data has a problem and that the deduplication process is required. For drivers, the driver needs to perform duplicate removal processing under the conditions of continuous vehicle taking-out, continuous vehicle taking-in, continuous ticket listening and the like. Specifically, for example, in the above embodiment, for the case of [ A1, B2, A1, A2], it is necessary to perform the deduplication processing on the second A1, that is, to retain the first A1, and to delete the second A1 from the time-series state change list.
In one embodiment, the categories of the status information of the different categories include at least two categories: the driver listens to the state information, the driver position information and the driver gets out and receives the vehicle information; the driver ticket state information comprises a real-time ticket state, a reservation ticket state and a full-listening state; the driver position information includes being within and outside the electronic fence range; the driver vehicle-out and vehicle-in information comprises a vehicle-out state and a vehicle-in state.
In this embodiment, it is generally necessary to calculate that the driver satisfies a prescribed operation period based on the state information of the driver and the conditions set by the activity. Specifically, for example, the calculation condition of the activity is taken as in the case where the ticket state of the driver is in the real-time ticket state or the full-listening state, and the calculation condition of the activity is not taken as in the case where the driver is in the listening reservation state. As a calculation condition of the activity when the driver is within the range of the electronic fence, and as a calculation condition of the activity when the driver is outside the range of the electronic fence. As an active calculation condition when the driver is in the out-of-car state, and as an inactive calculation condition when the driver is in the in-car state. The manager of the rough car/net car company can select the three conditions as corresponding conditions by setting the conditions so as to calculate the activity duration of the driver.
In one embodiment, the method for calculating the activity duration may further include: if the state change information of different types appearing for the first time in the time sequence state change list does not meet the time length calculation condition, and the time corresponding to the state change information is different from the starting time of the period, setting the state change information of the starting time as the state change information meeting the time length calculation condition of different types, and adding the state change information into the time sequence state change list.
In this embodiment, the state information at the initial time in one cycle is not recorded, and it is necessary to perform initialization processing to avoid loss of the time length calculation. In the present embodiment, if the time at which the state change information in one category first appears is not the initial time, it is necessary to perform the initialization processing. Since the driver's vehicle receiving and receiving information, the driver's position information, and the like include only two states, if the class first appears to be that the timing condition is not satisfied, it is indicated that the state change information before the condition is not satisfied is the state change information belonging to the condition, and therefore, the result of initialization is that the condition is satisfied, and the state change information corresponding to the class at the initial time needs to be set as the state change information satisfying the condition. For the first occurrence of this category to satisfy the timing condition, it is explained that the state change information before the condition is satisfied belongs to the case where the condition is not satisfied, nor is it required to be included in the calculation range, and therefore, it is not required to be added to the time-series state change list.
In one embodiment, the method for calculating the activity duration may further include: if the state change information of different types in the last occurrence of the time sequence state change type meets the time length calculation condition and the corresponding time of the state change information is different from the ending time of the period, setting the state change information of the ending time as the state change information which does not meet the time length calculation condition of different types, and adding the state change information into the time sequence state change list.
In the present embodiment, it is necessary to stop the calculation at the end time, and to make the result of the calculation more accurate, it is necessary to mark the state change information at the end time. If the last time the state change information in a category appears in a period is not the end time, it needs to be initialized. If the last state change information of the category is the state change information meeting the condition, the timing is required to be stopped at the end time, and the state change information at the end time is required to be changed into the state change information not meeting the condition. Specifically, for example, for the case that the last state change information of the outgoing and receiving state change information of the driver is outgoing, the outgoing and receiving information needs to be marked as the receiving information which does not meet the condition at the end time and added into the time sequence state change list.
In this embodiment, if the state change information in one period includes state change information of a plurality of consecutive days, and the activity duration of the driver needs to be counted according to the days, the state change information at the moment of 23:59:59 may be marked as not meeting the condition and added to the time sequence state change list; the state change information at the moment of 0:00:00 of the next day is then marked as meeting the condition, and added to the time sequence state change list. By analogy, the state change information in one period can be split into data of multiple days, and the activity duration of a driver is counted respectively.
In one embodiment, the method for calculating the activity duration may further include: acquiring state change information of different classes of drivers according to set time intervals; and storing the state change information and the time corresponding to the state change information into a message middleware in a key-value pair mode under the condition that the state change information of different types is changed compared with the previous moment.
In the present embodiment, in order to reduce the storage of data, recording is performed once when the state change information of the driver changes. Specifically, for the in-out loop state change information of the production location point: for each activity of the driver, there is also an in-out status change recorded in redis for direct use of subsequent query services. In the form of key-value pairs, recorded into redis. And high-speed query calculation is convenient. The ring entering and exiting states are 'ring entering and ring exiting', namely: indicating whether a course of fence state change is stored within the active fence. If the first time of storing is carried out, the first time of storing is directly stored; otherwise, taking the previous state change action.
In one embodiment, the method for calculating the activity duration may further include: and if the time corresponding to the state change information is earlier than the time corresponding to the previous state change information, regenerating the state change information of the driver, and storing the state change information and the time corresponding to the state change information into the message middleware in a key-value pair mode.
In the present embodiment, if the current state does not match the previous state for a certain category, a determination needs to be made once. Specifically, for example, the last state is the out-of-circle state, the current state is the in-circle state, if the time of the current message middleware mq event is later, the current message middleware mq event is directly stored; otherwise, the disorder is described, the measurement is needed according to the position record of the driver, and the position state change information of the driver is regenerated.
Referring to fig. 2, an embodiment of the present application further provides an activity duration calculating apparatus, where the activity duration calculating apparatus may include: the device comprises a time sequence state change list generating unit, an effective activity duration calculating unit and an activity duration accumulating unit.
And the time sequence state change list generation unit is used for sequencing the acquired state change information of different classes of drivers in one period according to the time sequence to obtain a time sequence state change list.
The effective active duration calculation unit is used for traversing the time sequence state change list in sequence and subtracting the starting time from the ending time to obtain effective duration; the starting time represents the time corresponding to the last state change information in the state change information meeting the calculation conditions in different continuous categories; the end time indicates a time corresponding to the state change information that does not satisfy the condition next to the last state change information as an end time.
And the active duration accumulating unit is used for repeating the steps, and accumulating the effective duration under the condition that the time sequence state change list is traversed, so as to obtain the active duration.
The specific functions and effects achieved by the activity duration calculating device may be explained with reference to other embodiments of the present specification, and will not be described herein. The various modules in the object recognition device may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in hardware or independent of a processor in the computer device, or can be stored in a memory in the computer device in a software mode, so that the processor can call and execute the operations corresponding to the modules.
Referring to fig. 3, an embodiment of the present application further provides an electronic device, where the electronic device includes a processor and a memory, where the memory is configured to store a computer program, and when the computer program is executed by the processor, the method for calculating an activity duration is implemented.
The processor may be a central processing unit (Central Processing Unit, CPU). The processor may also be any other general purpose processor, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules, corresponding to the methods in embodiments of the present invention. The processor executes various functional applications of the processor and data processing, i.e., implements the methods of the method embodiments described above, by running non-transitory software programs, instructions, and modules stored in memory.
The memory may include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created by the processor, etc. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some implementations, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
One embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium is configured to store a computer program, where the computer program is executed by a processor to implement the method for calculating an activity duration as described above.
Those skilled in the art will appreciate that implementing all or part of the processes in the methods of the embodiments may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise processes of embodiments of the methods as described herein. Any reference to memory, storage, database, or other medium used in the implementations provided herein can include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The various embodiments of the present disclosure are described in a progressive manner. The different embodiments focus on describing different portions compared to other embodiments. Those skilled in the art will appreciate, after reading the present specification, that a plurality of embodiments of the present specification and a plurality of technical features disclosed in the embodiments may be combined in a plurality of ways, and for brevity of description, all of the possible combinations of the technical features in the embodiments are not described. However, as long as there is no contradiction between the combinations of these technical features, it should be considered as the scope described in the present specification.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The various embodiments in this specification are themselves focused on differing portions from other embodiments, and the various embodiments may be explained in cross-reference to one another. Any combination of the various embodiments in the present specification is encompassed by the disclosure of the present specification by a person of ordinary skill in the art based on general technical knowledge.
The foregoing is merely illustrative of the present invention and is not intended to limit the scope of the claims. Various modifications and changes may occur to those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which fall within the spirit and principles of the present invention are intended to be included within the scope of the claims.

Claims (10)

1. A method for calculating an activity duration, the method comprising:
sequencing the acquired state change information of different classes of drivers in one period according to a time sequence to obtain a time sequence state change list;
traversing the time sequence state change list in sequence, and subtracting the starting time from the ending time to obtain effective duration; the starting time represents the time corresponding to the last state change information in the state change information meeting the calculation conditions in different continuous categories; the ending time is used for representing the time corresponding to the state change information which does not meet the condition next to the last state change information as the ending time;
under the condition that the time sequence state change list is traversed, accumulating operation is carried out on the effective duration to obtain the activity duration;
and carrying out segment statistics on the effective activity duration of the driver in a certain time period, wherein the statistical rule is to start calculating duration under the condition that all kinds of state change information meet the corresponding conditions until stopping calculating duration under the condition that any one of all kinds of state change information does not meet the conditions, and the duration experienced in the middle is taken as the effective duration.
2. The method according to claim 1, wherein the method further comprises:
if two or more pieces of same state change information appear continuously for the same category of state change information in the time sequence state change list, the first piece of state change information is reserved in the time sequence state change list, and the state change information is subjected to de-duplication processing.
3. The method of claim 1, wherein the categories of status information of the different categories include at least two categories: the driver listens to the state information, the driver position information and the driver gets out and receives the vehicle information; the driver ticket state information comprises a real-time ticket state, a reservation ticket state and a full-listening state; the driver position information includes being within and outside the electronic fence range; the driver vehicle-out and vehicle-in information comprises a vehicle-out state and a vehicle-in state.
4. The method according to claim 1, wherein the method further comprises:
if the state change information of different types appearing for the first time in the time sequence state change list does not meet the time length calculation condition, and the time corresponding to the state change information is different from the starting time of the period, setting the state change information of the starting time as the state change information meeting the time length calculation condition of different types, and adding the state change information into the time sequence state change list.
5. The method according to claim 1, wherein the method further comprises:
if the state change information of different types in the last occurrence of the time sequence state change type meets the time length calculation condition and the corresponding time of the state change information is different from the ending time of the period, setting the state change information of the ending time as the state change information which does not meet the time length calculation condition of different types, and adding the state change information into the time sequence state change list.
6. The method according to claim 1, wherein the method further comprises:
acquiring state change information of different classes of drivers according to set time intervals;
and storing the state change information and the time corresponding to the state change information into a message middleware in a key-value pair mode under the condition that the state change information of different types is changed compared with the previous moment.
7. The method of claim 6, wherein the method further comprises:
and if the time corresponding to the state change information is earlier than the time corresponding to the previous state change information, regenerating the state change information of the driver, and storing the state change information and the time corresponding to the state change information into the message middleware in a key-value pair mode.
8. An activity duration calculation apparatus, wherein the activity duration calculation apparatus comprises:
the time sequence state change list generation unit is used for sequencing the acquired state change information of different classes of drivers in one period according to the time sequence to obtain a time sequence state change list;
the effective active duration calculation unit is used for traversing the time sequence state change list in sequence and subtracting the starting time from the ending time to obtain effective duration; the starting time represents the time corresponding to the last state change information in the state change information meeting the calculation conditions in different continuous categories; the ending time is used for representing the time corresponding to the state change information which does not meet the condition next to the last state change information as the ending time;
the active duration accumulating unit is used for accumulating the effective duration to obtain the active duration under the condition that the time sequence state change list is traversed;
and carrying out segment statistics on the effective activity duration of the driver in a certain time period, wherein the statistical rule is to start calculating duration under the condition that all kinds of state change information meet the corresponding conditions until stopping calculating duration under the condition that any one of all kinds of state change information does not meet the conditions, and the duration experienced in the middle is taken as the effective duration.
9. An electronic device, characterized in that the electronic device arrangement comprises a processor and a memory for storing a computer program which, when executed by the processor, implements the method according to any of claims 1 to 7.
10. A computer readable storage medium for storing a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
CN202211376998.6A 2022-11-04 2022-11-04 Activity duration calculation method and device, electronic equipment and storage medium Active CN115640469B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211376998.6A CN115640469B (en) 2022-11-04 2022-11-04 Activity duration calculation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211376998.6A CN115640469B (en) 2022-11-04 2022-11-04 Activity duration calculation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115640469A CN115640469A (en) 2023-01-24
CN115640469B true CN115640469B (en) 2023-08-08

Family

ID=84949459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211376998.6A Active CN115640469B (en) 2022-11-04 2022-11-04 Activity duration calculation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115640469B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112164210A (en) * 2020-09-16 2021-01-01 南京领行科技股份有限公司 Object-based early warning method and device, storage medium and electronic equipment
CN112381505A (en) * 2020-11-09 2021-02-19 南京领行科技股份有限公司 Management method and device of network car booking service, electronic equipment and readable storage medium
CN114722093A (en) * 2022-03-21 2022-07-08 杭州锘崴信息科技有限公司 Privacy calculation system, method and application of total driving time of taxi appointment drivers

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112164210A (en) * 2020-09-16 2021-01-01 南京领行科技股份有限公司 Object-based early warning method and device, storage medium and electronic equipment
CN112381505A (en) * 2020-11-09 2021-02-19 南京领行科技股份有限公司 Management method and device of network car booking service, electronic equipment and readable storage medium
CN114722093A (en) * 2022-03-21 2022-07-08 杭州锘崴信息科技有限公司 Privacy calculation system, method and application of total driving time of taxi appointment drivers

Also Published As

Publication number Publication date
CN115640469A (en) 2023-01-24

Similar Documents

Publication Publication Date Title
CN111966729B (en) Vehicle track data processing method, device, equipment and storage medium
CN105513339B (en) A kind of track of vehicle analysis method and equipment
CN105956669A (en) Vehicle maintenance strategy pushing method and device
CN107491458B (en) Method, device and system for storing time series data
CN115880894A (en) Traffic state determination method, device and equipment
CN115640469B (en) Activity duration calculation method and device, electronic equipment and storage medium
CN101729709B (en) Method and device for processing branch ticket
CN106382036B (en) A kind of parking management method, system and terminal
CN113065803B (en) Inter-station driving data processing method and device, electronic equipment and storage medium
CN111476421B (en) Order prediction method, device, storage medium and equipment
CN109816993B (en) Method for identifying vehicle rapid acceleration behavior and related equipment
CN116934432A (en) Risk monitoring method, device, system, equipment and medium for leasing transaction
CN114283503B (en) Station time energy consumption alarm control method applied to cigarette equipment
CN113657635B (en) Method for predicting loss of communication user and electronic equipment
CN109150819B (en) A kind of attack recognition method and its identifying system
CN116383211A (en) Internet of vehicles data processing method and device, electronic equipment and storage medium
CN113420942B (en) Sanitation vehicle real-time route planning method based on deep Q learning
CN107995014B (en) Method and device for discovering function topology based on alarm information
CN116166710B (en) Duration processing method and device, electronic equipment and storage medium
CN114355412A (en) Abnormal track identification method and device, electronic equipment and storage medium
CN111242147B (en) Method and device for identifying intimate contact person and frequent active area
CN116166709B (en) Time length correction method, device, electronic equipment and storage medium
CN109214542A (en) Frequency predictor method and device based on big data
CN115964408B (en) Time length correction method, device, electronic equipment and storage medium
JP2010250673A (en) Taxi user extraction device and taxi user extraction method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant