This application is based upon and claims the benefit of priority of the prior Japanese Patent Application No. 2015-068640, filed on Mar. 30, 2015, the entire contents of which are incorporated herein by reference.
The embodiments discussed herein are related to a data processing method, a data processing apparatus, and a data processing program.
A processing apparatus configured to execute data processing to a plurality of records in accordance with a query has been proposed. Each record includes data corresponding to each of a plurality of attributes.
The record is, for example, a record including the sales of a store, and the sales record includes the date as a first attribute and the sales of the date (such as sales proceeds and sales quantity) as a second attribute. For example, a first record includes the sales “1 million” yen of January 1st, and a second record includes the sales of “2 million” yen of January 2nd.
The query includes, for example, identification information for identifying the range of processing target records and processing information indicating the content of data processing. The range of processing target records may be referred to as the range of processing target data.
The processing apparatus inputs records and stores the records into a memory thereof. The processing apparatus then identifies the range of processing target records among a plurality of records stored in the memory based on identification information of the inputted query. Then, the processing apparatus executes data processing to data of the identified record (in a processing target data range) based on processing information of the inputted query. The processing apparatus deletes records within the identified range from the memory after execution of data processing in order to improve utilization efficiency of the memory, for example. Related techniques are disclosed in, for example, Japanese Laid-open Patent Publication Nos. 2000-331104 and 2008-171250.
The user of the processing apparatus sometimes requests the processing apparatus to execute a new query. Assume that the new query includes a request to execute a predetermined processing to data of a plurality of records deleted from the memory. That is, assume that data of the processing target record is data of the record deleted from the memory. The processing apparatus changes the range of the processing target data by executing the new query. Since the processing target record has been deleted from the memory, the processing apparatus has to again input the record deleted from the memory before executing the new query.
However, when inputting a record once inputted again, the processing apparatus has to execute various processings such as a processing of searching the record to be inputted again and a processing of inputting the searched record. This causes disadvantages such as increase of the processing load and prolonged processing time. In light of such disadvantages, inputting the record again is not practical.
As described above, when a new query is inputted after execution of data processing, it is difficult for the processing apparatus to execute the query by changing the range of the processing target data.
According to an aspect of the embodiments discussed herein, it is an object of the present disclosure to enable execution of a new query by changing the range of the processing target data even after execution of data processing.
According to an aspect of the invention, a data processing method includes steps of; allowing establishment of a first flag or a second flag for each of a plurality of items where corresponding values are inputted sequentially; upon detecting that a value associated with an item where the first flag is established in an Nth place is inputted and that a value associated with an item where the second flag is established in an Mth place (M is equal to or larger than N) is inputted, executing a predetermined processing to values in a range from the value that is inputted by associating with the item where the first flag is established in the Nth place to the value that is inputted by associating with the item where the second flag is established in the Mth place; and executing a processing of outputting a processed result in order from the item in the Nth place.
The object and advantages of the invention will be realized and attained by means of the elements and combinations particularly pointed out in the claims.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the invention, as claimed.
Processing target data range is described with reference to
Table T1 stores one record in each of second and subsequent lines. Date field of the table T1 stores date of the record. Sales field of the table T1 stores sales (referred to as sales as appropriate) of the record. Unit of the sales is, for example, in 10,000 yen. In the diagram, “---” indicates that the content in the field is omitted.
Assume that a first query for calculating the total sales for three days while sliding day by day is inputted to the processing apparatus. The first query is, for example, a query described with “SELECT FIRST_VALUE (date), sum (sales) RANGE 3 DAYS, SLIDE 1 DAY FROM data”.
In the example of
Sales from pth day of January to (p+2)th day of January is the processing target data range (hereinafter referred to as first data range as appropriate). Hereinafter, pth day of January is referred to as first day of the first data range, and (p+2)th day of January is referred to as last day of the first data range. Also, hereinafter, pth day of January is referred to as “1/p” as appropriate.
Table T2 illustrates a calculation result in a table format. Table T2 stores the calculation result in each of second and subsequent lines. Date field of the table T2 stores the first day of the first data range. Total sales field of the table T2 stores the total sales in the first data range.
In
The processing apparatus calculates, for example, the sum of sales between January 1st and January 3rd (400=100+200+100) (see a second line of table T2). Next, the processing apparatus calculates the sum of sales between January 2nd and January 4th (430=200+100+130) (see a third line of table T2). The window W2 is a window for calculating the total sales from January 2nd to January 4th.
Thereafter, the processing apparatus performs the above-mentioned data processing. When a record of data processing target may be discarded, the processing apparatus deletes the record to improve memory utilization efficiency. For example, upon completing calculation of the total sales between January 2nd and January 4th, the processing apparatus deletes the sales record of January 2nd (record in the second line of Table T1) from the memory therein.
In data processing, sliding the window as illustrated in
Next, processing target data range is described with reference to
A second query for calculating the total sales between the first day and the seventh day for each month is inputted into the processing apparatus. The second query is, for example, a query described with “SELECT FIRST_VALUE (month), sum (sales) RANGE 7 DAYS SLIDE 1 MONTH FROM data”.
In the example of
Sales from January 1st to January 7th is the processing target data range (hereinafter referred to as second data range as appropriate). Hereinafter, January 1st is referred to as a first day of the second data range, and January 7th is referred to as a last day of the second data range. Table T3 illustrates calculation results in a table format. Table T3 stores the calculation result in each of second and subsequent lines. Month field of the table T3 stores the month of first day in the second data range. Total sales field of the table T3 stores the total sales of the second data range.
In
In data processing, the window with start condition and end condition designated as described with reference to
In addition to the above windows, there are various other windows in data processing, such as, for example, a time window with the window range and slide width designated by time, and a tuple window with the window range and slide width designated by the number of records.
[Change of Query]
As described above, when the data processing target record may be discarded after completion of data processing, the processing apparatus deletes the record to improve memory utilization efficiency. When the record deletion is performed, there may be a case where a new query is not executable. Execution of the new query may be also referred to as execution of a changed query.
Table T4 of
In
The processing apparatus calculates the total sales of the sales of January 1st (first day) to January 4th and outputs calculation results. Then, the processing apparatus deletes records of 1/1 to 1/4 from the memory.
Here, assume that after the record of 1/4 has been deleted from the memory, a fourth query for calculating the total sales of the sales of 1/3 to the sales of 1/5 is inputted into the processing apparatus. In this assumption, when the fourth query is inputted, records of 1/1 to 1/4 have been deleted from the memory. Therefore, the processing apparatus is unable to calculate the total sales of records (record of 1/3 to record of 1/5) in the range indicated by the reference numeral W14.
That is, when a new query is inputted (when the query is changed) after starting execution of data processing, it may be difficult to establish a new window (reference numeral W14) while holding the state of the window (see reference numeral W13) prior to the change.
In other words, after starting execution of data processing, the inputted new query is executed. Therefore, it may be difficult to change the processing target data range. Since the processing apparatus executes the inputted new query, it may be difficult to establish a plurality of windows in one or more records so as to overlap each other. In view of the foregoing problem, an aspect of the embodiments provides a data processing system capable of changing the processing target data range even after execution of data processing has been started.
As described above, when the processing apparatus executes a new query, a record deleted from the memory may be inputted again. In other words, entire data processing system may be reset. An example of the resetting comprises rewriting the program for executing data processing in the processing apparatus so as to enable execution of the new query, and inputting records again. However, as described above, it is not practical to input records again. Further, the rewriting of the program is not practical considering the number of rewriting steps.
[System Configuration Diagram]
The data generation apparatus DGA generates various data such as the record and outputs to the processing apparatus MA. The record includes, for example, an inventory management record, a sales management record, and an event monitoring record. Event monitoring includes monitoring of events related to, for example, natural phenomena such as rainfall and atmospheric temperature. An example of the event monitoring record is a rainfall sum-up record.
The processing apparatus MA inputs various records outputted from the data generation apparatus DGA, and inputs window information into each of the inputted a plurality of records. Inputting window information into the record may be also referred to as embedding of window information into the record. Window information includes information indicating start and end of the data processing range.
Window information may be automatically embedded into the record by a dedicated program. Also, window information may be manually embedded into the record via a record processing program by the user requesting execution of data processing. The user embeds window information into the record so as to match a desired data processing range.
The processing apparatus MA outputs the record including window information to the data processing apparatus DPA.
The data processing apparatus DPA inputs a record including window information, and based on a query inputted from the terminal apparatus TA, executes data processing of a processing target record included in the inputted record. Then, the data processing apparatus DPA outputs processing result to the terminal apparatus TA. Data processing is utilized for event monitoring, Business Integrate (BI), and stream processing.
The terminal apparatus TA is an apparatus configured to operate the processing apparatus MA and the data processing apparatus DPA.
[Data Processing Apparatus DPA]
The data processing apparatus DPA of
The data processing apparatus DPA includes a CPU 101, a RAM 102, a ROM 103, a communication device 104, a storage device 105, and an external storage medium read device 106, all of which are connected to a bus B. CPU is an abbreviation for “central processing unit”, RAM is an abbreviation for “random access memory”, and ROM is an abbreviation for “read only memory”.
The CPU 101 is a central processing unit configured to control the entire data processing apparatus DPA. The RAM 102 is a storage device configured to temporarily store data generated (calculated) in steps executed by the CPU 101 and in processings executed by the data processing program PG1. The data processing program PG1 is a program configured to execute data processing to the inputted record. The RAM 102 is an example of a storage device storing the record. The RAM 102 includes a data processing region RG configured to store various data related to data processing. The RAM 102 is a semiconductor memory such as, for example, a dynamic random access memory (DRAM).
The ROM 103 is configured to store various data. The communication device 104 is a device configured to connect with a network such as, for example, a local area network (LAN). The communication device 104 communicates the processing apparatus MA and the terminal apparatus TA of
The storage device 105 is a data storage device such as, for example, a hard disk drive, a solid state drive, and a nonvolatile semiconductor memory.
The external storage medium read device 106 is a device configured to read data stored in an external storage medium MD. The external storage medium MD is a nonvolatile storage medium, which is, for example, a portable storage device such as, for example, a compact disc read only memory (CD-ROM) and a digital versatile disc (DVD).
An execution file of the data processing program PG1 is stored in the storage device 105. The CPU 101 is configured to read the execution file of the data processing program PG1 from the storage device 105 when the data processing apparatus DPA is activated, and develop into the RAM 102. The execution file of the data processing program PG1 may be stored in the external storage medium MD. The CPU 101 is configured to read the execution file of the data processing program PG1 from the external storage medium MD when the data processing apparatus DPA is activated, and develop into the RAM 102.
The query input unit 11 is configured to input a query outputted from the terminal apparatus TA of
The record input unit 12 is configured to input the record outputted from the processing apparatus MA of
The window processing unit 13 is configured to establish a window in the inputted record based on the window information. The intermediate data processing unit 14 is configured to execute, based on the inputted query, data processing to the record where the window is established, and output the processing result to the data output unit 15. The data output unit 15 outputs the processing result to the terminal apparatus TA.
[Processing Apparatus MA]
The CPU 201 is a central processing unit configured to control the entire processing apparatus MA. The RAM 202 is a storage device configured to temporarily store data generated (calculated) in processings executed by the CPU 201 and in steps executed by the processing program PG2. The RAM 202 is a semiconductor memory such as, for example, a DRAM.
The processing program PG2 is a program configured to process the record outputted from the data generation apparatus DGA. Specifically, the program enables establishment of a first flag and/or establishment of a second flag for each of a plurality of items (for example, records) into which a corresponding value (or may be referred to as data) is inputted sequentially. The processing program PG2 is an example of a dedicated program for embedding window information into the record. The processing program PG2 outputs the processed record to the data processing apparatus DPA. The processing program PG2 is also referred to as a flag generation unit.
The ROM 203 is configured to store various data. The communication device 204 is a device configured to connect with a network such as, for example, LAN. The communication device 204 communicates with the data generation apparatus DGA, the terminal apparatus TA, and the data processing apparatus DPA, as illustrated in
The storage device 205 is a data storage device such as, for example, a hard disk drive, a solid state drive, and a nonvolatile semiconductor memory.
The external storage medium read device 206 is a device configured to read data stored in an external storage medium MD.
The execution file of the processing program PG2 is stored in the storage device 205. The CPU 201 is configured to read the execution file of the processing program PG2 from the storage device 205 when the processing apparatus MA is activated, and develop into the RAM 202. The execution file of the processing program PG2 may be stored in the external storage medium MD. The CPU 201 is configured to read the execution file of the processing program PG2 from the external storage medium MD when the processing apparatus MA is activated, and develop into the RAM 202.
[Data Processing]
[First Data Processing]
Table T11 of
The data generation apparatus DGA of
The record input unit 12 of the data processing apparatus DPA inputs the record outputted from the processing apparatus MA and stores into the RAM 102 in the table format illustrated in
Every time one record is inputted, the data processing apparatus DPA executes window establishment processing and data processing described later based on start information and end information.
Table T11 stores one record in each of second and subsequent lines. Date field of the table T11 stores date of the record. Sales field of the table T11 stores sales of the record. Start field of the table T11 stores start information of the record. End field of the table T11 stores end information of the record.
The numeric value in the start field of the table is a start flag. The start flag of a numeric value equal to or larger than 1 or −1 described later is a flag indicating start of the window. The start flag of “0” is a flag not indicating start of the window.
The numeric value in the end field of the table is an end flag. The end flag of a numeric value equal to or larger than 1 or −1 described later is a flag indicating the end of a window. The end flag of “0” is a flag not indicating end of the window.
The dotted arrow of
The window processing unit 13 detects that the value (or data) of the record where a first flag is established in an Nth place is inputted and data associated with a record where a second flag is established in an Mth place is inputted. In other words, the window processing unit 13 detects that a value (or data) associated with a record where the first flag is established in the Nth place is inputted and a value (or data) associated with a record where the second flag is established in the Mth place is inputted. The uppercase letter N is an integer equal to or larger than 1, and the uppercase letter M is an integer equal to or larger than N. The value (data) associated with the record means data included in the record.
The first flag is a flag indicating start of the range of records to be subjected to a predetermined processing. The second flag is a flag corresponding to the first flag and indicating end of the range. Here, the first flag and the second flag are information indicating the number of the ranges. Information indicating the range is, for example, a numeric value.
The first flag is, for example, a record start flag “1”. The second flag is, for example, a record end flag “1”.
The intermediate data processing unit 14 executes a predetermined processing to data in a range from data which is inputted by associating with a record where the first flag is established in the Nth place to data which is inputted by associating with a record where the second flag is established in the Mth place. Data inputted by associating with the record means data included in the inputted record.
The predetermined processing is a processing based on the processing information of the query. The predetermined processing is, for example, a processing of calculating an average value of the sales included in the record, and a processing for calculating the sum of the sales included in the record. Further, the predetermined processing includes various processings such as a complicated set operation.
In the example of
The window processing unit 13 detects that the following first data and second data have been inputted. The first data is data (sales “100”) associated with the record of 1/1 where the first flag (start flag “1”) is established in the Nth place (N is 1). The second data is data (sales “200”) associated with the record of 1/2 where the second flag (end flag is “1”) is established in the Mth place (M is 2).
Then, the intermediate data processing unit 14 executes a predetermined processing (for example, calculating an average value of the sales) to data in the range from the first data to the second data. The data output unit 15 executes a processing of outputting the output result (for example, sales “150”) in order from a record in the Nth place (N is 1).
As described above, the record input unit 12 sequentially inputs a plurality of records including processing target data and the first flag and the second flag indicating the range of processing target. The first and second flags are flags indicating the range of processing target.
Then, the window processing unit 13 detects input of the first record including the first flag, and further detects input of the second record including the second flag. When this detection is executed, the intermediate data processing unit 14 executes a predetermined processing to data in the range from processing target data of the first record to processing target data of the second record. Then, the data output unit 15 outputs processing result.
The above processing is described specifically below. The window processing unit 13 establishes a window W21 for the record of 1/1 and the record of 1/2. Based on the processing information of the query, the intermediate data processing unit 14 executes data processing to the two records where the window W21 is established. The data processing is, for example, to calculate an average value of the sales included in the records where the window is established.
The start flag and the end flag of the records of 1/3 and 1/4 are “0” and “0” respectively. Therefore, the window processing unit 13 does not establish a window for the records of 1/3 and 1/4.
The start flag and the end flag of the record of 1/5 are “1” and “0” respectively. The start flag and the end flag of the record of 1/6 are “1” and “1” respectively. Therefore, the window processing unit 13 establishes a window W22 for the record of 1/5 and the record of 1/6. Based on the processing information of the query, the intermediate data processing unit 14 executes data processing to two records where the window W22 is established. In the below description, the intermediate data processing unit 14 also executes data processing to the record where a window is established.
The start flag and the end flag of the record of 1/6 are “1” and “1” respectively. The start flag and the end flag of the record of 1/7 are “0” and “1” respectively. Therefore, the window processing unit 13 establishes a window W23 for the record of 1/6 and the record of 1/7.
The start flag and the end flag of the record of 1/8 are “1” and “1” respectively. Therefore, the window processing unit 13 establishes a window W24 for the record of 1/8.
The window establishment method described with reference to
For example, assume a case where a fifth query for calculating the sum of the sales included in the record of 1/5 and the sales included in the record of 1/6 is executed. Here, the window W22 and the window W23 are established one over another for the record of 1/6. Thus, the record of 1/6 is not deleted until processing of the records of 1/6 and 1/7 is executed.
Thus, this query is executable even when a sixth query for calculating the sum of the sales included in the record of 1/6 and the sales included in the record of 1/7 is inputted. That is, even after data processing of the fifth query has started, the processing target data range may be dynamically changed.
In addition, for example, assume a case where monitoring of fluctuation of the sales is desired. In this assumption, the user establishes a start flag “1” to the start flag of the starting record for starting monitoring of the fluctuation and establishes an end flag “0” to the end flag of the starting record. Then, the user establishes an end flag “1” to the end flag of the ending record ending monitoring of the fluctuation ends, and establishes a start flag “0” to the start flag of the ending record. Further, the user establishes “0” to the start flag and the end flag of each of records between the starting record and the ending record.
With the flags established as above, the intermediate data processing unit 14 executes a predetermined data processing (in the above example, calculation of sales fluctuation) to data in the range from processing target data included in the starting record to processing target data included in the ending record.
With the start flag and the end flag established in the record as above, the user may establish a timing of starting to monitor sales fluctuation in a flexible manner according to circumstances. As a result, user's convenience is improved.
The intermediate data processing unit 14 deletes a record which has been subjected to data processing and thereafter is not subjected to data processing, in order to improve utilization efficiency of the memory. That is, when end flags equivalent to the number of start flags up to the target record are inputted, it may be said that the target record is no longer used.
[Second Data Processing]
The second data processing defines start (or end) of a plurality of windows in one record. For example, in
To define the window as above, for example, an integer equal to or larger than 2 is used as a symbol representing the start flag and the end flag. The window processing unit 13 establishes the window corresponding to a value of the start flag and a value of the end flag in the record.
The window processing unit 13 establishes start of windows of the same number as a numeric value of the start flag in the record including the numeric value of the start flag equal to or larger than 2. Then, the window processing unit 13 establishes the end of the window to which start has been established, in the record including the end flag corresponding to the start flag. Hereinafter, the establishment processing is described with reference to
Table T12 of
The data generation apparatus DGA of
The table T12 has the same configuration as the table T1 of
In the example of
Therefore, the window processing unit 13 establishes a start point of the quantity (1) indicated by a first flag, the start point indicating start of the range, in a record where the first flag (start flag “1” of the record) is established in an Nth place (N is 1). That is, a start point of the quantity indicated by the first flag is established in the record in the Nth place (N is 1). The start point is the start point of the window W31. The range is a range of records to be subjected to a predetermined processing.
The window processing unit 13 establishes an end point indicating the end of the range in a record (record of 1/2) of the quantity (1) where a second flag is established, the record inputted after a record in the Nth place (N is 1). The end point is the end point of the window W32.
The above processing is described specifically below. The window processing unit 13 establishes a window W31 in the record of 1/1 and the record of 1/2. Based on the processing information of the query, the intermediate data processing unit 14 executes data processing to the two records where the window W31 is established. The data processing is, for example, to calculate an average value of the sales of records where the window is established.
The start flag and the end flag of the record of 1/3 are “2” and “1” respectively. The start flag and the end flag of the record of 1/4 are “1” and “2” respectively. Therefore, the window processing unit 13 establishes the start point of two windows W32 and W33 in the record of 1/3. Then, the window processing unit 13 establishes the end point of the window W32 in the record of 1/3, and establishes the end point of the window W33 in the record of 1/4. That is, the window processing unit 13 establishes the window W32 in the record of 1/3, and establishes the window W33 in the record of 1/3 and the record of 1/4. Further, the window processing unit 13 establishes the start point and the end point of the window W34 in the record of 1/4. That is, the window processing unit 13 establishes the window W34 in the record of 1/4. As described above, the end point of windows of the quantity same as the numeric value of the end flag is established in the record including the end flag of the numeric value equal to or larger than 2.
The start flag and the end flag of the record of 1/5 are “2” and “0” respectively. The start flag and the end flag of the record of 1/6 are “0” and “1” respectively. The start flag and the end flag of the record of 1/7 are “1” and “1” respectively.
Therefore, the window processing unit 13 establishes the start point of two windows W35 and W36 in the record of 1/5. Then, the window processing unit 13 establishes the end point of the window W35 in the record of 1/6, and establishes the end point of the window W36 in the record of 1/7. That is, the window processing unit 13 establishes the window W35 in the record of 1/5 and the record of 1/6, and establishes the window W36 in the record of 1/5 to the record of 1/7.
The start flag and the end flag of the record of 1/7 are “1” and “1” respectively. The start flag and the end flag of the record of 1/8 are “0” and “1” respectively. The end point of the window W36 has been established in the record of 1/7. Therefore, the window processing unit 13 establishes a window W37 in the record of 1/7 and the record of 1/8.
Here, for example, assume that a fifth query for calculating the sum of the sales included in the record of 1/5 and the sales included in the record of 1/6 is executed. Here, the window W35 and the window W36 are established one over another in the record of 1/5 and the record of 1/6. Thus, the record of 1/5 and the record of 1/6 are not deleted until processing to the records of 1/5 to 1/7 is executed.
Thus, this query is executable even when a seventh query for calculating the sum of the sales included in the record of 1/5 to the sales included in the record of 1/7 is inputted. That is, even after data processing of the fifth query has started, the processing target data range may be dynamically changed.
According to the window establishment method described with reference to
Next, assume a case where the window processing unit 13 establishes a window in a record illustrated in the table T13 of
In the example of
Therefore, the window processing unit 13 establishes start points of the quantity (5) indicated by the first flag in a record in an Nth place (N is 1) where the first flag (start flag “5” of the record) is established, the start points indicating a start of the range. That is, the window processing unit 13 establishes the start points of the quantity indicated by the first flag in a record in an Nth place (N is 1). The start points are a start point of the window W41 to the window W45. The range is a range of records to be subjected to a predetermined processing.
The window processing unit 13 establishes the end point indicating the end of the range in records (records of 1/2, 1/3, 1/5, 1/6 and 1/7) of the quantity (5) where the second flag is established, the records inputted after the record in the Nth place (N is 1). The end point is an end point in the window W41 to the window W45.
As described above, the window processing unit 13 establishes the start points of the quantity (5) indicated by the first flag in a first record (record of 1/1) including the first flag, the start point indicating a start of the range. The range is a range of records to be subjected to a predetermined processing. Then, the window processing unit 13 establishes the end point indicating the end of the range in each of second records (records of 1/2, 1/3, 1/5, 1/6 and 1/7) of the quantity where the second flag is established, the records inputted after the first record.
Then, the intermediate data processing unit 14 executes a predetermined processing to data in a range from processing target data (sales “100”) of the first record where the start point is established to processing target data of the second record where the end point is established.
The above processing is described specifically below. The window processing unit 13 establishes the start point of five windows W41 and W45 in the record of 1/1. Then, the window processing unit 13 establishes the end point of the window W41 in the record of 1/2, establishes the end point of the window W42 in the record of 1/3, and establishes the end point of the window W43 in the record of 1/5. Then, the window processing unit 13 establishes the end point of the window W44 in the record of 1/6, and establishes the end point of the window W45 in the record of 1/7.
Then, the intermediate data processing unit 14 executes a predetermined processing (for example, calculation of the average value of the sales) to data of a plurality of records where any one of the window W41 to the window W45 is established. In the above example, the intermediate data processing unit 14 calculates the average value (“150”) of data (sales “100”, sales “200”) of a plurality of records where the window W41 is established. The intermediate data processing unit 14 also calculates the average value (“133”) of data (sales “100”, sales “200”, “100”) of a plurality of records where the window W42 is established.
[Third Data Processing]
In the second data processing, when a plurality of window starts (or ends) are defined in one record, the number of defined windows or the plurality of windows is restricted to a designated number. In other words, the second data processing allows definition of only a predetermined number of window starts (or window ends) in one record.
For example, assume that in the example described with reference to
Thus, infinite window starts (or ends) are defined in one record. For the purpose of the definition, an infinite code is assigned to either the start flag or the end flag of the record. The infinite code is, for example, “−1”. As described above, the first flag is information (infinite code) indicating that the number of ranges is infinite. Hereinafter, this establishment is described with reference to
For example, assume a case where the window processing unit 13 establishes windows in records illustrated in a table T14 of
In the example of
Therefore, the window processing unit 13 establishes a start point being infinite in a record in an Nth (N is 1) place where the first flag of the infinite code is established. The start point is a start point of windows W51 to W5q (lowercase letter q is an integer equal to or larger than 2). Next, the window processing unit 13 establishes the end point in each of a plurality of records (records of 1/2 to 1/8) where the second flag is established, the records inputted after a record in an Nth place.
As described above, the window processing unit 13 establishes a start point being infinite in a first record (record of 1/1) where the first flag is established, and establishes the end point in each of a plurality of second records where the second flag is established, the plurality of second records inputted after the first record.
The above processing is described specifically below. The window processing unit 13 establishes the start point of q windows W51 to W5q in the record of 1/1. To simplify description, only windows W51 to W56 are illustrated in
Then, the window processing unit 13 establishes the end point of the window W51 in the record of 1/2, establishes the end point of the window W52 in the record of 1/3, and establishes the end point of the window W53 in the record of 1/5. Then, the window processing unit 13 establishes the end point of the window W54 in the record of 1/6, and establishes the end point of the window W55 in the record of 1/7. Then, the window processing unit 13 establishes the end point of two windows W56 in the record of 1/8.
According to the window establishment method described with reference to
[Fourth Data Processing]
The third data processing defines infinite window starts (or ends) in one record. In the fourth data processing, processing of stopping (or canceling) the establishment of infinite windows is described. For the canceling, special information is embedded into the record. The special information is a symbol indicating that the establishment of infinite windows is canceled.
The processing program PG2 of the processing apparatus MA additionally establishes, in the record, special information indicating that the establishment of infinite windows is canceled. The special information is an example of the third flag indicating stop of the establishment of the end point.
That is, the processing program PG2 allows to establish the third flag indicating stop of the establishment of the end point in the record. The processing apparatus MA outputs the record to the data processing apparatus DPA.
The record input unit 12 of the data processing apparatus DPA inputs the record outputted from the processing apparatus MA, the record further including the third flag indicating cancellation of the establishment of the end point, and stores into the RAM 102 in the table format illustrated in
Table T15 stores one record in each of second and subsequent lines. The table T15 is a table with the special field added to the table T11 of
In the table T15, the record of 1/1 to the record of 1/5 are the same as the record of 1/1 to the record of 1/5 in the table T14 of
Therefore, the window processing unit 13 establishes the start point of three windows W61 to W63 in the record of 1/1. Then, the window processing unit 13 establishes the end point of the window W61 in the record of 1/2, establishes the end point of the window W62 in the record of 1/3, and establishes the end point of the window W63 in the record of 1/5. That is, the window processing unit 13 establishes the window W61 in records of 1/1 and 1/2, establishes the window W62 in records of 1/1 to 1/3, and establishes the window W63 in records of 1/1 to 1/5.
The window processing unit 13 detects input of the record of 1/1 where a first flag (infinite code) being information indicating the number of range is infinite is established, and then detects input of the record of 1/6 where a third flag (special information “1”) is established. Then, upon detecting input of the record of 1/6, the window processing unit 13 executes the following processing. That is, the window processing unit 13 cancels the processing of establishing the end point corresponding to the first flag (infinite code) in records following a record where the third flag is established.
As described above, the window processing unit 13 detects input of the first record (record of 1/1) where the first flag being information indicating the number of ranges is infinite is established, and then detects input of the record of 1/6 where the third flag is established. Then, the window processing unit 13 cancels the processing of establishing the end point in records following a record where the third flag is established.
The above processing is described specifically below. Upon detecting input of the record of 1/6 where the third flag is established, the window processing unit 13 cancels the processing of establishing windows having the start point thereof in the record of 1/1 as illustrated in
The special information, the start flag and the end flag of the record of 1/6 are “1”, “1” and “0” respectively. The special information, the start flag and the end flag of the record of 1/7 are “0”, “1” and “1” respectively. The special information, the start flag and the end flag of the record of 1/8 are “0”, “0” and “1” respectively. Therefore, the window processing unit 13 establishes a window W64 in the record of 1/6 and the record of 1/7. Then, the window processing unit 13 establishes a window W65 in the record of 1/7 and the record of 1/8.
According to the window establishment method described with reference to
For example, assume a case where the total sales from the beginning day to a middle day of the month is calculated every day. The middle day is a day between a first day and a last day of the month. In case of January, the middle day is a day among 1/1 to 1/31. To implement this calculation, an infinite window start is established in a record of the first day of the month, and the end of the window is established in a record of every day of a month.
The record for calculating the total sales from the beginning day to a middle day every day in each month is described with reference to
The table T16 has the same configuration as the table T15 of
For records of February, windows are established in the same manner as January. The window processing unit 13 establishes windows W2001 to W2003 in the record of 2/1 to the record of 2/3.
According to the window establishment method described with reference to
[Fifth Data Processing]
As described with reference to
Thus, when an infinite window is established in a record, the data processing apparatus DPA executes data processing based on the record to generate intermediate data and then deletes the record from the RAM 102.
For example, when executing data processing of records following a record where the start point of a window is established, the intermediate data processing unit 14 performs the following processing. Also, when executing data processing of records preceding a record where the end point of the window is established, the intermediate data processing unit 14 performs the following processing. That is, the intermediate data processing unit 14 stores execution result of the data processing into the buffer and then deletes the inputted record.
Data processing in consideration of efficient utilization of the memory area is described with reference to
Table T17 is a table extracted from the table T14 of
The record input unit 12 sequentially inputs the record of 1/1 to the record of 1/s (lowercase letter s is an integer equal to or larger than 1 and equal to or smaller than 6) and stores in the RAM 102. The window processing unit 13 establishes a window W5s (for the window W5s, see
When the record of 1/1 is stored in the RAM 102, the intermediate data processing unit 14 calculates the total sales “100” of the record of 1/1 and stores into the RAM 102 as intermediate data MDT1. Then, the intermediate data processing unit 14 deletes the record of 1/1 from the RAM 102.
Next, when the record of 1/2 is stored into the RAM 102, the intermediate data processing unit 14 calculates the total sales “300” by performing addition (see reference numeral AD1) of the sales “200” of the record of 1/2 and the intermediate data MD1 (“100”) and stores into the RAM 102 as intermediate data MDT2. Since the window W51 (see
Next, when the record of 1/3 is stored in the RAM 102, the intermediate data processing unit 14 calculates the total sales “400” by performing addition (see reference numeral AD2) of the sales “100” of the record of 1/3 and the intermediate data MDT2 (“300”) and stores into the RAM 102 as intermediate data MDT3. Then, the intermediate data processing unit 14 deletes the record of 1/3 from the RAM 102. Here, since the window W52 (see
Next, when the record of 1/4 is stored in the RAM 102, the intermediate data processing unit 14 calculates the total sales “530” by performing addition (see reference numeral AD3) of the sales “130” of the record of 1/4 and the intermediate data MDT3 (“400”) and stores into the RAM 102 as intermediate data MDT4. Then, the intermediate data processing unit 14 deletes the record of 1/4 from the RAM 102. Here, since no window is established in records of 1/1 to 1/4, the data output unit 15 does not output the total sales “530” (see reference numeral MDT4) of the sales of 1/1 to the sales of 1/4.
Next, when the record of 1/5 is stored in the RAM 102, the intermediate data processing unit 14 calculates the total sales “730” by performing addition (see reference numeral AD4) of the sales “200” of the record of 1/5 and the intermediate data MDT4 (“530”) and stores into the RAM 102 as intermediate data MDT5. Then, the intermediate data processing unit 14 deletes the record of 1/5 from the RAM 102. Here, since the window W53 (see
Next, the intermediate data processing unit 14 calculates the total sales “950” by performing addition (see reference numeral AD5) of the sales “220” of the record of 1/6 and the intermediate data MDT5 (“730”) and stores into the RAM 102 as intermediate data MDT6. Then, the intermediate data processing unit 14 deletes the record of 1/6 from the RAM 102. Here, since the window W54 (see
As described above, data processing may be executed and processing result may be outputted by utilizing latest records and intermediate data without executing data processing to records stored in the RAM 102 every time the window or the processing target data range is changed.
That is, when infinite windows are established in a record, the data processing apparatus DPA executes data processing based on the record to generate intermediate data and then deletes the record from the RAM 102. As a result, a record may be deleted from the memory area of the RAM 102 as appropriate, and thereby the memory area of the RAM 102 may be utilized efficiently.
Next, data processing in consideration of efficient utilization of the memory area is described with reference to
A dotted right arrow of
A reference numeral BF1 represents a buffer configured to store the sales for one day. A reference numeral BF2 represents a buffer configured to store the sales for three days. The buffer BF1 is a buffer configured to store the sales of a first day of the output target month. The buffer BF2 is a buffer configured to store the sales up to two days before the reference record. The buffer BF2 is a queue of FIFO (First In, First Out). The intermediate data processing unit 14 stores the sales of the reference record in a lower most area (see “REFERENCE” in
The intermediate data processing unit 14 secures the area of buffers BF1 and BF2 in the RAM 102 before executing the second data processing.
The record input unit 12 sequentially inputs the record of 1/1 into the record of 1/s (lowercase letter s is an integer equal to or larger than 1 and equal to or smaller than 6) and stores in the RAM 102. The window processing unit 13 establishes a window W5s (for the window W5s, see
When the record of 1/1 is stored in the RAM 102, the intermediate data processing unit 14 stores the sales “100” of the record of 1/1 into the buffer BF1. Then, the intermediate data processing unit 14 stores the sales “100” of the record of 1/1 into the lower most area of the buffer BF2. Then, the intermediate data processing unit 14 deletes the record of 1/1 from the RAM 102.
When the record of 1/2 is stored in the RAM 102, the intermediate data processing unit 14 stores the sales “100” of the record of 1/1 into the middle area of the buffer BF2, and stores the sales “200” of the record of 1/2 into the lower most area of the buffer BF2. Now, 1/2 is the reference day.
Since the window W51 (see
When the record of 1/3 is stored in the RAM 102, the intermediate data processing unit 14 stores the sales “100” of the record of 1/1 into the upper most area of the buffer BF2, and stores the sales “200” of the record of 1/2 into the middle area of the buffer BF2. Then, the intermediate data processing unit 14 stores the sales “100” of the record of 1/3 into the lower most area of the buffer BF2. Now, 1/3 is the reference day.
Since the window W52 (see
When the record of 1/4 is stored in the RAM 102, the intermediate data processing unit 14 stores the sales “200” of the record of 1/2 into the upper most area of the buffer BF2, and stores the sales “100” of the record of 1/3 into the middle area of the buffer BF2. Then, the intermediate data processing unit 14 stores the sales “130” of the record of 1/4 into the lower most area of the buffer BF2. Now, 1/4 is the reference day.
When the record of 1/5 is stored in the RAM 102, the intermediate data processing unit 14 stores the sales “100” of the record of 1/3 into the upper most area of the buffer BF2, and stores the sales “130” of the record of 1/4 into the middle area of the buffer BF2. Then, the intermediate data processing unit 14 stores the sales “200” of the record of 1/5 into the lower most area of the buffer BF2. Now, 1/5 is the reference day.
Since the window W53 (see
When the record of 1/6 is stored in the RAM 102, the intermediate data processing unit 14 stores the sales “130” of the record of 1/4 into the upper most area of the buffer BF2, and stores the sales “200” of the record of 1/5 into the middle area of the buffer BF2. Then, the intermediate data processing unit 14 stores the sales “220” of the record of 1/6 into the lower most area of the buffer BF2. Now, 1/6 is the reference day.
Since the window W54 (see
As described with reference to
As described with reference to
Although flags described with reference to
[Flow of Data Processing]
Next, a flow of data processing according to this embodiment is described with reference to
A window open number WON and a window close number WCN are variables for managing the number of windows established in execution of data processing. A buffer BUFF stores processing target data (for example, sales) and the number of window starts (start flags).
The window processing unit 13 performs the following processing when a query is inputted from the query input unit 11. That is, the window processing unit 13 secures an area for storing the window open number WON and the window close number WCN in a data processing region RG of the RAM 102, and further secures an area of the buffer BUFF. In the drawing, the window start number in the buffer BUFF is abbreviated as “START” for convenience of illustrating in the drawing.
Starting date SMD represents the starting date of the intermediate data. Ending date EMD represents the ending date of the intermediate data. Total sales TMD is the total sales.
The intermediate data processing unit 14 performs the following processing when a query is inputted from the query input unit 11. That is, the intermediate data processing unit 14 secures an area for storing the starting date SMD, the ending date EMD, and the total sales TMD in the data processing region RG of the RAM 102.
The output data table OUTD is a table indicating data outputted to the terminal apparatus TA of
(Flow Diagram)
Step S1: The record input unit 12 inputs one record from the processing apparatus MA of
Step S2: The window processing unit 13 determines whether the inputted record includes window reset information (that is, special flag “1”).
If the input record includes the window reset information (S2: YES), the processing proceeds to S5. If the input record does not include the window reset information (S2: NO), the processing proceeds to S3.
Step S3: The window processing unit 13 determines whether the window start number of the input record is not “0”. The window start number is a start flag of the record. If the window start number is not “0” (S3: YES), the processing proceeds to S6. If the window start number is “0” (S3: NO), the processing proceeds to S4.
Step S4: The window processing unit 13 determines whether the window open number WON is not “0”. If the window open number WON is not “0” (S4: YES), the processing proceeds to S9. If the window open number WON is “0” (S4: NO), the processing proceeds to S1.
Step S5: The window processing unit 13 clears the buffer BUFF, the window open number WON, the window close number WCN, the starting date SMD, the ending date EMD, and the total sales TMD. This clearance stops establishment of infinite windows. After S5, the processing proceeds to S3.
Step S6: The window processing unit 13 determines whether the window start number (start flag) of the inputted record is an infinite code or whether the window open number WON is an infinite code.
If the window start number of the inputted record is an infinite code or if the window open number WON is an infinite code (S6: YES), the processing proceeds to S7. If S6 is not YES (S6: NO), the processing proceeds to S8.
Step S7: The window processing unit 13 sets the window open number WON to the infinite code (“−1”). After S7, the processing proceeds to S9.
Step S8: The window processing unit 13 adds the window start number of the input record to the window open number WON. After S8, the processing proceeds to S9.
Step S9: The intermediate data processing unit 14 generates new intermediate data from the input record and the current intermediate data in accordance with the inputted query (hereinafter referred to as the query C as appropriate). After S9, the processing proceeds to S10.
Step S10: The window processing unit 13 determines whether the window open number WON is an infinite code. If the window open number WON is an infinite code (S10: NO), the processing proceeds to S12 of
Step S11: The window processing unit 13 adds data desired for updating the intermediate data, and the window start number of the input record out of data included in the input record into the buffer BUFF. Data desired for updating the intermediate data is, for example, data processing target data included in the query C. After S11, the processing proceeds to S12 of
Step S12 of
Step S13: The window processing unit 13 determines whether the window close number WCN is not “0” and the window open number WON is not “0”. If the window close number WCN is not “0” and the window open number WON is not “0” (S13: YES), the processing proceeds to S14. If S13 is not YES (S13: NO), the processing proceeds to S1 of
Step S14: The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD, ending date EMD, and total sales TMD) of the RAM 102, and the data output unit 15 outputs the output data generated by the intermediate data processing unit 14 to the terminal apparatus TA of
Step S15: The window processing unit 13 determines whether the window close number WCN is an infinite code. If the window close number WCN is an infinite code (S15: NO), the processing proceeds to S17. If the window close number WCN is not an infinite code (S15: YES), the processing proceeds to S16.
Step S16: The window processing unit 13 subtracts one from the window close number WCN. After S16, the processing proceeds to S17.
Step S17: The window processing unit 13 determines whether the window open number WON is an infinite code. If the window open number WON is an infinite code (S17: NO), the processing proceeds to S19. If the window open number WON is not an infinite code (S17: YES), the processing proceeds to S18.
Step S18: The window processing unit 13 subtracts one from the window open number WON. After S18, the processing proceeds to S19.
Step S19: The window processing unit 13 determines whether the buffer BUFF is not empty. If the buffer BUFF is empty (S19: NO), the processing proceeds to S13. If the buffer BUFF is not empty (S19: YES), the processing proceeds to S20.
Step S20: The window processing unit 13 subtracts one from the window start number stored in the head of the buffer BUFF. After S20, the processing proceeds to S21.
Step S21: The window processing unit 13 determines whether the window start number stored in the head of the buffer BUFF is “0”. If the window start number stored in the head of the buffer BUFF is not “0” (S21: NO), the processing proceeds to S13. If the window start number stored in the head of the buffer BUFF is “0” (S21: YES), the processing proceeds to S22.
Step S22: The intermediate data processing unit 14 updates the intermediate data based on the data stored in the head of the buffer BUFF and deletes the data stored in the head of the buffer BUFF from the buffer BUFF. After S22, the processing proceeds to S23.
Step S23: The intermediate data processing unit 14 determines whether the buffer BUFF is empty. If the buffer BUFF is not empty (S23: YES), the processing proceeds to S21. If the buffer BUFF is empty (S23: NO), the processing proceeds to S13.
(Record of January 1st)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
As illustrated in
The input record of 1/1 does not include window reset information (or, special flag “1”). The window start number of the input record is “1”. The window start number of the input record is not an infinite code (for example, “−1”), or the window open number WON is not an infinite code. Therefore, the window processing unit 13 determines NO in S2, YES in S3 and NO in S6. Then, the window processing unit 13 adds the window start number “1” of the input record to the window open number WON “-” (“0”) to get the window open number WON “1” as illustrated in
Reference is made to
Since the window open number WON is “1” and not an infinite code, the window processing unit 13 determines as YES in S10. As illustrated in
Since the window close number WCN is “0” and the window open number WON is “1”, the window processing unit 13 determines as NO in S13. Then, the processing proceeds to record input processing (S1).
(Record of January 2nd)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
The input record of 1/2 does not include window reset information (or, special flag “1”). The window start number of the input record is “1”. The window start number of the input record is not an infinite code (for example, “−1”), or the window open number WON is not an infinite code. Therefore, the window processing unit 13 determines NO in S2, YES in S3 and NO in S6. Then, the window processing unit 13 adds the window start number “1” of the input record to the window open number WON “1” (see
Reference is made to
Since the window open number WON is “2” and not an infinite code, the window processing unit 13 determines as YES in S10. As illustrated in
Since the window close number WCN is “1” and the window open number WON is “2”, the window processing unit 13 determines as YES in S13.
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/1”, ending date EMD “1/2”, and total sales TMD “300”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/1”, the ending date “1/2” and the total sales “300”. The output data is shown in the second line of the output data table OUTD of
As described above, the window processing unit 13 establishes the window start point in the record of 1/1 by storing 1/1 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/2 by storing 1/2 into the RAM 102 as the ending date EMD. Then, the intermediate data processing unit 14 calculates the sum “300” of the sales “100” of the record of 1/1 and the sales “200” of the record of 1/2. The data output unit 15 outputs start “1/1” and end “1/2” of data processing and the sum “300”.
In
Then, in
Then, in
As illustrated in
Specifically, the intermediate data processing unit 14 subtracts the sales “100” (see
Next, the intermediate data processing unit 14 deletes the starting date “1/1” (see
Next, the intermediate data processing unit 14 deletes data (sales “100”, window start number “0” (see
As illustrated in
As illustrated in
(Record of January 3rd)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
The input record of 1/3 does not include window reset information (or, special flag “1”). The window start number of the input record is “1”. The window start number of the input record is not an infinite code (for example, “−1”), or the window open number WON is not an infinite code (see
Reference is made to
Since the window open number WON is “2” and not an infinite code, the window processing unit 13 determines as YES in S10. As illustrated in
Since the window close number WCN is “−1” and the window open number WON is “2”, the window processing unit 13 determines as YES in S13.
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/2”, ending date EMD “1/3”, and total sales TMD “300”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/2”, the ending date “1/3” and the total sales “300”. The output data is shown in the third line of the output data table OUTD of
As described above, the window processing unit 13 establishes the window start point in the record of 1/2 by storing 1/2 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/3 by storing 1/3 into the RAM 102 as the ending date EMD. Then, the intermediate data processing unit 14 calculates the sum “300” of the sales “200” of the record of 1/2 and the sales “100” of the record of 1/3. The data output unit 15 outputs start “1/2” and end “1/3” of data processing and the sum “300”.
In
Then, in
Then, in
As illustrated in
Specifically, the intermediate data processing unit 14 subtracts the sales “200” (see
Next, the intermediate data processing unit 14 deletes the starting date “1/2” (see
Next, the intermediate data processing unit 14 deletes data (sales “200”, window start number “0” (see
As illustrated in
As illustrated in
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/3”, ending date EMD “1/3”, and total sales TMD “100”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/3”, the ending date “1/3” and the total sales “100”. The output data is shown in the fourth line of the output data table OUTD of
As described above, the window end number of the record of 1/3 is the infinite code “−1”, and the window start number of the record of 1/3 is “1”. Therefore, the window processing unit 13 establishes the window start point in the record of 1/3 by storing 1/3 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/3 by storing 1/3 into the RAM 102 as the ending date EMD. Then, the data output unit 15 outputs the sales “100” of the record of 1/3.
In
Then, in
Then, as illustrated in
Specifically, the intermediate data processing unit 14 subtracts the sales “100” (see
Next, the intermediate data processing unit 14 deletes the starting date “1/3” (see
Next, the intermediate data processing unit 14 deletes data (sales “100”, window start number “0” (see
As illustrated in
(Record of January 4th)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
The input record of 1/4 does not include window reset information (or, special flag “1”). The window start number of the input record is “2”. The window start number of the input record is not an infinite code (for example, “−1”), or the window open number WON is not an infinite code (see
Reference is made to
In
Since the window close number WCN is “1” and the window open number WON is “2”, the window processing unit 13 determines as YES in S13.
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/4”, ending date EMD “1/4”, and total sales TMD “130”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/4”, the ending date “1/4” and the total sales “130”. The output data is shown in the fourth line in the output data table OUTD of
As described above, the window start number of the record of 1/4 is “2”, and the window end number of the record of 1/4 is “1”. Therefore, the window processing unit 13 establishes the window start point in the record of 1/4 by storing 1/4 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/4 by storing 1/4 into the RAM 102 as the ending date EMD. Then, the data output unit 15 outputs the sales “130” of the record of 1/4.
In
Then, in
Then, in
As illustrated in
Since the window close number WCN is “0”, the window processing unit 13 determines as NO in S13. Then, the processing proceeds to record input processing (S1). Before executing the processing in S1, the record input unit 12 deletes the record inputted this time (record of 1/4) from the RAM 102.
(Record of January 5th)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
The input record of 1/5 does not include window reset information (or, special flag “1”). The window start number of the input record is “2”. The window start number of the input record is not an infinite code (for example, “−1”), or the window open number WON is not an infinite code (see
Reference is made to
In
Since the window close number WCN is “2” and the window open number WON is “3”, the window processing unit 13 determines as YES in S13.
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/4”, ending date EMD “1/5”, and total sales TMD “330”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/4”, the ending date “1/5” and the total sales “330”. The output data is shown in the sixth line of the output data table OUTD of
As described above, the window open number of the record of 1/4 is “2”, and the window end number of the record of 1/4 is “1”. The window start number of the record of 1/5 is “2”, and the window end number of the record of 1/5 is “2”. Therefore, the window processing unit 13 establishes the window start point in the record of 1/4 by storing 1/4 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/5 by storing 1/5 into the RAM 102 as the ending date EMD. The intermediate data processing unit 14 calculates the sum “330” of the sales “130” of the record of 1/4 and the sales “200” of the record of 1/5. The data output unit 15 outputs start “1/4” and end “1/5” of data processing and the sum “330”.
In
Then, in
Then, in
As illustrated in
Specifically, the intermediate data processing unit 14 subtracts the sales “130” (see
Next, the intermediate data processing unit 14 deletes the starting date “1/4” (see
Next, the intermediate data processing unit 14 deletes data (sales “130”, window start number “0” (see
As illustrated in
As illustrated in
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/5”, ending date EMD “1/5”, and total sales TMD “200”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/5”, the ending date “1/5” and the total sales “200”. The output data is shown in the seventh line in the output data table OUTD of
As described above, the window start number of the record of 1/5 is “2”, and the window end number of the record of 1/5 is “2”. Therefore, the window processing unit 13 establishes the window start point in the record of 1/5 by storing 1/5 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/5 by storing 1/5 into the RAM 102 as the ending date EMD. Then, the data output unit 15 outputs the sales “200” of the record of 1/5.
In
In
Then, in
As illustrated in
Since the window close number WCN is “0” as illustrated in
(Record of January 6th)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
The input record of 1/6 does not include window reset information (or, special flag “1”). The window start number of the input record is “−1”. That is, the window start number of the input record is an infinite code.
Therefore, the window processing unit 13 determines NO in S2, YES in S3 and YES in S6. Then, the window processing unit 13 sets the window open number WON to the infinite code (“−1”) as illustrated in
Reference is made to
In
Since the window close number WCN is “1” and the window open number WON is “−1”, the window processing unit 13 determines as YES in S13.
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/5”, “1/6”, ending date EMD “1/6”, and total sales TMD “420”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/5”, the ending date “1/6” and the total sales “420”. The output data is shown in the eighth line in the output data table OUTD of
As described above, the window start number of the record of 1/5 is “2”, and the window end number of the record of 1/5 is “2”. The window end number of the record of 1/6 is “1”. Therefore, the window processing unit 13 establishes the window start point in the record of 1/5 by storing 1/5 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/6 by storing 1/6 into the RAM 102 as the ending date EMD. The intermediate data processing unit 14 calculates the sum “420” of the sales “200” of the record of 1/5 and the sales “220” of the record of 1/6. The data output unit 15 outputs start “1/5” and end “1/6” of data processing and the sum “420”.
In
Then, in
In
As illustrated in
Specifically, the intermediate data processing unit 14 subtracts the sales “200” (see
Next, the intermediate data processing unit 14 deletes the starting date “1/5” (see
Next, the intermediate data processing unit 14 deletes data (sales “200”, window start number “0” (see
As illustrated in
Then, as illustrated in
(Record of January 7th)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
The input record of 1/7 does not include window reset information (or, special flag “1”). The window start number of the input record is “0”. Further, the window open number WON is “−1”. Therefore, the window processing unit 13 determines NO in S2, NO in S3 and YES in S4. Then, the processing proceeds to S9.
Reference is made to
In
Since the window close number WCN is “1” and the window open number WON is “−1”, the window processing unit 13 determines as YES in S13.
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/6”, “1/7”, the ending date EMD “1/7”, and the total sales TMD “370”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/6”, the ending date “1/7” and the total sales “370”. The output data is shown in the ninth line of the output data table OUTD of
As described above, the window start number of the record of 1/6 is “−1” (infinite code), and the window end number of the record of 1/6 is “1”. The window end number of the record of 1/7 is “1”. Therefore, the window processing unit 13 establishes the window start point in the record of 1/6 by storing 1/6 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/7 by storing 1/7 into the RAM 102 as the ending date EMD. The intermediate data processing unit 14 calculates the sum “370” of the sales “220” of the record of 1/6 and the sales “150” of the record of 1/7. The data output unit 15 outputs start “1/6” and end “1/7” of data processing and the sum “370”.
In
Then, in
In
As illustrated in
(Record of January 8th)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
The input record of 1/8 includes window reset information (or, special flag “1”). Therefore, as illustrated in
The window start number of the input record is “−1”. That is, the window start number of the input record is an infinite code.
Therefore, the window processing unit 13 determines YES in S3 and YES in S6. Then, the window processing unit 13 sets the window open number WON to the infinite code (“−1”) as illustrated in
Reference is made to
In
Since the window close number WCN is “1” and the window open number WON is “−1”, the window processing unit 13 determines as YES in S13.
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/8”, ending date EMD “1/8”, and total sales TMD “220”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/8”, the ending date “1/8” and the total sales “220”. The output data is shown in the tenth line of the output data table OUTD of
As described above, the window start number of the record of 1/8 is “−1” (infinite code), and the window end number of the record of 1/8 is “1”. Therefore, the window processing unit 13 establishes the window start point in the record of 1/8 by storing 1/8 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/8 by storing 1/8 into the RAM 102 as the ending date EMD. The data output unit 15 outputs start “1/8” and end “1/8” of data processing and the sum “220”.
In
In
In
In
(Record of January 9th)
The record input unit 12 inputs one record from the processing apparatus MA of
In the input record table IND of
Therefore, the window processing unit 13 determines NO in S2, NO in S3 and YES in S4, and the processing proceeds to S9.
Reference is made to
In
Since the window close number WCN is “1” and the window open number WON is “−1”, the window processing unit 13 determines as YES in S13.
The intermediate data processing unit 14 generates output data from the intermediate data (starting date SMD “1/8”, “1/9”, ending date EMD “1/9”, and total sales TMD “400”) of the RAM 102, and the data output unit 15 outputs the output data to the terminal apparatus TA (S14). The output data includes the starting date “1/8”, the ending date “1/9” and the total sales “400”. The output data is shown in the eleventh line of the output data table OUTD of
As described above, the window start number of the record of 1/8 is “−1” (infinite code), the window start number of the record of 1/9 is “0”, and the window end number of the record of 1/9 is “1”. Therefore, the window processing unit 13 establishes the window start point in the record of 1/8 by storing 1/8 into the RAM 102 as the starting date SMD. The window processing unit 13 establishes the window end point in the record of 1/9 by storing 1/9 into the RAM 102 as the ending date EMD. Then, the intermediate data processing unit 14 calculates the sum “400” of the sales “220” of the record of 1/8 and the sales “180” of the record of 1/9. The data output unit 15 outputs start “1/8” and end “1/9” of data processing and the sum “400”.
In
In
In
In
When the data processing apparatus DPA includes the function of the processing unit 10, the data generation apparatus DGA of
The processing unit 10 of the data processing apparatus DPA processes the record outputted from the data generation apparatus DGA and outputs the processed record (that is, the record into which window information is embedded) to the record input unit 12. The record input unit 12 inputs the record from the processing unit 10.
All examples and conditional language recited herein are intended for pedagogical purposes to aid the reader in understanding the invention and the concepts contributed by the inventor to furthering the art, and are to be construed as being without limitation to such specifically recited examples and conditions, nor does the organization of such examples in the specification relate to a showing of the superiority and inferiority of the invention. Although the embodiments of the present invention have been described in detail, it should be understood that the various changes, substitutions, and alterations could be made hereto without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
2015-068640 | Mar 2015 | JP | national |