In this embodiment, it is supposed that the records are sorted. Therefore, the normal RDB is not practical in viewpoints of the processing speed and the storage capacity, and the data structure as shown in
The DB server 5 includes a search instruction receiver 51 that receives search instructions from the user terminal 3 via the network 1, a search instruction data storage 52 that stores data relating to the search instructions received by the search instruction receiver 51, an event judgment processor 53 that carries out an event judgment processing by using the data stored in the search instruction data storage 52, an event management table storage 54 that stores a processing result of the event judgment processor 53, a search preprocessor 55 that carries out a processing by using the data stored in the search instruction data storage 52, the event management table storage 54 and the FAST structure data storage 56, an event history condition table storage 57 that stores an event history condition table that is a processing result by the search preprocessor 55, a sorting result storage 58 that stores data of a sorting result that is a processing result by the search preprocessor 55, a search processor 59 that extracts pertinent data by carrying out a search processing according to an instruction from the search preprocessor 55 by using the FAST structure data storage 56, the sorting result storage 58 and the event history condition table storage 57, a search result storage 60 that stores a processing result by the search processor 59, and a search result output unit 61 that outputs data stored in the search result storage 60 to the user terminal 3 of the requesting source. Incidentally, the search processor 59 includes a state transition manager 591 that carries out management of the state transitions based on settings by the search preprocessor 55.
Next, an operation of the system shown in
First, the user of the user terminal 3 operates the user terminal 3 to access the DB server 5, and causes it to display an input screen of a search instruction on a display device. For example, a screen as shown in
The user designates necessary conditions in the screen as shown in
The search instruction receiver 51 of the DB server 5 receives the search instruction from the user terminal 3, and stores the data relating to the search instruction into the search instruction data storage 52 (
Then, the event judgment processor 53 judges whether or not all events have been processed (step S15), and when any unprocessed event exists, the processing returns to the step S11. On the other hand, when all events have been processed, the processing returns to the original processing.
Returning to the explanation of
First, the search preprocessor 55 identifies an item name used in each event from the event management table stored in the event management table storage 54, obtains, for each identified item name, all item values from the FAST structure data storage 56, and configures an event history condition table for each identified item name (
Next, the search preprocessor 55 refers to the event management table in the event management table storage 54 and the search instruction data storage 52 to associate one event with one state, and sets a flag of a corresponding item value ON to generate the event flags for each item value (step S23).
The event order condition in the search instruction relating to the processing is stored in the search instruction data storage 52. According to this order condition, the event is associated with the state. According to the aforementioned conditions, because the event 1 (E1), the event 2 (E2) and the event 3 (E3) are searched in this order, the event 1 is associated with the state S1, the event 2 with the state S2, and the event 3 with the state S3. Then, they are stored into the event history condition table. When the processing is carried out by this step, the event history condition table becomes a state as shown in
Furthermore, as for each state, ON is set to the flag of the corresponding item value. According to the aforementioned conditions, because “DVD player”, “HDD recorder” or “TV” is designated in the event 1 (E1), “DVD player”, “HDD recorder” and “TV” are identified as the corresponding item values. Moreover, “1” is set in the column of the state S1 corresponding to the event 1 and in the respective lines of “DVD player”, “HDD recorder” and “TV”, and “0” is set in the same column and in the other lines.
Incidentally, there is a case where the item value designated in the search condition is not completely identical to the item value actually registered in the database. In this embodiment, it is not judged for each record whether or not the item values are identical. Because it is judged at this stage whether or not the item value registered in the value table 9007 is identical to the item value designated in the search condition, the subsequent processing is simplified.
Similarly, because “Software” is designated in the event 2 (E2), “DVD software” is identified as the corresponding item value. Thus, in a case where there is no complete conformity, as compared with the conventional technique in which the comparison is carried out for each record, the subsequent processing in this embodiment becomes efficient. Then, “1” is set in the column of the state S2 corresponding to the event 2 and in the line “DVD software”, and “0” is set in the other lines.
Because “DVD-R” or “CD-RW” is designated in the event 3 (E3), only “DVD-R” is identified as the corresponding item value. Thus, in a case where the search condition including the completely different item value is designated, it is easily understood that the comparison for each record is much inefficient. Then, “1” is set in the column of the state S3 corresponding to the event 3 and in the line “DVD-R”.
Then, bits of the flags set from the state S1 to S8 are treated as a binary bit string. Incidentally, the earlier the order of the event, the lower bit “1” is set, and the later the order of the event, the higher bit “1” is set. Thus, according to the order of the event, the event flag is set. In a case where the same order is designated, even if the different item values are found, the same event flag is set.
Because the event history condition table is completed at this stage, data of this event history condition table is stored in the event history condition table storage 57. Incidentally, although it is described later, a table on behalf of the value table 9007 is required. Therefore, a table 501 is generated as shown in
After that, the search preprocessor 55 refers to the FAST structure data storage 56, sorts search target data in the FAST structure according to the group item and the sort item, which are stored in the search instruction data storage 52, and stores the sorting result into the sorting result storage 58 (step S25). This processing itself is the same as the conventional technique. The data stored in the sorting result storage 58 is data as shown in
In addition, the search preprocessor 55 sets conditions of the state transitions into the state transition manager 591 according to the search instruction (step S27). Although the details are explained below, the conditions of the state transitions can be variously set. For example, as for the aforementioned specific example, there is a case where the conditions of the state transition should be set according to the intention of the searcher, such as a treatment in a case where the event 1 occurs after the event 1, a treatment in a case where any event other than the events 1 to 3 occurs after the event 1 and then the event 2 occurs, and the like. Here, when there is an instruction in the search instruction for a treatment in the case where any event other than the events 1 to 3 occurs after the event 1 and then the event 2 occurs or the like, the conditions of the state transitions are set into the state transition manager 591. There is a case where the step S27 is skipped because the default settings are used. Incidentally, because the number of states is determined according to the number of events, the setting of the number of states is always carried out. The processing shifts to a processing shown in
The states and the state transitions, which are managed by the state transition manager 591, will be explained by using
Incidentally, by setting the conditions of the self transitions and the state transition to the initial state according to the search instruction, the flexible extraction can be carried out. For example, it is possible to carry out a setting in which the self transition is carried out as long as the condition making the transition to the subsequent state is not satisfied. For example, when “HDD recorder”, “DVD software” and “DVD-R” are purchased in this order, the aforementioned conditions are satisfied. However, when “HDD recorder”, “refrigerator”, “DVD software” and “DVD-R” are purchased in this order, the aforementioned conditions are not satisfied. However, if the self transition occurs without shifting to the initial state, even when the record “refrigerator” is detected, it is judged that the aforementioned conditions are satisfied even in a case of the latter purchase history. That is, it becomes possible to extract customers who approximately carry out the target purchase history by broadly grasping the purchase history.
Next, the search processor 59 identifies an unprocessed record from the record (
Then, the search processor 59 judges whether or not the item value of the group item of the unprocessed record identified at the step S31 is changed (step S33). By holding the item value of the group item of the previously processed record, it is judged whether or not it is changed. This is because whether or not the search conditions are satisfied should be judged for the records whose group item has the same item value. Incidentally, when there is no previously processed record, it is judged that the change occurred.
When it is judged that the change occurred, the search processor 59 causes the state transition manager 591 to carry out the state transition to the initial state S0 (step S35). After the step S35 or when it is judged that the item value of the group item is not changed, the search processor 59 identifies the event flag of the identified unprocessed record (step S37). This processing will be explained by using
First, when the unprocessed record is identified from the SET array 9011 stored in the sorting result storage 58, the record number of the identified unprocessed record is identified. Then, the item value number at the record number is identified in the POS array 9006 for the product name, which is stored in the FAST structure data storage 56, and instead of the previous value table 9007, the event flag at the position of the item value number in the event flag table 501 is identified. When the SETID is “1”, it is identified that the item value number is “5” in the POS array 9006. However, “TV” is not identified from the value table 9007, and the event flag “1” (a binary value “00000001”) is identified from the event flag table 501.
Returning to the explanation of
What state transition occurs depends on what is the current state and what event flag is identified. In a case of the state and the transition as shown in
Thus, it is possible to judge whether or not the state transition occurs, by checking the current state and the predetermined bit of the event flag.
Returning to the explanation of
After the step S47, or when it is judged that the current state does not reach the final state, the state transition manager 591 judges whether or not the final record among the search target records has been processed (step S49). When there is an unprocessed record, the processing returns to the step S29. On the other hand, when the final record has been processed, the processing returns to the original processing.
The processing progress of the steps S29 to S49 in a case where the sorting result as shown in
Incidentally, when the 5th record is processed, because the customer ID that is the group item is changed, the current state is forcibly shifted to the initial state S0. In addition, because the event flag of the 5th record is “0”, the self transition to the initial state S0 occurs. Because the event flag of the 6th record is “0”, the self transition to the initial state S0 occurs. Because the event flag of the 7th record is “1”, the state transition from the initial state to the state S1 occurs. Because the event flag of the 8th record is “0”, the state transition to the initial state S0 occurs.
Incidentally, when the 9th record is processed, because the customer ID that is the group ID is changed, the current state is forcibly shifted to the initial state S0. In addition, because the event flag of the 9th record is “1”, the state transition from the initial state S0 to the state S1 occurs. Because the event flag of the 10th record is “1,” the self transition to the state S1 occurs. Because the event flag of the 11th record is “4”, the state transition from the state S1 to the initial state S0 occurs.
Incidentally, when the 12th record is processed, because the customer ID that is the group item is changed, the current state is forcibly shifted to the initial state S0. In addition, because the event flag of the 12th record is “1”, the state transition from the initial state S0 to the state S1 occurs. Because the event flag of the 13th record is “2”, the state transition from the state S1 to the state S2 occurs. Because the event flag of the 14th record is “4”, the state transition from the state S2 to the state S3 occurs. That is, because the current state reaches the final state, the record numbers of the 12th, 13th and 14th record are outputted. Then, the current state shifts to the initial state S0.
Incidentally, when the 15th record is processed, because the customer ID that is the group item is changed, the current state is forcibly shifted to the initial state S0. In addition, because the event flag of the 15th record is “1”, the state transition from the initial state S0 to the state S1 occurs. Because the event flag of the 16th record is “0”, the state transition to the initial state S0 occurs.
Incidentally, when the 17th record is processed, because the customer ID that is the group item is changed, the current state is forcibly shifted to the initial state S0. In addition, because the event flag of the 17th record is “1”, the state transition from the initial state S0 to the state S1 occurs. Because the event flag of the 18th record is “2”, the state transition from the state S1 to the state S2 occurs.
Incidentally, when the 19th record is processed, because the customer ID that is the group item is changed, the current state is forcibly shifted to the initial state S0. In addition, because the event flag of the 19th record is “1”, the state transition from the initial state S0 to the state S1 occurs. However, because this record is the final record, the processing returns to the original processing.
Thus, the comparison between the item values are carried out only at the settings of the event flags, and during the processing for each record, the event flags are identified to judge whether or not the state transitions occurred according to the event flags occur along with the definition. As for the checking of the event flag, when the aforementioned flags are used, because it is only confirmed whether or not “1” is set at a predetermined position, the processing is highly simplified. Moreover, the processing for the records is limited to once for one record. Therefore, when the huge volume of the records should be processed, the processing load is reduced.
Returning to the explanation of
Then, the search result output unit 61 reads out the search result stored in the search result storage 60, and outputs the read search result to the user terminal 3 of the requesting source (step S9). The user terminal 3 receives data of the search result from the DB server 5, and displays the data on the display device. For example, when the data as shown in
By carrying out the aforementioned processing, the speed of the entire search processing is improved, and it is possible to treat various search instructions.
Although one embodiment of this invention has been described, this invention is not limited this embodiment. For example, the functional block diagram of the DB server 5 shown in
In addition, as for the processing flow, as long as the processing result is the same, it is possible to execute in parallel or change the order of the steps. For example, the sorting processing can be carried out in earlier stage of the search processing, and because the sorting processing needs much time, the sorting processing may be executed by other processor in parallel.
In addition, the setting method of the event flags is not limited to the aforementioned method, and it is possible to set the event flags in other modes. For example, when the occurrences of the state transitions can be merely grasped, appropriately, it is not necessary to shift the bit position in the binary bit string, and the different value may be merely adopted. Moreover, when the number of state transitions is large, it is possible to use the event flag over 8 bits.
In addition, in the aforementioned specific example, the group item is designated. However, the group item is not always designated. Moreover, although the sorting is carried out in time sequence in the aforementioned example, the sort item is not only the date and time, but also other item may be designated. In addition, the search item is only the product name in the aforementioned specific example. It is possible to designate plural search items. Furthermore, it is possible to designate only an OR condition for the same search item in the same event, but it is possible to designate an AND condition for a relationship between different search items. When the AND condition is used, the event flag is separately designated for each search item, and the state transition is judged based on combinations of the plural event flags. For example, in a case where an event in which the product name is “TV” and its price is “more than 50000 Yen” is defined, when a combination of a flag for the product name “TV” and a flag for the price “more than 50000 Yen” occurs, it is judged, in that case, that the search conditions relating to the event are satisfied. For example, even when a combination of the flag A and a flag X is identified, the same state transition does not occur, in that case. That is, it is possible to flexibly deal with the search conditions by appropriately defining the state transitions.
Incidentally, the client terminal 3 and/or DB server 5 are computer devices as shown in
Although the present invention has been described with respect to a specific preferred embodiment thereof, various change and modifications may be suggested to one skilled in the art, and it is intended that the present invention encompass such changes and modifications as fall within the scope of the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
2006-155552 | Jun 2006 | JP | national |