A page development method and device
By acquiring and uploading code snippets and hierarchical information of custom components in the code of the page to be decrypted, the problem of the website building platform being unable to edit user-developed secondary pages has been solved, improving user experience and development efficiency.
Patent Information
- Application Number
- CN202210495131.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-07
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2042-05-07
AI Technical Summary
Existing website building platforms are unable to effectively edit and optimize pages that users can customize, resulting in a poor user experience and an inability to meet users' ever-changing needs.
By obtaining code snippets and hierarchical information of custom components from the code of the page to be decrypted, and uploading them to a preset website building platform, the capabilities of the preset website building platform are used to build and optimize the page.
It enables users to edit and optimize secondary development pages, improving user experience and meeting diverse user needs.
Smart Images

Figure CN117055852B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software development technology, and in particular to a page development method and apparatus. Background Technology
[0002] Internet products have now entered the industrial age, and the demands on marketing and promotional pages are no longer limited to breakthroughs in user experience and event strategies. Higher requirements are being placed on development efficiency and refined operation.
[0003] To improve page development efficiency and refine operational capabilities, website building platforms have emerged. Currently, most website building platforms are developed around features such as "rapid website creation," "product and operation-oriented design," and "rich customization capabilities." Their main purpose is to allow developers to quickly build a deliverable page based solely on visual designs, thereby shortening the development cycle and reducing costs. As mentioned above, existing website building platforms focus on enriching their capabilities, constantly attempting to expand their feature sets to cover more production scenarios. However, different users have vastly different needs, and even the same user's needs change over time. Therefore, in many scenarios, website building platforms cannot fully meet user demands, and constantly trying to cater to user requests will indefinitely increase the platform's costs. To better meet user needs, existing technologies have begun to support users in performing secondary development on native pages developed through website building platforms. For example, in Wix's development mode, users can obtain the code of a native page developed through a website building platform and then perform secondary development on the page code. However, due to the limitations of the platform's runtime and secondary development, the user experience of pages obtained through secondary development is generally very different from that of native pages developed through the website building platform. Furthermore, it is impossible to further optimize user-developed pages through the website building platform. Therefore, the existing page development methods cannot adequately meet user demands. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a page development method and apparatus to solve the problem that website building platforms cannot edit pages that have been developed by users.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] In a first aspect, embodiments of the present invention provide a page development method, including:
[0007] Obtain the code of the page to be decrypted, wherein the code of the page to be decrypted includes code snippets corresponding to at least one component;
[0008] Identify a custom component among the at least one component; the custom component is a component among the at least one component that does not belong to the preset website building platform;
[0009] Obtain the hierarchical information of the at least one component;
[0010] Upload the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform.
[0011] As an optional implementation of this invention, obtaining the code of the page to be decrypted includes:
[0012] Obtain the page code template of the preset website building platform;
[0013] In response to the editing operation of the page code template, the page code to be decrypted is generated.
[0014] As an optional implementation of this invention, obtaining the code of the page to be decrypted includes:
[0015] Obtain the page code of the original page, wherein the original page is a page built through the preset website building platform;
[0016] In response to the editing operation of the page code of the original page, the page code to be decrypted is generated.
[0017] As an optional implementation of this invention, the editing operation of the page code of the original page includes:
[0018] The operation includes at least one of the following: adding code snippets corresponding to components to the page code of the original page, deleting code snippets corresponding to components from the page code of the original page, modifying code snippets corresponding to components from the page code of the original page, and adjusting the hierarchical information of components from the page code of the original page.
[0019] As an optional implementation of this invention, obtaining the hierarchical information of the at least one component includes:
[0020] Obtain the Abstract Syntax Tree (AST) corresponding to the code of the page to be decrypted;
[0021] Parse the AST to obtain the hierarchical information of the at least one component.
[0022] As an optional implementation of this invention, uploading the code snippet corresponding to the custom component to the preset website building platform includes:
[0023] The code snippets corresponding to each custom component are packaged separately to generate the source code package of each custom component;
[0024] Upload the source code packages of each custom component to the designated object storage OBS server, and obtain the OBS storage path corresponding to the source code packages of each custom component.
[0025] Upload the OBS storage path corresponding to the source code package of each of the custom components to the preset website building platform.
[0026] As an optional implementation of this invention, uploading the code snippet corresponding to the custom component to the preset website building platform includes:
[0027] Each of the custom components' corresponding code snippets is compiled to generate a compiled package for each custom component.
[0028] Upload the compiled packages of each custom component to the designated content delivery network (CDN), and obtain the CDN address corresponding to the compiled package of each custom component;
[0029] Upload the CDN address corresponding to the compilation package of each custom component to the preset website building platform.
[0030] As an optional implementation of this invention, the custom component includes: a new component and a modified component, wherein the new component is a component that does not exist in the preset website building platform, and the modified component is a component obtained by editing an existing component in the preset website building platform; the method further includes:
[0031] Register the newly added component in the custom components in the preset website building platform.
[0032] As an optional implementation of this invention, uploading the hierarchical information to the preset website building platform includes:
[0033] The hierarchical information is converted into a domain-related language DSL file mapped to the preset website building platform;
[0034] Upload the DSL file to the preset website building platform.
[0035] As an optional implementation of this invention, after uploading the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform, the method further includes:
[0036] Based on the code snippet corresponding to the custom component and the hierarchical information, the page corresponding to the page code to be decrypted is displayed in the page building interface of the preset website building platform;
[0037] Receive user editing operations on the page corresponding to the page code to be decrypted;
[0038] The code of the page to be decrypted is edited in response to the editing operation.
[0039] Secondly, embodiments of the present invention provide a page development apparatus, comprising:
[0040] An acquisition unit is used to acquire the code of the page to be decrypted, wherein the code of the page to be decrypted includes a code fragment corresponding to at least one component.
[0041] A component identification unit is used to identify a custom component among the at least one component; the custom component is a component among the at least one component that does not belong to the preset website building platform;
[0042] A hierarchical parsing unit is used to obtain the hierarchical information of the at least one component;
[0043] The communication unit is used to upload the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform.
[0044] As an optional implementation of this invention, the acquisition unit is specifically used to acquire the page code template of the preset website building platform; and in response to the editing operation of the page code template, to generate the page code to be decrypted.
[0045] As an optional implementation of this invention, the acquisition unit is specifically used to acquire the page code of the original page, which is a page built through the preset website building platform; in response to the editing operation of the page code of the original page, the page code to be decrypted is generated.
[0046] As an optional implementation of this invention, the editing operation of the page code of the original page includes:
[0047] The operation includes at least one of the following: adding code snippets corresponding to components to the page code of the original page, deleting code snippets corresponding to components from the page code of the original page, modifying code snippets corresponding to components from the page code of the original page, and adjusting the hierarchical information of components from the page code of the original page.
[0048] As an optional implementation of this invention, the hierarchical parsing unit is specifically used to obtain the abstract syntax tree (AST) corresponding to the page code to be decrypted; and to parse the AST to obtain the hierarchical information of the at least one component.
[0049] As an optional implementation of this invention, the communication unit is specifically used to package the corresponding code fragments of each custom component to generate the source code package of each custom component; upload the source code package of each custom component to a designated object storage OBS server, and obtain the OBS storage path corresponding to the source code package of each custom component; and upload the OBS storage path corresponding to the source code package of each custom component to the preset website building platform.
[0050] As an optional implementation of this invention, the communication unit is specifically used to compile the corresponding code segments of each custom component to generate a compilation package for each custom component; upload the compilation packages of each custom component to a designated content delivery network (CDN) and obtain the CDN address corresponding to the compilation package of each custom component; and upload the CDN address corresponding to the compilation package of each custom component to the preset website building platform.
[0051] As an optional implementation of this invention, the custom component includes: a new component and a modified component. The new component is a component that does not exist in the preset website building platform, and the modified component is a component obtained by editing an existing component in the preset website building platform.
[0052] The communication unit is also used to register the newly added component in the custom components in the preset website building platform.
[0053] As an optional implementation of this invention, the communication unit is specifically used to convert the hierarchical information into a domain-related language (DSL) file mapped to the preset website building platform; and to upload the DSL file to the preset website building platform.
[0054] As an optional implementation of this invention, the page development apparatus further includes: a building unit, configured to, after uploading the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform, display the page corresponding to the page code to be decrypted in the page building interface of the preset website building platform according to the code snippet corresponding to the custom component and the hierarchical information; receive user editing operations on the page corresponding to the page code to be decrypted; and edit the page code to be decrypted in response to the editing operations.
[0055] Thirdly, embodiments of the present invention provide an electronic device, including: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to cause the electronic device to implement the page development method described in any of the above embodiments when executing the computer program.
[0056] Fourthly, embodiments of the present invention provide a computer-readable storage medium that, when the computer program is executed by a computing device, causes the computing device to implement the page development method described in any of the above embodiments.
[0057] Fifthly, embodiments of the present invention provide a computer program product that, when run on a computer, enables the computer to implement the page development method described in any of the above embodiments.
[0058] The page development method provided in this embodiment of the invention, after obtaining the page code to be decrypted, first identifies custom components in the page code that do not belong to a preset website building platform, then obtains the hierarchical information of the components in the page code to be decrypted, and finally uploads the code snippets corresponding to the custom components and the hierarchical information to the preset website building platform. First, because the page development method provided in this embodiment of the invention uploads the code snippets corresponding to components in the page code to be decrypted that do not belong to the preset website building platform, the preset website building platform can obtain the code snippets corresponding to all components in the page code to be decrypted. Second, because the page development method provided in this embodiment of the invention also uploads the hierarchical information of the components in the page code to be decrypted to the preset website building platform, the preset website building platform can also obtain the hierarchical information of the components in the page code to be decrypted. Since the website building platform can build the page corresponding to the page code to be decrypted based on the code snippets and hierarchical information of all components in the page code to be decrypted, and optimize the page corresponding to the page code to be decrypted, this embodiment of the invention can solve the problem that the website building platform cannot edit the user-developed page again. Attached Figure Description
[0059] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0060] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings that need to be called in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0061] Figure 1 This is one of the flowcharts of the page development method provided in the embodiments of the present invention;
[0062] Figure 2 The second flowchart of the page development method provided in the embodiments of the present invention;
[0063] Figure 3A flowchart illustrating the page development method provided in an embodiment of the present invention;
[0064] Figure 4 The third step of the page development method provided in this embodiment of the invention;
[0065] Figure 5 One of the structural schematic diagrams of the page development apparatus provided in the embodiments of the present invention;
[0066] Figure 6 A second schematic diagram of the structure of the page development device provided in an embodiment of the present invention;
[0067] Figure 7 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0068] To better understand the above-mentioned objectives, features, and advantages of the present invention, the solutions of the present invention will be further described below. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.
[0069] Many specific details are set forth in the following description in order to provide a full understanding of the invention, but the invention may also be practiced in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of the invention, and not all embodiments.
[0070] In embodiments of the present invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner. Furthermore, in the description of embodiments of the present invention, unless otherwise stated, "a plurality of" means two or more.
[0071] This invention provides a page development method, referring to... Figure 1 As shown, the page development method includes the following steps S11 to S14:
[0072] S11. Obtain the code of the page to be decrypted.
[0073] The code of the page to be decrypted includes at least one code snippet corresponding to a component.
[0074] In this embodiment of the invention, the page code to be decrypted refers to the page code that needs to be decrypted by the website building platform. The page code to be decrypted can be any page, and this embodiment of the invention does not limit this. The website building platform's decryption of page code refers to the process of extracting the code fragments corresponding to the components in the page code and the hierarchical information of the components, and automatically building the page corresponding to the page code based on these code fragments and hierarchical information.
[0075] As an optional implementation of this invention, the above step S11 (obtaining the code of the page to be decrypted) may include the following steps a and b:
[0076] Step a: Obtain the page code template of the preset website building platform.
[0077] Step b: In response to the editing operation of the page code template, generate the page code to be decrypted.
[0078] That is, in some embodiments, users can also directly edit the page code template created based on a preset website building platform to generate the page code to be reversed in the embodiments of the present invention, instead of editing the page code built through the website building platform and obtained by forward decoding to generate the page code to be reversed.
[0079] As an optional implementation of this invention, the above step S11 (obtaining the code of the page to be decrypted) may include the following steps 1 and 2:
[0080] Step 1: Obtain the page code of the original page.
[0081] The original page is a page built using the preset website building platform.
[0082] For example, obtaining the page code of the original page can be achieved through steps 1.1 to 1.4 as follows:
[0083] Step 1.1: Arrange the user interface and capabilities of the page to be built on the preset website building platform according to the user's requirements, and generate detailed information of the page to be built.
[0084] Step 1.2: Obtain the identification code of the completed page to be built using a preset method.
[0085] The identification code of the page to be built can be used to obtain detailed information about the page. The identification code of the page to be built can be obtained by either automatically generating and outputting the identification code of the page to be built by the building platform or obtaining the identification code of the page to be built according to predefined rules.
[0086] Step 1.3: Initialize the solution tools provided by the pre-defined website building platform.
[0087] That is, to ensure that the correct solution tools provided by the preset website building platform are in a usable state.
[0088] For example, the correct solution tool can be a command line interface (CLI) tool.
[0089] Step 1.4: Input the identification code of the page to be built into the decoding tool, so that the decoding tool can obtain the detailed information of the page to be built and decode the page code of the page to be built based on the detailed information of the page to be built.
[0090] In this embodiment of the invention, the correct solution refers to converting the detailed information of the page to be built into the page code of the page to be built. The correct solution process requires the following key steps:
[0091] 1. Obtain the correct solution module; the correct solution template has some basic components and basic architecture built in, which ensure the normal compilation and operation of the local project.
[0092] 2. Convert the Domain Specific Language (DSL) in the page details into an Abstract Syntax Tree (AST). The specific conversion process may include: extracting the hierarchical information, component information for each node, and dependent components from the DSL based on its design; then mapping and combining the hierarchical and node information from the DSL into an AST.
[0093] 3. Convert the AST to framework code. Since the AST is a relatively abstract and very detailed design, considering the workload, we can directly use Babel (a JavaScript compiler) to convert the AST directly into framework code.
[0094] Fourth, import components into the framework code. With the framework code and components, combining them yields the page code. This step translates the component dependency information previously parsed from the DSL into the specific page code.
[0095] Step 2: In response to the editing operation of the page code of the original page, generate the page code to be decrypted.
[0096] As an optional implementation of this invention, the editing operation of the page code of the original page includes:
[0097] The operation includes at least one of the following: adding code snippets corresponding to components to the page code of the original page, deleting code snippets corresponding to components from the page code of the original page, modifying code snippets corresponding to components from the page code of the original page, and adjusting the hierarchical information of components from the page code of the original page.
[0098] It should be noted that because user-developed page code has a strong style, converting it into a fixed DSL is costly and difficult to control. Therefore, users need to adhere to certain constraints during secondary development to improve the success rate of reverse engineering. These constraints are: allowing users to add, delete, modify, and adjust the hierarchical information of components in the original page's code; but disallowing other editing operations.
[0099] S12. Determine the custom component among the at least one component.
[0100] The custom component is a component among the at least one components that does not belong to the preset website building platform.
[0101] That is, in this embodiment of the invention, the components in the code to be decrypted are classified into two categories: the first category is the native components of the preset website building platform, and the second category is components obtained by the user by modifying the native components according to their needs or custom components. Step S12 above is to determine the second category of components in the page code to be decrypted.
[0102] As an optional implementation of this invention, the custom component includes: a new component and a modified component;
[0103] The newly added component is a component that does not exist in the preset website building platform, and the modified component is a component obtained by editing an existing component in the preset website building platform.
[0104] For example, the preset website building platform first builds page A, and the page code of page A obtained by correct solution includes: code snippets corresponding to component 1 and code snippets corresponding to component 2. After the user obtains the page code of page A, the user performs an editing operation on the page code of page A. The editing operation specifically involves: modifying component 1 in the page code of page A, and adding component 3, which does not belong to the preset website building platform, and component 4, which belongs to the preset website building platform, to the page code of page A. At this time, the custom components include: the modified component 1 and component 3.
[0105] Optionally, Git (a local file code version control tool) can be used to find changes to the code of the page to be unpacked, thereby identifying the custom components in the code of the page to be unpacked. The version information of the component can be recorded by the ID of each commit (identified by publishId in the component configuration).
[0106] Custom components can be divided into two types: ordinary components and business components. The similarity between ordinary components and business components is that both have configuration files. The difference is that the configuration file name of the business component is different from that of the ordinary component. For example, the configuration file name of the business component is business.json, while the configuration file name of the ordinary component is base.json. Another difference is that the business component has a publishId field to record the local publishing ID.
[0107] When Git scans the code of a page to be unpacked, it first retrieves the local file change directory from the most recent commit, thus identifying which components have changed. Then, it filters the changed components (changes to files outside the component or unrelated files within the component will not affect the component's update). The components that have changed fall into the following categories:
[0108] New business components: The criteria for determining whether a business component has a publishId in its configuration is whether it has one. If a business component does not have a publishId in its configuration, it means that the component has only been registered but has not yet been published.
[0109] Components that have changed before: If a component has changed but is still a regular component, then it is considered a custom component.
[0110] Newly added ordinary components: Identifying these components requires verification from multiple perspectives because they are newly added ordinary components and cannot be updated as business components. Identification requires determining the component's update time and the time of its first local Git commit, as well as pulling the component's source code from the website building platform to compare whether the component has changed.
[0111] Components affected by the update: These components are parsed from the dependencies of the two types of components mentioned above: newly added components and modified components. If the dependent component is updated, the importer also needs to make corresponding changes to the way the component is imported.
[0112] S13. Obtain the hierarchical information of the at least one component.
[0113] The main purpose of step S13 above is to obtain the hierarchical information of the components in the code of the page to be decrypted. This hierarchical information describes the calling relationships or dependencies between the components in the code of the page to be decrypted.
[0114] As an optional implementation of this invention, step S13 (obtaining the hierarchical information of the at least one component) includes the following steps I and II:
[0115] Step 1: Obtain the Abstract Syntax Tree (AST) corresponding to the code of the page to be decrypted.
[0116] Step II: Parse the AST to obtain the hierarchical information of at least one component.
[0117] Optionally, Babel can be used to parse the code of the page to be decrypted to obtain the corresponding AST. Babel can directly convert the code into an operable AST, and after obtaining the AST, it can traverse the AST in a hierarchical order and determine and process four types when parsing each node: element node, attribute node, extended attribute node, and import declaration node, in order to obtain the hierarchical information of at least one component.
[0118] For example, if an element node is found by traversing through the child node attributes of the root node, it can be determined that this element has the highest level, and the level information needs to include this element node as one of the top-level element components. Accordingly, we will also obtain information such as the element's name, usage, and whether it has a closing tag from this element node. After the level traversal is complete, combining this information will give us a complete level information.
[0119] S14. Upload the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform.
[0120] As an optional implementation of this invention, the step S14 above, which involves uploading the hierarchical information to the preset website building platform, includes:
[0121] The hierarchical information is converted into a domain-related language DSL file mapped to the preset website building platform; and the DSL file is uploaded to the preset website building platform.
[0122] Since the above embodiments convert the hierarchical information of the components in the page code to be decrypted into a description that the preset website building platform can understand (the DSL file of the preset website building platform), the above embodiments can further facilitate the preset website building platform to decrypt the page code to be decrypted.
[0123] The page development method provided in this embodiment of the invention, after obtaining the page code to be decrypted, first identifies custom components in the page code that do not belong to a preset website building platform, then obtains the hierarchical information of the components in the page code to be decrypted, and finally uploads the code snippets corresponding to the custom components and the hierarchical information to the preset website building platform. First, because the page development method provided in this embodiment of the invention uploads the code snippets corresponding to components in the page code to be decrypted that do not belong to the preset website building platform, the preset website building platform can obtain the code snippets corresponding to all components in the page code to be decrypted. Second, because the page development method provided in this embodiment of the invention also uploads the hierarchical information of the components in the page code to be decrypted to the preset website building platform, the preset website building platform can also obtain the hierarchical information of the components in the page code to be decrypted. Since the website building platform can build the page corresponding to the page code to be decrypted based on the code snippets and hierarchical information of all components in the page code to be decrypted, and optimize the page corresponding to the page code to be decrypted, this embodiment of the invention can solve the problem that the website building platform cannot edit the user-developed page again.
[0124] As an extension and refinement of the above embodiments, this invention provides another page development method, referring to... Figure 2 As shown, the method includes the following steps:
[0125] S201. Obtain the code of the page to be decrypted.
[0126] The code of the page to be decrypted includes at least one code snippet corresponding to a component.
[0127] S202. Determine the custom components in the code of the page to be decrypted.
[0128] The custom component is a component in the page code to be decrypted that does not belong to the preset website building platform. The custom component includes: a newly added component and a modified component. The newly added component is a component that does not exist in the preset website building platform, and the modified component is a component obtained by editing an existing component in the preset website building platform.
[0129] S203. Register the newly added component in the custom components in the preset website building platform.
[0130] That is, obtain the information of the newly added component in the custom component, and call the relevant application programming interface (API) to register the component.
[0131] S204. Package the code snippets corresponding to each custom component to generate the source code package of each custom component.
[0132] Optionally, the code snippets corresponding to the custom components can be packaged into source code packages for each custom component using a local compression tool (such as the zip command in Linux).
[0133] S205. Upload the source code packages of each of the custom components to the specified Object Storage Service (OBS) server, and obtain the OBS storage path corresponding to the source code packages of each of the custom components.
[0134] S206. Compile the code snippets corresponding to each custom component to generate the compiled packages for each custom component.
[0135] Optionally, the code snippets corresponding to each custom component can be compiled separately using a bundling tool (such as webpack) to generate a compiled package (AMD component) for each custom component.
[0136] S207. Upload the compiled packages of each of the custom components to the specified Content Delivery Network (CDN) and obtain the CDN address corresponding to the compiled packages of each of the custom components.
[0137] It should be noted that the main purpose of steps S204 and S205 is to upload the source code of each custom component to the OBS server so that the website building platform can obtain the source code of each custom component through the OBS server. The main purpose of steps S206 and S207 is to upload the compiled package of each custom component to the CDN so that the website building platform can obtain the compiled package of each custom component through the CDN. Since the source code and compiled package of the custom component can be converted to each other, this embodiment of the invention can execute only steps S204 and S205 without executing steps S206 and S207, or only execute steps S206 and S207 without executing steps S204 and S205, or execute steps S204 and S205 and execute steps S206 and S207.
[0138] S208. Obtain the hierarchical information of the at least one component.
[0139] S209. Map the hierarchical information to the DSL file of the preset website building platform.
[0140] S210. Upload the OBS storage path corresponding to the source code package of each custom component, the CDN address corresponding to the compilation package of each custom component, and the DSL file to the preset website building platform.
[0141] Reference Figure 3 As shown, when obtaining the code of the page to be decrypted includes: obtaining the page code of the original page built through the preset website building platform, and generating the code of the page to be decrypted in response to the editing operation of the page code of the original page, the above... Figure 2 The steps of the method shown can be as follows: Figure 3 As shown, it includes:
[0142] Step 1: Enter the website building platform and build the user interface and capabilities of the original page according to your needs.
[0143] Step 2: Obtain the ID of the original page.
[0144] Step 3: Initialize the correct solution tool provided by the website building platform.
[0145] Step 4: Enter the ID of the original page into the solution tool to obtain the page code of the original page.
[0146] Step 5: In response to the editing operation of the page code of the original page, generate the page code to be decrypted.
[0147] Step 6: Identify the custom components in the code of the page to be decrypted.
[0148] Step 7: Register the newly added component in the custom components in the website building platform.
[0149] Step 8: Package the code snippets corresponding to each custom component to generate the source code package of each custom component.
[0150] Step 9: Upload the source code packages of each custom component to the designated OBS server, and obtain the OBS storage path corresponding to the source code packages of each custom component.
[0151] Step 10: Compile the code snippets corresponding to each custom component to generate a compiled package for each custom component.
[0152] Step 11: Upload the compilation packages of each custom component to the designated CDN, and obtain the CDN address corresponding to the compilation package of each custom component.
[0153] Step 12: Obtain the hierarchical information of the components in the code of the page to be decrypted and map the hierarchical information to the Domain Design Language (DSL) file of the preset website building platform.
[0154] Step 13: Upload the OBS storage path corresponding to each custom component, the CDN address corresponding to each custom component, and the DSL file to the website building platform.
[0155] The page development method provided in this embodiment is the same as that described above. Figure 1 The implementation principle and technical effect of the page development method provided in the illustrated embodiment are similar, and will not be repeated here.
[0156] As an optional implementation of the present invention, refer to Figure 4 As shown, in Figure 1 Based on steps S11 to S14, after step S14 (uploading the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform), the page development method provided in this embodiment of the invention further includes:
[0157] S41. Based on the code snippet corresponding to the custom component and the hierarchical information, display the page corresponding to the page code to be decrypted in the page building interface of the preset website building platform.
[0158] On one hand, since the code snippets corresponding to the custom components in the page code to be decrypted have been uploaded to the preset website building platform in step S14, and all other components in the page code to be decrypted belong to the preset website building platform, the preset website building platform can obtain the code snippets corresponding to all components in the page code to be decrypted. On the other hand, since the hierarchical information of the components in the page code to be decrypted has been uploaded to the preset website building platform in step S14, the preset website building platform can also obtain the hierarchical information of the components in the page code to be decrypted. Because the preset website building platform obtains the code snippets and hierarchical information of all components in the page code to be decrypted, it can build the page corresponding to the page code to be decrypted and display it in the page building interface of the preset website building platform.
[0159] S42. Receive the user's editing operation on the page corresponding to the page code to be decrypted.
[0160] In other words, users can also optimize the user interface or functions of the page corresponding to the page code to be decrypted.
[0161] S43. In response to the editing operation, edit the code of the page to be decrypted.
[0162] That is, after receiving the user's editing operation on the page corresponding to the page code to be decrypted, the edited part can be directly synchronized to the page code to be decrypted.
[0163] Based on the same inventive concept, as an implementation of the above method, this embodiment of the invention also provides a page development device, which corresponds to the aforementioned method embodiment. For ease of reading, this embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the page development device in this embodiment can implement all the contents of the aforementioned method embodiment.
[0164] This invention provides a page development apparatus. Figure 5 This page provides a schematic diagram of the development device's structure, as shown below. Figure 5 The page development device 500 includes:
[0165] The acquisition unit 51 is used to acquire the code of the page to be decrypted, wherein the code of the page to be decrypted includes at least one code fragment corresponding to a component.
[0166] The component identification unit 52 is used to identify a custom component among the at least one component; the custom component is a component among the at least one component that does not belong to the preset website building platform;
[0167] The hierarchical parsing unit 53 is used to obtain the hierarchical information of the at least one component;
[0168] The communication unit 54 is used to upload the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform.
[0169] As an optional implementation of this invention, the acquisition unit 51 is specifically used to acquire the page code template of the preset website building platform; and in response to the editing operation of the page code template, to generate the page code to be decrypted.
[0170] As an optional implementation of this invention, the acquisition unit 51 is specifically used to acquire the page code of the original page, which is a page built through the preset website building platform; in response to the editing operation of the page code of the original page, the page code to be decrypted is generated.
[0171] As an optional implementation of this invention, the editing operation of the page code of the original page includes:
[0172] The operation includes at least one of the following: adding code snippets corresponding to components to the page code of the original page, deleting code snippets corresponding to components from the page code of the original page, modifying code snippets corresponding to components from the page code of the original page, and adjusting the hierarchical information of components from the page code of the original page.
[0173] As an optional implementation of this invention, the hierarchical parsing unit 53 is specifically used to obtain the abstract syntax tree (AST) corresponding to the page code to be decrypted; and to parse the AST to obtain the hierarchical information of the at least one component.
[0174] As an optional implementation of this invention, the communication unit 54 is specifically used to package the corresponding code fragments of each custom component to generate the source code package of each custom component; upload the source code package of each custom component to a designated object storage OBS server, and obtain the OBS storage path corresponding to the source code package of each custom component; and upload the OBS storage path corresponding to the source code package of each custom component to the preset website building platform.
[0175] As an optional implementation of this invention, the communication unit 54 is specifically used to compile the corresponding code segments of each of the custom components to generate compilation packages for each of the custom components; upload the compilation packages of each of the custom components to a designated content delivery network (CDN) and obtain the CDN address corresponding to the compilation package of each of the custom components; and upload the CDN address corresponding to the compilation package of each of the custom components to the preset website building platform.
[0176] As an optional implementation of this invention, the custom component includes: a new component and a modified component. The new component is a component that does not exist in the preset website building platform, and the modified component is a component obtained by editing an existing component in the preset website building platform.
[0177] The communication unit 54 is also used to register the newly added component in the custom components in the preset website building platform.
[0178] As an optional implementation of this invention, the communication unit 54 is specifically used to convert the hierarchical information into a domain-related language (DSL) file mapped to the preset website building platform; and to upload the DSL file to the preset website building platform.
[0179] As an optional implementation of the present invention, refer to Figure 6 As shown, the page development device 500 further includes:
[0180] The building unit 55 is used to, after uploading the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform, display the page corresponding to the page code to be decrypted in the page building interface of the preset website building platform according to the code snippet corresponding to the custom component and the hierarchical information; receive the user's editing operation on the page corresponding to the page code to be decrypted; and edit the page code to be decrypted in response to the editing operation.
[0181] The page development apparatus provided in this embodiment can execute the page development method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0182] Based on the same inventive concept, embodiments of the present invention also provide an electronic device. Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, such as... Figure 7 As shown, the electronic device provided in this embodiment includes a memory 701 and a processor 702. The memory 701 is used to store computer programs; the processor 702 is used to execute the page development method provided in the above embodiment when executing the computer program.
[0183] Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the computing device to implement the page development method provided in the above embodiments.
[0184] Based on the same inventive concept, this embodiment of the invention also provides a computer program product, which, when run on a computer, enables the computing device to implement the page development method provided in the above embodiment.
[0185] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0186] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0187] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0188] Computer-readable media include both permanent and non-permanent, removable and non-removable storage media. Storage media can store information using any method or technology; the information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media do not include transient computer-readable media, such as modulated data signals and carrier waves.
[0189] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A page development method, characterized in that, include: Obtain the code of the page to be decrypted, wherein the code of the page to be decrypted includes code snippets corresponding to at least one component; Identify a custom component among the at least one component; the custom component is a component among the at least one component that does not belong to the preset website building platform; Obtain the hierarchical information of the at least one component; The hierarchical information is used to describe the calling or dependency relationships between components in the code of the page to be decrypted; Upload the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform.
2. The method according to claim 1, characterized in that, The step of obtaining the code of the page to be decrypted includes: Obtain the page code template of the preset website building platform; In response to the editing operation of the page code template, the page code to be decrypted is generated.
3. The method according to claim 1, characterized in that, The step of obtaining the code of the page to be decrypted includes: Obtain the page code of the original page, wherein the original page is a page built through the preset website building platform; In response to the editing operation of the page code of the original page, the page code to be decrypted is generated.
4. The method according to claim 3, characterized in that, The editing operation on the page code of the original page includes: The operation includes at least one of the following: adding code snippets corresponding to components to the page code of the original page, deleting code snippets corresponding to components from the page code of the original page, modifying code snippets corresponding to components from the page code of the original page, and adjusting the hierarchical information of components from the page code of the original page.
5. The method according to claim 1, characterized in that, The step of obtaining the hierarchical information of the at least one component includes: Obtain the Abstract Syntax Tree (AST) corresponding to the code of the page to be decrypted; Parse the AST to obtain the hierarchical information of the at least one component.
6. The method according to claim 1, characterized in that, Upload the code snippet corresponding to the custom component to the preset website building platform, including: The code snippets corresponding to each custom component are packaged separately to generate the source code package of each custom component; Upload the source code packages of each custom component to the designated object storage OBS server, and obtain the OBS storage path corresponding to the source code packages of each custom component. Upload the OBS storage path corresponding to the source code package of each of the custom components to the preset website building platform.
7. The method according to claim 1, characterized in that, Upload the code snippet corresponding to the custom component to the preset website building platform, including: Each of the custom components' corresponding code snippets is compiled to generate a compiled package for each custom component. Upload the compiled packages of each custom component to the designated content delivery network (CDN), and obtain the CDN address corresponding to the compiled package of each custom component; Upload the CDN address corresponding to the compilation package of each custom component to the preset website building platform.
8. The method according to claim 1, characterized in that, The custom component includes: a new component and a modified component, wherein the new component is a component that does not exist in the preset website building platform, and the modified component is a component obtained by editing an existing component in the preset website building platform; the method further includes: Register the newly added component in the custom components in the preset website building platform.
9. The method according to any one of claims 1-8, characterized in that, Uploading the hierarchical information to the preset website building platform includes: The hierarchical information is converted into a domain-related language DSL file mapped to the preset website building platform; Upload the DSL file to the preset website building platform.
10. The method according to any one of claims 1-8, characterized in that, After uploading the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform, the method further includes: Based on the code snippet corresponding to the custom component and the hierarchical information, the page corresponding to the page code to be decrypted is displayed in the page building interface of the preset website building platform; Receive user editing operations on the page corresponding to the page code to be decrypted; The code of the page to be decrypted is edited in response to the editing operation.
11. A page development apparatus, characterized in that, include: An acquisition unit is used to acquire the code of the page to be decrypted, wherein the code of the page to be decrypted includes at least one code fragment corresponding to a component. A component identification unit is used to identify a custom component among the at least one component; the custom component is a component among the at least one component that does not belong to the preset website building platform; A hierarchical parsing unit is used to obtain the hierarchical information of the at least one component; The hierarchical information is used to describe the calling or dependency relationships between components in the code of the page to be decrypted; The communication unit is used to upload the code snippet corresponding to the custom component and the hierarchical information to the preset website building platform.
12. An electronic device, characterized in that, include: A memory and a processor, the memory being used to store a computer program; the processor being used to cause the electronic device to implement the page development method according to any one of claims 1-10 when executing the computer program.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a computing device, causes the computing device to implement the page development method according to any one of claims 1-10.
14. A computer program product, characterized in that, When the computer program product is run on a computer, the computer enables the page development method as described in any one of claims 1-10.
Citation Information
Patent Citations
Personalized component realizing method and device
CN107133029A
