Page module control method, device, electronic device and storage medium

By filtering the code based on the module identification and version identification on the server side and determining the edited page module information, the complex code logic in the page module upgrade is solved, and a simplified upgrade process and improved maintenance convenience is achieved.

CN113760314BActive Publication Date: 2025-02-21BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010692419.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-17
Publication Date
2025-02-21
Estimated Expiration
2040-07-17

AI Technical Summary

Technical Problem

In the prior art, more and more data is required for page modules to be compatible during upgrades, resulting in complex code logic and difficult to maintain in subsequent upgrades.

Method used

By receiving the client's page module editing request on the server, filtering codes based on the module identification and version identification, and determining the edited page module information based on the input parameters, and sending the edited information to the client, thereby realizing the upgrade of the page module.

Benefits of technology

It avoids the complexity of code logic caused by excessive data that requires compatibility, simplifies the upgrade process of page modules, and improves the convenience of maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760314B_ABST
    Figure CN113760314B_ABST
Patent Text Reader

Abstract

The present invention discloses a control method, device, electronic device and storage medium for a page module, and relates to the field of computer technology. A specific implementation of the method includes: receiving an edit request for a page module sent by a first client, the edit request including a module identifier, a version identifier and input parameters of the page module to be edited; filtering the code corresponding to the page module to be edited according to the module identifier and the version identifier; determining the edited page module information according to the input parameters and the code; and sending the edited page module information to the first client. This implementation can solve the problem that the module needs to be compatible with more and more data during the upgrade, which makes the logic of the code in the subsequent upgrade very complicated and difficult to maintain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a control method, device, electronic device and storage medium for a page module. Background Art

[0002] For a page composed of multiple modules, there is usually only one version of each module in the page. When a module needs to be upgraded, it is usually upgraded in a code-directly compatible manner. Code-directly compatible means that the updated code is compatible with the original version of the module code, so both the original module data and the upgraded data can be displayed.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] In the direct code compatibility method, code needs to be added every time the module is upgraded, which makes the code more and more. During the upgrade, more and more data needs to be compatible, which makes the logic of the code in subsequent upgrades very complicated and difficult to maintain. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a control method, device, system and storage medium for a page module, which can solve the problem that the module needs to be compatible with more and more data during upgrading, resulting in the logic of the code in subsequent upgrades being very complex and difficult to maintain.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for controlling a page module is provided.

[0007] A page module control method according to an embodiment of the present invention is used on a server side, comprising: receiving an editing request for a page module sent by a first client, the editing request comprising a module identifier, a version identifier and input parameters of the page module to be edited; filtering a code corresponding to the page module to be edited according to the module identifier and the version identifier; determining edited page module information according to the input parameters and the code; and sending the edited page module information to the first client.

[0008] In one embodiment, the editing request includes an adding request, and the page module to be edited includes a page module to be added;

[0009] The step of filtering the code corresponding to the module of the page to be edited according to the module identifier and the version identifier includes:

[0010] If the version identifier belongs to the target version identifier set corresponding to the module identifier, the code corresponding to the to-be-added page module is screened according to the module identifier and the version identifier.

[0011] In yet another embodiment, the editing request includes a modification request, and the page module to be edited includes a page module to be modified.

[0012] In yet another embodiment, determining the edited page module information according to the input parameter and the code includes:

[0013] Using the input parameter as an input parameter of the code, and determining the running result of the code;

[0014] The running result of the code is determined as the edited page module information.

[0015] In yet another embodiment, further comprising:

[0016] receiving a page viewing request sent by a second client, wherein the page viewing request includes a page identifier of a target page and a version identifier supported for display by the second client;

[0017] According to the page identifier, determining the module identifier and the version identifier of the page module included in the target page from the page data corresponding to the page identifier;

[0018] Determine the module identifier and version identifier of the page module to be displayed according to the version identifier supported for display by the second client, the module identifier and version identifier of the page module included in the target page;

[0019] Determine the module information of the page to be displayed according to the module identifier and version identifier of the page module to be displayed;

[0020] Send the page module information to be displayed to the second client.

[0021] In yet another embodiment, determining the module identifier and version identifier of the page module to be displayed according to the version identifier supported for display by the second client and the module identifier and version identifier of the page module included in the target page includes:

[0022] Filtering, from the page modules included in the target page, target page modules whose version identifiers are not greater than the display version identifiers supported by the second client;

[0023] The module identifier and version identifier of the target page module are determined as the module identifier and version identifier of the to-be-displayed page module.

[0024] To achieve the above objective, according to another aspect of an embodiment of the present invention, a method for controlling a page module is provided.

[0025] Another page module control method of an embodiment of the present invention is used for a first client, including: obtaining a module identifier and a version identifier of a page module to be edited; setting input parameters of the page module to be edited according to the content of the page module to be edited; sending an editing request for the page module to the server, the editing request including the module identifier and the version identifier of the page module to be edited, and the input parameters; receiving edited page module information sent by the server, and determining the edited page module according to the edited page module information.

[0026] In one embodiment, the page module to be edited includes a page module to be added, and the edit request includes an add request;

[0027] The step of obtaining the version identifier of the page module to be edited includes:

[0028] Obtain the version identifier of the page module to be added from the target version identifier set corresponding to the page module to be added.

[0029] To achieve the above objective, according to another aspect of an embodiment of the present invention, a control device for a page module is provided.

[0030] A control device for a page module in an embodiment of the present invention is arranged at a server end, and includes: a receiving unit, used to receive an editing request for a page module sent by a first client, the editing request including a module identifier, a version identifier and input parameters of the page module to be edited; a screening unit, used to screen a code corresponding to the page module to be added according to the module identifier and the version identifier; a determining unit, used to determine the edited page module information according to the input parameters and the code; and a sending unit, used to send the edited page module information to the first client.

[0031] In one embodiment, the editing request includes an adding request, and the page module to be edited includes a page module to be added;

[0032] The screening unit is specifically used for:

[0033] If the version identifier belongs to the target version identifier set corresponding to the module identifier, the code corresponding to the to-be-added page module is screened according to the module identifier and the version identifier.

[0034] In yet another embodiment, the editing request includes a modification request, and the page module to be edited includes a page module to be modified.

[0035] In yet another embodiment, the determining unit is specifically configured to:

[0036] Using the input parameter as an input parameter of the code, and determining the running result of the code;

[0037] The running result of the code is determined as the edited page module information.

[0038] In yet another embodiment, the receiving unit is further configured to receive a page viewing request sent by a second client, wherein the page viewing request includes a page identifier of a target page and a version identifier supported for display by the second client;

[0039] The determining unit is further configured to determine, according to the page identifier, a module identifier and a version identifier of a page module included in the target page from the page data corresponding to the page identifier;

[0040] The determining unit is further configured to determine the module identifier and version identifier of the page module to be displayed according to the version identifier supported for display by the second client, the module identifier and version identifier of the page module included in the target page;

[0041] The determining unit is further used to determine the module information of the page to be displayed according to the module identifier and version identifier of the module of the page to be displayed;

[0042] The sending unit is further used to send the page module information to be displayed to the second client.

[0043] In yet another embodiment, the determining unit is further configured to:

[0044] Filtering, from the page modules included in the target page, target page modules whose version identifiers are not greater than the display version identifiers supported by the second client;

[0045] The module identifier and version identifier of the target page module are determined as the module identifier and version identifier of the to-be-displayed page module.

[0046] To achieve the above objective, according to another aspect of an embodiment of the present invention, a control device for a page module is provided.

[0047] Another control device for a page module according to an embodiment of the present invention is arranged on a first client, and includes: an acquisition unit, used to acquire a module identifier and a version identifier of a page module to be edited; a setting unit, used to set input parameters of the page module to be edited according to the content of the page module to be edited; a sending unit, used to send an editing request for the page module to the server, the editing request including the module identifier and the version identifier of the page module to be edited, and the input parameters; a determination unit, used to receive the edited page module information sent by the server, and determine the edited page module according to the edited page module information.

[0048] In one embodiment, the page module to be edited includes a page module to be added, and the edit request includes an add request;

[0049] The acquisition unit is further used for:

[0050] Obtain the version identifier of the page module to be added from the target version identifier set corresponding to the page module to be added.

[0051] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device is provided.

[0052] An electronic device according to an embodiment of the present invention includes: one or more processors; a storage device 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 implement the control method of the page module provided by the embodiment of the present invention.

[0053] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0054] A computer-readable medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, the method for controlling a page module according to an embodiment of the present invention is implemented.

[0055] One embodiment of the above invention has the following advantages or beneficial effects: In the embodiment of the present invention, when editing a page module, the first client can send an edit request for the page module to the server. After receiving the edit request for the page module sent by the first client, the server can filter out the code corresponding to the page module to be added according to the module identifier and the version identifier; and determine the added page module information according to the input parameters and the code; and send the added page module information to the first client, thereby realizing the first client's request to edit the page module. In the embodiment of the present invention, the client can upgrade the page module by requesting the server to edit the page module. The server stores the code corresponding to each version of the page module, so that the code compatibility of different versions of the page module is not required, thereby avoiding the problem that the logic of the upgraded code is very complicated and difficult to maintain due to too much data that needs to be compatible.

[0056] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0058] Figure 1is a schematic diagram of a system architecture of a method for controlling a page module according to an embodiment of the present invention;

[0059] Figure 2 is a schematic diagram of a main process of a method for controlling a page module according to an embodiment of the present invention;

[0060] Figure 3 is a schematic diagram of another main process of a method for controlling a page module according to an embodiment of the present invention;

[0061] Figure 4 is a schematic diagram of another main process of a method for controlling a page module according to an embodiment of the present invention;

[0062] Figure 5 is a schematic diagram of another main process of a method for controlling a page module according to an embodiment of the present invention;

[0063] Figure 6 is a schematic diagram of a main unit of a control device for a page module according to an embodiment of the present invention;

[0064] Figure 7 is a schematic diagram of another main unit of the control device of the page module according to an embodiment of the present invention;

[0065] Figure 8 is another exemplary system architecture diagram to which the embodiments of the present invention can be applied;

[0066] Fig. 9 It is a schematic diagram of the structure of a computer system suitable for implementing the embodiment of the present invention. DETAILED DESCRIPTION

[0067] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0068] It should be pointed out that the embodiments of the present invention and the features in the embodiments may be combined with each other if there is no conflict.

[0069] An embodiment of the present invention provides a control system for page modules, which can be used in a scenario where each page module is controlled in a page including multiple page modules. The control system may include a server and a first client, and the first client may modify and add or subtract the page modules included in the page through the server. The server may develop and store codes for each version of the page module, set a code identifier for each code, and may modify and add or subtract the page module according to the request of the first client. In an embodiment of the present invention, in order to facilitate the storage and query of the code of each page template, the server may set metadata corresponding to the version of each version of the page module, and the metadata may include the version identifier of the page template, the module identifier of the page module, and the code identifier of the code corresponding to the page module. In the metadata, the module identifier indicates the type identifier of the page module, which can reflect the type of the page module, such as the coupon type, image type, etc. The module identifier can be set according to different setting rules according to the specific scenario; the version identifier indicates the version identifier of the page module, which can uniquely identify the version of a page module in the page modules with the same module identifier. The version identifier can be set according to different setting rules according to the specific scenario, for example, the numbers can be used in ascending order as the version identifier of the page module; the code identifier indicates the identifier of the code used to implement the page module, which corresponds one-to-one to the code used to implement the page module, and the code identifier can be set according to different setting rules according to the specific scenario. In this way, after the server determines the version identifier and module identifier of the page module, it can query the code identifier corresponding to the page module according to the metadata, and then filter out the corresponding code.

[0070] It should be noted that, in an embodiment of the present invention, the code stored on the server may be a code template, in which specific parameters corresponding to the content in the page module may be replaced by preset characters, which are replaced according to the input parameters of the first client when the code is running, thereby obtaining the page module required by the first client.

[0071] In an embodiment of the present invention, the control system may further include a second client, which may view the page through the server. The page may include multiple page modules of different versions. The server may determine the page modules that can be displayed based on the version supported by the second client, and send them to the second terminal for display.

[0072] Figure 1 FIG. 1 is a schematic diagram of a system architecture of a page control system according to an embodiment of the present invention. Figure 1 As shown, the multi-version control is a server in an embodiment of the present invention. Figure 1In the example, the page module is module A. V1, V2 and V3 represent the version identifiers of module A. Module A includes three versions. The version upgrade order is module A-V1, A-V2 and A-V3. The codes corresponding to the three versions are module A code-V1, module A code-V2 and module A code-V3. After the development is completed, the first client can control the page module according to its own needs, which can include editing the page module and adding a new page module. Figure 1 The first client shown in the figure is the merchant. After the server is developed, users can also view the page through the second client and other devices. When the user views the page, he needs to provide the server with the version identifier of the page module it supports. The server determines the page module that can be displayed on the second client based on the version identifier of the page module supported by the second client, and then sends it to the second client for display. Usually, the second client views the page by installing an APP, such as Figure 1 As shown in the figure, the APP access is a scenario in which the second client installs the APP and views the page through the APP.

[0073] It should be noted that in an embodiment of the present invention, in order to encourage users to upgrade to the latest version of the page module in a timely manner, the first client can be restricted to only adding the latest version of the page module when adding a page module, so that when the user views the page, in order to be able to view the new version of the content, the version of the page module it supports is actively upgraded.

[0074] It should be noted that, in the embodiment of the present invention, the number of the first client and the second client may be multiple. Figure 1 The illustrated system architecture is described by taking the number of the first client and the number of the second client as one as an example.

[0075] The embodiment of the present invention provides a method for controlling a page module. The method can be executed by a server in a control system of the page module. Figure 2 As shown, the method includes the following steps.

[0076] S201: receiving a page module editing request sent by a first client.

[0077] The editing request includes the module identifier, version identifier and input parameters of the page module to be edited. The module identifier and version identifier of the page module to be edited are used to indicate which page module to be edited. The input parameters represent input parameters of the code for implementing the page module to be edited. The code of the page module to be edited can obtain the edited page module after running, and the input parameters can include the parameter values ​​of the variables to be assigned in the code, so that the page module that meets the requirements of the first client can be obtained after the code is run.

[0078] In an embodiment of the present invention, editing of a page module may include adding a page module and modifying a page module, so an editing request may include an adding request, in which case the page module to be edited may include a page module to be added, and an editing request may also include a modifying request, in which case the page module to be edited may include a page module to be modified.

[0079] In the scenario where the edit request includes an add request, the add request includes a module identifier of the page module to be added, a version identifier of the page module to be added, and an input parameter of the page module to be added. The input parameter represents an input parameter of a code for implementing the page module to be added. The code for implementing the page module to be added can derive the page module to be added after running, and the input parameter can include a parameter value of a variable to be assigned in the code, so that a page module that meets the functional requirements of the first client can be obtained after the code runs.

[0080] When the first client needs to add a page module, it can determine the module identifier, version identifier and required input parameters of the module to be added, and carry them in the addition request to send to the server. After receiving the addition request sent by the first client, the server can derive the module identifier of the page module to be added, the version identifier of the page module to be added and the input parameters of the page module to be added from the addition request.

[0081] S202: Filter the code corresponding to the page module to be edited according to the module identifier and the version identifier.

[0082] Among them, when the server edits the page module to be edited, it is necessary to first determine the code corresponding to the page module to be edited. In the embodiment of the present invention, the server sets metadata corresponding to the page module with each version identifier, so based on the stored metadata, the code identifier of the code corresponding to the page module to be added can be queried according to the module identifier and version identifier of the page module to be edited, and then the code corresponding to the page module to be edited can be screened from the database storing the code according to the code identifier.

[0083] In the scenario where the editing request includes an addition request, in order to avoid too many versions of the page module that can be added in the first client, which makes it difficult for the user to choose the version of the page module to be added when adding the page module, and increases the complexity of adding the page module, in the embodiment of the present invention, for each page module, the version identification range of the newly added page module is limited, that is, the target version identification set, so that the first client can add a limited number of page module versions, reducing the complexity of adding the page module. For example, for a page module with a module identification of coupon, the set of version identifications that can be added is limited to 3 and 4, which means that when adding a page module with a module identification of coupon, only page modules with version identifications of 3 or 4 can be added, that is, the target version identification set is 3 and 4.

[0084] Therefore, when the editing request includes an adding request, this step is specifically performed as follows: if the version identifier belongs to the target version identifier set corresponding to the module identifier, the code corresponding to the page module to be added is filtered according to the module identifier and the version identifier.

[0085] After receiving the page request sent by the first client, the server first determines whether the version identifier of the page module to be added belongs to the target version identifier set corresponding to the module identifier of the page module to be added, that is, whether the version identifier of the page module to be added is a version identifier that is allowed to be added. If the version identifier of the page module to be added does not belong to the target version identifier set corresponding to the module identifier of the page module to be added, the page module is not allowed to be added, and a message that the addition is not allowed can be sent to the first client. If the version identifier of the page module to be added belongs to the target version identifier set corresponding to the module identifier of the page module to be added, the step of determining the page module information of the page module to be added is executed.

[0086] After determining that the page module is allowed to be added, the server needs to first determine the code corresponding to the page module to be added. In the embodiment of the present invention, the server sets metadata corresponding to the page module with each version identifier, so based on the stored metadata, the code identifier of the code corresponding to the page module to be added can be queried according to the module identifier and version identifier of the page module to be added, and then the code corresponding to the page module to be added can be screened from the database storing the code according to the code identifier.

[0087] It should be noted that, in the embodiment of the present invention, in order to promote the use of the new version of the page module, the target version identifier set can be set to the latest version identifier of the page module, that is, only the first client is allowed to add the latest version of the page module. When the first client needs to add a page module, the version of the page module to be added can be selected from the target version identifier set corresponding to the page module to be added. In this way, the version of the page module used by the first client when adding the page module can be limited, and the version of the page module to be added can be easily selected, reducing the complexity of the client adding the page module.

[0088] S203: Determine the edited page module information according to the input parameters and code.

[0089] In step S202, the code corresponding to the page module to be edited is determined, and based on the input parameters and code of the page to be edited, the page module information of the page module to be edited after editing can be determined.

[0090] In the embodiment of the present invention, the code needs to be run through input parameters when it is running, so this step can be specifically performed as follows: using the input parameters as the input parameters of the code to determine the running results of the code; and determining the running results of the code as the edited page module information.

[0091] The input parameters of the page module to be edited are parameters that satisfy the functions implemented by the first client editing the page module. The input parameters of the page module to be edited are used as the input parameters of the code determined in step S202, and the page module required to be edited by the first client can be obtained by running the code. Therefore, the running result of the code can be determined as the edited page module information.

[0092] When the editing request includes an adding request, the input parameters of the page module to be added are parameters that satisfy the functions implemented by the new page module of the first client. The input parameters of the page module to be added are used as the input parameters of the code determined in step S202, and the page module to be added by the first client can be obtained by running the code. Therefore, the running result of the code can be determined as the page module information of the page module to be added.

[0093] It should be noted that in an embodiment of the present invention, after determining the page module information of the edited page module, it is necessary to save the input parameters and the correspondence between the input parameters and the edited page module, so that when the second client views the page module, the input parameters can be used to determine the page module information of the page module.

[0094] S204: Send the edited page module information to the first client.

[0095] After determining the page module information of the edited page module, the page module information of the edited page module may be sent to the first client, and the first client may determine the edited page module according to the edited page module information.

[0096] In an embodiment of the present invention, the client can upgrade the page module by requesting the server to edit the page module. The server stores the codes corresponding to each version of the page module, thereby eliminating the need for code compatibility of different versions of the page modules, thereby avoiding the problem of too much data that needs to be compatible, resulting in the logic of the code during the upgrade being very complicated and difficult to maintain.

[0097] Combination Figure 2 The embodiment shown in Figure 1 Taking the system structure shown in the figure as an example, Figure 2 The embodiment shown is specifically described. Figure 1For example, if the page module requested to be added by the merchant in the first client is module A-V3, the request for adding the page module sent by the first client in step S201 includes the module identifier as module A, the version identifier as V3, and the input parameters as the parameters corresponding to the code for implementing the page module to be added. After the server receives the addition request in step S201, it can determine that the module identifier of the page module to be added is module A and the version identifier is V3, and then V3 can be compared with the target version identifier set with the module identifier as module A to determine whether V3 belongs to the target version identifier set. If V3 belongs to the target version identifier set, step S202 is executed; if V3 does not belong to the target version identifier set, a message that the page module to be added cannot be added can be returned to the first client. Taking the example that the target version identification set of module A includes V3, the server in step S202 can filter out the corresponding metadata based on the module identification as module A and the version identification as V3 after determining that the target version identification set of module A includes V3, and determine the code identification corresponding to the page module with the module identification as module A and the version identification as V3 based on the metadata, and then filter out the code corresponding to the page module with the module identification as module A and the version identification as V3 according to the code identification. Then the server can execute step S203, run the code corresponding to the page module with the module identification as module A and the version identification as V3 based on the input parameters, obtain the page module information of the page module with the module identification as module A and the version identification as V3, and send the page module information of the page module with the module identification as module A and the version identification as V3 to the first client through step S204, thereby completing the process of adding the page module requested by the first client.

[0098] The embodiment of the present invention provides another method for controlling a page module. The method can be executed by a first client in a control system of the page module. Figure 3 As shown, the method includes the following steps.

[0099] S301: Obtain the module identifier and version identifier of the page module to be edited.

[0100] When the page module needs to be edited, the user can determine the module and version of the page module to be edited according to the requirements and indicate it to the first client. The first client can obtain the module identifier and version identifier of the page module to be edited through the received user instruction.

[0101] Specifically, the first client determines the version identifier and module identifier of the page module to be edited by the user dragging the template of the page module to be edited to a specific area, and the first client determines the version identifier and module identifier of the page module to be edited according to the parameters of the page template in the specific area.

[0102] S302: Setting input parameters of the page module to be edited according to the content of the page module to be edited.

[0103] After determining the version identifier and module identifier of the page module to be edited, the content of the module to be edited is determined. The required functions need to be achieved by setting the parameter values ​​of some parameters. Therefore, in this step, the input parameters of the page module to be edited need to be set according to the content of the page module to be added and personal needs.

[0104] S303: Sending a page module editing request to the server.

[0105] The editing request includes the module identifier and version identifier of the page module to be added, as well as input parameters.

[0106] In the embodiment of the present invention, after determining the module identifier and version identifier of the page module to be edited and input parameters, an edit request can be sent to the server, so that the server can determine the page module information of the page module to be edited after editing.

[0107] In an embodiment of the present invention, editing of a page module may include adding a page module and modifying a page module, so the page module to be edited may include a page module to be added, and the editing request may include an adding request, and the page module to be edited may include a page module to be modified, and the editing request may also include a modifying request.

[0108] The user can determine the page identifier of the page module to be added according to the functions to be added, and indicate it to the first client. In order to avoid too many versions of the page module that can be added in the first client, which makes it difficult for the user to choose the version of the page module to be added when adding the page module, and increases the complexity of adding the page module, in an embodiment of the present invention, for each page module, the version identifier range of the newly added page module is limited, that is, the target version identifier set. The target version identifier set indicates the range of the version identifier of the page module that can be added by the module identifier to which the page module to be added belongs. When it is necessary to upgrade the page module by adding a page module, the version identifier of the page module that can be added can be selected from the target version identifier set, that is, the version identifier of the page module to be added. That is, step S301 can be specifically performed as follows: from the target version identifier set corresponding to the page module to be added, the version identifier of the page module to be added is obtained.

[0109] S304: receiving the edited page module information sent by the server, and determining the edited page module according to the edited page module information.

[0110] Among them, after the server determines the edited page module information of the page module to be edited, it can send the edited page module information to the first client, so the first client can receive the edited page module information sent by the server, and derive the edited page module based on the page module information to realize the upgrade of the page module.

[0111] In an embodiment of the present invention, the client can upgrade the page module by requesting the server to edit the page module. The server stores the codes corresponding to each version of the page module, thereby eliminating the need for code compatibility of different versions of the page modules, thereby avoiding the problem of too much data that needs to be compatible, resulting in the logic of the code during the upgrade being very complicated and difficult to maintain.

[0112] Combine the following Figure 1 The system architecture shown in the figure, the embodiment of the present invention provides a method for controlling a page module, and specifically describes the process of modifying the page module. The method can be Figure 1 In the system architecture shown, the server and the first client execute, such as Figure 4 As shown, the method includes the following steps.

[0113] S401: The first client determines information of a page module to be modified, and sends a modification request to the server.

[0114] The first client can modify the existing page module to change the function implemented by the page module. When the first client needs to modify the page module, it is necessary to first determine the information of the page module to be modified, that is, the module identifier, version identifier and input parameters of the page module to be modified. After determining the information of the page module to be modified, the first client can send a modification request to the server, and the modification request includes the information of the page module to be modified, so that the server can modify the page module to be modified.

[0115] S402: The server receives the modification request sent by the first client, and filters the code corresponding to the page module to be modified according to the module identifier and version identifier of the page module to be modified.

[0116] In an embodiment of the present invention, metadata is set for different version identifiers of different page modules. Therefore, based on the stored metadata, the metadata of the page module to be modified can be queried according to the module identifier and version identifier of the page module to be modified in the modification request, and then the code identifier of the code corresponding to the modified page module can be determined, and then the code corresponding to the page module to be modified can be filtered out from the stored code according to the code identifier.

[0117] S403: The server determines the modified page module information according to the input parameters and code of the page module to be modified.

[0118] Due to different input parameters, the results of code execution will be different, and the obtained page module information will also be different. Therefore, in this step, the input parameters of the page module to be modified sent by the first client are used as the input parameters of the code filtered in step S402 and run to obtain the modified page module information.

[0119] It should be noted that in an embodiment of the present invention, after determining the page module information of the page module to be modified, it is necessary to save the input parameters and the correspondence between the input parameters and the page module to be modified, so that when the second client views the page module, the input parameters can be used to determine the page module information of the page module.

[0120] S404: Send the modified page module information to the first client.

[0121] After determining the page module information of the page module to be modified, the page module information of the page module to be modified may be sent to the first client, and the first client may determine the modified page module according to the page module information of the page module to be modified.

[0122] In an embodiment of the present invention, the first client can change and upgrade the content of the page module by requesting the server to modify the page module. The server stores the code corresponding to each version of the page module, thereby eliminating the need for code compatibility of different versions of the page modules, thereby avoiding the problem of too much data that needs to be compatible, resulting in the logic of the code during the upgrade being very complicated and difficult to maintain.

[0123] In the embodiment of the present invention, after the first client adds, modifies, etc. a page module in a page, the page data corresponding to each page stores the module identifier, version identifier, etc. of the page module. Therefore, when the second client views the page, the page module information that can be displayed on the second client can be determined based on the page data of the viewed page.

[0124] The embodiment of the present invention provides another method for controlling a page module, specifically describing the process of viewing a page. The method can be executed by a server in a control system of the page module, such as Figure 5 As shown, the method includes the following steps.

[0125] S501: receiving a page viewing request sent by a second client.

[0126] The page viewing request includes a page identifier of a target page and a version identifier supported for display by the second client. The target page represents the page requested to be viewed by the second client.

[0127] The second client can view the page by installing an APP or other methods. Since the second client does not necessarily support all versions of page modules, the page viewing request needs to include the page identifier of the target page and the version identifier supported by the second client for display. The page identifier of the target page can represent the page identifier of the page to be viewed, and the version identifier supported by the second client for display represents the version identifier of the page module supported for display by the second client. If the versions of the page modules are unified, the version identifier supported and displayed by the second client can be a unified version identifier, which represents the version identifier of each page module supported by the second client; if the versions of the page modules are not unified, the version identifier supported and displayed by the second client can include the version identifiers supported by each page module in the second client.

[0128] S502: According to the page identifier, determine the module identifier and the version identifier of the page module included in the target page from the page data corresponding to the page identifier.

[0129] After receiving the page viewing request, the server can determine the page and page data that the second client wants to view based on the page identifier, that is, the page data corresponding to the page identifier, and thus determine the module identifier and version identifier of the page module included in the target page based on the page data of the page that the second client wants to view. A page can include different page modules and different versions of the same page module, so the server needs to determine the module identifier and version identifier of all page modules included in the target page, so as to determine the page module information that the second client can display.

[0130] S503: Determine the module identifier and version identifier of the page module to be displayed according to the version identifier supported for display by the second client, and the module identifier and version identifier of the page module included in the target page.

[0131] Among them, since the page module with a version higher than the version supported by the second client cannot be displayed on the second client, after the server determines the module identifier and version identifier of the page module included in the target page, it can determine the module identifier and version identifier of the page module to be displayed based on the version identifier supported by the second client.

[0132] Specifically, the method for determining the module identifier and version identifier of the page module to be displayed in this step can be as follows: from the page modules included in the target page, filter the target page module whose version identifier is not greater than the display version identifier supported by the second client; determine the module identifier and version identifier of the target page module as the module identifier and version identifier of the page module to be displayed.

[0133] In this step, target page modules whose version identifiers are not greater than the version identifiers supported for display by the second client can be screened according to the version identifiers of the page modules included in the target page. These target page modules are the page modules that can be displayed on the second client. In the embodiment of the present invention, the version identifiers are usually determined in sequence according to the upgrade order. The larger the value of the version identifier is, the newer the corresponding page module is and the higher the level of the version is. Therefore, the value of the version identifier of each page module in the target page can be compared with the value of the version identifier supported for display by the second client. If the value of the version identifier of the page module is greater than the value of the version identifier supported for display by the second client, it means that the version of the page module is higher than the version supported for display by the second client; if the value of the version identifier of the page module is not greater than the value of the version identifier supported for display by the second client, it means that the version of the page module is not higher than the version supported for display by the second client. Therefore, target page modules whose version identifiers are not greater than the version identifier supported for display by the second client can be screened out from the page modules included in the target page.

[0134] S504: Determine the module information of the page to be displayed according to the module identifier and the version identifier of the module of the page to be displayed.

[0135] In this step, after determining the module identifier and version identifier of the page module to be displayed, the code identifier of the page module to be displayed can be determined based on the metadata, and then the code and corresponding input parameters of the page module to be displayed can be queried. In this way, the input parameters are input into the code and the code is run to obtain the page module information to be displayed.

[0136] S505: Sending the page module information to be displayed to the second client.

[0137] After determining the page module information of the page module to be displayed, the page module information of the page module to be displayed may be sent to the second client, so that the second client can display the target page according to the page module information to be displayed.

[0138] In the embodiment of the present invention, since the page modules in the target page whose versions are not higher than the version supported by the second terminal are all displayed, the page modules with lower versions will not disappear due to the upgrade of the page modules. Multiple versions of the same page module coexist at the same time, and different versions of page modules correspond to different code implementations, so that the upgrade of the page module has no effect on the client, and the old and new versions of the page modules can be displayed normally, and the conversion rate will not be affected. Regardless of the size of the page module upgrade, it can be completed very simply and smoothly.

[0139] In order to solve the problems existing in the prior art, the embodiment of the present invention provides a control device 600 of a page module, which is arranged at a server end, such as Figure 6 As shown, the device 600 includes:

[0140] The receiving unit 601 is used to receive an edit request for a page module sent by a first client, wherein the edit request includes a module identifier, a version identifier and input parameters of the page module to be edited;

[0141] A screening unit 602, configured to screen the code corresponding to the to-be-added page module according to the module identifier and the version identifier;

[0142] A determination unit 603, configured to determine the edited page module information according to the input parameter and the code;

[0143] The sending unit 604 is used to send the edited page module information to the first client.

[0144] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 2 The method of the illustrated embodiment is the same and will not be repeated here.

[0145] In an implementation of the embodiment of the present invention, the editing request includes an adding request, and the page module to be edited includes a page module to be added;

[0146] The screening unit 602 is specifically used for:

[0147] If the version identifier belongs to the target version identifier set corresponding to the module identifier, the code corresponding to the to-be-added page module is screened according to the module identifier and the version identifier.

[0148] In another implementation of the embodiment of the present invention, the editing request includes a modification request, and the page module to be edited includes a page module to be modified.

[0149] In another implementation of the embodiment of the present invention, the determining unit 603 is specifically configured to:

[0150] Using the input parameter as an input parameter of the code, and determining the running result of the code;

[0151] The running result of the code is determined as the edited page module information.

[0152] In another implementation of the embodiment of the present invention, the receiving unit 601 is further configured to receive a page viewing request sent by a second client, wherein the page viewing request includes a page identifier of a target page and a version identifier supported for display by the second client;

[0153] The determining unit 603 is further configured to determine, according to the page identifier, a module identifier and a version identifier of a page module included in the target page from the page data corresponding to the page identifier;

[0154] The determining unit 603 is further configured to determine the module identifier and version identifier of the page module to be displayed according to the version identifier supported for display by the second client, the module identifier and version identifier of the page module included in the target page;

[0155] The determining unit 603 is further configured to determine the module information of the page to be displayed according to the module identifier and version identifier of the module of the page to be displayed;

[0156] The sending unit 604 is further configured to send the page module information to be displayed to the second client.

[0157] In another implementation of the embodiment of the present invention, the determining unit 603 is further configured to:

[0158] Filtering, from the page modules included in the target page, target page modules whose version identifiers are not greater than the display version identifiers supported by the second client;

[0159] The module identifier and version identifier of the target page module are determined as the module identifier and version identifier of the to-be-displayed page module.

[0160] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 2 , Figure 4 , Figure 5 The method of the illustrated embodiment is the same and will not be repeated here.

[0161] In an embodiment of the present invention, the client can upgrade the page module by requesting the server to edit the page module. The server stores the codes corresponding to each version of the page module, thereby eliminating the need for code compatibility of different versions of the page modules, thereby avoiding the problem of too much data that needs to be compatible, resulting in the logic of the code during the upgrade being very complicated and difficult to maintain.

[0162] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a control device 700 of a page module, which is arranged at a first client, such as Figure 7 As shown, the device 700 includes:

[0163] The acquisition unit 701 is used to acquire the module identifier and version identifier of the page module to be edited;

[0164] A setting unit 702, configured to set input parameters of the module of the page to be edited according to the content of the module of the page to be edited;

[0165] The sending unit 703 is used to send an edit request of the page module to the server, wherein the edit request includes a module identifier and a version identifier of the page module to be edited, and the input parameter;

[0166] The determination unit 704 is configured to receive the edited page module information sent by the server, and determine the edited page module according to the edited page module information.

[0167] In another implementation of the embodiment of the present invention, the acquisition unit 701 is further configured to:

[0168] Obtain the version identifier of the page module to be added from the target version identifier set corresponding to the page module to be added.

[0169] It should be understood that the manner of implementing the embodiments of the present invention is different from the Figure 3 The method of the illustrated embodiment is the same and will not be repeated here.

[0170] In an embodiment of the present invention, the client can upgrade the page module by requesting the server to edit the page module. The server stores the codes corresponding to each version of the page module, thereby eliminating the need for code compatibility of different versions of the page modules, thereby avoiding the problem of too much data that needs to be compatible, resulting in the logic of the code during the upgrade being very complicated and difficult to maintain.

[0171] According to an embodiment of the present invention, the present invention also provides an electronic device and a readable storage medium.

[0172] The electronic device of the present invention comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the one processor, and the instructions are executed by the at least one processor so that the at least one processor executes the control method of the page module provided in an embodiment of the present invention.

[0173] Figure 8 An exemplary system architecture 800 is shown to which the method for controlling a page module or the device for controlling a page module according to the embodiment of the present invention can be applied.

[0174] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0175] Users can use terminal devices 801, 802, and 803 to interact with server 805 through network 804 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 801, 802, and 803, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0176] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0177] The server 805 may be a server that provides various services, such as a backend management server (only an example) that provides support for shopping websites browsed by users using the terminal devices 801, 802, and 803. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as product information - only an example) to the terminal device.

[0178] It should be noted that the control method of the page module provided in the embodiment of the present invention is generally executed by the server 805 , and accordingly, the control device of the page module is generally arranged in the server 805 .

[0179] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0180] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 suitable for implementing an embodiment of the present invention. Fig. 9 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0181] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0182] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0183] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the present invention are executed.

[0184] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0185] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a unit, a program segment, or a part of a code, and the above-mentioned unit, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0186] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a receiving unit, a screening unit, a determining unit, and a sending unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the receiving unit may also be described as a "unit of the function of the receiving unit".

[0187] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device executes the control method of the page module provided by the present invention.

[0188] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for controlling a page module, characterized in that: For the server, including: Receive an edit request for a page module sent by a first client, the edit request including a module identifier, a version identifier, and input parameters of the page module to be edited, the module identifier indicating a type identifier of the page module, reflecting the type of the page module, and the input parameters may include parameter values ​​of variables to be assigned in the code; According to the module identifier and the version identifier, filter the code corresponding to the module of the page to be edited; Determine the edited page module information according to the input parameter and the code; Sending the edited page module information to the first client; Determining the edited page module information according to the input parameter and the code includes: Using the input parameter as an input parameter of the code, and determining the running result of the code; The running result of the code is determined as the edited page module information.

2. The method according to claim 1, characterized in that The editing request includes an adding request, and the page module to be edited includes a page module to be added; The step of filtering the code corresponding to the module of the page to be edited according to the module identifier and the version identifier includes: If the version identifier belongs to the target version identifier set corresponding to the module identifier, the code corresponding to the to-be-added page module is screened according to the module identifier and the version identifier.

3. The method according to claim 1, characterized in that The editing request includes a modification request, and the page module to be edited includes a page module to be modified.

4. The method according to claim 1, characterized in that Also includes: receiving a page viewing request sent by a second client, wherein the page viewing request includes a page identifier of a target page and a version identifier supported for display by the second client; According to the page identifier, determining the module identifier and the version identifier of the page module included in the target page from the page data corresponding to the page identifier; Determine the module identifier and version identifier of the page module to be displayed according to the version identifier supported for display by the second client, the module identifier and version identifier of the page module included in the target page; Determine the module information of the page to be displayed according to the module identifier and version identifier of the page module to be displayed; Send the page module information to be displayed to the second client.

5. The method according to claim 4, characterized in that The determining the module identifier and the version identifier of the page module to be displayed according to the version identifier supported for display by the second client and the module identifier and the version identifier of the page module included in the target page comprises: Filtering, from the page modules included in the target page, target page modules whose version identifiers are not greater than the display version identifiers supported by the second client; The module identifier and version identifier of the target page module are determined as the module identifier and version identifier of the to-be-displayed page module.

6. A method for controlling a page module, characterized in that: For the first client, including: Obtaining a module identifier and a version identifier of the page module to be edited, wherein the module identifier indicates a type identifier of the page module, reflecting the type to which the page module belongs; According to the content of the page module to be edited, the input parameters of the page module to be edited are set, and the input parameters may include parameter values ​​of variables to be assigned in the code; Sending a page module editing request to a server, the editing request including a module identifier and a version identifier of the page module to be edited, and the input parameter, so that the server screens the code corresponding to the page module to be edited according to the module identifier and the version identifier, and uses the input parameter as an input parameter of the code to determine the running result of the code to obtain the page module information after editing; Receive the edited page module information sent by the server, and determine the edited page module according to the edited page module information.

7. The method according to claim 6, characterized in that The page module to be edited includes a page module to be added, and the editing request includes an adding request; The step of obtaining the version identifier of the page module to be edited includes: Obtain the version identifier of the page module to be added from the target version identifier set corresponding to the page module to be added.

8. A control device for a page module, characterized in that: Set on the server side, including: a receiving unit, configured to receive an edit request for a page module sent by a first client, wherein the edit request includes a module identifier, a version identifier, and input parameters of the page module to be edited, wherein the module identifier indicates a type identifier of the page module, reflecting the type to which the page module belongs, and the input parameters may include parameter values ​​of variables to be assigned in the code; A screening unit, used for screening the code corresponding to the page module to be added according to the module identifier and the version identifier; A determination unit, used to determine the edited page module information according to the input parameter and the code; A sending unit, configured to send the edited page module information to the first client; The determining unit is specifically configured to: Using the input parameter as an input parameter of the code, and determining the running result of the code; The running result of the code is determined as the edited page module information.

9. A control device for a page module, characterized in that: Set on the first client, including: An acquisition unit, used to acquire a module identifier and a version identifier of a page module to be edited, wherein the module identifier indicates a type identifier of the page module, reflecting the type to which the page module belongs; A setting unit, used to set input parameters of the to-be-edited page module according to the content of the to-be-edited page module, wherein the input parameters may include parameter values ​​of variables to be assigned in the code; A sending unit, used to send an edit request of a page module to a server, wherein the edit request includes a module identifier and a version identifier of the page module to be edited, and the input parameter, so that the server screens the code corresponding to the page module to be edited according to the module identifier and the version identifier, and uses the input parameter as an input parameter of the code to determine the running result of the code to obtain the page module information after editing; The determination unit is used to receive the edited page module information sent by the server, and determine the edited page module according to the edited page module information.

10. An electronic device, characterized in that: include: one or more processors; a storage device 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 implement the method according to any one of claims 1 to 7.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Software test method, device and apparatus and computer storage medium

    CN108491331A