A product page updating method, device, computer equipment and storage medium
By obtaining the unique identifier of the product and modifying the template string, the problem of updating product pages on different sites in cross-border e-commerce was solved, achieving efficient product information updates and reducing development costs and time.
Patent Information
- Application Number
- CN202111210781.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-18
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2041-10-18
AI Technical Summary
In the cross-border e-commerce industry, existing technologies cannot use a single set of HTML code to update product pages across different website platforms, resulting in high development costs and low efficiency.
By obtaining the product's unique identifier, the product's position on the page is located. The basic template element block is obtained from the upper-level DOM element, converted into a template string, and modified according to the information to be updated, thus adapting the product information updates to different site themes.
There is no need to develop a single set of HTML code for each platform, which significantly reduces development time and manpower, and improves the efficiency and adaptability of product page updates.
Smart Images

Figure CN113961858B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network page processing, and in particular to a commodity page updating method, device, computer equipment and storage medium. Background Art
[0002] In the cross-border e-commerce industry, optimizers need to adjust the marketing of products on the site page according to the sales situation of the products. By displaying the corresponding products in the browser's unique identifier, the optimization processing efficiency can be improved.
[0003] For example, you can develop an APP under the independent station platform, or simply build your own services and scripts, or use the platform API capabilities to add custom scripts and HTML in the site background. Among these three methods, the third one is the simplest, fastest, and least expensive. However, in actual operation, the site theme styles of each platform are different, which means that one set of HTML code cannot be applied to different sites. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide a product page updating method, apparatus, computer device and storage medium that overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect, an embodiment of the present invention provides a method for updating a product page.
[0006] The product page updating method comprises the following steps:
[0007] Get the unique identifier of the product on the product page;
[0008] Locate the first product on the page based on its unique identifier, and bubble up to the upper DOM element until the element block that displays the basic template for the product is obtained;
[0009] Convert the DOM elements in the element block into a template string, and modify the template string into a marked template string according to the information to be updated of the first product;
[0010] Copy the marked template string to the element block of the basic template that displays other products to be updated to replace its DOM element, and modify the corresponding marked template string according to the information to be updated of each product to obtain the template string of the product to be updated;
[0011] Convert the template string of the product to be updated into a DOM element and render the page.
[0012] Optionally, locating the position of the first product on the page according to the unique identifier corresponding to the first product, and bubbling the upper DOM element until an element block of a basic template displaying the product is obtained includes:
[0013] Locate the first product on the page based on its unique identifier and bubble up the upper DOM element;
[0014] If the number of element blocks of the basic template for displaying products is equal to the number of products displayed on the product page, and the number of upper-level elements is 1, then the element block of the basic template for displaying the first product is obtained.
[0015] Optionally, the step of copying the marked template string to an element block of a basic template that displays other products to be updated to replace the DOM element thereof comprises the following steps:
[0016] According to the unique identifiers corresponding to the other products to be updated, the element blocks of the basic templates displaying the other products to be updated are searched.
[0017] Optionally, the information to be updated of the product includes one or more of a product title, a product price, a jump link, and a product picture.
[0018] In a second aspect, an embodiment of the present invention provides a device for updating a product page.
[0019] The commodity page updating device comprises:
[0020] A unique identifier acquisition module is used to obtain a unique identifier corresponding to a product on a product page;
[0021] The first product element block acquisition module is used to locate the first product on the page according to the unique identifier corresponding to the first product, and bubble up the upper DOM element until the element block of the basic template displaying the product is obtained;
[0022] A marked template string determination module, used for converting the DOM element in the element block into a template string, and modifying the template string into a marked template string according to the information to be updated of the first product;
[0023] The module for determining the template string of the product to be updated is used to copy the marked template string to the element block of the basic template that displays other products to be updated to replace its DOM element, and modify the corresponding marked template string according to the information to be updated of each product to obtain the template string of the product to be updated;
[0024] The page rendering module is used to convert the template string of the product to be updated into a DOM element and render the page.
[0025] Optionally, the first commodity element block acquisition module includes:
[0026] The bubbling submodule is used to locate the first product on the page according to the unique identifier corresponding to the first product, and to bubble the upper DOM element;
[0027] The first product element block acquisition submodule is used to acquire the element block of the basic template for displaying the first product if the number of element blocks of the basic template for displaying the products is equal to the number of products displayed on the product page and the number of upper-level elements is 1.
[0028] Optionally, the device further comprises:
[0029] The module for obtaining element blocks of other commodities to be updated is used to search for element blocks of the basic templates for displaying other commodities to be updated according to the unique identifiers corresponding to the other commodities to be updated.
[0030] Optionally, the information to be updated of the product includes one or more of a product title, a product price, a jump link, and a product picture.
[0031] In a third aspect, an embodiment of the present invention provides a computer device.
[0032] The computer device comprises:
[0033] one or more processors;
[0034] A memory for storing one or more programs;
[0035] When the one or more programs are executed by the one or more processors, the one or more processors implement the product page updating method as described in any one of the first aspects.
[0036] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium.
[0037] The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the product page updating method as described in any one of the first aspects is implemented.
[0038] In this embodiment, the unique identifier corresponding to the product of the product page is obtained; the position of the first product on the page is located according to the unique identifier corresponding to the first product, and the upper DOM element is bubbled until the element block of the basic template displaying the product is obtained; the DOM element in the element block is converted into a template string, and the template string is modified into a marked template string according to the information to be updated of the first product; the marked template string is copied to the element block of the basic template displaying other products to be updated to replace its DOM element, and the corresponding marked template string is modified according to the information to be updated of each product to obtain the template string of the product to be updated; the template string of the product to be updated is converted into a DOM element, and the page is rendered. It can adapt to the product information update of different site themes, without the need to develop a set of HTML codes for each platform, which greatly reduces development time and manpower. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A flowchart of a product page updating method provided in Embodiment 1 of the present invention;
[0041] Figure 2 A schematic diagram of the structure of a product page updating device provided in the second embodiment of the present invention;
[0042] Figure 3 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0043] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0044] An independent website is a website that an enterprise or individual builds by purchasing a server and a domain name. In the e-commerce industry, an independent website is your own e-commerce website, which is owned by you and is different from a third-party e-commerce platform. E-commerce service platforms, such as Shopify, Shoplazza, ShopBase, etc., can provide e-commerce sellers with technology and templates for building online stores. Merchants register an account, choose a website template, upload products and add descriptions, set prices and logistics options, and add payment methods. In a short time, a beautiful and reliable independent website can be generated.
[0045] In the cross-border e-commerce industry, optimizers need to adjust the marketing of products on the site page according to the sales situation of the products. By displaying the corresponding products in the browser's unique identifier, the optimization processing efficiency can be improved.
[0046] This can be achieved by developing an APP under the independent station platform, by simply building your own services and scripts, or by using the platform API capabilities to add custom scripts and HTML in the site background. Among these three methods, the third one is the simplest, fastest, and least expensive. However, in actual operation, the site theme styles of each platform are different, which means that a set of HTML code cannot be applied to different sites.
[0047] Embodiment 1
[0048] Figure 1 This is a flowchart of a product page update method provided in the first embodiment of the present invention. The method can be executed by a product page update device. The product page update device can be implemented by software and / or hardware and can be configured in a computer device, such as a server, a personal computer, etc. The method can adapt to the product information update of different site themes without developing a set of HTML codes for each platform, which greatly reduces development time and manpower. The product page update method specifically includes the following steps:
[0049] Step 101: Obtain a unique identifier corresponding to a product on a product page.
[0050] A product page can display several products, including product titles, product prices, jump links, product images, and other information. By obtaining the unique identifier corresponding to the product on the product page, the list information of the products displayed on the product page can be obtained.
[0051] Step 102: locate the position of the first product on the page according to the unique identifier corresponding to the first product, and bubble up the upper DOM element until the element block of the basic template displaying the product is obtained.
[0052] The basic template can display the page content of a product, such as the product title, product price, jump link, product image and other information, which is implemented through HTML code. By updating the relevant information of the basic template, the page content of the corresponding product can be updated and optimized.
[0053] Specifically, the position of the first product on the page is found through the unique identifier corresponding to the first product in the product list information. This position is the approximate position of the first product on the page, not the basic template for displaying the product. It is necessary to continuously bubble up its upper DOM element based on the position of the first product on the page until the element block for displaying the basic template of the product is obtained.
[0054] In one embodiment, step 102 includes:
[0055] Sub-step 1021: locate the position of the first product on the page according to the unique identifier corresponding to the first product, and bubble up the upper DOM element.
[0056] Sub-step 1022: If the number of element blocks of the basic template for displaying products is equal to the number of products displayed on the product page, and the number of upper-level elements is 1, then obtain the element block of the basic template for displaying the first product.
[0057] If the number of element blocks of the basic template for displaying products is equal to the number of products displayed on the product page, and the number of upper-level elements is 1, that is, its parent element is not a root element, then the content below the parent element of the current element is the element block of the basic template for displaying the product.
[0058] Step 103: convert the DOM elements in the element block into a template string, and modify the template string into a marked template string according to the information to be updated of the first product.
[0059] To convert DOM to string, you can use a third-party library. For example, use the method var domStr = $("#").html() provided by jQuery to convert DOM to string.
[0060] After converting the DOM elements in the element block into a template string, the template string is modified into a marked template string according to the information to be updated of the first product. For example, if the information to be updated of the first product includes a product ID and a product name, the corresponding product ID in the template string is replaced with "customid" and the corresponding product name in the template string is replaced with "customname" to obtain a marked template string.
[0061] In addition to the product ID and product name, the information to be updated of the first product may also include one or more of the product title, product price, jump link, and product image, or may only include one or more of the product title, product price, jump link, and product image, depending on the actual situation.
[0062] In one implementation, before step 103, step 102A is further included, searching for element blocks of the basic template that display other commodities that need to be updated according to unique identifiers corresponding to other commodities that need to be updated.
[0063] Step 104: copy the marked template string to the element block of the basic template that displays other products to be updated to replace its DOM element, and modify the corresponding marked template string according to the information to be updated of each product to obtain the template string of the product to be updated.
[0064] For example, if the information of a top product needs to be updated, then the marked template string is copied to the element block of the basic template corresponding to the top product to replace its DOM element, and the corresponding marked template string is modified according to the information obtained from the shopping mall store backend system, that is, the information to be updated of the top product. For example, if the name of a top product needs to be updated to ABC, then the "customname" in the corresponding marked template string is modified to "ABC" to obtain the template string after the updated information of the top product.
[0065] Step 105: Convert the template string of the product to be updated into a DOM element and render the page.
[0066] The template string of the product to be updated can be converted into a DOM element using the html() method of jQuery. After rendering the page, the updated product page can be obtained.
[0067] In this embodiment, the unique identifier corresponding to the product of the product page is obtained; the position of the first product on the page is located according to the unique identifier corresponding to the first product, and the upper DOM element is bubbled until the element block of the basic template displaying the product is obtained; the DOM element in the element block is converted into a template string, and the template string is modified into a marked template string according to the information to be updated of the first product; the marked template string is copied to the element block of the basic template displaying other products to be updated to replace its DOM element, and the corresponding marked template string is modified according to the information to be updated of each product to obtain the template string of the product to be updated; the template string of the product to be updated is converted into a DOM element, and the page is rendered. It can adapt to the product information update of different site themes, without the need to develop a set of HTML codes for each platform, which greatly reduces development time and manpower.
[0068] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0069] Embodiment 2
[0070] Figure 2 This is a schematic diagram of the structure of a product page updating device provided in Embodiment 2 of the present invention. The product page updating device may specifically include the following modules:
[0071] A unique identifier acquisition module 201 is used to acquire a unique identifier corresponding to a product on a product page;
[0072] The first product element block acquisition module 202 is used to locate the position of the first product on the page according to the unique identifier corresponding to the first product, and bubble up the upper DOM element until the element block of the basic template displaying the product is obtained;
[0073] A marked template string determination module 203 is used to convert the DOM element in the element block into a template string, and modify the template string into a marked template string according to the information to be updated of the first product;
[0074] The module 204 for determining the template string of the product to be updated is used to copy the marked template string to the element block of the basic template that displays other products to be updated to replace its DOM element, and modify the corresponding marked template string according to the information to be updated of each product to obtain the template string of the product to be updated;
[0075] The page rendering module 205 is used to convert the template string of the product to be updated into a DOM element and render the page.
[0076] In one implementation, the first commodity element block acquisition module 202 includes:
[0077] The bubbling submodule is used to locate the first product on the page according to the unique identifier corresponding to the first product, and to bubble the upper DOM element;
[0078] The first product element block acquisition submodule is used to acquire the element block of the basic template for displaying the first product if the number of element blocks of the basic template for displaying the products is equal to the number of products displayed on the product page and the number of upper-level elements is 1.
[0079] In one embodiment, the device further comprises:
[0080] The module for obtaining element blocks of other commodities to be updated is used to search for element blocks of the basic templates for displaying other commodities to be updated according to the unique identifiers corresponding to the other commodities to be updated.
[0081] In one implementation, the product information to be updated includes one or more of a product title, a product price, a jump link, and a product picture.
[0082] The product page updating device provided in the embodiment of the present invention can execute the product page updating method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0083] Embodiment 3
[0084] Figure 3 A schematic diagram of the structure of a computer device provided in Embodiment 3 of the present invention. Figure 3 A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 3 The computer device 12 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.
[0085] like Figure 3 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0086] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0087] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0088] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 3 not shown, usually called a "hard drive"). Although Figure 3 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0089] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0090] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the computer device 12, and / or may communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0091] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the commodity page updating method provided in the embodiment of the present invention.
[0092] Embodiment 4
[0093] Embodiment 4 of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned product page update method are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0094] Among them, computer-readable storage media may include, for example, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: 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 this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0095] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for updating a product page, characterized in that: The method comprises the following steps: Get the unique identifier of the product on the product page; Locate the first product on the page based on its unique identifier, and bubble up the upper DOM element until the element block that displays the basic template for the product is obtained; Convert the DOM elements in the element block into a template string, and modify the template string into a marked template string according to the information to be updated of the first product; Copy the marked template string to the element block of the basic template that displays other products to be updated to replace its DOM element, and modify the corresponding marked template string according to the information to be updated of each product to obtain the template string of the product to be updated; Convert the template string of the product to be updated into a DOM element and render the page; The method of locating the position of the first product on the page according to the unique identifier corresponding to the first product and bubbling the upper DOM element until obtaining the element block of the basic template for displaying the product includes: Locate the first product on the page based on its unique identifier and bubble up the upper DOM element; If the number of element blocks of the basic template for displaying products is equal to the number of products displayed on the product page, and the number of upper-level elements is 1, then the element block of the basic template for displaying the first product is obtained.
2. The method according to claim 1, characterized in that: The step of copying the marked template string to the element block of the basic template that displays other products to be updated to replace the DOM element thereof includes the following steps: According to the unique identifiers corresponding to the other products to be updated, the element blocks of the basic templates for displaying the other products to be updated are searched.
3. The method according to any one of claims 1 to 2, characterized in that: The information to be updated of the product includes one or more of the product title, product price, jump link, and product picture.
4. A product page updating device, characterized in that: The device comprises: A unique identifier acquisition module is used to obtain a unique identifier corresponding to a product on a product page; The first product element block acquisition module is used to locate the first product on the page according to the unique identifier corresponding to the first product, and bubble up the upper DOM element until the element block of the basic template displaying the product is obtained; A marked template string determination module, used for converting the DOM element in the element block into a template string, and modifying the template string into a marked template string according to the information to be updated of the first product; The module for determining the template string of the product to be updated is used to copy the marked template string to the element block of the basic template that displays other products to be updated to replace its DOM element, and modify the corresponding marked template string according to the information to be updated of each product to obtain the template string of the product to be updated; The page rendering module is used to convert the template string of the product to be updated into a DOM element and render the page; The first commodity element block acquisition module includes: The bubbling submodule is used to locate the first product on the page according to the unique identifier corresponding to the first product, and to bubble the upper DOM element; The first product element block acquisition submodule is used to acquire the element block of the basic template for displaying the first product if the number of element blocks of the basic template for displaying the products is equal to the number of products displayed on the product page and the number of upper-level elements is 1.
5. The device according to claim 4, characterized in that The device also includes: The module for obtaining element blocks of other commodities to be updated is used to search for element blocks of the basic templates for displaying other commodities to be updated according to the unique identifiers corresponding to the other commodities to be updated.
6. The device according to any one of claims 4 to 5, characterized in that: The information to be updated of the product includes one or more of the product title, product price, jump link, and product picture.
7. A computer device, characterized in that: The computer device comprises: one or more processors; A memory 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 product page updating method according to any one of claims 1 to 3.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the product page updating method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Page processing method and device and storage medium
CN109522018A
Page snapshot display method and device, electronic equipment and storage medium
CN112307384A