Method and system for realizing object-oriented programming on spreadsheet and medium
By implementing static definition and reading, dynamic creation and dynamic transformation of objects in spreadsheets, the problem that existing spreadsheet software fails to implement object-oriented programming is solved, efficient operation and management of complex data is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202311311715.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-11
- Publication Date
- 2025-04-11
AI Technical Summary
Existing spreadsheet software fails to implement object-oriented programming on its basic functions, limiting users' operations and management of complex data.
By implementing static definition and reading, dynamic creation and dynamic transformation of objects in a spreadsheet, combining the concepts of tree-shaped data storage and object-oriented programming, users allow users to define, load, operate and save objects in a spreadsheet.
It realizes object-oriented programming in spreadsheets, enhances users' ability to operate and manage complex data, and improves the functional complexity and user experience of spreadsheets.
Smart Images

Figure CN119806480A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of application software design utilizing computer-aided knowledge work. Background Art
[0002] Spreadsheet is a long-lasting office software. One of the reasons for its success is that it has a simple and pure calculation model, which is reflected in the user level to produce a natural and easy-to-understand user experience. With the upgrade of hardware equipment, the operation speed and the amount of data that can be processed by modern spreadsheets have greatly increased. However, the basic functional form of spreadsheets has not changed much compared with its early days. At the same time, the functional complexity of application software has also increased as hardware upgrades. In order to support users' needs for complex functions, object-oriented programming methods have emerged in the field of software design. The first feature of object-oriented programming methods is to package complex data into structures called objects, and another feature is that functions called methods need to be written for these objects. Programmers can use these methods to operate related objects, thereby hiding a large part of the underlying logic complexity and increasing the abstraction that is beneficial to conceptual thinking. Now, if there is a way to implement object-oriented programming on spreadsheets, it will be able to usher in a new period of productivity growth. Past patents in this area are relatively rare. Some slightly related ones include: CN101809610A describes a method for generating some views from a part of the content of a spreadsheet; CN116595959A describes a method for generating a spreadsheet after compiling some custom semantic files. However, these are not to implement object-oriented programming on spreadsheets. Summary of the invention
[0003] First, recognize that the most common structure for object definition is a tree structure, so any file or file part that can store tree-structured data (such as common JSON, XML, YAML, etc. formats) can be used to store data in a long-term medium ( Figure 1 :102) Stores the definition of an object (including object type, object attribute values, and other information).
[0004] In memory ( Figure 1 :103), general programming languages have data structures to hold data with tree structures (such as struct in C language, map in JAVA language, dict in Python language, etc.), and There is a function that canData is read from the medium into memory for calculation, and there are functions that can write data from memory to the medium for storage. Therefore, the first step of statically defining an object is to create a definition file for the object (or add a new paragraph to an existing file) and save this file in the medium. Each subsequent use only requires reading it into memory and converting it to a structure that is convenient for calculation. In order to ensure that the file can be found in the future, a unique identifier needs to be added to the file. Generally, the identifier can be added directly to the definition and saved together with the definition in the medium. The identifier and the method of finding the file should also be recorded in an addressing memo so that the file can be found by the identifier in the future. When the object is to be deleted in the future, it is only necessary to delete the definition file in the medium and the relevant entries in the addressing memo. There are many ready-made implementation methods for this addressing memo, such as a file system on a single machine (the identifier is the file name) or a server on the network (the identifier is the URL).
[0005] Next, we will explain how to read static objects ( Figure 2 :210). After obtaining the identifier of the file containing the object to be loaded, the identifier is used to find the location of the corresponding file in the address memo (such as the file path or web page address, etc.), and then the object definition in the file is read into memory.
[0006] Next, we will explain how to dynamically define objects ( Figure 2 :220). In many temporary situations, an object is used only to assist in the intermediate steps of a lengthy calculation, and it does not need to be stored for a long time. This requires temporarily defining the object in memory. To this end, we need to define the object's constructor. The constructor definition is static, that is, it needs to be saved in the medium and read into the memory before use. After the constructor is executed in the memory, it needs to return the data structure of the constructed object in the memory. The constructor can also receive some parameters from the outside world and return objects with different contents according to these parameters according to the established definition. The method of deleting an object is similar to deleting other values in memory (if the object is allocated in the heap area, it can be deleted through relevant conventional methods).
[0007] Next, we will explain how to dynamically transform objects ( Figure 2 :230). The definition of the object has been read or temporarily constructed and now exists in the memory. Then it is natural to use it for calculation. This requires some functions called methods to transform it. The transformation result can be any type of value or object, not necessarily limited to the same type. The definition of these method functions is the same as the definition of the constructor, that is, first write a static definition file, then save it to the medium, and read it into the memory before use.
[0008] Next, the user needs to enter the Figure 1:104) Load objects in memory for browsing and manipulation ( Figure 2 :240). The loaded object will occupy only one cell like a normal value. The cell is usually not large enough to display the object's contents completely, so only a short summary is displayed. The system can provide the user with another view to display the object's full contents. To manipulate the object, the user only needs to write an expression containing the cell address of the object, just like manipulating other values.
[0009] So far, we have explained the static definition and reading of objects ( Figure 2 :210), dynamic creation ( Figure 2 :220), dynamic transformation ( Figure 2 :230), user browsing and operation methods ( Figure 2 :240), together they implemented an object-oriented programming approach on the spreadsheet ( Figure 2 :200), after being equipped with various hardware, it becomes a system ( Figure 1 :100). Example
[0010] We take the implementation of a vector (vec) object on a spreadsheet as an example to further explain the above method and system.
[0011] On the spreadsheet ( Figure 3 :300), the user enters the expression =vec_seq(1,4,1) in cell A1 ( Figure 3 :321), this is to use a vec object constructor vec_seq to construct a vector object whose content is an arithmetic progression with a first term of 1, a length of 4, and a difference of 1. After the system parses the expression, it creates a data structure in memory to hold the vector object and the object's type name (i.e. vec) or the type's unique identifier.
[0012] The user now asks to browse the results ( Figure 3 :340), the system provides her with a window view in the user interface ( Figure 3 :344). This view briefly shows near the top that the original cell address is A1 and the object type is vec ( Figure 3 :345), the view body shows the contents of the vector object as 1,2,3,4 ( Figure 3 :346).
[0013] Next, the user needs to use the vector (vec) object in A1 to perform sum calculations. She uses the statically defined method function sum. She writes the expression =sum(A1) to pass the address of A1 to the method function sum as a parameter ( Figure 3:331). After the system parses this expression, it will find the data structure that A1 is referencing in the memory, and then the system will operate on this data structure according to the logic defined by sum itself ( Figure 3 :330), and finally the result 10 ( Figure 3 :332) are displayed in a single pane view on the user interface ( Figure 3 :334).
[0014] The above is a common example of starting from dynamic creation. Next, we will explain the static definition and reading methods.
[0015] The user now wants to save the vector (vec) object in A1 to a medium for long-term use. She enters the expression =save(A1) in cell B1. Figure 3 :351), after receiving the instruction, the system finds the data structure that A1 is referencing in the memory, converts it into a file structure (such as JSON, XML, or YAML), and then creates a unique identifier id12345, using it as the file name to write the file to the connected medium ( Figure 3 :350), and finally display the identifier id12345 in a single-grid view on the user interface ( Figure 3 :352).
[0016] After receiving the identifier id12345, the user wants to read the saved object. She enters the expression =load(“id12345”) in cell B2. Figure 3 :311). After the system parses this expression, it will ask the file system for the file with id12345 as the identifier. After obtaining it, the system will create a data structure in memory that can hold the vector object based on the file.
[0017] The user can now treat B1 the same way as A1, for example, she can request to browse the contents of B1 ( Figure 3 :342), the system will provide a view with the same content as before ( Figure 3 :344).
Claims
1. A method for assisting a user in performing object-oriented programming on a spreadsheet, characterized in that: include: There is a file for long-term storage of objects in media, There is a data structure for holding objects in memory, There is a view for displaying objects on the interface. There is a function for reading objects from a file into an in-memory data structure. There is a function for saving objects from an in-memory data structure to a file. There is a function that returns an object, There is a function that accepts an object as input, There is a method or function that can display the object in memory to the view on the interface.
2. The view according to claim 1, characterized in that include: Contains the content of the displayed object.
3. Each function according to claim 1, characterized in that include: Has an expression (referred to as a function expression) for editing by the user on the interface, The result obtained by calculating the function expression can be displayed on the interface.
4. A method or function capable of displaying an object in memory on a view of an interface as claimed in claim 1, characterized in that: include: There is a step to transform the object in memory into a data structure that can be directly used by the view (referred to as the view data structure). There is a step to draw the view on the interface according to the view data structure.
5. A system for assisting a user in performing object-oriented programming on a spreadsheet, characterized in that: include: There is a spreadsheet graphical user interface (referred to as the interface); There is a data processor (referred to as the processor) for executing the program of the method of claims 1-4 and accessing related data; There is a data storage device (referred to as memory) for storing the method program and related data of claims 1-4 during execution, so that the system can execute the method program of claims 1-4 when there is a processor.
6. There is a non-temporary computer readable and writable medium (hereinafter referred to as the medium) for long-term storage of the program and related data of the above method, so that when the program and data in the storage medium are read by the processor of the system described in claims 1-5, any step of the method described in any one of claims 1-4 can be executed.
Citation Information
Patent Citations
Auto-generation and syndication of tables as forms
CN101809610A
Model-driven spreadsheet implementation method
CN116595959A