Work day searching method and device, storage medium and equipment
A technology of working days and binary search method, applied in the field of data processing, can solve the problems of large database load and low calculation efficiency, and achieve the effect of fewer holidays, reduced traversal time, and fast calculation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Publication Date
- 2019-09-20
- Estimated Expiration
- Not applicable · inactive patent
Smart Images

Figure 1
Abstract
Description
technical field
[0001] The present invention relates to the technical field of data processing, and in particular to a method, device, storage medium and equipment for finding workdays. Background technique
[0002] The traditional working day calculation method is: directly based on java.util.Calendar to judge the working days within the start and end time range, that is, after giving the start date and end date, search in sequence to calculate the number of working days. The advantage of this algorithm is that it is simple in logic and can be calculated without additional data configuration. But the actual situation is that you may have to work on weekends, and non-weekends may be holidays. Therefore, this calculation method is only applicable to the situation without additional holidays.
[0003] Based on the above reasons, a general enterprise will design a calendar table at the beginning to record working days and holidays, and provide a functional interface for users ...
Examples
Embodiment Construction
[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0026] The weekday search method in this embodiment is as follows: figure 1 shown, including:
[0027] Step S1, read the user configuration file and extract holidays from it, store the holidays sequentially to form a holiday sequence. Among them, the calendar data in the database is not divided into workdays and holidays. After the user configures, one piece of data per day is used to distinguish between workdays and holidays through a flag field, such as: 1 indic...