Table calculation device, table calculation method, table calculation program, and add-in program
The spreadsheet device addresses the issue of increased communication volume by caching query information and answers, reducing server queries and operational costs, and enhancing security.
Patent Information
- Application Number
- PCT/JP2024/002148
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-01-25
- Publication Date
- 2025-07-31
AI Technical Summary
Existing spreadsheet devices incur an increase in communication volume due to frequent queries made to a server when recalculating cells with mathematical formulas that use query functions.
A spreadsheet device that processes a worksheet and a cache sheet by generating a query based on input values, transmitting it to an external server, obtaining an answer, associating query information with the answer, and storing it in the cache sheet, allowing the device to retrieve the answer from the cache sheet during recalculation instead of re-transmitting the query to the server.
This approach suppresses the increase in communication volume and reduces operational costs by minimizing server queries, while also eliminating the need for a third-party cache server and preventing information leakage.
Smart Images

Figure JP2024002148_31072025_PF_FP_ABST
Abstract
Description
Spreadsheet device, spreadsheet method, spreadsheet program, and add-in program
[0001] The present invention relates to a spreadsheet device, a spreadsheet method, a spreadsheet program, and an add-in program.
[0002] 2. Description of the Related Art Conventionally, devices for performing spreadsheet calculations have been known (for example, see Patent Document 1).
[0003] Japanese Patent Application Publication No. 08-235266
[0004] However, in the device of Patent Document 1, if a formula that uses a value obtained by querying a server is set in a cell in a table, a query is made to the server every time the cell is recalculated, which poses a problem in that the device of Patent Document 1 cannot suppress an increase in communication traffic.
[0005] The present invention has been made in view of the above points, and an object of the present invention is to provide a spreadsheet device, a spreadsheet method, a spreadsheet program, and an add-in program that can suppress an increase in communication volume.
[0006] In order to achieve the above object, a spreadsheet device according to a first aspect of the present invention is a spreadsheet device that processes worksheets and cachesheets, characterized in that: (1) when a formula that calls a query function that references input values entered in other cells in the worksheet is set in a cell in the worksheet, (a) a query based on the input values is generated, (b) the query is sent to an external server, (c) an answer is obtained from the external server, (d) query information representing the query and the answer are associated and stored in the cachesheet, and (e) the obtained answer is stored as the value of the cell, and (2) when recalculation is performed on the cell, if the query information representing the query is stored in the cachesheet, instead of sending the query to the external server to obtain the answer, the answer that is associated with the query information and stored in the cachesheet is obtained as the value to be stored in the cell.
[0007] In order to achieve the above object, an add-in program according to a second aspect of the present invention is characterized in that it has a communication unit and causes a computer of a spreadsheet device that executes a spreadsheet program to function as a query unit that, when a query based on a query argument obtained from the spreadsheet program, or query information representing the query, and a server's answer to the query are associated and saved in a spreadsheet, (1) prevents the communication unit from sending the query to the server, (2) obtains the answer associated with the query or the query information from the spreadsheet, and (3) outputs the obtained answer as a return value to the spreadsheet program.
[0008] The spreadsheet device, spreadsheet method, spreadsheet program, and add-in program according to the present invention can suppress an increase in communication traffic.
[0009] FIG. 1 is a system configuration diagram illustrating an example of the configuration of a spreadsheet system according to an embodiment of the present invention. FIG. 2 is a hardware configuration diagram illustrating an example of the configuration of a spreadsheet device. FIG. 3 is a functional block diagram illustrating an example of functions possessed by a spreadsheet device. FIG. 4 is a diagram illustrating an example of a worksheet processed by a spreadsheet device. FIG. 5 is a diagram illustrating an example of a cash sheet processed by a spreadsheet device according to an embodiment. FIG. 6 is a flowchart illustrating an example of spreadsheet processing executed by a spreadsheet device according to an embodiment. FIG. 7 is a diagram illustrating an example of a cash sheet processed by a spreadsheet device according to a modified example 7 of the embodiment. FIG. 8 is a flowchart illustrating an example of query processing executed by a spreadsheet device according to a modified example 9 of the embodiment.
[0010] <Example> An example of the present invention will be described below with reference to the accompanying drawings. A spreadsheet system 1 according to an example of the present invention includes a spreadsheet device 100 as shown in Fig. 1, which executes a spreadsheet program to which an add-in program has been added. In this example, the following description will be given assuming that the spreadsheet program is Excel, but the present invention is not limited to this.
[0011] The spreadsheet device 100 is connected to a server 900 via a network NT, which may be, for example, the Internet, a local area network (LAN), or a wide area network (WAN). The server 900 is not included in the spreadsheet system 1 and is located outside the spreadsheet system 1, and is therefore also referred to as an external server. The server 900 is equipped with an interactive generative AI (artificial intelligence), for example, ChatGPT (generative pre-trained transformer). Upon receiving a query from the spreadsheet device 100, the server 900 generates an answer to the received query using the generative AI and returns the generated answer to the spreadsheet device 100. For this reason, the server 900 is also referred to as an AI server.
[0012] As shown in Figure 2, the spreadsheet device 100 includes one or more of a CPU (Central Processing Unit) 101, a RAM (Random Access Memory) 102, a ROM (Read Only Memory) 103a, a storage device 103b, a data communication circuit 104a, a video card 105a, a display device 105b, and an input device 105c. The CPU 101 executes a program stored in the ROM 103a or the storage device 103b. The RAM 102 temporarily stores data to be processed when the program is executed. The storage device 103b is, for example, a flash memory, which is a semiconductor memory, or a hard disk, and stores various types of data.
[0013] When the network NT is the Internet, the data communication circuit 104a of the spreadsheet device 100 performs data communication using radio waves with a base station (not shown) in accordance with a communication standard such as LTE (Long Term Evolution) or 5G (5th Generation). As a result, the data communication circuit 104a performs data communication with the server 900 via the network NT connected to the base station. On the other hand, when the network NT is a LAN or WAN, the data communication circuit 104a performs communication using radio waves with an access point (not shown) connected to the network NT in accordance with a communication standard such as "11ac."
[0014] The video card 105a of the spreadsheet device 100 outputs an image signal based on a signal output from the CPU 101. The display device 105b is, for example, a liquid crystal display (LCD), a plasma display panel (PDP), or an electroluminescence (EL) display, and displays an image according to the image signal output from the video card 105a. The input device 105c is, for example, at least one of a keyboard, a mouse, or a touchpad, and inputs a signal according to a user operation.
[0015] When a user operates the input device 105c of the spreadsheet device 100 to start execution of a spreadsheet program, the input device 105c outputs a signal corresponding to the operation. When the signal is output from the input device 105c, the CPU 101 executes the spreadsheet program stored in the storage device 103b. In this embodiment, an add-in program is added to the spreadsheet program, and the CPU 101 executes both the spreadsheet program itself and the add-in program, thereby functioning as the spreadsheet unit 130 shown in FIG. 3. The spreadsheet unit 130 includes a calculation unit 110 that is realized by the CPU 101 executing the spreadsheet program itself, and a query unit 120 that is realized by the CPU 101 executing the add-in program. The storage device 103b also functions as an information storage unit 190.
[0016] Next, when an operation is performed on the input device 105c to select an electronic file stored in advance in the information storage unit 190 and open a workbook (workbook or simply a book) represented by the selected electronic file, the CPU 101 reads out the selected electronic file. Next, the CPU 101 opens the book represented by the read electronic file and displays the opened book on the display device 105b.
[0017] In this embodiment, for simplicity, the following explanation will be given using as a specific example a case where an existing workbook containing one spreadsheet (called a spreadsheet) is opened, but a new workbook may also be created. A spreadsheet has multiple rows and multiple columns, each row containing multiple cells arranged in the scanning direction, and each column containing multiple cells arranged in the sub-scanning direction. In this embodiment, the following explanation will be given using as a specific example a case where the single spreadsheet contained in the existing workbook to be opened is a worksheet (also called a worksheet), not a cashsheet.
[0018] A worksheet is a spreadsheet in which values are entered into cells or formulas are set in accordance with user operations, while a cashsheet is a spreadsheet in which values used to calculate formulas set in worksheet cells are entered into cells. For ease of explanation, hereinafter, entering values into cells and setting formulas in cells will be collectively referred to as editing a cell. Furthermore, a cell in a worksheet will be referred to as a work cell, and a cell in a cashsheet will be referred to as a cash cell.
[0019] In this embodiment, the following description will be given by taking as a specific example a case in which the character string "Opportunity to learn skills," representing a response to a questionnaire, as shown in Figure 4, has already been entered as a value in the cell at row 2, column A of one worksheet in an existing book. Furthermore, in this embodiment, the following description will be given by taking as a specific example a case in which, after an existing book is opened, a formula that calls a query function is set by a user in the cell at row 2, column B of the worksheet (referred to as workcell 2B), which refers to a value (referred to as the entered value) entered in the cell at row 2, column A of the same worksheet (referred to as workcell 2A). A formula that calls a query function refers to a formula that includes a query function, and a query function refers to a function that (1) receives arguments (referred to as query arguments) and (2) returns the answer of server 900 to a query generated based on the query arguments.
[0020] In this embodiment, the query function is a function that takes as query arguments (1) (a) the referenced input value and (b) (i) a string included in a formula and (ii) a string representing multiple categories, and (2) returns an answer from the server 900 to a query inquiring about the category into which the input value should be classified among the multiple categories. In this embodiment, a specific example will be described in which the multiple categories include "salary," "career planning," and "benefits." For these reasons, the query function called by the formula in work cell 2B returns an answer representing the category to which the server 900 has responded, among the categories "salary," "career planning," and "benefits," the survey response represented by the input value in work cell 2A should be classified.
[0021] After a workbook is opened in accordance with a user's operation, when the user operates the input device 105c of the spreadsheet device 100 to input a formula into the work cell 2B, the input device 105c outputs a signal corresponding to the operation. When the signal is output, the CPU 101 edits the work cell 2B in accordance with the operation. The CPU 101 then acquires information representing an event that has occurred, for example, from an event handler. Next, when the CPU 101 determines that the event represented by the acquired information (referred to as an acquired event) is an event indicating that a cell has been edited (referred to as an edit event), it performs calculations on the cells in the workbook. Performing cell calculations means calculating the formula set in the cell. Furthermore, calculating the formula set in the cell includes the first calculation and subsequent calculations (referred to as recalculation), counting from the time the formula was set in the cell or the time the formula set in the cell was changed.
[0022] To this end, the CPU 101 of the spreadsheet device 100 executes a spreadsheet process as shown in Fig. 6, the processing contents of which are described in the spreadsheet program itself. When execution of the spreadsheet process begins, the calculation unit 110 determines whether subsequent processing, including step S03 below, has been performed on all cells in all spreadsheets in the workbook (step S01). At this time, the calculation unit 110 determines that processing has not been performed on all cells (step S01; No), and selects one of the unprocessed cells as the processing target (step S02). In this embodiment, the following description will first be given using a specific example in which work cell 2A is the processing target.
[0023] Next, calculation unit 110 of spreadsheet device 100 determines that work cell 2A, the processing target, contains a character string representing a questionnaire response and has no formula set therein (step S03; No), and repeats the above process from step S01. Next, calculation unit 110 executes steps S01 and S02 again to select one of the multiple cells in the workbook, which is different from work cell 2A that has already been selected for processing, as the processing target. In this example, the following explanation will be given using a specific example in which work cell 2B is selected for processing.
[0024] After step S02 is executed, calculation unit 110 of spreadsheet device 100 determines that a formula is set in work cell 2B, which is the processing target (step S03; Yes). Next, calculation unit 110 determines that the formula in work cell 2B calls a query function (step S04; Yes). Then, CPU 101, functioning as calculation unit 110, reads from information storage unit 190 an add-in program for the spreadsheet program that is pre-associated with information representing the name of the query function, from one or more add-in programs added to the spreadsheet program. Next, CPU 101 executes the read add-in program to perform query processing as shown in FIG. 7 (step S05). As a result, CPU 101 functions as query unit 120 as shown in FIG. 3.
[0025] When the query process begins, the query unit 120 of the spreadsheet device 100 obtains (1) the input value of work cell 2A referenced by work cell 2B and (2) a string representing multiple classifications contained in the formula of work cell 2B from the spreadsheet program itself as query arguments (step S11).
[0026] Next, the query unit 120 of the spreadsheet device 100 determines whether the workbook has a cache sheet. In this embodiment, the name of a cache sheet includes a predetermined character string (referred to as a cache name string) that indicates that it is a cache sheet, but the name of a worksheet does not include the cache name string. Therefore, the query unit 120 first acquires the cache name string, for example, from binary data representing an add-in program. Next, the query unit 120 acquires the names of all spreadsheets included in the workbook and determines whether any of the acquired names includes the cache name string, thereby determining whether the workbook has a cache sheet. In this embodiment, since no name includes the cache name string, the query unit 120 determines that the workbook does not have a cache sheet (Step S12; No).
[0027] After that, the query unit 120 of the spreadsheet device 100 generates a new cash sheet in the workbook (step S13). In this example, the following explanation will be given using as a specific example a case where no value has been entered in the cell of the new cash sheet and no formula has been set.
[0028] After generating the cash sheet, the query unit 120 of the spreadsheet device 100 determines whether information representing a query generated based on the query arguments (referred to as query information) is stored in the generated cash sheet (step S14). Storing the query information in the cache sheet means that the query information is saved in the cache sheet, and saving the query information in the cache sheet means that the query information is input as a value in a cell of the cache sheet.
[0029] In this embodiment, a query is (1) data that is sent to the server 900 and (2) data that includes (a) information representing the URL (Uniform Resource Locator) of the server 900 and (b) text data. In this embodiment, the following description will be given using as a specific example a case where the text data is data representing text (referred to as structured text) structured according to the JSON (JavaScript Object Notation) data format. However, the text represented by the text data may be unstructured text or may be text structured according to a format other than the JSON format.
[0030] The text represented by the text data includes (1) a character string generated based on a query argument and (2) a character string representing the content of a query to the server 900. Here, the query argument is a character string representing the input value of work cell 2A, “There are opportunities to learn skills,” and multiple classifications, “Salary,” “Career Planning,” and “Employee Benefits.” Therefore, in this embodiment, the following description will be given using a specific example in which the character string representing the query content generated based on the query argument includes a character string representing the question, “To which of “Salary,” “Career Planning,” and “Employee Benefits” can the answer “There are opportunities to learn skills” be classified?” Furthermore, in this embodiment, the information representing the query is information for identifying the query, and the following description will be given using a specific example in which the information for identifying the query is a hash value of the text data included in the query. However, the query information is not limited to a hash value and may be any information for identifying the query.
[0031] In step S14, the query unit 120 of the spreadsheet device 100 generates structured text including a character string representing the content of a query to the server 900, based on (1) the input value of work cell 2A and (2) the character strings representing multiple classifications, which are acquired as query arguments. Next, the query unit 120 generates query information by calculating a hash value of the generated structured text. Thereafter, the query unit 120 attempts to acquire the generated query information from the cache sheet by searching the cache sheet based on the generated query information. Next, the query unit 120 determines that the query information is not stored in the cache sheet because the query information is not acquired (step S14; No).
[0032] Next, the query unit 120 of the spreadsheet device 100 acquires information representing the URL of the server 900, for example, from binary data representing an add-in program. The query unit 120 then generates a query including the acquired information representing the URL and text data representing the generated structured text (step S15). The query unit 120 then outputs the generated query to the data communication circuit 104a of FIG. 2 , and the data communication circuit 104a transmits the query to the server 900. In this manner, the query unit 120 controls the data communication circuit 104a to transmit the query to the server 900 (step S16). When the data communication circuit 104a receives an answer to the query from the server 900, the query unit 120 acquires the answer from the data communication circuit 104a (step S17). In this embodiment, the following description will be given using as a specific example a case in which a character string representing the category "career design" is acquired as the answer.
[0033] Thereafter, the query unit 120 of the spreadsheet device 100 associates the query information with the answer "carrier design" and stores them in a cache sheet (step S18). To do this, the query unit 120 inputs a cache value, which is the query information, as a value into the cache cell in row 3, column A shown in FIG. 5. The query unit 120 also inputs the answer "carrier design" as a value into the cache cell in row 3, column B. Thereafter, the query unit 120 of the spreadsheet device 100 outputs the answer "carrier design" to the spreadsheet program itself as a return value of the query function (step S19), and then terminates execution of the query process.
[0034] After the query processing is executed in step S05 of FIG. 6 , the calculation unit 110 of the spreadsheet device 100 acquires the answer "Career Design" from the add-in program as the return value of the query function. Next, the calculation unit 110 uses the acquired answer to calculate the formula set in work cell 2B (step S06). In this embodiment, a formula whose calculation result is the return value of the query function is set in work cell 2B. Therefore, the calculation unit 110 stores the answer "Career Design" acquired as the return value in work cell 2B as the value of work cell 2B (step S07). Storing the answer "Career Design" as the cell value in the cell means maintaining the formula set in the cell, while changing or maintaining the calculation result of the formula displayed in the cell to the string "Career Design." In this embodiment, the answer output as the return value is stored as a value in work cell 2B. Therefore, outputting the answer as a return value is also referred to as outputting the cell value.
[0035] After the answer "career design" is stored as a value in work cell 2B, calculation unit 110 of spreadsheet device 100 returns to step S01 and repeats the process from step S01 to step S03. As a result, calculation unit 110 sequentially processes cells other than work cells 2A and 2B among the multiple cells in the workbook, and determines that no formula has been set. This determination is made because cells other than work cells 2A and 2B (1) have not yet been edited, so no value has been entered and no formula has been set, or (2) query information has been entered as a value but no formula has been set. Then, calculation unit 110 determines that all cells have been processed (step S01; Yes) and ends the spreadsheet process.
[0036] Next, we will explain a specific example in which the string "The employee benefits are insufficient" representing a response to a questionnaire is entered as a value into the work cell at row 3, column A (referred to as work cell 3A) shown in Figure 4.
[0037] When an operation to input a character string into work cell 3A is performed, CPU 101 edits work cell 3A according to the operation and executes the spreadsheet processing shown in Figure 6 for the second time since the workbook was opened. Next, calculation unit 110 of spreadsheet device 100 executes the processing of steps S01 to S03, selecting work cell 2A as the processing target and determining that no formula is set in work cell 2A. Thereafter, calculation unit 110 returns to step S01 and executes the processing of steps S01 to S03 again, selecting work cell 2B as the processing target and determining that a formula is set in work cell 2B (step S03; Yes). Next, calculation unit 110 executes the processing of steps S04 and S05, determining that the formula in work cell 2B calls a query function, and executes the query processing shown in Figure 7 for the second time since the workbook was opened.
[0038] After that, the query unit 120 of the spreadsheet device 100 executes the processing of step S11 and determines that among the names of all spreadsheets in the workbook, there is a name that includes the cache name string. Therefore, the query unit 120 determines that the workbook has a cache sheet (step S12; Yes). Next, the query unit 120 determines whether the query information is stored in the cache sheet (step S14) without executing the processing of step S13 to generate a new cache sheet. At this time, the query unit 120 attempts to obtain the query information from the cache sheet and obtains the query information stored in the cache sheet during the first execution of the query processing. Therefore, the query unit 120 determines that the query information is stored in the cache sheet (step S14; Yes).
[0039] Next, the query unit 120 of the spreadsheet device 100 does not execute the processes of steps S15 to S18, but instead acquires the answer "carrier design" associated with the query information from the cache sheet (step S20). That is, instead of generating a query, controlling the data communication circuit 104a to send the query, and acquiring the answer from the data communication circuit 104a, the query unit 120 acquires the answer from the cache sheet. Thereafter, the query unit 120 outputs the answer "carrier design" acquired from the cache sheet to the spreadsheet program as a return value of the query function (step S19), and then terminates execution of the query processing.
[0040] 6, after the query process is executed for the second time, the calculation unit 110 of the spreadsheet device 100 executes the processes of steps S06 and S07 to store the answer "carrier design" obtained from the cash sheet as a value in work cell 2B. In this embodiment, the answer obtained from the cash sheet is output as a return value, and the answer output as a return value is stored as a value in work cell 2B. Therefore, obtaining an answer from the cash sheet is also referred to as obtaining the answer as a value to be stored in work cell 2B.
[0041] After storing the answer as a value in work cell 2B, calculation unit 110 of spreadsheet device 100 returns to step S01 and repeats the processes of steps S01 to S03. As a result, calculation unit 110 sequentially processes cells other than work cells 2A and 2B among the multiple cells in the workbook, and determines that no formula is set in those cells. After that, calculation unit 110 determines that all cells have been processed (step S01; Yes), and ends execution of the spreadsheet process.
[0042] Finally, the following description will be given, taking as a specific example a case where an operation to instruct saving of a workbook is performed on the input device 105c of the spreadsheet device 100. When the input device 105c outputs a signal corresponding to the operation, the calculation unit 110 of the spreadsheet device 100 rewrites the electronic file stored in the information storage unit 190 into an electronic file representing the edited workbook. As a result, the calculation unit 110 saves, in the same electronic file, the worksheet edited by the spreadsheet program and the cache sheet generated by the add-in program and containing the query information.
[0043] According to these configurations, when query information is stored in a cache sheet, the spreadsheet device 100, instead of transmitting the query to the server 900 to obtain the answer, obtains the answer "carrier design" stored in the cache sheet in association with the query information as a value to be stored in work cell 2B. This allows the spreadsheet device 100 to suppress an increase in communication volume. Here, when the usage fee for the server 900 is determined according to at least one of the communication volume between the server 900 and the spreadsheet device 100 or the calculation volume of the server 900 required to generate the answer, the spreadsheet device 100 can suppress an increase in the usage fee for the server 900.
[0044] Furthermore, because the query information and answers are stored in a cache sheet, a cache server operated by a third party is not required. In other words, there is no need to store the query information and answers in a cache server operated by a third party. This eliminates the need to pay usage fees for a cache server operated by a third party, thereby suppressing increases in the operating costs of the spreadsheet device 100.
[0045] Furthermore, the spreadsheet device 100 can eliminate the need to store query information and answers in a third-party cache server, thereby suppressing information leakage. That is, for example, it is possible to prevent the contents of queries to the server 900 from being leaked from a third-party cache server. Furthermore, since a cache server operated by the company is no longer necessary, it is possible to suppress increases in operational costs. The company includes, for example, a natural person or corporation that operates the spreadsheet system 1, but is not limited to this.
[0046] Furthermore, with these configurations, if a cash sheet does not exist in a workbook, the query unit 120 of the spreadsheet device 100 generates a cash sheet for the workbook and stores the query information and answers in the generated cash sheet. Furthermore, the calculation unit 110 of the spreadsheet device 100 saves the worksheet and the cash sheet in the same electronic file. This allows the user to easily compare the query information and answers stored in the cash sheet with the values displayed in the worksheet.
[0047] <First Variation of the Embodiment> In the embodiment, a case where one piece of query information is stored in a cache sheet has been described. However, multiple pieces of query information may be stored in a cache sheet. In this case, the query unit 120 may acquire one or more pieces of query information already stored in the cache sheet, and then sort the acquired piece of query information and the one or more pieces of query information to be newly stored in the cache sheet according to a predetermined rule, such as ascending order or descending order. The algorithm used for sorting may be, for example, a known sorting algorithm, such as quick sort. The query unit 120 may then delete one or more pieces of query information already stored in the cache sheet, and then store the sorted pieces of query information in the cache sheet in order according to the sorting results. Furthermore, the query unit 120 may search for desired query information from the multiple pieces of query information stored in the cache sheet using a known search algorithm, such as binary search. This configuration allows the spreadsheet device 100 to suppress an increase in the amount of calculation required to search for query information.
[0048] <Second Modification of the Example> In the example, the query function has been described as taking an input value representing a questionnaire response as a query argument. Also, in the example, the query function has been described as a function that returns an answer from the server 900 in response to a query inquiring whether the response represented by the query argument falls into one of a plurality of categories, including "career planning." However, the query function may be a function that takes an input value representing a questionnaire response as a query argument and returns an answer from the server 900 in response to a query inquiring whether the response represented by the query argument falls into one of a plurality of categories, "positive content," "negative content," or "neutral content," which is neither positive nor negative.
[0049] Furthermore, the query argument including the input value may be any data including a character, a character string, or a numerical value, and the query content represented by the query and the content of the response from the server 900 represented by the answer may be any content. Therefore, the query function may be, for example, a function that takes a character string to be translated as a query argument and returns an answer from the server 900 in response to a query inquiring about the result of translating the character string to be translated into a pre-specified language. Furthermore, the query function may be a function that takes a character string to be translated and information indicating a language specified by a user as query arguments and returns an answer from the server 900 in response to a query inquiring about the result of translating the character string to be translated into a language specified by the user.
[0050] <Third Modification of the Embodiment> In the embodiment, it has been explained that when the CPU 101 of the spreadsheet device 100 determines that the acquired event is an edit event, it executes the spreadsheet processing of Fig. 6. However, when the CPU 101 determines that the acquired event is at least one of (1) an edit event, (2) a delete event, (3) a calculation instruction operation event, (4) a save event, (5) an open event, or (6) a print event, it may execute the spreadsheet processing to perform calculations on the cells.
[0051] The edit event is an event that a cell in a worksheet or a cell in a cashsheet, including workcell 2A, 2B, or 3A, is edited, and the delete event is an event that a row or column in a worksheet or cashsheet is deleted. The calculation instruction operation event is an event that an operation is performed to instruct the calculation of a formula set in a cell. Examples of operations to instruct calculation include pressing the "F9" key and pressing the "Shift" key and the "F9" key simultaneously. Formulas instructed to be calculated include formulas set in all cells in the active spreadsheet or in all spreadsheets included in the workbook, or in cells included in a range selected by the user.
[0052] A save event is an event in which a book is saved, and occurs between a timing a predetermined time before the save timing, which is the timing at which saving of the book starts, and the save timing. An open event is an event in which a book is opened, and occurs between an open timing, which is the timing at which opening of the book is completed, and a timing a predetermined time after the open timing. A print event is an event in which at least one spreadsheet in a book is printed, and occurs between a print timing, which is the timing at which printing of at least one spreadsheet starts, and a timing a predetermined time before the print timing.
[0053] <Fourth Variation of the Example> In the example, a specific example was given in which the character string "You will have an opportunity to learn a skill" is input as a value into work cell 2A in Figure 4, and a formula referencing the input value of work cell 2A is set in work cell 2B. However, in this variation, the following description will be given using a specific example in which the character string "You will have an opportunity to learn a skill" is input as a value into one or more work cells (referred to as one or more input value cells) including work cell 2A. Furthermore, in this variation, the following description will be given using a specific example in which a formula is set in multiple work cells (referred to as multiple formula cells) that are different from the one or more input value cells and that include work cell 2B, and the formula is a formula that calls a query function that refers to the input value of one or more input value cells.
[0054] Furthermore, in this modified example, the following description will be given by taking as a specific example a case in which a user who visually recognizes the character string "Career Design" stored in the cache cell at row 3, column B (referred to as cache cell 3B) shown in FIG. 5 performs an operation on the input device 105c of the spreadsheet device 100 to change the character string stored in cache cell 3B to "Employee Benefits." At this time, the CPU 101 of the spreadsheet device 100 edits cache cell 3B based on a signal output from the input device 105c. Thereafter, the CPU 101 acquires information representing an event, and when it determines that the acquired event represented by the acquired information is an edit event, it executes the spreadsheet processing of FIG. 6 and the query processing of FIG. 7.
[0055] At this time, the query unit 120 of the spreadsheet device 100 sequentially executes steps S20 and S19 in Fig. 7 to suppress the execution of control to send a query based on the input values of one or more input value cells to the server 900. The query unit 120 also acquires the changed answer "welfare benefits" stored in cache cell 3B and outputs the acquired changed answer "welfare benefits." Thereafter, the calculation unit 110 sequentially executes steps S06 and S07 in Fig. 6 to store the output changed answer "welfare benefits" as a value in multiple formula cells.
[0056] According to these configurations, after the spreadsheet device 100 changes the AI's answer "Career Planning" stored in cache cell 3B to "Employee Benefits" in accordance with a user's operation, when recalculating the multiple formula cells, it stores the changed answer "Employee Benefits" stored in cache cell 3B as a value in the multiple formula cells. Therefore, for example, if the AI's answer differs from the answer the user believes to be correct, the user can change the answer stored in the cache sheet to change the values stored in the multiple formula cells of the worksheet to the answer the user believes to be correct, thereby improving user convenience.
[0057] <Fifth Modification of the Example> In the example, the character string representing the inquiry included in the query is described as including a character string representing a question. However, the character string representing the inquiry is not limited to this, and may include (a) a character string representing the question, as well as (b) a character string that relaxes the restriction imposed on the answer by the question. To achieve this, the query unit 120 of the spreadsheet device 100 may generate structured text including a character string representing the inquiry in step S14 of FIG. 7 , and then, for example, obtain a character string that relaxes the restriction from binary data representing an add-in program, and add the obtained character string to the generated structured text.
[0058] In the example, a specific example was given in which the character string representing the question is "To which of the following categories can you classify the answer "There are opportunities to learn skills": "Salary," "Career planning," or "Employee benefits?" Therefore, the restriction imposed on the answer by the question is that the answer must be a character string representing that the answer "There are opportunities to learn skills" is classified into one of the multiple categories "Salary," "Career planning," and "Employee benefits."
[0059] For this reason, in this modified example, the string that relaxes the restrictions is (1) a string that includes a string (called a non-classified string) that indicates that the answer to the questionnaire is not classified into any of multiple categories, and (2) a string that relaxes the restrictions imposed on answers so that when the answer to the questionnaire is not classified into any of multiple categories, the non-classified string is used as the answer.This will be explained below using the following example as a concrete example.
[0060] An answer not being classified into any of the multiple categories means at least one of the following: (1) it is impossible or inappropriate to classify the answer into any of the multiple categories, (2) it is more appropriate to classify the answer into a category other than any of the multiple categories rather than classifying the answer into one of the multiple categories, or (3) it is impossible or inappropriate to classify the answer at all. An answer that is impossible or inappropriate to classify includes, for example, an answer that has no semantic relationship to any of the multiple categories, and an answer that has no semantic relationship to any of the multiple categories includes, for example, the answers "Nothing in particular" and "I don't have anything in particular to say."
[0061] In addition, in this modified example, the non-classifiable string will be described using the string "Unclassifiable" as a specific example. Therefore, the following description will be given using the string "If you cannot classify, please answer 'Unclassifiable'" as a specific example. However, the non-classifiable string is not limited to this, and may be the string "Not applicable" or "Not applicable," or "No classification" or "Unclassified." In other words, these strings that relax the restriction relax the restriction that the answer must be a string indicating that the questionnaire response is classified into one of multiple categories, to the restriction that the answer must be (1) one of multiple categories, or (2) the string (a) "Unclassifiable," (b) "Not applicable," (c) "No classification," (d) "No classification," or (e) "Unclassified."
[0062] With these configurations, even if a user who is not proficient in generating queries sets multiple categories that do not include non-categorization strings as query arguments, the spreadsheet device 100 can relax the restriction imposed on answers from requiring the answer to be one of the categories to requiring the answer to be one of the categories or a non-categorization string. Therefore, when an answer is not classified into any of the categories, the spreadsheet device 100 can prevent the AI of the server 900 from outputting an answer indicating that the answer is classified into one of the categories. Therefore, the spreadsheet device 100 can prevent a decrease in the accuracy of answers output by query functions.
[0063] <Sixth Modification of the Example> In the fifth modification of the example, the character string representing the inquiry included in the query was described as including (a) a character string representing the question and (b) a character string that relaxes the restriction imposed on the answer by the question, but this is not limited to this. The character string representing the inquiry may include (c) a character string representing a restriction imposed on the expression format of the answer (referred to as an expression restriction character string) in addition to (a) a character string representing the question and (b) a character string that relaxes the restriction imposed on the answer by the question. For this purpose, the query unit 120 of the spreadsheet device 100 may generate structured text including the character string representing the inquiry and the character string that relaxes the restriction in step S14 of FIG. 7 , and then, for example, obtain an expression restriction character string from binary data representing an add-in program and add the obtained character string to the generated structured text. In this modified example, the expression-restricted character string is a character string that indicates the restriction that the answer must be expressed using a specified number of words, rather than a sentence or paragraph, and the following explanation will be given using the character string "Please answer in one word" as a specific example. However, the expression-restricted character string is not limited to this, and may be, for example, the character string "Please answer in one word" or "Please answer in one noun."
[0064] In this case, if the acquired answer is one of multiple categories or a non-categorization string, the query unit 120 of the spreadsheet device 100 may determine that the answer does not violate the restrictions and output the answer to the spreadsheet program. This determination is made because, in this modification, each of the multiple categories and the non-categorization string is a single word and therefore complies with the restrictions expressed by the expression-restricted string. In contrast, if the acquired answer is neither one of multiple categories nor a non-categorization string, the query unit 120 may determine that the answer violates the relaxed restrictions imposed by the question or the expression format restrictions. If the query unit 120 determines that the answer violates the restrictions, the query unit 120 may change the answer to "unclassifiable," a non-categorization string, store the changed answer in association with the query information, and output the changed answer as a return value to the spreadsheet program.
[0065] With these configurations, when the acquired answer is expressed, for example, as a sentence or paragraph, the query unit 120 of the spreadsheet device 100 performs an analysis including at least one of morphological analysis, syntactic analysis, semantic analysis, and contextual analysis, and can accurately restrict the expression format of the answer that the query function outputs as a return value with less computational effort than when the query unit 120 changes the expression format of the answer based on the analysis results and outputs it. Also, with these configurations, the spreadsheet device 100 can accurately restrict the return value that the query function outputs to one of multiple classifications set by the user or to a non-classified string with less computational effort.
[0066] In this modified example, the specified number of words is one, and each of the multiple categories and the non-categorization strings contains one word. However, this is not limited to this. The specified number of words, and the number of words in each of the multiple categories and the non-categorization strings may be two or more. Furthermore, in this modified example, the character string representing the inquiry includes (a) a character string representing a question, (b) a character string representing a restriction imposed on the expression format of the answer, and (c) a character string that relaxes the restriction imposed on the answer by the question. However, the character string representing the inquiry may include (a) a character string representing a question and (b) a character string representing a restriction imposed on the expression format of the answer, but may not include (c) a character string that relaxes the restriction imposed on the answer by the question.
[0067] <Seventh Modification of the Example> In the example, it was described that the query unit 120 of the spreadsheet device 100 associates query information with answers and stores them in a cache sheet. However, in this modification, as shown in FIG. 8 , the query unit 120 associates query information, query auxiliary information, and answers and stores them in a cache sheet. The query auxiliary information is information that assists the user of the spreadsheet device 100 in identifying a query. In this modification, the query auxiliary information includes information representing the name of a query function and a query argument. Therefore, in step S18 of FIG. 7 , the query unit 120 acquires, for example, a character string representing the name of the query function from binary data representing an add-in program. In this modification, the following description will be given using as a specific example a case where the name of the query function is "BB.CATEGORIZE."
[0068] Next, the query unit 120 of the spreadsheet device 100 inputs a cache value, which is query information, as a value into the cache cell in row 3, column A shown in FIG. 8 . Then, the query unit 120 inputs a character string representing the name of the query function "BB.CATEGORIZE" as a value into the cache cell in row 3, column B. The query unit 120 also inputs a character string representing the survey answer "There are opportunities to learn skills," which is the input value of work cell 2A and was acquired as a query argument, as a value into the cache cell in row 3, column C. The query unit 120 also inputs character strings representing the multiple categories "Salary," "Career Planning," and "Benefits," which were acquired as query arguments, as values into the cache cell in row 3, column D. The query unit 120 also inputs the answer "Career Planning" as a value into the cache cell in row 3, column E. According to these configurations, the spreadsheet device 100 associates the query auxiliary information with the answers and stores them in a cache sheet, so that the user can easily guess or confirm the history of inquiries to the server 900 by visually checking the cache sheet.
[0069] <Eighth Modification of the Example> In the example, the structured text was described as including a character string representing the content of a query to the server 900. However, the structured text according to this modification further includes arguments (referred to as AI arguments) that are passed to the generation AI included in the server 900. In this modification, the AI arguments include, for example, at least one of (1) a model-specific argument, (2) a same-expression suppression argument, (3) a general expression suppression argument, or (4) a randomness control argument, but the AI arguments are not limited to these.
[0070] The model specification argument is an argument that specifies a set of processing systems including trained data used by the generation AI of the server 900. The set of processing systems used by the generation AI may further include a language model used by the generation AI. Furthermore, the model specification argument may be, for example, the argument "model" used in ChatGPT, or may be an argument that specifies "GPT3.5" or "GPT4". Furthermore, the model specification argument may be an argument used to specify a set of processing systems in Google Gemini (simply referred to as Gemini), or may be an argument used in generation AIs other than ChatGPT and Gemini.
[0071] The expression suppression argument is an argument for suppressing the use of the same expression in answers, and may be, for example, the argument "frequency_penalty" used in ChatGPT. The general expression suppression argument is an argument for suppressing the use of common expressions in answers, and may be, for example, the argument "presence_penalty" used in ChatGPT. The randomness control argument is an argument for controlling the randomness of the answer output by the generation AI, and may be, for example, at least one of the arguments "temperature" or "TOP_P" used in ChatGPT. Furthermore, at least one of the expression suppression argument, the general expression suppression argument, or the randomness control argument may be an argument used in Gemini, or may be an argument used in a generation AI other than ChatGPT and Gemini.
[0072] For example, if an AI argument is included in a formula set in work cell 2B, the query unit 120 of the spreadsheet device 100 may acquire the AI argument as a query argument in addition to the input value of work cell 2A and the character strings representing multiple categories in step S11 of FIG. Also, if the formula does not include an AI argument and no AI argument is acquired as a query argument, the query unit 120 may acquire a predetermined default value for the AI argument from, for example, binary data representing an add-in program, and set the acquired default value as the AI argument. Then, in step S14, the query unit 120 generates structured text including the AI argument based on (1) (a) the input value of work cell 2A and (b) the character strings representing multiple categories acquired as query arguments, and (2) the AI argument acquired as a query argument or set to a default value. Next, the query unit 120 generates query information by calculating a hash value of the generated structured text.
[0073] Thereafter, if the query unit 120 of the spreadsheet device 100 determines that the query information is not stored in the cache sheet, then in step S15, it generates a query including an AI argument, and in step S16 performs control to transmit the generated query to the server 900. The generating AI of the server 900 generates an answer according to the AI argument included in the query, and returns the generated answer to the spreadsheet device 100.
[0074] <Ninth Modification of the Example> In the example, it was explained that the query unit 120 of the spreadsheet device 100 acquires an answer from the cache sheet with a probability of "100%" when query information is saved in the cache sheet (referred to as a "saved" case) by executing the query processing shown in Fig. 7. However, in this modification, the query unit 120 acquires an answer from the cache sheet with a cache hit rate (simply referred to as a "hit rate") set based on the randomness control argument by executing the query processing shown in Fig. 9.
[0075] The hit rate is the probability that the query unit 120 of the spreadsheet device 100 retrieves an answer from the cash sheet when it has been saved. In this modified example, the following explanation will be given using as a specific example a case where the randomness control argument is included in the formula set in the work cell 2B. Therefore, when execution of the query process shown in FIG. 9 begins, the query unit 120 of the spreadsheet device 100 retrieves, as query arguments, from the spreadsheet program (step S11): (1) the input value of the work cell 2A referenced by the work cell 2B, and (2) (a) character strings representing multiple classifications and (b) the randomness control argument, which are included in the formula of the work cell 2B.
[0076] Next, the query unit 120 of the spreadsheet device 100 executes the process of step S12 or the processes of steps S12 and S13 described in the embodiment, and then determines whether the query information is stored in the cache sheet (step S14). At this time, if the query unit 120 determines that the query information is not stored in the cache sheet (step S14; No), it executes the processes of steps S15 to S19 and then terminates the execution of the query process. The processes of steps S15 to S19, which are executed when the query information is not stored in the cache sheet (referred to as the case where it is not stored), are the same as the processes described in the embodiment.
[0077] In response to this, if the query unit 120 of the spreadsheet device 100 determines that query information is stored in the cache sheet (step S14; Yes), it sets a hit rate based on the randomness control argument acquired in step S11 (step S21). In this variation, the randomness control argument is "temperature" used in ChatGPT. Therefore, a specific example will be described in which the randomness control argument "temperature" is set to a value equal to or greater than "0.0," which controls randomness to the lowest value, and equal to or less than "2.0," which controls randomness to the highest value. Therefore, the query unit 120 sets the hit rate to a value calculated using, for example, the following formula (1). That is, for example, if the randomness control argument "temperature" is "0.0," the query unit 120 sets the hit rate to "100%." If the randomness control argument "temperature" is "1.0" or "2.0," the query unit 120 sets the hit rate to "50%" or "0%." However, the method of setting the hit rate is not limited to the method using formula (1), and any method can be used as long as the hit rate is set to a lower value the more the randomness control argument ``temperature'' controls the randomness of the answers generated by the generation AI.
[0078] Hit rate = (1 - randomness control argument "temperature" / 2) × 100% (1)
[0079] Next, the query unit 120 of the spreadsheet device 100 generates a software random number greater than or equal to "0" and less than or equal to "100" (step S22). Based on the generated software random number and the set hit rate, the query unit 120 determines whether to retrieve an answer from the cache sheet. The hit rate is a numerical value used with a percent sign when expressing a hit rate as a percentage. For example, a hit rate of "50%" would be "50." If the query unit 120 determines that the value of the software random number is less than or equal to the hit rate (step S23; Yes), it determines to retrieve an answer from the cache sheet. The query unit 120 then retrieves the answer associated with the query information from the cache sheet (step S20), outputs the retrieved answer to the spreadsheet program (step S19), and terminates the execution of the query process. In this way, the query unit 120 retrieves an answer from the cache sheet using the hit rate (also known as the probability of an event) and outputs the retrieved answer.
[0080] In response to this, if the query unit 120 of the spreadsheet device 100 determines that the value of the software random number is greater than the hit rate (step S23; No), it decides to obtain a new answer from the generation AI of the server 900. Next, the query unit 120 generates a query including the randomness control argument (referred to as the base randomness control argument) that is the basis for calculating the hit rate (step S15) and controls the data communication circuit 104a to transmit the generated query to the server 900 (step S16). The query unit 120 then obtains the new answer from the data communication circuit 104a (step S17) and overwrites the answer stored in the cache sheet in association with the query information with the obtained new answer (step S18). The query unit 120 then outputs the new answer to the spreadsheet program (step S19) and terminates execution of the query process. In other words, the query unit 120 obtains a new answer from the generation AI using the probability (called the probability of the complementary event) obtained by subtracting the probability of the event, which is the hit rate, from the 100% probability, and outputs the obtained answer.
[0081] According to these configurations, when the query has been saved, the query unit 120 of the spreadsheet device 100 (1) suppresses control of sending a query to the server 900 with the probability of an event, which is the hit rate, and (2) outputs the answer acquired from the cash sheet to the spreadsheet program. Furthermore, when the query has been saved, the query unit 120 (1) controls control of sending a query to the server 900 with the probability of a complementary event, and (2) outputs a new answer acquired from the server 900. Therefore, the query unit 120 can suppress a decrease in the randomness of the answers to be output while suppressing an increase in the amount of communication between the spreadsheet device 100 and the server 900.
[0082] Furthermore, with these configurations, the query unit 120 of the spreadsheet device 100 sets the probability of an event, which is a hit rate, lower the more the randomness control argument controls the randomness, and therefore sets the probability of a complementary event higher. In other words, the query unit 120 sets the probability of obtaining an answer without randomness from the cash sheet lower and sets the probability of obtaining a new answer with randomness from the server 900 higher the more the randomness control argument controls the randomness. Therefore, the query unit 120 can suppress an increase in the difference between the randomness of the answer output by the generation AI controlled by the randomness control argument and the randomness of the answer output by the query unit 120.
[0083] <Modification 10 of the Example> In Modification 9 of the example, the query unit 120 of the spreadsheet device 100 was described as acquiring, as a query argument, the randomness control argument included in the formula of work cell 2B from the spreadsheet program, but this is not limited to this. The randomness control argument does not have to be included in the formula set in work cell 2B. In this case, the query unit 120 may not acquire the randomness control argument as a query argument, but may instead acquire a predetermined default value for the randomness control argument from binary data representing an add-in program, and set the hit rate based on the acquired default value for the randomness control argument.
[0084] Furthermore, the formula set in the work cell 2B based on the user's operation on the input device 105c of the spreadsheet device 100 may not include a randomness control argument but may include a hit rate. In this case, the query unit 120 may not acquire the randomness control argument as a query argument, may not set the hit rate based on the randomness control argument, and may instead acquire the hit rate set based on the user's operation as a query argument. With these configurations, the user can set the hit rate to the probability that the amount of communication traffic reduced by the spreadsheet device 100 will approach the amount desired by the user, simply by operating the input device 105c of the spreadsheet device 100. Furthermore, with these configurations, the user can set the hit rate to the probability that the randomness of the answers output by the query unit 120 will approach the randomness desired by the user, simply by operating the input device 105c of the spreadsheet device 100. These configurations improve user convenience.
[0085] <Eleventh Modification of the Example> In the ninth modification of the example, the randomness control argument was described as "temperature" used in ChatGPT, but it may also be "TOP_P." In this case, the randomness control argument "TOP_P" is set to a value equal to or greater than "0.0," which controls randomness to the lowest level, and equal to or less than "1.0," which controls randomness to the highest level. Therefore, the query unit 120 of the spreadsheet device 100 sets the hit rate to a value calculated using, for example, the following formula (2). However, the method for setting the hit rate is not limited to the method using formula (2), and any method may be used as long as the hit rate is set to a lower value the more the randomness control argument "TOP_P" controls randomness. Furthermore, the randomness control arguments used to set the hit rate are not limited to the AI arguments used in ChatGPT, but may be, for example, AI arguments used to control randomness in Gemini, or arguments used in generated AI other than ChatGPT and Gemini.
[0086] Hit rate = (1 - randomness control argument "TOP_P") x 100% (2)
[0087] <Variation 12 of the Example> In Variation 9 of the example, it was explained that when query information is stored in a cache sheet (i.e., when already stored), the query unit 120 of the spreadsheet device 100 controls the transmission of a query including a randomness control argument (i.e., a base randomness control argument) that is used as the basis for calculating the hit rate, using the probability of complementary events. However, in this variation, the query unit 120 corrects the base randomness control argument to an argument that controls randomness so that the value is higher than when controlled by the base randomness control argument. Next, the query unit 120 controls the data communication circuit 104a to transmit a query including the corrected randomness control argument to the server 900.
[0088] In this modified example, the query unit 120 of the spreadsheet device 100 corrects the base randomness control argument "temperature" so that the corrected randomness control argument "temperature" becomes "2.0," which maximizes randomness. This correction is performed to prevent a decrease in the randomness of the answer that occurs when the answer is obtained from a cash sheet. As a specific example, we will explain why the randomness of the answer is lost by taking a case where the randomness control argument "temperature" of "1.0" controls the generation AI so that the randomness of the generated answer is "50%," and the randomness control argument "temperature" of "2.0" controls the generation AI so that the randomness of the generated answer is "100%." In this case, if an answer is not obtained from the cash sheet and a query including a basic randomness control argument "temperature" with a value of "1.0" with a probability of "100%" is sent to server 900 (this is referred to as a case where a randomness control argument with a value of "1.0" with a probability of "100%" is used), an answer with randomness of "50%" will be obtained with a probability of "100%".
[0089] In contrast, if the hit rate (i.e., the probability of an event) is set to 50% based on a randomness control argument "temperature" of 1.0, an answer with 0% randomness will be retrieved from the cash sheet with a 50% probability of the event, as described in the ninth variation of the embodiment. In this case, if a query including a base randomness control argument "temperature" of 1.0 with a complementary event probability of 50% is sent to the server 900, an answer with 50% randomness will simply be retrieved with a 50% complementary event probability. Thus, when a randomness control argument of 1.0 is used with a probability of 50% and an answer is retrieved from the cash sheet with a probability of 50%, the randomness of the retrieved answer will be 25%, which is a 25% decrease in randomness compared to the 50% randomness obtained when a randomness control argument of 1.0 is used with a probability of 100%.
[0090] In contrast, in this modified example, control is performed to send a new query including a randomness control argument "temperature" that has been corrected to a value of "2.0", which is higher than the value "1.0" of the basic randomness control argument "temperature", with a complementary probability of "50%". As a result, an answer with randomness of "100%" is obtained with a complementary probability of "50%". In other words, in this modified example, even if an answer is obtained from the cash sheet with a probability of "50%," because a randomness control argument with a value of "2.0" and a probability of "50%" is used, the randomness of the obtained answer is equal to the randomness of the answer obtained when a randomness control argument with a probability of "100%" and a value of "1.0" is used.
[0091] In this modified example, the base randomness control argument “temperature” is corrected so that the corrected randomness control argument “temperature” has a value of “2.0.” However, the correction method is not limited to this. The correction method for the base randomness control argument may be any method that results in a value of the corrected randomness control argument that is greater than the value of the base randomness control argument. Furthermore, in this modified example, the reason for the loss of answer randomness was explained by citing a case in which a randomness control argument “temperature” of value “1.0” controls the generation AI so that the randomness of the generated answer is “50%,” and a randomness control argument “temperature” of value “2.0” controls the generation AI so that the randomness of the generated answer is “100%.” However, the relationship between the value of the randomness control argument included in a query and the randomness of the answer to that query is not limited to this, and any relationship may be used as long as there is a correlation between the value of the randomness control argument and the randomness of the answer.
[0092] According to these configurations, the query unit 120 of the spreadsheet device 100 corrects the base randomness control argument to an argument that controls randomness so that the value is higher than when controlled by the base randomness control argument. Furthermore, the query unit 120 (1) causes the data communication circuit 104a in FIG. 2 to transmit a new query including the corrected randomness control argument to the server 900 using the probability of the complementary event, and then (2) outputs a new answer obtained from the generation AI of the server 900. Furthermore, the query unit 120 outputs the answer obtained from the cash sheet using the probability of the event. As a result, the query unit 120 can suppress a decrease in the randomness of the output answer while suppressing an increase in the amount of communication between the spreadsheet device 100 and the server 900.
[0093] <Variation 13 of the Example> In the example, the server 900 is described as being equipped with ChatGPT as the generation AI, but the generation AI is not limited to this. The generation AI may be Gemini or another AI. Furthermore, in the example, the spreadsheet program is described as being Excel, but the generation AI is not limited to this. The spreadsheet program may be Google Spreadsheets, WPS Office Spreadsheets, or Numbers, or another program. Furthermore, in the example, the CPU 101 of the spreadsheet device 100 is described as functioning as the query unit 120 by executing an add-in program added to the spreadsheet program itself. However, the CPU 101 may function as the query unit 120 by executing the spreadsheet program itself.
[0094] Furthermore, in the embodiment, the query unit 120 of the spreadsheet device 100 generates one cash sheet for a workbook. However, two or more cash sheets may be generated. Also, in the embodiment, the cache sheet name includes a cache name string, but the worksheet name does not include a name string. However, this is not limited to this. For example, a cache name string may be input as a value in a type input cell of a cash sheet, but a cache name string may not be input as a value in a type input cell of a worksheet. A type input cell refers to a cell that is predetermined as a cell into which a string representing the type of spreadsheet is input. Furthermore, a type input cell may be, for example, a cell in a predetermined row and a predetermined column, or a cell with a defined name indicating that it is a type input cell. In this case, the query unit 120 may obtain values input into type input cells from all spreadsheets in the workbook, and determine that the workbook has a cash sheet if a value that is a cache name string is present among the obtained values, and determine that the workbook does not have a cash sheet if such a value is not present.
[0095] Although the description has been given of a book opened by the spreadsheet device 100 having one worksheet, the book may have multiple worksheets, and the spreadsheet device 100 may open a book having one worksheet and then add one or more worksheets to the opened book. Furthermore, the spreadsheet device 100 may generate a book having one or more worksheets, or may add one or more worksheets to the generated book. Furthermore, in the embodiment, the description has been given of the spreadsheet device 100 opening a book without a cash sheet, but the spreadsheet device 100 may also open a book with a cash sheet. Furthermore, the spreadsheet device 100 may generate a book without a cash sheet, or may generate a book with a cash sheet.
[0096] Furthermore, in the embodiment, it has been described that the query function called by the formula set in workcell 2B references the input value of workcell 2A, and that the worksheet containing workcell 2A (referred to as worksheet A) and the worksheet containing workcell 2B (referred to as worksheet B) are the same sheet. However, worksheet A and worksheet B may be different sheets. Furthermore, the book containing worksheet A (referred to as book A) and the book containing worksheet B (referred to as book B) may be the same book or different books. Furthermore, when book A and book B are different books, the query unit 120 of the spreadsheet device 100 may generate a cache sheet in book B and store the query information used in the calculation of worksheet B in the generated cache sheet. Furthermore, in the embodiment, it has been described that the query function of workcell 2B uses the input value of workcell 2A as a query argument, but the query function of workcell 2B may also use a value included in the formula set in workcell 2B as a query argument.
[0097] In the embodiment, the work cell 2B is set with a formula whose calculation result is the return value of the query function. However, the work cell 2B may be set with a formula whose calculation result is the result of performing some processing on the return value of the query function. The processing may include, for example, at least one of adding a predetermined character or character string to the return value, deleting a predetermined character or character string from the return value, or converting a predetermined character or character string included in the return value into a character or character string different from the original character or character string.
[0098] In addition, although the embodiment has been described in which work cells 2B and 3A are edited in order, the order in which the work cells are edited may be any order. Also, in the embodiment, the embodiment has been described in which work cells 2A, 2B, and 3A, as well as other cells, are processed in order, but the order in which the cells are processed may be any order.
[0099] In the embodiment, it has been explained that it is determined that the formula in work cell 2B calls the query function in step S04 of Fig. 6. However, if it is determined that the formula in work cell 2B does not call the query function (step S04; No), the calculation unit 110 of the spreadsheet device 100 may calculate the formula in work cell 2B without using the query function (step S08) and store the calculation result in the cell as the value of work cell 2B (step S07).
[0100] In the embodiment, it has been described that the calculation unit 110 of the spreadsheet device 100 saves a worksheet and a cash sheet in the same electronic file by saving a book. However, the query unit 120 may save a worksheet and a cash sheet in the same electronic file by saving a book. The timing at which the query unit 120 saves the book may include at least one of the timing at which the cash sheet is generated in the book, the timing at which query information is stored in the cash sheet, and the timing at which an answer is output as a return value to the spreadsheet program.
[0101] In the embodiment, if query information representing a query and an answer from the server 900 to the query are not associated and stored in a cache sheet, the query unit 120 of the spreadsheet device 100 causes the data communication circuit 104a to send the query to the server 900, obtains the answer from the server 900 from the data communication circuit 104a, and associates and stores the query information and the answer in a cache sheet. However, if the query and the answer are not associated and stored in a cache sheet, the query unit 120 may cause the data communication circuit 104a to send the query to the server 900, obtain the answer from the server 900 from the data communication circuit 104a, and associate and store the query and the answer in a cache sheet. In this case, if the query and the answer are associated and stored in a cache sheet, the query unit 120 may refrain from causing the data communication circuit 104a to send the query to the server 900, and obtain the answer associated with the query from the cache sheet.
[0102] In the embodiment, a specific example has been given in which the worksheet and the cashsheet are different spreadsheets, but the worksheet and the cashsheet may be the same spreadsheet.
[0103] In the embodiment, the query information is described as a hash value of text data included in the query, but this is not limited to this. The query information may be a hash value of the query, or may be the same information as the query auxiliary information. In the seventh modification example of the embodiment, the query auxiliary information is described as including information representing the name of a query function and a query argument, but this is not limited to this. The query auxiliary information may include the query argument, but may not include information representing the name of the query function.
[0104] The embodiment and the first to thirteenth exemplary embodiments can be combined with each other. Not only can the embodiment be provided as a spreadsheet device 100 having a configuration for realizing the functions of any of the embodiment and the first to thirteenth exemplary embodiments, but it can also be provided as a system composed of multiple devices, with the entire system having a configuration for realizing the functions of any of the embodiment and the first to thirteenth exemplary embodiments. Furthermore, the spreadsheet program and the add-in program for the spreadsheet program according to any of the embodiment and the first to thirteenth exemplary embodiments can be distributed in any manner. For example, they can be stored on a non-transitory recording medium such as a memory card, a CD (Compact Disc)-ROM, or a DVD (Digital Versatile Disk)-ROM and distributed via a communication medium such as the Internet. Furthermore, the method according to the present invention can be implemented using the spreadsheet system 1 or the spreadsheet device 100 according to any of the embodiment and the first to thirteenth exemplary embodiments. While preferred embodiments of the present invention have been described above in detail, the present invention is not limited to these specific embodiments, and various modifications and variations are possible within the scope of the gist of the present invention as defined in the claims.
[0105] (Supplementary Note) (Supplementary Note 1) A spreadsheet device that processes worksheets and cachesheets, characterized in that: (1) when a formula that calls a query function that references an input value entered in another cell in the worksheet is set in a cell in the worksheet, (a) a query based on the input value is generated, (b) the query is sent to an external server, (c) an answer is obtained from the external server, (d) query information representing the query and the answer are associated and stored in the cachesheet, and (e) the obtained answer is stored as the value of the cell, (2) when recalculation is performed on the cell, if the query information representing the query is stored in the cachesheet, instead of sending the query to the external server to obtain the answer, the answer that is associated with the query information and stored in the cachesheet is obtained as the value to be stored in the cell.
[0106] (Supplementary Note 2) The spreadsheet device according to Supplementary Note 1, characterized in that the recalculation for the cell is performed at least one of the following times: (1) when a first cell that is the cell, a second cell that is the other cell, or a third cell different from the first cell and the second cell is edited; (2) when a column or row including the third cell is deleted; (3) when an operation instructing a calculation is performed; (4) when a workbook having the worksheet is saved; (5) when the workbook is opened; or (6) when at least one of the worksheet or the cashsheet is printed.
[0107] (Supplementary Note 3) The spreadsheet device according to Supplementary Note 1 or 2, wherein the query includes (1) a query asking which of a plurality of categories the input value falls into, or (2) a query asking for the result of translating the input value into a specified language, and the query is sent to the external server equipped with a generation AI (Artificial Intelligence).
[0108] (Supplementary Note 4) A method executed by a spreadsheet device that processes worksheets and cachesheets, comprising: (1) when a formula that calls a query function that references input values entered in other cells in the worksheet is set in a cell in the worksheet, (a) generating a query based on the input values, (b) sending the query to an external server, (c) obtaining an answer from the external server, (d) storing query information representing the query and the answer in the cachesheet in association with each other, and (e) storing the obtained answer as a value of the cell; and (2) when performing recalculation on the cell, if the query information representing the query is stored in the cachesheet, instead of sending the query to the external server to obtain the answer, obtaining the answer that is stored in the cachesheet in association with the query information as a value to be stored in the cell.
[0109] (Supplementary Note 5) A spreadsheet program comprising: a computer of a spreadsheet device that has a communications unit and processes worksheets and cashsheets; (1) when a formula that calls a query function that references input values entered in other cells in the worksheet is set in a cell of the worksheet, (a) generating a query based on the input values; (b) causing the communications unit to send the query to an external server; (c) obtaining an answer from the external server from the communications unit; (d) storing query information representing the query and the answer in the cachesheet in association with each other; and (e) storing the obtained answer as a value of the cell; (2) when recalculation is performed on the cell, if the query information representing the query is stored in the cachesheet, instead of sending the query to the external server to obtain the answer, obtaining the answer that is stored in the cachesheet in association with the query information as a value to be stored in the cell.
[0110] (Supplementary Note 6) An add-in program for a spreadsheet program, comprising: a computer of a spreadsheet device that has a communication unit and processes worksheets and cashsheets, the add-in program causing the computer to function as a query unit that, when a formula that calls a query function referencing input values entered in other cells in the worksheet, (a) generates a query based on the input values, (b) causes the communication unit to send the query to an external server, (c) obtains an answer from the external server from the communication unit, (d) associates query information representing the query with the answer and stores it in the cache sheet, and (e) outputs the obtained answer as the value of the cell, and (2) when recalculation is performed on the cell, if the query information representing the query is stored in the cache sheet, instead of sending the query to the external server to obtain the answer, obtains the answer that is stored in the cache sheet in association with the query information as the value to be stored in the cell.
[0111] (Appendix 7) The add-in program according to Appendix 6, characterized in that the query unit generates the cache sheet in a workbook having the work sheet when the cache sheet does not exist, and stores the query information and the answer in the generated cache sheet.
[0112] (Supplementary Note 8) The add-in program according to Supplementary Note 6 or 7, wherein the work sheet and the cash sheet are each saved in the same electronic file.
[0113] (Supplementary Note 9) The add-in program according to any one of Supplementary Notes 6 to 8, wherein the external server is equipped with a generation AI (Artificial Intelligence), the query includes a randomness control argument that is an argument that controls randomness of the answer generated by the generation AI, and the query unit, when the query information is stored in the cache sheet, (1) retrieves the answer stored in the cache sheet in association with the query information, with a cache hit rate that is set based on the randomness control argument or that is set based on an operation performed on an input unit provided in the spreadsheet device, and (2) causes the communication unit to send a new query based on the input values to the external server, with a probability obtained by subtracting the cache hit rate from a probability of 100%, and retrieves a new answer from the external server from the communication unit.
[0114] (Supplementary Note 10) An add-in program comprising: a computer of a spreadsheet device having a communication unit and executing a spreadsheet program; when a query based on a query argument acquired from the spreadsheet program, or query information representing the query, and an answer from a server to the query are associated and stored in a spreadsheet, the add-in program causes the computer to function as a query unit that: (1) prevents the communication unit from sending the query to the server; (2) acquires the answer associated with the query or the query information from the spreadsheet; and (3) outputs the acquired answer as a return value to the spreadsheet program.
[0115] (Supplementary Note 11) The add-in program according to any one of Supplementary Notes 6 to 10, wherein the server is equipped with a generation AI (Artificial Intelligence), the query includes an AI argument that is an argument of the generation AI, and the AI argument includes a randomness control argument that is an argument that controls randomness of the answer generated by the generation AI, and the query unit: (1) sets a cache hit rate, which is a probability of retrieving the query or the answer associated with the query information from the spreadsheet when the query or the query information has been saved, based on the randomness control argument or based on an operation performed on an input unit provided in the spreadsheet device, and (2) when the query or the query information has been saved, at the set cache hit rate: (a) suppresses the communication unit from sending the query to the server, (b) retrieves the query or the answer associated with the query information from the spreadsheet, and (c) outputs the retrieved answer as the return value.
[0116] (Supplementary Note 12) The add-in program according to any one of Supplementary Notes 6 to 11, characterized in that the query unit sets the cache hit rate lower the more the randomness control argument controls the randomness.
[0117] (Appendix 13) The add-in program described in any one of Appendices 6 to 12, characterized in that, when the data has been saved, the query unit (1) causes the communication unit to send a new query based on the query arguments to the server, with a probability of a complementary event that is the probability obtained by subtracting the cache hit rate from a probability of 100%, (2) obtains a new answer from the server from the communication unit, and (3) outputs the obtained new answer as the return value.
[0118] (Supplementary Note 14) The add-in program described in any one of Supplementary Notes 6 to 13, characterized in that the query unit, when saved, causes the communication unit to send the new query, including a randomness control argument that controls the randomness so that the value is higher than when controlled by the randomness control argument that was used as the basis for setting the cache hit rate, with the probability of the complementary event.
[0119] (Supplementary Note 15) The add-in program described in any one of Supplementary Notes 6 to 14, characterized in that the inquiry arguments include a plurality of categories and a classification target string to be classified, the query includes a string expressing a question as to which of the plurality of categories the classification target string falls into, and a string that relaxes the restrictions imposed on the answer by the question, and the communication unit transmits the query to the server equipped with the generation AI.
[0120] (Appendix 16) An add-in program described in any one of Appendices 6 to 15, characterized in that the restriction imposed on the answer by the question includes a restriction that the answer must be one of the multiple classifications, and the string that relaxes the restriction relaxes the restriction imposed on the answer by the question to a restriction that the answer must be one of the multiple classifications or a non-classification string that indicates that the string to be classified is not classified into any of the multiple classifications.
[0121] (Appendix 17) The add-in program described in any one of Appendices 6 to 16, characterized in that: the generating AI is an interactive AI; the query further includes a string representing restrictions imposed on the expression format of the answer; the expression format of each of the multiple categories and the expression format of the non-classified string comply with the restrictions imposed on the expression format; and if the answer is not the non-classified string and is not one of the multiple categories, the query unit changes the answer to the non-classified string and outputs the changed answer as the return value.
[0122] (Supplementary Note 18) The add-in program described in any one of Supplementary Notes 6 to 17, characterized in that the restriction imposed on the expression format of the answer is a restriction that the answer must be expressed in a predetermined number of words.
[0123] (Supplementary Note 19) The add-in program described in any one of Supplementary Notes 6 to 18, characterized in that, when the query or the query information and the answer are not associated and saved in the spreadsheet, the query unit: (1) causes the communication unit to send the query to the server; (2) acquires the answer from the server via the communication unit; (3) outputs the acquired answer as the return value; and (4) associates the query or the query information and the answer and saves them in the spreadsheet.
[0124] (Supplementary Note 20) The spreadsheet device according to any one of Supplementary Notes 1 to 3, wherein the formula is set in a plurality of cells in the worksheet including the cell, and when the answer stored in the cache sheet is changed, when recalculating the plurality of cells, instead of sending the query to the external server to obtain the answer, the changed answer stored in the cache sheet is stored as a value in the plurality of cells.
[0125] 1: Spreadsheet system, 100: Spreadsheet device, 101: CPU, 102: RAM, 103a: ROM, 103b: Storage device, 104a: Data communication circuit, 105a: Video card, 105b: Display device, 105c: Input device, 110: Calculation unit, 120: Inquiry unit, 130: Spreadsheet unit, 190: Information storage unit, 900: Server, NT: Network
Claims
1. A spreadsheet device that processes a worksheet and a cash sheet, comprising: (1) When a formula for calling a query function that refers to an input value entered in another cell in the worksheet is set in a cell in the worksheet, (a) generating a query based on the input value; (b) sending the query to an external server; (c) obtaining an answer from the external server; (d) associating the query information representing the query with the answer and storing them in the cash sheet; and (e) storing the obtained answer as the value of the cell. (2) When recalculating the cell, if the query information representing the query is stored in the cash sheet, instead of sending the query to the external server to obtain the answer, obtaining the answer stored in the cash sheet associated with the query information as the value to be stored in the cell. A spreadsheet device characterized by the above.
2. (1) When the first cell which is the cell, the second cell which is the other cell, or a third cell different from the first cell and the second cell is edited, (2) when a column or row including the third cell is deleted, (3) when an operation for instructing calculation is performed, (4) when a work book having the worksheet is saved, (5) when the work book is opened, or (6) when at least one of the worksheet or the cash sheet is printed, the recalculation for the cell is executed. A spreadsheet device according to claim 1, characterized by the above.
3. The query includes: (1) an inquiry asking to which of a plurality of classifications the input value is classified, or (2) an inquiry asking for the result of translating the input value into a specified language, and the query is sent to the external server equipped with a generative AI (Artificial Intelligence). A spreadsheet device according to claim 1 or 2, characterized by the above.
4. A method executed by a spreadsheet device that processes a worksheet and a cache sheet, comprising: (1) when a formula that calls a query function for referring to an input value entered in another cell in the worksheet is set in a cell in the worksheet, (a) generating a query based on the input value, (b) sending the query to an external server, (c) obtaining an answer from the external server, (d) associating query information representing the query with the answer and storing them in the cache sheet, and (e) storing the obtained answer as the value of the cell; and (2) when recalculating the cell, if the query information representing the query is stored in the cache sheet, instead of sending the query to the external server to obtain the answer, obtaining the answer stored in the cache sheet associated with the query information as the value to be stored in the cell. A spreadsheet method characterized by the above.
5. A computer of a spreadsheet device that includes a communication unit and processes a worksheet and a cache sheet, when (1) a formula that calls a query function for referring to an input value entered in another cell in the worksheet is set, (a) generating a query based on the input value, (b) causing the communication unit to send the query to an external server, (c) obtaining an answer from the external server through the communication unit, (d) associating query information representing the query with the answer and storing them in the cache sheet, and (e) storing the obtained answer as the value of the cell; and (2) when recalculating the cell, if the query information representing the query is stored in the cache sheet, instead of causing the query to be sent to the external server to obtain the answer, obtaining the answer stored in the cache sheet associated with the query information as the value to be stored in the cell, and functioning as a spreadsheet calculation unit. A spreadsheet program characterized by the above.
6. An add-in program for a spreadsheet program, comprising a communication unit and a computer of a spreadsheet device that processes a worksheet and a cache sheet, which: (1) When a formula for calling a query function that references an input value entered in another cell in the worksheet is set in a cell in the worksheet: (a) generates a query based on the input value; (b) causes the communication unit to transmit the query to an external server; (c) obtains an answer from the external server via the communication unit; (d) stores the query information representing the query and the answer in association with each other in the cache sheet; and (e) outputs the obtained answer as the value of the cell. (2) When recalculating a cell, if the query information representing the query is stored in the cache sheet, instead of transmitting the query to the external server to obtain the answer, obtains the answer stored in the cache sheet in association with the query information as the value to be stored in the cell, and functions as a query unit. An add-in program characterized by the above.
7. The query unit generates a cache sheet in a workbook having the worksheet when the cache sheet does not exist, and stores the query information and the answer in the generated cache sheet. The add-in program according to claim 6, characterized by the above.
8. The worksheet and the cache sheet are each stored in the same electronic file. The add-in program according to claim 6 or 7, characterized by the above.
9. The external server is equipped with a generative AI (Artificial Intelligence), and the query includes a randomness control parameter which is a parameter for controlling the randomness of the answer generated by the generative AI. When the query information is stored in the cache sheet, the inquiry unit: (1) acquires the answer stored in the cache sheet in association with the query information at a cache hit rate set based on the randomness control parameter or based on an operation performed on an input unit provided in the spreadsheet device; (2) subtracts the cache hit rate from 100% and with the resulting probability, causes the communication unit to transmit a new query based on the input value to the external server and acquire a new answer from the external server via the communication unit. The add-in program according to any one of claims 6 to 8, characterized by the above.
10. When a computer of a spreadsheet device that includes a communication unit and executes a spreadsheet program has a saved state where a query based on an inquiry parameter acquired from the spreadsheet program or query information representing the query and an answer of the server to the query are associated and stored in a spreadsheet: (1) suppresses causing the communication unit to transmit the query to the server; (2) acquires the answer associated with the query or the query information from the spreadsheet; and (3) outputs the acquired answer as a return value to the spreadsheet program, functioning as an inquiry unit. The add-in program is characterized by the above.