CN110532227B - Job quantity query method and device - Google Patents

Job quantity query method and device Download PDF

Info

Publication number
CN110532227B
CN110532227B CN201910783283.4A CN201910783283A CN110532227B CN 110532227 B CN110532227 B CN 110532227B CN 201910783283 A CN201910783283 A CN 201910783283A CN 110532227 B CN110532227 B CN 110532227B
Authority
CN
China
Prior art keywords
job
user
determining
record file
current query
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
CN201910783283.4A
Other languages
Chinese (zh)
Other versions
CN110532227A (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.)
Guangdong Inspur Smart Computing Technology Co Ltd
Original Assignee
Guangdong Inspur Big Data Research 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 Guangdong Inspur Big Data Research Co Ltd filed Critical Guangdong Inspur Big Data Research Co Ltd
Priority to CN201910783283.4A priority Critical patent/CN110532227B/en
Publication of CN110532227A publication Critical patent/CN110532227A/en
Application granted granted Critical
Publication of CN110532227B publication Critical patent/CN110532227B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/137Hash-based
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/148File search processing
    • G06F16/152File search processing using file content signatures, e.g. hash values

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for inquiring the number of jobs, which comprise the following steps: receiving a query instruction sent by a user in a current query day, and determining a user identifier of the user; judging whether the preset job data table has job information corresponding to the user identification, determining the total job number corresponding to the user in the job record file by applying a quick retrieval method when the job data table does not have the job information corresponding to the user identification, and feeding back the total job number to the user; when the job information corresponding to the user identification exists in the job data table, determining a retrieval time period and the number of jobs in the job information, counting the number of jobs in the retrieval time period in the job record file, and feeding back the sum of the number of jobs in the job information and the number of jobs in the retrieval time period in the counted job record file to the user. The invention has simple and accurate query process for the number of the jobs of the user, and improves the use experience when the user queries the number of the jobs.

Description

Job quantity query method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for querying a job number.
Background
The jobs are tasks for performing a predetermined production, learning, and the like, and with the development of big data and cloud computing, the jobs are generally performed on servers, and a large number of users are stored in an integrated system constructed by the servers. For jobs in the System, a cluster job scheduling System (PBS) is typically used for scheduling and management.
A large number of users use the cluster job scheduling system, each user may submit hundreds of thousands of jobs to the cluster job scheduling system every day, and the number of jobs stored in the system is tens of thousands. When a user submits a job, the PBS system records all job information of all users in a file named by time, the job information recorded by the job recording mechanism in the PBS system is very complicated due to the fact that the number of the jobs uploaded by the user is large, when the user inquires the number of the jobs uploaded in the system, the user cannot inquire the number of the jobs uploaded in the system quickly and accurately, and therefore the use of the user is inconvenient, and the use experience of the user is reduced.
Disclosure of Invention
In view of this, the present invention provides a job quantity query method, which is used for querying a job quantity of a user in a cluster job scheduling system. The invention also correspondingly provides a job quantity query device which is used for supporting the application of the job quantity query method in practice.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a job quantity query method comprises the following steps:
receiving a query instruction sent by a user in a current query day, and determining a user identifier of the user;
judging whether job information corresponding to the user identification exists in a preset job data table or not;
when the job information corresponding to the user identification does not exist in the job data table, acquiring a preprocessed job record file, wherein the job record file comprises a plurality of job records;
determining the total job number of the user in the job record file by applying a preset quick retrieval method, wherein the total job number comprises a first job number and a second job number, the first job number is the job number of the user on the current query day, and the second job number is the job number obtained by subtracting the first job record number from the total job number;
storing the second job quantity and the user identifier in the job data table in a related manner, wherein the stored timestamp is the current query date, and the total job quantity is fed back to the user;
when the job information corresponding to the user identification exists in the job data table, determining a retrieval time period and determining a third job number in the job information;
acquiring the job record file, and determining the fourth job number of the user in the job record file, wherein the fourth job number is the sum of the number of recording time stamps of all job records in the job record file in the retrieval time period;
and feeding back the sum of the third job number and the fourth job number to the user.
The method described above, optionally, the preprocessing process of the preprocessed job record file includes:
acquiring an original operation record file in a preset database;
analyzing the query instruction, determining the operation state type queried by the user, and acquiring a state identifier corresponding to the operation state type;
and determining each job record corresponding to the state identifier according to the state identifier, and deleting each undetermined job record to obtain a processed job record file.
The method described above, optionally, the determining the total number of jobs of the user in the job record file includes:
determining each job record corresponding to the user identifier in the job record file, and determining a recording time stamp of each job record;
counting the number of the operation records of which the recording time stamps are the current query day, and determining the counted number as a first operation number;
counting the number of the operation records of which the recording time stamps are not the current query day, and determining the counted number as a second operation number;
and determining the sum of the first job number and the second job number as the total job number of the user in the job record file.
The foregoing method, optionally, wherein the determining the retrieval time period includes:
acquiring a timestamp of the operation information, and judging whether the timestamp of the operation information is the current query day;
if the time stamp of the job information is not the current query day, determining the time and date of the time stamp of the job information, and determining the time period from the time date of the time stamp of the job information to the current query day as a retrieval time period;
and if the timestamp of the operation information is the current query day, determining the retrieval time period as the current query day.
The method described above, optionally, the determining a fourth number of jobs of the user in the job record file includes:
when the retrieval time period is determined to be the current query day, the quick retrieval method is applied, and each job record corresponding to the user identifier is determined in the job record file;
and determining the recording time stamp of each job record, counting the number of the job records with the recording time stamp as the current query day, and determining the counted number of the job records as the fourth job number.
The method described above, optionally, the determining a fourth number of jobs of the user in the job record file includes:
when the time period from the time date of the timestamp of the job information to the current query date is a retrieval time period, applying the quick retrieval method to determine each job record corresponding to the user identifier in the job record file;
determining a recording time stamp of each job record;
determining the time date of the timestamp of the job information to the day before the current query day as an interval time period;
counting the number of the operation records of which the recording timestamps belong to the interval time periods, determining the counted number of the operation records as a fifth operation number, and updating the operation information of the user in the operation data table, wherein the updated timestamp is the current query day;
counting the number of the operation records with the record timestamp being the current query day, and determining the counted number of the operation records as the sixth operation number;
determining a sum of the fifth number of jobs and the sixth number of jobs as a fourth number of jobs.
A job number inquiry apparatus comprising:
the receiving unit is used for receiving a query instruction sent by a user in the current query day and determining the user identification of the user;
the judging unit is used for judging whether the preset job data table has job information corresponding to the user identification;
a first obtaining unit, configured to obtain a preprocessed job record file when there is no job information corresponding to the user identifier in the job data table, where the job record file includes a plurality of job records;
a first determining unit, configured to determine, by using a preset fast retrieval method, a total job number of the user in the job record file, where the total job number includes a first job number and a second job number, the first job number is a job number of the user on a current query day, and the second job number is a job number obtained by subtracting the first job record number from the total job number;
the saving unit is used for saving the second job quantity and the user identifier in the job data table in a related manner, the saved timestamp is the current query day, and the total job quantity is fed back to the user;
a second determining unit, configured to determine a retrieval time period and determine a third job number in the job information when job information corresponding to the user identifier exists in the job data table;
a second obtaining unit, configured to obtain the job record file, and determine a fourth job number of the user in the job record file, where the fourth job number is a sum of numbers of recording timestamps of the respective job records in the job record file within the retrieval time period;
and the feedback unit is used for feeding back the sum of the third job quantity and the fourth job quantity to the user.
The above apparatus, optionally, further comprises:
the third acquisition unit is used for acquiring an original operation record file in a preset database;
the analysis unit is used for analyzing the query instruction, determining the operation state type queried by the user and acquiring a state identifier corresponding to the operation state type;
and the third determining unit is used for determining each job record corresponding to the state identifier according to the state identifier, and deleting each undetermined job record to obtain a processed job record file.
The above apparatus, optionally, the first determining unit includes:
the first determining subunit is configured to determine each job record in the job record file corresponding to the user identifier, and determine a recording timestamp of each job record;
the first counting subunit is used for counting the number of the operation records with the record timestamp of the current query day and determining the counted number as a first operation number;
the second counting subunit is used for counting the number of the operation records of which the recording time stamps are not the current query day, and determining the counted number as a second operation number;
a second determining subunit, configured to determine a sum of the first job number and the second job number as a total job number of the user in the job record file.
The above apparatus, optionally, the second determining unit includes:
the acquisition subunit is configured to acquire the timestamp of the job information, and determine whether the timestamp of the job information is the current query day;
a third determining subunit, configured to determine, if the timestamp of the job information is not the current query day, a time date of the timestamp of the job information, and determine a time period from the time date of the timestamp of the job information to the current query day as a retrieval time period; and if the timestamp of the operation information is the current query day, determining the retrieval time period as the current query day.
The above apparatus, optionally, the second obtaining unit includes:
a fourth determining subunit, configured to apply the fast retrieval method to determine, in the job record file, each job record corresponding to the user identifier when the retrieval time period is determined to be the current query day;
and the third counting subunit is used for determining the recording time stamp of each job record, counting the number of the job records with the recording time stamp as the current query day, and determining the counted number of the job records as the fourth job number.
The above apparatus, optionally, the second obtaining unit includes:
a fifth determining subunit, configured to apply the fast retrieval method to determine, in the job record file, each job record corresponding to the user identifier when a time period from a time date of the timestamp of the job information to the current query day is a retrieval time period;
a sixth determining subunit configured to determine a recording time stamp of each job record;
a seventh determining subunit, configured to determine, as an interval period, a time date of the time stamp of the job information to a day before the current query day;
the fourth counting subunit is configured to count the number of job records of which the recording timestamps belong to the interval time periods, determine the counted number of job records as a fifth job number, and update the job information of the user in the job data table, where the updated timestamp is the current query day;
the fifth counting subunit is configured to count the number of the job records with the record timestamp of the current query day, and determine the counted number of the job records as a sixth job number;
an eighth determining subunit configured to determine a sum of the fifth job number and the sixth job number as a fourth job number.
Compared with the prior art, the invention has the following advantages:
in the method provided by the embodiment of the invention, in the current query day, a query instruction sent by a user is received, the user identification of the user is determined, and whether the job information corresponding to the user identification exists in a preset job data table is judged; when the job information corresponding to the user identification does not exist in the job data table, determining the total job quantity corresponding to the user in the preprocessed job record file by using a preset quick retrieval method, and feeding back the total job quantity to the user; when the job information corresponding to the user identification exists in the job data table, determining a retrieval time period and the number of jobs in the job information, determining the number of jobs in the retrieval time period in the job record file according to the retrieval time period, adding the number of jobs in the job information and the number of jobs in the retrieval time period in the job record file, and feeding back the obtained total number of jobs to the user. The method provided by the invention can be used for quickly inquiring the number of finished jobs of a user in the current month or the current year in the database, and the inquiring process is convenient, simple and accurate.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for querying a job number according to an embodiment of the present invention;
fig. 2 is a flowchart of another method of a method for querying a job number according to an embodiment of the present invention;
fig. 3 is a flowchart of another method of a method for querying a job number according to an embodiment of the present invention;
fig. 4 is a device structure diagram of a job number query device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The present invention is applicable in numerous general purpose or special purpose computing full-time environments or configurations. For example: personal computers, server computers, portable devices, tablet-type devices, multi-processing devices, distributed computing environments that include any one device or apparatus, and the like.
The embodiment of the invention provides a method for inquiring the number of jobs, which can be applied to a cluster job scheduling system and is used for inquiring and counting the number of jobs in the cluster job scheduling system by a user; the process of the method provided by the embodiment of the invention is shown in fig. 1, and is specifically described as follows:
s101, receiving a query instruction sent by a user in the current query day, and determining the user identification of the user.
In the method provided by the embodiment of the present invention, within a current query day, a query instruction sent by a user is received, and the query instruction is analyzed to obtain a user identifier of the user in the query instruction and a job type queried by the user in a cluster job scheduling system, where the job type may be: completed jobs and unfinished jobs, etc.
And S102, judging whether the preset job data table has job information corresponding to the user identification.
In the method provided by the embodiment of the invention, an operation data table preset in a system is obtained, and the user identification is traversed through the operation data table to judge whether operation information corresponding to the user identification exists in the operation data table or not; it should be noted that the job information includes a user identifier and a job number, where the job number is the number of job types queried by the user, for example, when the user queries the number of completed jobs, the job number stored in the job information is the number of completed jobs of the user.
S103, when the job information corresponding to the user identification does not exist in the job data table, acquiring a preprocessed job record file, wherein the job record file comprises a plurality of job records.
In the method provided by the embodiment of the present invention, when there is no job information corresponding to the user identifier in the job data table, a preprocessed job record file is obtained, and the job record file is preprocessed to remove job records that are inconsistent with the job type queried by the user, for example, when the type of the job queried by the user is a completion job, job records that are not of the completion job type in the job record file are removed. Note that the job records of a plurality of users are recorded in the job record file.
And S104, applying a preset quick retrieval method, and determining the total job number of the user in the job record file, wherein the total job number comprises a first job number and a second job number, the first job number is the job number of the user on the current query day, and the second job number is the job number obtained by subtracting the first job record number from the total job number.
In the method provided by the embodiment of the invention, the job records in the job record file are retrieved by applying a quick retrieval method based on a hash algorithm so as to determine the total job number of the user in the job record file. It should be noted that, when the fast search method is applied, each job record belonging to the user in the job record file may be searched according to the user identifier of the user, and the total number of each job record is the total number of jobs of the user in the job record file.
And S105, storing the second job quantity and the user identifier in the job data table in a related manner, wherein the stored timestamp is the current query day, and feeding back the total job quantity to the user.
In the method provided by the embodiment of the invention, the association between the second job quantity and the user identifier is stored in the job data table, and the stored timestamp is the current query date; the total job number is fed back to the user, and it should be noted that the total job number may be the total job number in the month, or may be the current total job number.
S106, when the job information corresponding to the user identification exists in the job data table, determining a retrieval time period and determining a third job number in the job information.
In the method provided by the embodiment of the invention, when the job information corresponding to the user identifier exists in the job data table, determining a retrieval time period for searching in the preprocessed job record file; and analyzing the job information to determine a third job number stored in the job information.
S107, acquiring the job record file, and determining the fourth job number of the user in the job record file, wherein the fourth job number is the sum of the number of the recording time stamps of all the job records in the job record file in the retrieval time period.
In the method provided by the embodiment of the invention, the preprocessed job record file is acquired, the recording time stamp of each job record in the job record file is determined, a fast retrieval method based on a Hash algorithm is applied, the recording time stamp is determined to belong to each job record in the retrieval time period, the number of each job record is acquired, and the number is determined as the fourth job number.
And S108, feeding back the sum of the third job quantity and the fourth job quantity to the user.
In the method provided by the embodiment of the invention, the third job number and the fourth job number are added to obtain the total job number of the user, and the total job number is fed back to the user. It should be noted that the total number of jobs may be the total number of jobs of the user in the current month, or may be the total number of jobs of the current user.
In the method provided by the embodiment of the invention, in the current query day, the user identification of the user is determined according to the received query instruction sent by the user; judging whether job information corresponding to the user identification exists in a preset job data table or not; when the job information of the user does not exist in the job data table, determining the total job number of the user in the processed job data table by using a preset quick retrieval method, and feeding back the total job number to the user; when the job information of the user exists in the job data table, determining a retrieval time period and the number of jobs in the job information; determining the number of the jobs in the retrieval time period in the job record file preprocessed by the user, adding the number of the jobs in the job information and the number of the jobs in the retrieval time period in the job record file to obtain the total number of the jobs, and feeding back the total number of the jobs to the user.
In the method provided by the embodiment of the invention, a query instruction sent by a user is received within the current query day, and the user identification of the user is determined; judging whether the preset job data table has job information corresponding to the user identification, determining the total job number corresponding to the user in the job record file by applying a quick retrieval method when the job data table does not have the job information corresponding to the user identification, and feeding back the total job number to the user; when the job information corresponding to the user identification exists in the job data table, determining a retrieval time period and the number of jobs in the job information, counting the number of jobs in the retrieval time period in the job record file, and feeding back the sum of the number of jobs in the job information and the number of jobs in the retrieval time period in the counted job record file to the user. The invention has simple and accurate query process of the number of the jobs of the user, and improves the use experience of the user in querying the number of the jobs in the system.
In the method provided by the embodiment of the present invention, when the total job number is fed back to the user, the job number belonging to the user in the job record file needs to be queried, the job record file needs to be preprocessed, and the process of preprocessing the job record file is as follows:
acquiring an original operation record file in a preset database;
analyzing the query instruction, determining the operation state type queried by the user, and acquiring a state identifier corresponding to the operation state type;
and determining each job record corresponding to the state identifier according to the state identifier, and deleting each undetermined job record to obtain a processed job record file.
In the method provided by the embodiment of the invention, an original operation record file is stored in a preset database, the original operation record file comprises records of all users uploading operation in a cluster operation scheduling system, each operation record has a recording timestamp, and the recording timestamp is uploading time, for example, a user A uploads a completed operation a in number 7 and 8 in 2019, the user A uploads a unfinished operation B in number 7 and 8 in 2019, and a user B uploads an unfinished operation c in number 7 and 9 in 2019.
It should be noted that, the query instruction is analyzed to determine the job status type queried by the user, for example, the queried job status type is a completed job, and a status identifier of the completed job is obtained; and determining each job record corresponding to the state identifier in the job record file according to the state identifier, and deleting each job record which does not correspond to the state identifier from the original job record file to obtain a processed job record file.
According to the method provided by the embodiment of the invention, the process of inquiring the total job number of the user is more accurate and convenient by processing the job record file; when the user does not have a corresponding user identifier in the job data table, counting the total number of the jobs of the user in the processed job record file, where a specific process is described in fig. 2, and specifically described as follows:
s201, determining each job record corresponding to the user identification in the job record file, and determining a recording time stamp of each job record.
In the method provided by the embodiment of the present invention, a preprocessed job record file is obtained, each job record corresponding to the job record file and a user identifier of a user is determined, and a recording timestamp of each job record is determined, where it is to be noted that the recording timestamp of a job record is a date when the job is uploaded to a system.
S202, counting the number of the operation records with the record timestamp being the current query day, and determining the counted number as a first operation number.
In the method provided by the embodiment of the invention, each operation record with the record timestamp consistent with the current query day is counted, and the counted number is determined as a first operation number; it should be noted that the first job number indicates the number of jobs uploaded by the user within the current query day.
S203, counting the number of the operation records of which the record timestamp is not the current query day, and determining the counted number as a second operation number.
In the method provided by the embodiment of the invention, the number of the job records of which the record timestamps are not the current query day is counted, and the counted number is determined as the second job number, wherein the second job number is the number of the jobs uploaded by the user on other dates.
And S204, determining the sum of the first job quantity and the second job quantity as the total job quantity of the user in the job record file.
In the method provided by the embodiment of the present invention, the first job quantity and the second job quantity are added, the obtained numerical value is the total job quantity queried by the user, and the total job quantity is fed back to the user. The total number of jobs may be the number of completed jobs of the user in the current month, or may be the number of completed jobs of the user in the current year. It should be noted that the total job number may also represent the total number of completed jobs uploaded by the user from the creation date to the current query date in the cluster job scheduling system.
By applying the method provided by the embodiment of the invention, the number of the jobs finished by the user in the same month or year can be inquired more simply and conveniently, the job finishing of the user can be inquired more quickly, simply, conveniently and accurately, the working efficiency of the system is improved, and the application experience of the user on the system inquiry function is also improved.
In the method provided by the embodiment of the present invention, when job information corresponding to a user identifier exists in the job data table, it needs to be determined whether a timestamp of the job information is a current query day, which is used to determine a retrieval time period, and different operations are executed according to different retrieval time periods, where a specific process is as shown in fig. 3, and the following specific description is as follows:
and S301, acquiring the time stamp of the job information.
In the method provided by the embodiment of the present invention, the timestamp of the job information is changed, and when the data in the job information is updated, the timestamp of the job information is updated at the same time, for example, when the latest timestamp of the job information 1 is 2019, 7 and 1 days, and the date of the current query day is 2019, 7 and 9 days, and the user queries the job information, the data in the job information is updated, and the timestamp in the job information is updated to 2019, 7 and 9 days.
S302, judging whether the timestamp of the operation information is the current query day, and executing S303 if the timestamp of the operation information is the current query day; otherwise, S304 is performed.
In the method provided by the embodiment of the invention, the timestamp of the operation information is compared with the current query day, when the date represented by the timestamp is the same as the date of the current query day, the timestamp of the operation information is the current query day, and the retrieval time period is determined as the current query day; otherwise, the time stamp of the job information is not the current query day, the time and date of the time stamp of the job information are determined, and the time period from the time date of the time stamp of the job information to the current query day is determined as the retrieval time period.
And S303, determining the total number of the jobs of the current query day of the user in the job record file.
In the method provided by the embodiment of the invention, the quick retrieval method is applied, and each job record corresponding to the user identifier is determined in the job record file; and determining the recording time stamp of each job record, counting the number of the job records with the recording time stamp as the current query day, and determining the counted number of the job records as the fourth job number. It should be noted that the current query day is compared with the record time stamps corresponding to the job records, so as to count the number of the job records with the record time stamps consistent with the current query day.
S304, determining the retrieval time period of the user, and determining the number of the timestamps of the job records of the user in the job record file in the retrieval time period.
In the method provided by the embodiment of the invention, the time period from the time date of the timestamp of the job information to the current query date is used as a retrieval time period, and a preset quick retrieval method is applied to determine each job record corresponding to the user identifier in the job record file; determining a recording time stamp of each job record; determining the time date of the timestamp of the job information to the day before the current query day as an interval time period; counting the number of the operation records of which the recording timestamps belong to the interval time periods, determining the counted number of the operation records as a fifth operation number, and updating the operation information of the user in the operation data table, wherein the updated timestamp is the current query day; counting the number of the operation records with the record timestamp being the current query day, and determining the counted number of the operation records as the sixth operation number; determining a sum of the fifth number of jobs and the sixth number of jobs as a fourth number of jobs.
When the job information of the user in the job data table is updated, the number of jobs recorded in the job information is added to the fifth number of jobs, and the added value is updated in the job data table.
According to the method provided by the embodiment of the invention, the accuracy of the user for inquiring the number of the jobs next time is ensured by updating the job information in the job data table, and the process of inquiring the number of the jobs by the user is simpler and more convenient.
In the method provided by the embodiment of the invention, in the current query day, a query instruction sent by a user is received, the user identification of the user is determined, and whether the job information corresponding to the user identification exists in a preset job data table is judged; when the job information corresponding to the user identification does not exist in the job data table, determining the total job quantity corresponding to the user in the preprocessed job record file by using a preset quick retrieval method, and feeding back the total job quantity to the user; when the job information corresponding to the user identification exists in the job data table, determining a retrieval time period and the number of jobs in the job information, determining the number of jobs in the retrieval time period in the job record file according to the retrieval time period, adding the number of jobs in the job information and the number of jobs in the retrieval time period in the job record file, and feeding back the obtained total number of jobs to the user. The method provided by the invention can be used for quickly inquiring the number of finished jobs of a user in the current month or the current year in the database, the efficiency of acquiring the number of finished jobs by a system is improved, and the inquiring process is convenient, simple and accurate.
Corresponding to the method provided by fig. 1, the present invention also provides a job quantity query device corresponding to a job quantity query method, and the device is used for supporting the application of the method in practice. The apparatus structure of the apparatus is shown in fig. 4, and the following is specifically explained:
a receiving unit 401, configured to receive a query instruction sent by a user in a current query day, and determine a user identifier of the user;
a determining unit 402, configured to determine whether job information corresponding to the user identifier exists in a preset job data table;
a first obtaining unit 403, configured to obtain a preprocessed job record file when there is no job information corresponding to the user identifier in the job data table, where the job record file includes a plurality of job records;
a first determining unit 404, configured to determine, by applying a preset fast retrieval method, a total job number of the user in the job record file, where the total job number includes a first job number and a second job number, the first job number is a job number of the user on a current query day, and the second job number is a job number obtained by subtracting the first job record number from the total job number;
a saving unit 405, configured to store the second job quantity and the user identifier in the job data table in a correlated manner, where the stored timestamp is a current query day, and feed back the total job quantity to the user;
a second determining unit 406, configured to determine, when job information corresponding to the user identifier exists in the job data table, a retrieval time period, and determine a third job number in the job information;
a second obtaining unit 407, configured to obtain the job record file, and determine a fourth job number of the user in the job record file, where the fourth job number is a sum of numbers of recording timestamps of respective job records in the job record file within the retrieval time period;
a feedback unit 408, configured to feed back the sum of the third job number and the fourth job number to the user.
In the device provided by the embodiment of the invention, within the current query day, a query instruction sent by a user is received, the user identification of the user is determined, and whether the job information corresponding to the user identification exists in a preset job data table or not is judged; when the job information corresponding to the user identification does not exist in the job data table, determining the total job quantity corresponding to the user in the preprocessed job record file by using a preset quick retrieval method, and feeding back the total job quantity to the user; when the job information corresponding to the user identification exists in the job data table, determining a retrieval time period and the number of jobs in the job information, determining the number of jobs in the retrieval time period in the job record file according to the retrieval time period, adding the number of jobs in the job information and the number of jobs in the retrieval time period in the job record file, and feeding back the obtained total number of jobs to the user. The device provided by the invention can quickly inquire the number of finished jobs of a user in the current month or the current year in the database, and the inquiry process is convenient, simple and accurate.
In the apparatus provided in the embodiment of the present invention, the apparatus may further be configured to:
the third acquisition unit is used for acquiring an original operation record file in a preset database;
the analysis unit is used for analyzing the query instruction, determining the operation state type queried by the user and acquiring a state identifier corresponding to the operation state type;
and the third determining unit is used for determining each job record corresponding to the state identifier according to the state identifier, and deleting each undetermined job record to obtain a processed job record file.
In the apparatus provided in the embodiment of the present invention, the first determining unit 404 may be configured to:
the first determining subunit is configured to determine each job record in the job record file corresponding to the user identifier, and determine a recording timestamp of each job record;
the first counting subunit is used for counting the number of the operation records with the recording time stamp as the current query day and determining the counted number as a first operation number;
the second counting subunit is used for counting the number of the operation records of which the recording time stamps are not the current query day, and determining the counted number as a second operation number;
a second determining subunit, configured to determine a sum of the first job number and the second job number as a total job number of the user in the job record file.
In the apparatus provided in the embodiment of the present invention, the second determining unit 406 may be configured to:
the acquisition subunit is configured to acquire the timestamp of the job information, and determine whether the timestamp of the job information is the current query day;
a third determining subunit, configured to determine, if the timestamp of the job information is not the current query day, a time date of the timestamp of the job information, and determine a time period from the time date of the timestamp of the job information to the current query day as a retrieval time period; and if the timestamp of the operation information is the current query day, determining the retrieval time period as the current query day.
In the apparatus provided in the embodiment of the present invention, the second obtaining unit 407 may be configured to:
a fourth determining subunit, configured to apply the fast retrieval method to determine, in the job record file, each job record corresponding to the user identifier when the retrieval time period is determined to be the current query day;
and the third counting subunit is used for determining the recording time stamp of each job record, counting the number of the job records with the recording time stamp as the current query day, and determining the counted number of the job records as the fourth job number.
In the apparatus provided in the embodiment of the present invention, the second obtaining unit 407 may be configured to:
a fifth determining subunit, configured to apply the fast retrieval method to determine, in the job record file, each job record corresponding to the user identifier when a time period from a time date of the timestamp of the job information to the current query day is a retrieval time period;
a sixth determining subunit configured to determine a recording time stamp of each job record;
a seventh determining subunit, configured to determine, as an interval period, a time date of the time stamp of the job information to a day before the current query day;
the fourth counting subunit is configured to count the number of job records of which the recording timestamps belong to the interval time periods, determine the counted number of job records as a fifth job number, and update the job information of the user in the job data table, where the updated timestamp is the current query day;
the fifth counting subunit is configured to count the number of the job records with the record timestamp of the current query day, and determine the counted number of the job records as a sixth job number;
an eighth determining subunit configured to determine a sum of the fifth job number and the sixth job number as a fourth job number.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A job quantity query method is characterized by comprising the following steps:
receiving a query instruction sent by a user in a current query day, and determining a user identifier of the user;
judging whether job information corresponding to the user identification exists in a preset job data table or not;
when the job information corresponding to the user identification does not exist in the job data table, acquiring a preprocessed job record file, wherein the job record file comprises a plurality of job records;
determining the total work quantity of the user in the work record file by applying a preset quick retrieval method, wherein the total work quantity comprises a first work quantity and a second work quantity, the first work quantity is the work quantity of the user on the current query day, and the second work quantity is the work quantity obtained by subtracting the first work quantity from the total work quantity;
storing the second job quantity and the user identifier in the job data table in a related manner, wherein the stored timestamp is the current query date, and the total job quantity is fed back to the user;
when the job information corresponding to the user identification exists in the job data table, determining a retrieval time period and determining a third job number in the job information;
acquiring the job record file, and determining the fourth job number of the user in the job record file, wherein the fourth job number is the sum of the number of recording time stamps of all job records in the job record file in the retrieval time period;
and feeding back the sum of the third job number and the fourth job number to the user.
2. The method of claim 1, wherein the pre-processing of the pre-processed job record file comprises:
acquiring an original operation record file in a preset database;
analyzing the query instruction, determining the operation state type queried by the user, and acquiring a state identifier corresponding to the operation state type;
and determining each job record corresponding to the state identifier according to the state identifier, and deleting each undetermined job record to obtain a processed job record file.
3. The method of claim 1, wherein determining the total number of jobs for the user in the job record file comprises:
determining each job record corresponding to the user identifier in the job record file, and determining a recording time stamp of each job record;
counting the number of the operation records of which the recording time stamps are the current query day, and determining the counted number as a first operation number;
counting the number of the operation records of which the recording time stamps are not the current query day, and determining the counted number as a second operation number;
and determining the sum of the first job number and the second job number as the total job number of the user in the job record file.
4. The method of claim 1, wherein determining the retrieval time period comprises:
acquiring a timestamp of the operation information, and judging whether the timestamp of the operation information is the current query day;
if the time stamp of the job information is not the current query day, determining the time and date of the time stamp of the job information, and determining the time period from the time date of the time stamp of the job information to the current query day as a retrieval time period;
and if the timestamp of the operation information is the current query day, determining the retrieval time period as the current query day.
5. The method of claim 4, wherein determining a fourth number of jobs for the user in the job record file comprises:
when the retrieval time period is determined to be the current query day, the quick retrieval method is applied, and each job record corresponding to the user identifier is determined in the job record file;
and determining the recording time stamp of each job record, counting the number of the job records with the recording time stamp as the current query day, and determining the counted number of the job records as the fourth job number.
6. The method of claim 4, wherein said determining a fourth number of jobs for the user in the job record file comprises:
when the time period from the time date of the timestamp of the job information to the current query date is a retrieval time period, applying the quick retrieval method to determine each job record corresponding to the user identifier in the job record file;
determining a recording time stamp of each job record;
determining the time date of the timestamp of the job information to the day before the current query day as an interval time period;
counting the number of the job records of which the recording timestamps belong to the interval time period, determining the counted number of the job records as the fifth job number, and updating the job information of the user in the job data table, wherein the updated timestamp is the current query date;
counting the number of the operation records with the record timestamp being the current query day, and determining the counted number of the operation records as the sixth operation number;
determining a sum of the fifth number of jobs and the sixth number of jobs as a fourth number of jobs.
7. An apparatus for querying a number of jobs, comprising:
the receiving unit is used for receiving a query instruction sent by a user in the current query day and determining the user identification of the user;
the judging unit is used for judging whether the preset job data table has job information corresponding to the user identification;
a first obtaining unit, configured to obtain a preprocessed job record file when there is no job information corresponding to the user identifier in the job data table, where the job record file includes a plurality of job records;
a first determining unit, configured to determine, by using a preset fast retrieval method, a total job number of the user in the job record file, where the total job number includes a first job number and a second job number, the first job number is a job number of the user on a current query day, and the second job number is a job number obtained by subtracting the first job number from the total job number;
the saving unit is used for saving the second job quantity and the user identifier in the job data table in a related manner, the saved timestamp is the current query day, and the total job quantity is fed back to the user;
a second determining unit, configured to determine a retrieval time period and determine a third job number in the job information when job information corresponding to the user identifier exists in the job data table;
a second obtaining unit, configured to obtain the job record file, and determine a fourth job number of the user in the job record file, where the fourth job number is a sum of numbers of recording timestamps of the respective job records in the job record file within the retrieval time period;
and the feedback unit is used for feeding back the sum of the third job quantity and the fourth job quantity to the user.
8. The apparatus of claim 7, further comprising:
the third acquisition unit is used for acquiring an original operation record file in a preset database;
the analysis unit is used for analyzing the query instruction, determining the operation state type queried by the user and acquiring a state identifier corresponding to the operation state type;
and the third determining unit is used for determining each job record corresponding to the state identifier according to the state identifier, and deleting each undetermined job record to obtain a processed job record file.
9. The apparatus of claim 7, wherein the first determining unit comprises:
the first determining subunit is configured to determine each job record in the job record file corresponding to the user identifier, and determine a recording timestamp of each job record;
the first counting subunit is used for counting the number of the operation records with the recording time stamp as the current query day and determining the counted number as a first operation number;
the second counting subunit is used for counting the number of the operation records of which the recording time stamps are not the current query day, and determining the counted number as a second operation number;
a second determining subunit, configured to determine a sum of the first job number and the second job number as a total job number of the user in the job record file.
10. The apparatus of claim 7, wherein the second determining unit comprises:
the acquisition subunit is configured to acquire the timestamp of the job information, and determine whether the timestamp of the job information is the current query day;
a third determining subunit, configured to determine, if the timestamp of the job information is not the current query day, a time date of the timestamp of the job information, and determine a time period from the time date of the timestamp of the job information to the current query day as a retrieval time period; and if the timestamp of the operation information is the current query day, determining the retrieval time period as the current query day.
CN201910783283.4A 2019-08-23 2019-08-23 Job quantity query method and device Active CN110532227B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910783283.4A CN110532227B (en) 2019-08-23 2019-08-23 Job quantity query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910783283.4A CN110532227B (en) 2019-08-23 2019-08-23 Job quantity query method and device

Publications (2)

Publication Number Publication Date
CN110532227A CN110532227A (en) 2019-12-03
CN110532227B true CN110532227B (en) 2022-05-24

Family

ID=68664118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910783283.4A Active CN110532227B (en) 2019-08-23 2019-08-23 Job quantity query method and device

Country Status (1)

Country Link
CN (1) CN110532227B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015135036A1 (en) * 2014-03-12 2015-09-17 Skedgo Pty Ltd Displaying and determining customer data
CN106294472B (en) * 2015-06-03 2019-08-02 中国移动通信集团广东有限公司 A kind of querying method and device of Hadoop database HBase
CN107871221B (en) * 2016-09-28 2022-07-05 北京京东尚科信息技术有限公司 Method and device for acquiring amount of marketable inventory
KR101812452B1 (en) * 2017-08-07 2018-01-30 건국대학교 산학협력단 Method for executing processing of queries in cloud services and apparatus using the same
CN108710668B (en) * 2018-05-15 2022-09-30 中国平安人寿保险股份有限公司 Business statistical method, device, computer equipment and storage medium
CN109086986B (en) * 2018-07-20 2022-12-09 中国邮政储蓄银行股份有限公司 Job scheduling method and device

Also Published As

Publication number Publication date
CN110532227A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
JP6064693B2 (en) Method and system for storing and retrieving data
EP2648105B1 (en) Database performance analysis
CN112561471A (en) Data sharing open system based on government affair information resources and implementation method thereof
CN108416137B (en) Method for conveniently dividing and tracking simplified expression standard part in aircraft manufacturing
CN109117428B (en) Data storage method and device, and data query method and device
JP7008708B2 (en) Methods and devices for tracking, capturing and synchronizing activity data across multiple devices
CN110442653B (en) Method, device, server and storage medium for incrementally constructing CUBE model
CN110008211B (en) Data query method and device, electronic equipment and storage medium
CN110532227B (en) Job quantity query method and device
WO2016153500A1 (en) Standardized custom surveys
CN1987860A (en) Method and device for representing continuum of data
CN110705229B (en) Editing class list arrangement recommendation method and device
JP6073912B2 (en) Work slip recording support system and program
CN112506957A (en) Method and device for determining workflow dependency relationship
CN111723004A (en) Measuring method for agile software development, measuring data output method and device
JP2016024486A (en) Data utilization system and control method therefor
JP5903390B2 (en) Document generation apparatus, document generation method, and program
JP5825915B2 (en) Work man-hour calculating device, work man-hour calculating method, and program
CN110704523B (en) Data export method, device, equipment and computer readable storage medium
CN112000456A (en) Task scheduling method, device, equipment and storage medium
US9009073B1 (en) Product availability check using image processing
CN108132940A (en) A kind of application data extracting method and device
CN107766380B (en) Method, device and system for balanced distribution and search of service data
CN114153830B (en) Data verification method and device, computer storage medium and electronic equipment
US11797600B2 (en) Time-series analytics for database management systems

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