Nothing Special   »   [go: up one dir, main page]

CN113760275A - Method and device for generating page - Google Patents

Method and device for generating page Download PDF

Info

Publication number
CN113760275A
CN113760275A CN202010975122.8A CN202010975122A CN113760275A CN 113760275 A CN113760275 A CN 113760275A CN 202010975122 A CN202010975122 A CN 202010975122A CN 113760275 A CN113760275 A CN 113760275A
Authority
CN
China
Prior art keywords
component
page
data
generating
attribute information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010975122.8A
Other languages
Chinese (zh)
Inventor
冯元良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010975122.8A priority Critical patent/CN113760275A/en
Publication of CN113760275A publication Critical patent/CN113760275A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method and a device for generating a page, and relates to the technical field of computers. One embodiment of the method comprises: component operation and operation results related to the components are defined based on the JSON format, service codes are generated according to the component operation and operation results defined by the JSON, the page is automatically generated by combining attribute codes of the components, service interaction between the page components and related functions or data is achieved, development workload of developers is reduced, and working efficiency is improved.

Description

Method and device for generating page
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for generating a page.
Background
In front-end application development, a developer can write HTML (hypertext markup language) codes, Javascript (an transliterated scripting language) scripts and the like to realize the display and functions of pages based on an Vue framework (Vue is a set of progressive framework for constructing a user interface), can define components through a JSON (lightweight data exchange format) format, and can realize dynamic presentation of the components through reading and analyzing the JSON data; in addition, the definition of the function method by the Javascript object can be completely serialized into a character string generation page in binary or Base64 format.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
by adopting the method of writing HTML or Javascript to generate pages, when the interface layout of a website system is updated or the service logic is added each time, the code needs to be modified and then released again for updating; the method for generating the page based on the JSON format has the problems that the JSON format supports limited data types and does not support the definition of the function method of the Javascript object and the logic relation between data; the method for defining serialization by using functions has the problems of complex editing operation and lack of standard definition of the serialized data, and the defects of large development workload and low working efficiency exist in each scheme in the prior art.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for generating a page, which can define component operations and operation results associated with a component based on a JSON format, generate service codes according to the component operations and operation results defined by the JSON, and automatically generate a page in combination with attribute codes of the component, thereby implementing service interaction between the page component and an associated function or data, reducing workload of development by developers, and improving work efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for generating a page, including: acquiring a first format text describing a page component, wherein the first format text comprises attribute information of the component, component operation related to the attribute information and an operation result corresponding to the component operation; generating a component code of the component according to the attribute information of the component, and generating a service code of the component according to the component operation and the operation result; and generating a page according to the component code and the service code.
Optionally, the method of generating a page is characterized in that,
the first format is a JSON structure.
Optionally, the method of generating a page is characterized in that,
the component operations include one or more of the following: event operations, binding, computation, data set operations, and snooping.
Optionally, the method of generating a page is characterized in that,
the event operation comprises: an event associated with the attribute information of the component is defined, and the operation result obtained after the event is operated is determined.
Optionally, the method of generating a page is characterized in that,
when the component operation is binding, defining a data source of the attribute information related to the component, binding the data source with the operation result, and determining the operation result according to data acquired from the data source.
Optionally, the method of generating a page is characterized in that,
when the component operates as a calculation, defining a relation representation corresponding to the calculation, and using the relation representation to obtain a result of the calculation as the operation result.
Optionally, the method of generating a page is characterized in that,
when the component operation is a data set operation, defining each data in the data set, and determining the operation result according to each data.
Optionally, the method of generating a page is characterized in that,
when the component operates as a monitor, defining data associated with the attribute information to be monitored, and determining the operation result according to the changed data.
To achieve the above object, according to a second aspect of the embodiments of the present invention, there is provided an apparatus for generating a page, including: the method comprises the steps of obtaining a component text module, a page code generation module and a page generation module; wherein,
the component text acquiring module is used for acquiring a first format text describing a page component, wherein the first format text comprises attribute information of the component, component operation related to the attribute information and an operation result corresponding to the component operation;
the page code generating module is used for generating a component code of the component according to the attribute information of the component and generating a service code of the component according to the component operation and the operation result;
and the page generation module is used for generating a page according to the component code and the service code.
Optionally, the apparatus for generating a page is characterized in that,
the first format is a JSON structure.
Optionally, the apparatus for generating a page is characterized in that,
the component operations include one or more of the following: event operations, binding, computation, data set operations, and snooping.
Optionally, the apparatus for generating a page is characterized in that,
the event operation comprises: an event associated with the attribute information of the component is defined, and the operation result obtained after the event is operated is determined.
Optionally, the apparatus for generating a page is characterized in that,
when the component operation is binding, defining a data source of the attribute information related to the component, binding the data source with the operation result, and determining the operation result according to data acquired from the data source.
Optionally, the apparatus for generating a page is characterized in that,
when the component operates as a calculation, defining a relation representation corresponding to the calculation, and using the relation representation to obtain a result of the calculation as the operation result.
Optionally, the apparatus for generating a page is characterized in that,
when the component operation is a data set operation, defining each data in the data set, and determining the operation result according to each data.
Optionally, the apparatus for generating a page is characterized in that,
when the component operates as a monitor, defining data associated with the attribute information to be monitored, and determining the operation result according to the changed data.
To achieve the above object, according to a third aspect of the embodiments of the present invention, there is provided an electronic device for generating a page, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method as in any one of the above methods of generating pages.
To achieve the above object, according to a fourth aspect of the embodiments of the present invention, there is provided a computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method as any one of the methods of generating a page described above.
One embodiment of the above invention has the following advantages or benefits: the method can define the component operation and operation result related to the component based on the JSON format, generate the service code according to the component operation and operation result defined by the JSON, automatically generate the page by combining the attribute code of the component, realize the service interaction between the page component and the related function or data, reduce the development workload of developers and improve the working efficiency.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a flowchart illustrating a method for generating a page according to an embodiment of the present invention;
FIG. 2A is a diagram of an example text for defining an event for a component according to one embodiment of the present invention;
FIG. 2B is an exemplary diagram of code for component-based event generation according to an embodiment of the present invention;
FIG. 3A is a diagram illustrating an example of text for defining a binding for a component, according to an embodiment of the present invention;
FIG. 3B is a diagram of an example of code generated based on a component-based binding according to an embodiment of the present invention;
FIG. 4A is a diagram of an example text for defining a computation of a component, provided by an embodiment of the invention;
FIG. 4B is an exemplary diagram of code generated by a component-based computation according to an embodiment of the invention;
FIG. 5A is a diagram illustrating an example of a text for defining operations for a data set of a component, according to an embodiment of the present invention;
FIG. 5B is an exemplary diagram of code generated based on a component-based data set operation according to an embodiment of the present invention;
FIG. 6A is a diagram illustrating an example of text defining listening for a component, according to an embodiment of the present invention;
FIG. 6B is a diagram of an example of code generated by a component-based snoop, according to an embodiment of the present invention;
FIG. 7 is a schematic structural diagram of an apparatus for generating a page according to an embodiment of the present invention;
FIG. 8 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 9 is a schematic block diagram of a computer system suitable for use in implementing a terminal device of an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
As shown in fig. 1, an embodiment of the present invention provides a method for generating a page, where the method may include the following steps:
step S101: the method comprises the steps of obtaining a first format text describing a page component, wherein the first format text comprises attribute information of the component, component operation related to the attribute information and an operation result corresponding to the component operation.
Specifically, a first format text describing each component of a page (namely, describing a page component) is obtained, wherein the first format is a JSON structure; the first format text (JSON structure-based text) contains attribute information of components, such as: the category of the component, the style of the component, the name of the component, the display text of the component, etc.; as shown by a201 in the text example of fig. 2A, where "" component ": "button" "defines the type of the component as a button (button); "" lnerText ": "button" "defines the display text of the component (button); the invention does not limit the concrete content contained in the component attribute. Further, the first format text (text based on JSON structure) also contains component operations associated with component attribute information and operation results corresponding to the component operations. Specifically, the assembly operations include: the component operations include one or more of the following: event operations, binding, computation, data set operations, and snooping. Further, the attribute information of the component may further include value, params, fields, source, watch, and the like, and the component may further associate the component attribute, the component operation, and the operation result by using the attribute information, specifically, the value is used for a data object of the component internal interactive operation, and is an initial value of a model that is one of bound data sources, and the value of the attribute in the object is affected by the user interactive operation in an interface presented by the component; the params is used for receiving a value or an object which is imported from the outside by the component, the value or the object is an input value of a model which is one of bound data sources, the params attribute and the value of a member can only be changed outside, and an initial value can be transferred when the component is initialized; the datasource represents the data interaction definition of the component and can support data returned in fixed value, ajax request, websocket and other modes; fields represents an array passed to the component to define the view structure of the component; the watchs are used for monitoring the change of the data attribute and updating another group of data attribute in the model after the change to realize linkage; it can be understood that the components can be associated with services such as data and functions by defining the component operation and the operation result corresponding to the component operation, and further, the service code is automatically generated, so that the workload of developing the page code by developers is reduced.
In the text example of fig. 2A, a202 shows an example of a component operation as an event operation, where "on" is an example of an event (i.e., a component operation associated with a button component), as shown in a203, "alert ('click')" is an operation result corresponding to "on", and one component (button) displayed on a page is described by text as in fig. 2A, text on the button (i.e., a "button") is displayed, and a prompt box containing alert and "click" information pops up after the button is clicked, that is, the first format text contains attribute information of the component, a component operation associated with the attribute information, and an operation result corresponding to the component operation. That is, the event operation includes: an event associated with the attribute information of the component is defined, and the operation result obtained after the event is operated is determined.
In the text example of fig. 3A, a303 shows an example in which a component operates as a binding, where "bind" is a binding operation, that is, when the component operates as a binding, a data source of the attribute information associated with the component is defined and bound with the operation result, and the operation result is determined according to data acquired from the data source; specifically, as shown in a302, the attribute information of the component indicates that the component is a button, and a data source (as shown in a 304) associated with the button action is defined by "binding", it is understood that data contained in the data source may be local data, or may be a server-side database, data of the database may be acquired by an HTTP request, or data is acquired by a Websocket, further, the data source is bound with the operation result, and the operation result is determined according to the data acquired from the data source, for example, the operation result is to display the acquired data on a page, or a result of analyzing, processing, counting, and cleaning the acquired data is displayed on the page; the invention does not limit the concrete form and content of the data source, the concrete content of the operation result and the data processing form; wherein binding related elements are defined, for example, by the following text examples of formats: $ type: 'bind' (i.e., bind); source: represents the source of the binding value, $ default: denotes a default value when the source value is undefined; with respect to datasource (i.e., data source), the following definitions can be made: when defining fixed data, it is used to provide object data or arrays, and the defined related elements are type: 'object'; data represents data, a fixed value can be set, a converted value can also be set, an HTTP request is used for acquiring data through the HTTP request, and the method has a load method, wherein the data acquisition can be triggered by a component event, and can also be triggered after a certain value change is realized by setting a watch (i.e. monitoring) operation, specifically taking the HTTP request as an example, the following relevant elements are described, namely, type: 'request' (i.e. request); url, request related url; method for HTTP request; data is data sent by the HTTP request; params is the parameter sent by the HTTP request; headers, header information of HTTP request; the watch monitors the members in params and model and then executes the request; autoLoad, which indicates whether to automatically request at component initialization; defaultData, default data indicating when the request result does not exist; errorData is the default data when an HTTP request is incorrect. Data can also be obtained through Websocket, for example, defined related elements are: the data source definition type is websocket, is used for receiving data pushed by a server after establishing websocket connection with the server, has a connect and disconnect method, and can control whether to establish connection or not by a component event, namely, the type is 'websocket'; remote address; timeout is connection timeout; autoConnect is automatically connected at component initialization.
When the component operates as a bind, $ source may also define the data source as the following parameters, including for example: params, model, datasource, sourcedata, arguments, scope, etc., in a format that may be defined as "< data Source > < Attribute > …" for supporting the fetching of multiple levels of child attributes from a source member; wherein params is used for receiving the value or object imported from the outside by the component; the model represents data of interactive operation influence change of the dynamic interface generated by the component and is also an output value of the component; the data source is a data source object of the component and comprises function methods and attributes of different types of data sources, wherein the data attributes represent data of the data sources, and the function methods of the data sources can be directly bound to events of the component defined in fields to realize the association of the component events and data source behaviors; sourcedata is a data attribute value directly pointing to a data source and is used as a binding value for association; definitions are a form in which, when the component operation is an event operation, definitions can handle parameter values as an array, and when defining the $ definitions property of an event, the binding of a parameter can use the parameter value array of the component event as the source of the value; scope is the current object that the defined $ field binding transform can use for a $ data array when the component operation is a data set operation (e.g., array).
In the text example of fig. 4A, a402 shows an example in which a component operates as a calculation, where "func" is a calculation operation, and a relational expression is that a corresponding relational expression (i.e., t.length) is calculated for a402 as shown in a403, and with the relational expression, a result of the calculation (e.g., a result of t.length is a length of an input text) is a result of the operation; when the component operates as a calculation, defining a relation representation corresponding to the calculation, and using the relation representation to obtain a result of the calculation as the operation result; wherein the computing operation may also set a parameter (e.g., $ argument in FIG. 4A) for further determining the relational representation corresponding to the computing operation; for example, the following format text example defines the computation related elements: type: 'func' (i.e., calculation); the input parameter of the function method is a key value pair, and comprises a parameter name and a parameter value, and the parameter value can be a fixed value or a formula. The result is the realization of a function method and supports the operation expression and javascript grammar of parameters; default value when the function execution result does not exist or the computation execution is abnormal.
In the text example of fig. 5A, a502 shows an example in which a component operation is a data set operation, where "array" indicates a data set (e.g., array) operation, where as shown in a401, "listData" is used to define data contained in an array (i.e., a data set), i.e., when the component operation is a data set operation, each data in the data set is defined, and further, data displayed on a page is determined according to the listData, as shown in a503, "scope. When the component operation is a data set operation, defining each data in the data set, and determining the operation result according to each data; the data set operation-related elements are defined, for example, using the following text format example: type: 'array' (i.e., operate on the data set); data for presenting the component; and field, component definition presented when traversing data, wherein if a certain property in the component uses binding conversion, a scope object can be used as a data source, and the scope object is the current object traversed by the $ data array data.
Further, the component operations further comprise listening; when the component operates as a monitor, defining data associated with the attribute information to be monitored, and determining the operation result according to the changed data. Specifically, the association of page data and real-time data update can be realized through the definition and operation of listening, and a601 in the text example of fig. 6A shows an example in which the operation of the component is listening, where "watch" is listening, "textLength" is the length of the input text associated with the textbox component that is being listened, and when the length of the input text changes due to the change of the input text, the data associated with "textLength" is "value. As can be appreciated, snooping can be employed with one or more of collection component operations (binding, computation, event operations, data collection operations).
Step S102: and generating a component code of the component according to the attribute information of the component, and generating a service code of the component according to the component operation and the operation result.
Specifically, as can be seen from the description in step S101, in the present application, in addition to defining the attribute of a page component, a component operation and an operation result corresponding to the component are defined by using a JSON structure text, further, according to the attribute information of the component, a component code of the component is generated, according to the component operation and the operation result, a service code of the component is generated, and a page is generated according to the component code and the service code.
For example, as shown in fig. 2B, B202 shows a business code generated based on the operation of the component of a202 as an event operation (i.e., an event of a button component, such as a click event) and the operation result of a203 (presentation prompt box), and B201 shows a component code of the component (button) generated based on a 201; as shown in fig. 3B, B301 shows a component code generated based on the component attribute information (button component) of a302, B302 shows a service code generated based on the operation of the component of a303 as a binding (e.g., button-to-get-data binding) and the operation result of a304 (data is obtained according to a defined data source, and a specific data source and get definition are as shown in a 301); as shown in fig. 4B, B401 shows a component code generated based on the component attribute information of a401 (the component is an input text box), and B402 shows a service code generated based on the operation of the component of a402 for calculation (for example, for calculating the length of an input text) and the operation result of the relational representation of a403 (for obtaining the length of a text); as shown in fig. 5B, B501 shows component codes generated based on component attribute information of a501 (a component is an array), and B502 shows business codes generated based on operations of a502 for a data set (for example, operations for data contained in a log array) and operation results of a503 (for data in an acquisition array);
as shown in fig. 6B, B601 shows component codes generated based on component attribute information (component is a text box) of a604, and B602 shows service codes generated based on operation of the component of a601 as listening and operation results of a602-a603 (value.
Further, the page code is generated according to the component code of each component contained in the page and the service code of the corresponding component, so that the workload of developing the page code is reduced, and the development efficiency is improved.
Step S103: and generating a page according to the component code and the service code.
Specifically, a page is generated according to each component code generated in step S102 and the corresponding service code, when a user performs an operation on the page, an operation instruction for the component included in the page is received, and based on the service code of the component, the operation result corresponding to the operation instruction is obtained and displayed. For example, a user clicks a button to inquire order data, and website information and the like are acquired; preferably, an embodiment of the present application is that a rendering process of a component is based on Vue, and the configuration of a front-end interface (i.e. page components and attribute information) is described by JSON format data, so that the rendering and interaction functions of the interface can be realized; furthermore, two links of conversion and attribute processing are added on the basis of Vue rendering, firstly, a created link in the JSON data (namely component operation including one or more of event operation, binding, calculation, data set operation and monitoring) is changed into the association relationship between data and components in the Vue component lifecycle, the result of attribute information processing is changed into component attributes in a rendering link, and the component operations being rendered are combined, for example, a node (for example: VNode) of a created component of a createElement method of Vue is called in rendering, further, the createElement method of Vue can define three parameters which are respectively component name elements and are used for defining the component type of the VNode to be created by Vue; attributes, fieldooptions: creating attribute information of the component of the VNode, including component operation and operation results; subassembly children: is a subassembly inside the assembly. Through the operation, the fact that only data defined by JSON text can be transmitted can present any Vue interface and interaction logic of the interface.
As shown in fig. 7, an embodiment of the present invention provides an apparatus 700 for generating a page, including: an acquiring component text module 701, a page code generating module 702 and a page generating module 703; wherein,
the component text obtaining module 701 is configured to obtain a first format text describing a page component, where the first format text includes attribute information of the component, a component operation associated with the attribute information, and an operation result corresponding to the component operation;
the page code generating module 702 is configured to generate a component code of the component according to the attribute information of the component, and generate a service code of the component according to the component operation and the operation result;
the page generating module 703 is configured to generate a page according to the component code and the service code.
Optionally, the obtaining component text module 701 includes: the first format is a JSON structure.
Optionally, the obtaining component text module 701 includes: the component operations include one or more of the following: event operations, binding, computation, data set operations, and snooping.
Optionally, the obtaining component text module 701 includes: the event operation comprises: an event associated with the attribute information of the component is defined, and the operation result obtained after the event is operated is determined.
Optionally, the component obtaining text module 701 is configured to, when the component operates as a binding, define a data source of the attribute information associated with the component, bind the data source with the operation result, and determine the operation result according to data obtained from the data source.
Optionally, the component text obtaining module 701 is configured to define a relationship representation corresponding to the calculation when the component is operated as the calculation, and use the relationship representation to take a result obtained by the calculation as the operation result.
Optionally, the module 701 for obtaining a component text is configured to define each data in the data set when the component operation is a data set operation, and determine the operation result according to each data.
Optionally, the component text obtaining module 701 is configured to define, when the component operates as monitoring, monitored data associated with the attribute information, and determine the operation result according to the changed data.
An embodiment of the present invention further provides an electronic device for generating a page, including: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are enabled to realize the method provided by any one of the above embodiments.
Embodiments of the present invention further provide a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method provided in any of the above embodiments.
Fig. 8 illustrates an exemplary system architecture 800 to which a method of generating a page or an apparatus for generating a page of an embodiment of the present invention may be applied.
As shown in fig. 8, the system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. The network 804 serves to provide a medium for communication links between the terminal devices 801, 802, 803 and the server 805. Network 804 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 801, 802, 803 to interact with a server 805 over a network 804 to receive or send messages or the like. Various client applications may be installed on the terminal devices 801, 802, 803.
The terminal devices 801, 802, 803 may be various electronic devices having display screens and supporting various client applications, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 805 may be a server that provides various services, such as a background management server that provides computation for page text designed by a user using the terminal devices 801, 802, 803. The background management server can analyze and calculate the received page design text, generate a page code and display the page to the terminal equipment so that a user can operate based on the page.
It should be noted that the method for generating a page provided by the embodiment of the present invention is generally executed by the terminal devices 801, 802, and 803 or the server 805, and accordingly, the apparatus for generating a page is generally disposed in the terminal devices 801, 802, and 803 or the server 805.
It should be understood that the number of terminal devices, networks, and servers in fig. 8 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 9 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU)901 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 909 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The above-described functions defined in the system of the present invention are executed when the computer program is executed by a Central Processing Unit (CPU) 901.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules and/or units described in the embodiments of the present invention may be implemented by software, and may also be implemented by hardware. The described modules and/or units may also be provided in a processor, and may be described as: a processor comprising: the method comprises the steps of obtaining a component text module, a page code generation module and a page generation module; the names of these modules do not form a limitation to the module itself in some cases, for example, the module for acquiring component text may also be described as a "module for acquiring the text of the attribute and business operation of the component according to the page design".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a first format text describing a page component, wherein the first format text comprises attribute information of the component, component operation related to the attribute information and an operation result corresponding to the component operation; generating a component code of the component according to the attribute information of the component, and generating a service code of the component according to the component operation and the operation result; and generating a page according to the component code and the service code.
Therefore, the component operation and operation result related to the component can be defined based on the JSON format, the service code is generated according to the component operation and operation result defined by the JSON, the page is automatically generated by combining the attribute code of the component, the service interaction between the page component and the related function or data is realized, the development workload of developers is reduced, and the working efficiency is improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A method of generating a page, comprising:
acquiring a first format text describing a page component, wherein the first format text comprises attribute information of the component, component operation related to the attribute information and an operation result corresponding to the component operation;
generating a component code of the component according to the attribute information of the component, and generating a service code of the component according to the component operation and the operation result;
and generating a page according to the component code and the service code.
2. The method of claim 1,
the first format is a JSON structure.
3. The method of claim 1,
the component operations include one or more of the following: event operations, binding, computation, data set operations, and snooping.
4. The method of claim 3,
the event operation comprises: an event associated with the attribute information of the component is defined, and the operation result obtained after the event is operated is determined.
5. The method of claim 3,
when the component operation is binding, defining a data source of the attribute information related to the component, binding the data source with the operation result, and determining the operation result according to data acquired from the data source.
6. The method of claim 3,
when the component operates as a calculation, defining a relation representation corresponding to the calculation, and using the relation representation to obtain a result of the calculation as the operation result.
7. The method of claim 3,
when the component operation is a data set operation, defining each data in the data set, and determining the operation result according to each data.
8. The method of claim 3,
when the component operates as a monitor, defining data associated with the attribute information to be monitored, and determining the operation result according to the changed data.
9. An apparatus for generating a page, comprising: the method comprises the steps of obtaining a component text module, a page code generation module and a page generation module; wherein,
the component text acquiring module is used for acquiring a first format text describing a page component, wherein the first format text comprises attribute information of the component, component operation related to the attribute information and an operation result corresponding to the component operation;
the page code generating module is used for generating a component code of the component according to the attribute information of the component and generating a service code of the component according to the component operation and the operation result;
and the page generation module is used for generating a page according to the component code and the service code.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202010975122.8A 2020-09-16 2020-09-16 Method and device for generating page Pending CN113760275A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010975122.8A CN113760275A (en) 2020-09-16 2020-09-16 Method and device for generating page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010975122.8A CN113760275A (en) 2020-09-16 2020-09-16 Method and device for generating page

Publications (1)

Publication Number Publication Date
CN113760275A true CN113760275A (en) 2021-12-07

Family

ID=78785694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010975122.8A Pending CN113760275A (en) 2020-09-16 2020-09-16 Method and device for generating page

Country Status (1)

Country Link
CN (1) CN113760275A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334387A (en) * 2017-01-20 2018-07-27 阿里巴巴集团控股有限公司 Dynamic interface rendering intent and device
CN108733375A (en) * 2018-05-29 2018-11-02 厦门白山耘科技有限公司 Web front-end configuration melts forwarding method, device, storage medium and computer equipment
CN109062563A (en) * 2018-08-01 2018-12-21 北京百度网讯科技有限公司 Method and apparatus for generating the page
CN109634599A (en) * 2018-12-14 2019-04-16 北京字节跳动网络技术有限公司 Display methods, device, equipment and the storage medium of page view
US20190310835A1 (en) * 2017-03-28 2019-10-10 Tencent Technology (Shenzhen) Company Limited Application development method, tool, and device, and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334387A (en) * 2017-01-20 2018-07-27 阿里巴巴集团控股有限公司 Dynamic interface rendering intent and device
US20190310835A1 (en) * 2017-03-28 2019-10-10 Tencent Technology (Shenzhen) Company Limited Application development method, tool, and device, and storage medium
CN108733375A (en) * 2018-05-29 2018-11-02 厦门白山耘科技有限公司 Web front-end configuration melts forwarding method, device, storage medium and computer equipment
CN109062563A (en) * 2018-08-01 2018-12-21 北京百度网讯科技有限公司 Method and apparatus for generating the page
CN109634599A (en) * 2018-12-14 2019-04-16 北京字节跳动网络技术有限公司 Display methods, device, equipment and the storage medium of page view

Similar Documents

Publication Publication Date Title
US11561846B2 (en) API notebook tool
US10831858B2 (en) Mobile enablement of existing web sites
US7870482B2 (en) Web browser extension for simplified utilization of web services
US9384005B2 (en) Systems and methods for dynamic configuration of client-side development environments through use of application servers
WO2017162024A1 (en) Method of developing component and template using visual expression, storage medium, and apparatus
TW201915850A (en) Method for generating application program, apparatus, system, device, and medium
US9451006B1 (en) Methods, systems, and articles of manufacture for configuration-based client-side resource resolution framework for customizable user experience
US9471211B2 (en) Chaining applications
US20140281859A1 (en) Enhanced mobilization of existing web sites
JP2021103506A (en) Method and device for generating information
US10162628B2 (en) Transactional distributed data analysis and transformation
WO2020233096A1 (en) Page resource data processing method and apparatus, medium and electronic device
CN112015420A (en) Form rendering method and device, computer equipment and storage medium
US10762285B2 (en) Methods and systems for generating electronic forms
US11366704B2 (en) Configurable analytics for microservices performance analysis
US20130124971A1 (en) Real time web script refresh using asynchronous polling without full web page reload
US20200401656A1 (en) User interface navigation management
CN112486482A (en) Page display method and device
CN113721910A (en) Interface code generation method and device, electronic equipment and computer readable medium
CN107562461B (en) Feature calculation system, feature calculation method, storage medium, and electronic device
CN116302895A (en) User behavior collection method, device, equipment and medium based on Javascript
CN113760275A (en) Method and device for generating page
CN111581173B (en) Method, device, server and storage medium for distributed storage of log system
CN113656033A (en) List page generation method, apparatus, device, medium, and program product
CN112433752A (en) Page parsing method, device, medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination