Page generation method and system

By defining basic elements and data presentation classes in the development of Apple mobile phones, and using Json format to configure data, we solve the problem of repeated work in the development process in the existing technology, realize rapid page generation and data interoperability, improve development efficiency and reduce maintenance costs.

CN118733025APending Publication Date: 2024-10-01EEO EDUCATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310312972.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

There is a lot of repetitive development and assembly work in the existing Apple mobile phone development process, resulting in low development efficiency and high maintenance costs.

Method used

Propose a page generation method, based on the iOS system, by defining the data description and data presentation class of basic elements, and using the Json format to configure the data to achieve rapid page generation and data interoperability, including defining basic elements, implementing data presentation classes and reconstruction Interface for obtaining configuration data.

Benefits of technology

It greatly improves development efficiency, reduces maintenance costs, and realizes quick page generation and data interoperability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733025A_ABST
    Figure CN118733025A_ABST
Patent Text Reader

Abstract

The invention provides a page generation method and system, and the method is realized based on an iOS system, and specifically comprises the steps: defining the data description of a basic element; realizing a data display class of the basic elements; the data display class of the basic elements is used for displaying the basic elements on a page and responding to events related to the basic elements; and reconstructing an interface for the system to obtain the configuration data. The method has the advantages that according to the technical scheme, page data display and data intercommunication can be achieved only through data configuration, the development efficiency is greatly improved, and the maintenance cost is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of mobile terminal software, and in particular relates to a page generation method and system. Background Art

[0002] With the continuous development of Internet technology, in order to meet various needs in the software development process, corresponding functional codes need to be written and processed. In the process of writing functional codes for intelligent terminal systems, the corresponding page content display and data output need to be involved. The current development of Apple mobile phones is based on the UI controls provided by the iOS system. The development process is to assemble UI controls, and then through user operations, the corresponding UI controls perform certain callbacks to obtain data. The existing development methods have a lot of repeated development and assembly work, which is not conducive to improving development efficiency and code maintenance. Summary of the invention

[0003] The object of the present invention is to overcome these drawbacks.

[0004] In order to achieve the above object, the present invention proposes a page generation method, which is implemented based on the iOS system and specifically includes:

[0005] Step 1: define the data description of the basic element; the basic element is a display area, including the display content, style and event response action of the area;

[0006] Step 2: Implement a data presentation class for basic elements; the data presentation class for basic elements is used to implement the display of basic elements on the page and respond to events related to the basic elements;

[0007] Step 3: Reconstruct the system interface for obtaining configuration data.

[0008] As an improvement of the above method, the data description of the basic element is in Json format, and the content includes:

[0009] cellType: unique identifier of the basic element;

[0010] cellIdent: basic element data display class name;

[0011] Title: The label on the left side of the basic element displays the content;

[0012] uploadValue: The data submitted by the basic element to the server.

[0013] As an improvement of the above method, when the user submits the page, the system VC traverses all basic elements, calls the data presentation class to extract the cellType field value in the basic element data description as the key, and the uploadValue field value as the value, to form a Json string and submit it to the server.

[0014] As an improvement of the above method, the reconstruction system obtains the interface of configuration data, specifically: the acquired data type is a two-dimensional array; one dimension of the two-dimensional array stores the partition number, and the other dimension stores the one-dimensional array; each element in the one-dimensional array is a data description of a basic element.

[0015] The present application also provides a page generation system, which is implemented based on the above method, and the system includes:

[0016] Define the basic element module, which is used to define the data description of the basic elements;

[0017] Implement a display class module, which is used to implement a data display class of a basic element; the data display class of the basic element is used to implement the display of the basic element on the page and respond to events related to the basic element;

[0018] The reconstruction interface module is used to reconstruct the interface of the system to obtain configuration data.

[0019] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above methods when executing the computer program.

[0020] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes any of the methods described above.

[0021] Compared with the prior art, the advantages of the present invention are:

[0022] The technical solution of this application only requires data configuration to realize page data display and data intercommunication, which greatly improves development efficiency and greatly reduces maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 Shown is a flow chart of the page generation method;

[0024] Figure 2 The following is a sample image of the generated page. DETAILED DESCRIPTION

[0025] The technical solution of the present invention is described in detail below with reference to the accompanying drawings.

[0026] This application proposes a page generation method, which realizes the quick generation of Apple terminal pages through basic elements and configuration data. The ultimate goal is that when creating a list page, only a set of Json data needs to be configured to realize page rendering, data display and data interoperability, which greatly improves development efficiency and greatly reduces maintenance costs.

[0027] like Figure 1 As shown, the page generation method includes:

[0028] Step 1: Define basic elements;

[0029] A basic element is a user-defined display area, including the display content, style, and event response actions of the area; after defining the basic elements, users can use multiple basic elements to form a page when generating a page.

[0030] According to the UI controls provided by the iOS system, and the styles and data that need to be displayed on the page, enter the code in Xcode or other editors to assemble the basic elements. The code is Josn data, including:

[0031] Title: The label on the left side of the basic element displays the content;

[0032] detail: The label with an arrow on the right side of the basic element displays the content;

[0033] cellIdent: the name of the basic element data display class; when the page displays data, the specific display process is implemented in this class, and the iOS VC (ViewController) calls the methods in this class to realize page display;

[0034] cellType: the unique identifier of this basic element;

[0035] uploadValue: data submitted by the basic element to the server;

[0036] currentDate: The value displayed by the basic element in the date control on the left;

[0037] expirationDate: The value of the basic element displayed in the date control on the right;

[0038] judgeScore: the page that needs to be displayed when the scoring rule is called in the basic element;

[0039] centerTitle: The label in the middle of the basic element displays the content;

[0040] rightSwitch: the right switch state of the basic element;

[0041] leftTopTitle: The label displayed on the upper left side of the basic element;

[0042] leftBottomTitle: The label displayed at the bottom left of the base element.

[0043] Step 2: Implement the data presentation class of the basic elements;

[0044] Basic elements are inherited from the iOS system control UITableViewCell and registered in the system VC. In the callback method provided by the iOS system control UITableview, each set basic element will be loaded when the page is displayed. The class given by the basic element cellIdent implements the interface provided by VC, realizes the control of the basic element display size, position, etc., and responds to basic element events.

[0045] When generating a page, the system obtains the class name required to display the current basic element based on the cellIdent field in the Json data, such as LMSDefaulrCell, and converts the class name string into the corresponding class through the NSClassFromString method provided by the system to display the basic element on the page.

[0046] For the click response of the basic elements, you need to implement the callback method corresponding to the parent class. When a click event occurs on a basic element, the system will call the callback method of the parent class, and compare the key value in the current event information with the cellType value of the basic element Json data to determine which basic element triggered the click event, and then distribute the event to the basic element, which will handle the click event.

[0047] When the user submits the page, the system VC traverses all basic elements, takes out the cellType field value in the basic element Json data as the key, and the uploadValue field value as the value, to form a Json string and submit it to the server.

[0048] Step 3: Reconstruct the interface for obtaining configuration data;

[0049] like Figure 2 As shown, a list page contains several partitions, and a partition contains several basic elements. Reconstruct the interface for obtaining configuration data provided by VC so that when creating a list page, the data type obtained is a two-dimensional array. One dimension of the two-dimensional array is the partition number, and the other dimension is a one-dimensional array; each element in the one-dimensional array is the Json data of a basic element.

[0050] When the system VC creates a page, it first calls the interface for obtaining configuration data, obtains a two-dimensional array, traverses the array, obtains the one-dimensional array of each partition, and then traverses the one-dimensional array to obtain each basic element that needs to be displayed in the partition. After obtaining the Json data of the basic element, the system obtains the class name required to display the current basic element according to the cellIdent field in the Json data, such as LMSDefaulrCell, and converts the class name string into the corresponding class for use through the NSClassFromString method provided by the system to display the basic element on the page.

[0051] The content displayed by basic elements on the page is read from Json data. For example, the content displayed by the label in the center on the left is displayed by getting the value from the title field. When the content of the label on the page changes, the value of the title field in the Json data will also be modified accordingly.

[0052] The iOS system needs to use the list class UITableView and the list element class UITableviewCell to generate a list page. The process of generating a list page is: the system loads the list class UITableView and sets the list class UITableview's agent as the current controller.

[0053] The specific process of implementing the proxy is to implement the following proxy method:

[0054] a)-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView; Get the number of elements in a two-dimensional array

[0055] b)-(NSInteger)tableView:(UITableView*)tableViewnumberOfRowsInSection:(NSInteger)section; Get the number of elements to be displayed in each group

[0056] c)-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath; Display of each row of elements (extract element data and display it on the page)

[0057] In the implemented proxy method, the data in the data source will be assigned to the corresponding control of UITableviewCell for display. When the corresponding proxy method is implemented, when the system calls the reloadData method of the list class UITableview, the data to be displayed will be automatically displayed according to the list rules.

[0058] Through the method of the present invention, all rules and data analysis are defined, and after the above-mentioned proxy method is implemented for data binding, the iOS system can obtain data from the outside according to the implemented proxy method and load the page according to the system process.

[0059] Therefore, after setting up customized basic elements, rules, data and element binding according to the steps of the application method, you only need to process the data source, and the iOS system can complete the loading and display of the page according to the internal logic of the system.

[0060] by Figure 2 This application method is explained using the following page as an example:

[0061] Define the Json data of the basic elements needed on the page, such as Figure 2 Element 1 in the image is composed of left-centered text + right-centered text + right-side arrow. The Json data is defined as:

[0062] {

[0063] "title": "Unit Theme",

[0064] “detail”: “what is it”,

[0065] "cellIdent":"LMSDefaulrCell",

[0066] "cellType": "unit"

[0067] "uploadValue":"what"

[0068] }

[0069] Then put all kinds of different data into the same array to complete the data processing, so that the label on the left and the label with an arrow on the right will be displayed.

[0070] like Figure 2 Element 3 in defines the Json data as:

[0071] {

[0072] "leftTopTitle": "Automatic scoring rules",

[0073] "leftBottomTitle": "After adding, no need for manual grading by teachers",

[0074] "cellIdent":"LMSCreateActivitySetJudgeRulesCell",

[0075] "cellType":"autoJudgeScore"

[0076] "uploadValue": "{}"

[0077] }

[0078] like Figure 2 Element 5 in defines the Json data as:

[0079] {

[0080] "title": "Public Assignment",

[0081] "switchOn":@(NO),

[0082] "cellIdent":"LMSCreateActivitySetSwitchCell",

[0083] "cellType":"publicHomework"

[0084] "uploadValue": "0"

[0085] }

[0086] By calling the defined Json data on the required page, the page can be automatically rendered and data output can be performed according to the selected elements, as follows:

[0087] Click the corresponding element, and the cellType field will be used to distinguish and process it in the subclass interface exposure callback, and then the corresponding Json will be found to modify the uploadValue and the value of the corresponding label, and the interface rendering will be refreshed. When the Done button is clicked, the array will be traversed to extract each partition array, traverse the partition array, obtain each Json, set the Json data of "cellType": "uploadValue", and transmit it to the server in the format of Json data.

[0088] The present invention may also provide a computer device, comprising: at least one processor, a memory, at least one network interface and a user interface. The various components in the device are coupled together through a bus system. It is understood that the bus system is used to achieve connection and communication between these components. In addition to the data bus, the bus system also includes a power bus, a control bus and a status signal bus.

[0089] The user interface may include a display, a keyboard or a pointing device, such as a mouse, a trackball, a touch pad or a touch screen.

[0090] It is understood that the memory in the disclosed embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memories described herein are intended to include, but are not limited to, these and any other suitable types of memories.

[0091] In some embodiments, the memory stores the following elements, executable modules or data structures, or a subset thereof, or an extended set thereof: an operating system and applications.

[0092] The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present disclosure can be included in the application.

[0093] In the above embodiment, the processor may also call a program or instruction stored in the memory, specifically, a program or instruction stored in an application program, and is used to:

[0094] Execute the steps of the above method.

[0095] The above method can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The above-disclosed methods, steps and logic block diagrams can be implemented or executed. The general processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the above-disclosed method can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined to execute. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0096] It is understood that the embodiments described in the present invention can be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application or a combination thereof.

[0097] For software implementation, the technology of the present invention can be implemented by executing the functional modules (such as procedures, functions, etc.) of the present invention. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0098] The present invention may also provide a non-volatile storage medium for storing a computer program. When the computer program is executed by a processor, each step in the above method embodiment can be implemented.

[0099] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention is described in detail with reference to the embodiments, it should be understood by those skilled in the art that any modification or equivalent replacement of the technical solutions of the present invention does not depart from the spirit and scope of the technical solutions of the present invention and should be included in the scope of the claims of the present invention.

Claims

1. A page generation method, which is implemented based on the iOS system and specifically includes: Step 1: Define the data description of the basic elements; The basic element is a display area, and the content includes the display content, style and event response action of the area; Step 2: Implement a data presentation class for basic elements; the data presentation class for basic elements is used to implement the display of basic elements on the page and respond to events related to the basic elements; Step 3: Reconstruct the system interface for obtaining configuration data.

2. The page generation method according to claim 1, characterized in that: The data description of the basic element is in Json format, including: cellType: unique identifier of the basic element; cellIdent: basic element data display class name; Title: The label on the left side of the basic element displays the content; uploadValue: The data submitted by the basic element to the server.

3. The page generation method according to claim 2, characterized in that: When the user submits the page, the system VC traverses all the basic elements, calls the data presentation class to extract the cellType field value in the basic element data description as the key, and the uploadValue field value as the value, forming a Json string and submitting it to the server.

4. The page generation method according to claim 1, characterized in that: The interface for the reconstruction system to obtain configuration data is specifically as follows: the data type obtained is a two-dimensional array; one dimension of the two-dimensional array stores the partition number, and the other dimension stores the one-dimensional array; each element in the one-dimensional array is a data description of a basic element.

5. A page generation system, implemented based on any method of claims 1-4, characterized in that: The system comprises: Define the basic element module, which is used to define the data description of the basic elements; Implementing a display class module, used to implement a data display class of a basic element; the data display class of the basic element is used to implement the display of the basic element on the page and respond to events related to the basic element; and The reconstruction interface module is used to reconstruct the interface of the system to obtain configuration data.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the method according to any one of claims 1 to 4.

Citation Information

Cited By

  • Page generation method, electronic equipment and computer readable storage medium

    CN119225728A