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

CN109062563B - Method and device for generating page - Google Patents

Method and device for generating page Download PDF

Info

Publication number
CN109062563B
CN109062563B CN201810865876.0A CN201810865876A CN109062563B CN 109062563 B CN109062563 B CN 109062563B CN 201810865876 A CN201810865876 A CN 201810865876A CN 109062563 B CN109062563 B CN 109062563B
Authority
CN
China
Prior art keywords
component
target
page
attribute
value
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.)
Active
Application number
CN201810865876.0A
Other languages
Chinese (zh)
Other versions
CN109062563A (en
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810865876.0A priority Critical patent/CN109062563B/en
Publication of CN109062563A publication Critical patent/CN109062563A/en
Application granted granted Critical
Publication of CN109062563B publication Critical patent/CN109062563B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • 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)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computing Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a method and a device for generating a page. One embodiment of the method comprises: acquiring JSON format data for describing a target page, wherein the JSON format data comprises a component type and a component type value of a component included in the target page, and an attribute value of the component corresponding to the component type value; searching a component in a preset component set as a target component according to the component type value, wherein the component in the component set is a component which is registered in advance; updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value; and generating a target page based on the updated target component. By the method, the page can be generated based on JSON format data, and the method simplifies the page generation mode.

Description

Method and device for generating page
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for generating a page.
Background
JSON (JavaScript Object Notation) is a lightweight data exchange format. It is based on a subset of ECMAScript (JS specification set by the european computer association) and uses a text format completely independent of the programming language to store and represent data. The simple and clear hierarchical structure enables JSON to become an ideal data exchange language, and the JSON is easy to read and write by people and is also easy to analyze by machines.
Disclosure of Invention
The embodiment of the application provides a method and a device for generating a page by a user.
In a first aspect, an embodiment of the present application provides a method for generating a page, where the method includes: receiving JSON format data for describing a target page, wherein the JSON format data comprises a component type and a component type value of a component included in the target page, and an attribute value of the component corresponding to the component type value; searching a component in a preset component set as a target component according to the component type value, wherein the component in the component set is a component which is registered in advance; updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value; and generating a target page based on the updated target component.
In some embodiments, generating the target page based on the updated target component includes: acquiring path information of the component type value according to the JSON format data; according to the path information, the function of the target component and the position in the target page are determined, and the target page is generated based on the determined position.
In some embodiments, the property values of the component to which the component type values correspond include values for configuring component behavior.
In some embodiments, the component behavior comprises at least one of: sending a request, popping up content, copying content, jumping pages, submitting a form, updating a target component and closing a prompt box.
In some embodiments, the property value of the component to which the component type value corresponds includes at least one of: the address communicating with the server and the jump address of the page.
In a second aspect, an embodiment of the present application provides an apparatus for generating a page, where the apparatus includes: the device comprises an acquisition unit and a processing unit, wherein the acquisition unit is configured to receive JSON format data for describing a target page, the JSON format data comprises a component type and a component type value of a component included in the target page, and an attribute value of the component corresponding to the component type value; the searching unit is configured to search a component in a preset component set as a target component according to the component type value, wherein the component in the component set is a component which is registered in advance; the updating unit is configured to update the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value; a page generating unit configured to generate a target page based on the updated target component.
In some embodiments, the page generation unit is further configured to: acquiring path information of the component type value according to JSON format data; according to the path information, the function of the target component and the position in the target page are determined, and the target page is generated based on the determined position.
In some embodiments, the property values of the component to which the component type values correspond include values for configuring component behavior.
In some embodiments, the component behavior comprises at least one of: sending a request, popping up content, copying content, jumping pages, submitting a form, updating a target component and closing a prompt box.
In some embodiments, the property value of the component to which the component type value corresponds includes at least one of: the address communicating with the server and the jump address of the page.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the method as described in any implementation of the first aspect.
In a fourth aspect, the present application provides a computer-readable medium, on which a computer program is stored, which, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
According to the method and the device for generating the page, JSON format data for describing the target page is obtained, wherein the JSON format data comprises a component type and a component type value of a component included in the target page, and an attribute value of the component corresponding to the component type value. In this way, according to the type value of the component, the component can be searched in a preset component set as a target component, wherein the component in the component set is a component which is registered in advance. And then updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value. And finally, generating a target page based on the updated target component. Therefore, the page can be generated based on the JSON format data, and the page generation mode is simplified.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for generating a page according to the present application;
FIG. 3 is a schematic diagram of an application scenario of a method for generating a page according to an embodiment of the present application;
FIG. 4 is a flow diagram of yet another embodiment of a method for generating a page according to the present application;
FIG. 5 is a block diagram of one embodiment of an apparatus for generating pages in accordance with the present application;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing an electronic device according to embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary architecture 100 to which a method for generating a page or an apparatus for generating a page of an embodiment of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may use terminal devices 101, 102, 103 to interact with a server 105 over a network 104 to receive or send messages or the like. Various client applications, such as an Integrated Development Environment (IDE) type application, a web browser application, an instant messaging tool, a text editing type application, a browser type application, and the like, may be installed on the terminal devices 101, 102, 103.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a backend server for JSON-formatted data that the terminal devices 101, 102, 103 send to. The background server can analyze and the like the JSON format data and feed back a processing result (for example, a page is generated according to the JSON format data) to the terminal equipment.
It should be noted that the method for generating the page provided by the embodiment of the present application may be executed by the terminal devices 101, 102, and 103, or may be executed by the server 105. Accordingly, the means for generating the page may be provided in the terminal devices 101, 102, 103, or in the server 105.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, may include a terminal device, a network, and a server, respectively. Alternatively, only the terminal device is included without including the network and the server. Alternatively, the mere inclusion of a server does not include a terminal device or a network. Or include one of a server and a terminal device and a network.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for generating pages in accordance with the present application is shown. The method for generating the page comprises the following steps:
step 201, acquiring JSON format data for describing a target page.
In the present embodiment, an execution subject of the method for generating a page (e.g., the terminal device 101, 102, 103 or the server 105 shown in fig. 1) can acquire JSON format data describing a target page in various ways. For example: a user can send a segment of JSON format data for describing a page to an execution main body through a user side, and the execution main body receives the segment of JSON format data; or the user may enter a piece of JSON formatted data directly into the execution body. The target page is a page which is finally generated by the user according to actual requirements.
In this embodiment, the target page is generally formed by one or more components arranged in a certain arrangement. Thus, the target page may be divided into one or more components according to its function. Accordingly, the JSON format data description component can be utilized to describe the target page. The JSON format data for describing the target page comprises: the component type, the component type value, the attribute and the attribute value of the component corresponding to the component type value of the component included in the target page. The following first paragraph of JSON formatted data is taken as an example for illustration:
Figure BDA0001750917560000051
Figure BDA0001750917560000061
in the JSON-format data, the component type is "type", and the value of the corresponding component type is "page". The attribute of the component corresponding to the component type value "page" is three, which are respectively: "title", "subTitle", and "body". And the attribute value corresponding to "title" is "this is the title", "subTitle" is "this is the subTitle", and the attribute value corresponding to "body" is "{" type ":" form "}".
Step 202, according to the component type value, searching a component in a preset component set as a target component.
In this embodiment, the correspondence between the component type value and the component in the preset component set is preset. For each component type value, the component corresponding to it can be found in the component set as the target component.
For example, a component in the set of components may be a pre-registered component, and the registered component is associated with a component type value. Specifically, for example, path information automatically added to the node for each component type value in JSON-formatted data associates the registration information with the path information when registering a component, i.e., the registration information may indicate that the component type value in the end of the path information is the component type value associated with the registered component. Taking the above JSON format data as an example, the path information is added to the node whose component type value is "page" in the above JSON format data. Correspondingly, a page component associated with the path information is registered in a preset component set. Then the node with the component type value of "page" can be identified, that is, the corresponding component can be found as the target component through the component type value. Similarly, path information, such as "page/body/0/form", is automatically added to a node of the component type value "form", and accordingly, a form component associated with the path information is registered in the preset component set, that is, the registration information of the form component in the preset component set indicates that all nodes of the path ending in the form component are nodes calling the form component, so that when the node of the component type value "form" is identified, the form component can be found in the preset component as a target component.
In this embodiment, optionally, the components in the component set include, but are not limited to, at least one of the following: a page (page) component, a form (form) component, a text entry box (txet) component, a radio box (Radios) component, and a button (button) component.
And step 203, updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value.
After the execution subject finds the target component, the corresponding attribute and attribute value of the target component can be updated according to the attribute and attribute value of the component corresponding to the component type value in the JSON format data in step 201. It should be noted that the attributes and attribute values of the target component may characterize the attributes of the corresponding component, such as the label, title, action, interface configuration, etc. Still taking the above-mentioned first paragraph of JSON format data as an example, after the execution subject finds the target component page, the target component is updated according to the component attribute and attribute value "" title "", "this is the title", "subTitle" "," this is the subTitle "," body "", "{" type ": and" form "}" corresponding to the component, that is, the component with the type value of page shows the text of "this is the title" and "this is the subTitle", and the component with the nested component type value of form is also located in the page component.
In this embodiment, the corresponding attribute and the attribute value of the target component are assigned to the target component, so that the target component has the corresponding attribute.
And step 204, generating a target page based on the updated target component.
In this embodiment, through the above step 203, the corresponding attribute and attribute value of the target component are updated. The updated target component may include attribute information such as a tag and a title of the component, and may obtain path information of the component type value according to the JSON format data. And the path information may reflect location information of the component. And finally generating the target page according to the determined position information.
Still taking the first JSON format data as an example, the path of the component type value "form" is "page/body/0/form", which can reflect that the form component is located in the page component. Thus, in the generated target page, the page component is located at the bottom layer and the form component is located above it.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for generating a page according to the present embodiment. In the application scenario of fig. 3, the terminal device 301 first acquires JSON format data for describing a page. The JSON format data comprises a component type of a component included in the target page, a component type value, and an attribute value of the component corresponding to the component type value. The JSON-formatted data in the terminal device 301 of fig. 3 is the same as the above-described first-segment JSON-formatted data, in which the component type is "type" and the value of the corresponding component type is "page". The attribute of the component corresponding to the component type value "page" is three, which are respectively: "title", "subTitle", and "body". And the attribute value corresponding to "title" is "this is the title", "subTitle" is "this is the subTitle", and the attribute value corresponding to "body" is "{" type ":" form "}". The attribute value corresponding to "body" includes a component with a component type of "type" and a component type value of "form". Then, the terminal device 301 may search, according to the component type values "page" and "form", components corresponding to the component type values "page" and "form" in a preset component set as target components (page components and form components), where the components in the component set are components that are registered in advance. And updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value "" title "", "" subTitle "", "" body "", "{" type "": form "} of the component corresponding to the component type value" page "and" form ". And generating a target page based on the updated target components (the page component and the form component).
In the method for generating a page provided by the above embodiment of the present application, JSON format data for describing a target page is first obtained, where the JSON format data includes a type of a component included in the target page, a component type value, and an attribute value of a component of the component corresponding to the component type value. And then searching a component in a preset component set as a target component according to the component type value, wherein the component in the component set is a component which is registered in advance. And updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value. And finally, generating a target page based on the updated target component. By the method, the page can be generated based on JSON format data, and the page generation mode is simplified.
With further reference to FIG. 4, a flow 400 of yet another embodiment of a method for generating a page is shown. The flow 400 of the method for generating a page includes the steps of:
step 401, acquiring JSON format data for describing a target page.
In the present embodiment, an execution subject of the method for generating a page (e.g., the terminal device 101, 102, 103 or the server 105 shown in fig. 1) can acquire JSON format data describing a target page in various ways.
In this embodiment, the target page is generally formed by one or more components arranged in a certain arrangement. Thus, the target page may be divided into one or more components according to its function. Accordingly, the JSON format data description component can be utilized to describe the target page. The JSON format data describing the target page comprises a component type of a component included in the target page, a component type value, and an attribute value of the component corresponding to the component type value.
In this embodiment, optionally, the attribute value of the component corresponding to the component type value may include a value for configuring a component behavior. The specific component behavior may include at least one of: sending a request, popping up content, copying content, jumping pages, submitting a form, updating a target component and closing a prompt box. That is, the attribute value of the component corresponding to the component type value may be a value for performing the above-described component behavior configuration on the component. For example: the method comprises the following steps of { "actionType": copy "," content ": content value" } is an attribute value of a certain component, specifically, an attribute value configuring component behavior for copying content of the component. Optionally, the attribute value of the component corresponding to the component type value may further include at least one of the following: an address for communicating with the server and a page jump address. The following second-stage JSON format data is taken as an example:
Figure BDA0001750917560000091
the code with the attribute value of put:/api/customer in the JSON format data is an address for communicating the component with the server, wherein the component type value of the component is form.
Step 402, searching a component in a preset component set as a target component according to the component type value.
The detailed processing of step 402 and the technical effects thereof can refer to step 202 in the embodiment corresponding to fig. 2, and are not described herein again.
Step 403, updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value.
After the execution subject finds the target component, the corresponding attribute and attribute value of the target component can be updated according to the attribute and attribute value of the component corresponding to the component type value in the JSON format data in step 401. It will be appreciated that the attributes and attribute values of the target component may characterize attributes of the corresponding component such as labels, titles, actions, interface configurations, and the like. Still taking the above-mentioned first JSON format data as an example, after the execution subject finds the target component page, the target component is updated according to the component attribute and attribute value "" title "", which is the title "," subTitle "", which is the subTitle "," body "", "{" type "": form "}" corresponding to the component. That is, the component with the type value of page shows the words of "this is the title" and "this is the subheading", and the component with the component type value of form is also nested in the page component. Taking the above-mentioned second JSON-formatted data as an example, after the execution subject finds the component whose component type value is "form", the attribute and the attribute value of the form component are updated according to the component attribute and the attribute value "" api ": put:/api/client" "corresponding to the component, that is, an address for communicating with the server is configured for the form component, and specifically, the address can communicate with the server through the application program call interface api.
In this embodiment, the corresponding attribute and the attribute value of the target component are assigned to the target component, so that the target component has the corresponding attribute.
And step 404, acquiring path information of the component type value according to the JSON format data.
The execution body can obtain the path information of the component type value according to the JSON format data. It can be understood that there are a plurality of nodes that can be identified in the JSON-formatted data, and the path information of the corresponding component type value can be acquired through the node where the component type value in the JSON-formatted data is located. For example, in the first JSON format data, the component type value "form" belongs to a partial attribute value of a component whose component type value is "page", and the path of the corresponding node is "page/body/0/form".
Step 405, according to the path information, determining the function of the target component and the position in the target page, and generating the target page based on the determined position.
The relative position relationship of the components can be obtained through the path information obtained in step 404. Still taking the first segment of JSON format data as an example, the node where the component type value "page" is located is the root node, and the path is "page". Thus, its corresponding component is at the bottom of the target page. The path of the component type value "form" is "page/body/0/form", and the form component is located in the page component according to the path information. That is, the page component corresponds to a container component having a function of accommodating other components, and the path reflects the positional relationship between the form component and the page component. That is, in the target page, the form component is located within the page component.
In this embodiment, all the components for executing the body call are packaged components, and the component behaviors supported by the components are already defined, and these packaging processes are well-known technologies widely studied and applied at present, and are not described herein again.
Based on the component behaviors supported by the component, the component behaviors may be configured for the component. For example, the property values of the components corresponding to the component type values in the JSON formatted data may include values that configure the behavior of the components. And assigning the attribute value to the corresponding target component, so that the component in the generated target page can complete corresponding behaviors in the page operation process. However, even if the components have the same component type value, the functions of the components are not necessarily the same in the attributes of the components corresponding to different component type values. Taking the component with type value "text" as an example, it has the function of input box when it is located in the form component, and has the function of text display when it is located outside the form component. It should be noted that these functions are already associated with path information during the registration process of the component, and the functions corresponding to the components with different path information are defined. Thus, the function of the target component can be determined by the path information.
Through the steps, the functions of the target components and the positions of the target components in the target page are determined, and the components in the generated target page also have corresponding functions.
As can be seen from fig. 4, compared with the embodiment corresponding to fig. 2, the flow 400 of the method for generating a page in the present embodiment highlights the process of generating a target page based on a target component. Therefore, the scheme described in this embodiment can generate a page based on JSON format data, assign a component attribute value in the JSON format data to a corresponding target component, acquire path information of a component type value according to the JSON format data, determine a function of the target component and a position in the target page, simplify a page generation manner, and generate a target component in the page as a component having a corresponding function.
With further reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for generating a page, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 5, the apparatus 500 for generating a page provided by the present embodiment includes an obtaining unit 501, a searching unit 502, an updating unit 503, and a page generating unit 504. The acquiring unit 501 is configured to acquire JSON format data for describing a target page, where the JSON format data includes a component type and a component type value of a component included in the target page, and an attribute value of a component corresponding to the component type value; a searching unit 502 configured to search a component in a preset component set as a target component according to the component type value, wherein the component in the component set is a component registered in advance; an updating unit 503 configured to update the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value; a page generating unit 504 configured to generate a target page based on the updated target component.
In the present embodiment, in the apparatus 500 for generating a page: the specific processing of the obtaining unit 501, the searching unit 502, the updating unit 503 and the page generating unit 504 and the technical effects thereof can refer to the related descriptions of step 201, step 202, step 203 and step 204 in the corresponding embodiment of fig. 2, which are not described herein again.
In some optional implementations of this embodiment, the page generating unit is further configured to obtain path information of the component type value according to JSON format data; according to the path information, the function of the target component and the position in the target page are determined, and the target page is generated based on the determined position.
In some optional implementations of this embodiment, the attribute value of the component corresponding to the component type value includes a value for configuring a component behavior.
In some optional implementations of the embodiment, the component behavior includes at least one of: sending a request, popping up content, copying content, jumping pages, submitting a form, updating a target component and closing a prompt box.
In some optional implementations of this embodiment, the attribute value of the component corresponding to the component type value includes at least one of the following: the address communicating with the server and the jump address of the page.
In the apparatus provided by the above embodiment of the present application, first, the obtaining unit 501 obtains JSON format data for describing a target page, where the JSON format data includes a component type and a component type value of a component included in the target page, and an attribute value of a component corresponding to the component type value. Then, the searching unit 502 searches for a component in a preset component set as a target component according to the component type value, where the component in the component set is a component registered in advance. Then, the corresponding attribute and attribute value of the target component are updated by the updating unit 503 according to the attribute and attribute value of the component corresponding to the component type value. Finally, the page generation unit 504 generates a target page based on the updated target component.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to an embodiment 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 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium of the present application 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 application, 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 this application, 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.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
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 application. 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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 units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor comprises an acquisition unit, a search unit, an update unit and a page generation unit. The names of these units do not in some cases constitute a limitation on the unit itself, and for example, an acquisition unit may also be described as a "unit for JSON-format data acquisition".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: acquiring JSON format data for describing a target page, wherein the JSON format data comprises a component type of a component included in the target page, a component type value, and an attribute value of the component corresponding to the component type value; searching a component in a preset component set as a target component according to the component type value, wherein the component in the component set is a component which is registered in advance; updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value; and generating a target page based on the updated target component.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for generating a page, comprising:
acquiring JSON format data for describing a target page, wherein the target page is divided into one or more components based on the function of the target page, the JSON format data is used for describing the components by using the JSON format data to describe the target page, and the JSON format data comprises component types, component type values, and attributes and attribute values of the components corresponding to the component type values of the components included in the target page;
searching a component in a preset component set as a target component according to the component type value, wherein the component in the component set is a component which is registered in advance;
updating the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value;
and generating a target page based on the updated target component.
2. The method of claim 1, wherein generating a target page based on the updated target component comprises:
acquiring path information of a component type value according to the JSON format data;
according to the path information, determining the function of the target component and the position in the target page, and generating the target page based on the determined position.
3. The method of claim 1, wherein the property values of the component to which the component type values correspond comprise values for configuring component behavior.
4. The method of claim 3, wherein the component behavior comprises at least one of: sending a request, popping up content, copying content, jumping pages, submitting a form, updating a target component and closing a prompt box.
5. The method of any of claims 1-4, wherein the property value of the component to which the component type value corresponds comprises at least one of: the address communicating with the server and the jump address of the page.
6. An apparatus for generating a page, comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is configured to acquire JSON format data for describing a target page, the target page is divided into one or more components based on the function of the target page, the JSON format data is used for describing the components by JSON format data so as to describe the target page, and the JSON format data comprises component types and component type values of the components included in the target page, and attributes and attribute values of the components corresponding to the component type values;
the searching unit is configured to search a component in a preset component set as a target component according to the component type value, wherein the component in the component set is a component which is registered in advance;
the updating unit is configured to update the corresponding attribute and attribute value of the target component according to the attribute and attribute value of the component corresponding to the component type value;
a page generating unit configured to generate a target page based on the updated target component.
7. The apparatus of claim 6, wherein the page generation unit is further configured to:
acquiring path information of a component type value according to the JSON format data;
according to the path information, determining the function of the target component and the position in the target page, and generating the target page based on the determined position.
8. The apparatus of claim 6, wherein the property value of the component to which the component type value corresponds comprises a value for configuring a component behavior.
9. The apparatus of claim 8, wherein the component behavior comprises at least one of: sending a request, popping up content, copying content, jumping pages, submitting a form, updating a target component and closing a prompt box.
10. The apparatus for generating pages according to one of claims 6 to 9 wherein the attribute values of the component to which said component type value corresponds comprise at least one of: the address communicating with the server and the jump address of the page.
11. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, wherein the computer program, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201810865876.0A 2018-08-01 2018-08-01 Method and device for generating page Active CN109062563B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810865876.0A CN109062563B (en) 2018-08-01 2018-08-01 Method and device for generating page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810865876.0A CN109062563B (en) 2018-08-01 2018-08-01 Method and device for generating page

Publications (2)

Publication Number Publication Date
CN109062563A CN109062563A (en) 2018-12-21
CN109062563B true CN109062563B (en) 2022-06-07

Family

ID=64832462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810865876.0A Active CN109062563B (en) 2018-08-01 2018-08-01 Method and device for generating page

Country Status (1)

Country Link
CN (1) CN109062563B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109683939B (en) * 2018-12-29 2023-05-02 北京小米移动软件有限公司 Component object updating method, device and storage medium
CN109814865B (en) * 2019-01-18 2022-06-03 四川长虹电器股份有限公司 Mobile application page generation method based on json data format
CN110275754A (en) * 2019-06-28 2019-09-24 百度在线网络技术(北京)有限公司 Exchange method, device, equipment and the storage medium presented for user interface
CN110780898B (en) * 2019-10-08 2023-06-27 北京字节跳动网络技术有限公司 Page data upgrading method and device and electronic equipment
CN110825374A (en) * 2019-11-04 2020-02-21 泰康保险集团股份有限公司 Page generation method and device based on component, electronic equipment and storage medium
CN111831263B (en) * 2020-07-20 2023-04-25 抖音视界有限公司 Method, apparatus, electronic device and computer readable medium for data processing
CN113760275A (en) * 2020-09-16 2021-12-07 北京京东尚科信息技术有限公司 Method and device for generating page
CN112214218B (en) * 2020-10-12 2024-06-14 上海赛可出行科技服务有限公司 Sketch component library generation and management system
CN114089982A (en) * 2020-11-03 2022-02-25 西安京迅递供应链科技有限公司 Front-end page generation method, device, equipment and medium
CN112433725A (en) * 2020-11-26 2021-03-02 泰康保险集团股份有限公司 Interface generation method and device, electronic equipment and storage medium
CN113672304A (en) * 2021-08-26 2021-11-19 北京光启元数字科技有限公司 Dynamic data acquisition method, device, equipment and readable medium
CN113868092B (en) * 2021-10-11 2024-06-21 维沃移动通信有限公司 Application determination method, application determination device, electronic device, and readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150074561A1 (en) * 2010-05-07 2015-03-12 Google Inc. Customizable themes for browsers and web content
CN106294816B (en) * 2016-08-16 2022-03-25 腾讯科技(深圳)有限公司 Page information processing method and device

Also Published As

Publication number Publication date
CN109062563A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109062563B (en) Method and device for generating page
US10942708B2 (en) Generating web API specification from online documentation
CN109634598A (en) A kind of page display method, device, equipment and storage medium
CN110019080B (en) Data access method and device
US11586772B2 (en) Method and device for displaying information
CN110780874B (en) Method and device for generating information
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN112395027B (en) Widget interface generation method and device, storage medium and electronic equipment
CN113076153B (en) Interface calling method and device
US20180234329A1 (en) Test building for testing server operation
CN110888794B (en) Interface testing method and device
CN109062560B (en) Method and apparatus for generating information
CN112988583A (en) Method and device for testing syntax compatibility of database
CN115599386A (en) Code generation method, device, equipment and storage medium
CN115964646A (en) Heterogeneous graph generation for application microservices
CN113553123B (en) Data processing method, device, electronic equipment and storage medium
CN112835606A (en) Gradation issuing method, gradation issuing apparatus, electronic device, gradation issuing medium, and program product
CN110807535A (en) Construction method and construction device of unified reservation platform and unified reservation platform system
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN110618811A (en) Information presentation method and device
CN110471708B (en) Method and device for acquiring configuration items based on reusable components
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN110096392B (en) Method and device for outputting information
CN113448652A (en) Request processing method and device
CN111400623A (en) Method and apparatus for searching information

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
GR01 Patent grant
GR01 Patent grant