CN-121982139-A - Method, apparatus, device and readable medium for data processing
Abstract
Embodiments of the present disclosure provide methods, apparatus, devices, and readable media for data processing. The method includes obtaining content data in a first page, the content data indicating images and/or text arranged in a predetermined order in the first page, traversing the content data in the predetermined order, creating an image object and a rich text editor object, presenting a preview of the content data in a second page based on the created image object, the created rich text editor object, and an order between the image object and the rich text editor object, and transmitting the content data presented in the second page to a server in response to receiving a first instruction. In this way, manual uploading and/or copying of images and/or text in the first page can be avoided, and efficiency is improved. At the same time it is ensured that the order of the images and/or text in the new content data is identical to the order in the original content data.
Inventors
- KE JUNSHENG
Assignees
- 北京沃东天骏信息技术有限公司
- 北京京东世纪贸易有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20241030
Claims (11)
- 1. A method for data processing, comprising: acquiring content data in a first page, wherein the content data indicates images and/or texts which are arranged according to a preset sequence in the first page; traversing the content data in the predetermined order, wherein during the traversing, In response to determining that the currently traversed content data is the image, creating an image object corresponding to the image in a second page, the image object indicating an image path and image attributes of the image; Creating a rich text editor object corresponding to the text in the second page in response to determining that the currently traversed content data is the text; Presenting a preview of the content data in the second page based on the created image object, the created rich text editor object, and an order between the image object and the rich text editor object, and In response to receiving the first instruction, the content data presented in the second page is sent to a server.
- 2. The method of claim 1, wherein obtaining content data in the first page comprises: In response to detecting the second instruction, acquiring a first identification of the first page; Injecting a first script into the first page, causing the first script to acquire the images and/or the text in the first page in the predetermined order based on the first identification to generate the content data, and The content data transmitted by the first script is received.
- 3. The method of claim 1, wherein prior to traversing the content data in the predetermined order, the method further comprises: generating a second identification of the content data; Creating the second page and a link to the second page, and And adding the second identification to a link of the second page.
- 4. A method according to claim 3, wherein traversing the content data in the predetermined order comprises: injecting a second script into the second page in response to determining that the link of the second page satisfies a first predetermined condition during creation of the second page, causing the second script to obtain the content data based on the second identification in the link of the second page in response to the link of the second page satisfying a second predetermined condition, and Traversing the second script through the acquired content data according to the preset sequence.
- 5. The method of claim 4, wherein the first predetermined condition indicates a predetermined link format, and the second predetermined condition indicates that the second identifier is included in a link of the second page and the predetermined link format.
- 6. The method of claim 4, wherein causing the second script to acquire the content data comprises: receiving a request message sent by the second script, the request message indicating the second identifier, and And based on the second identifier, sending the content data corresponding to the second identifier to the second script.
- 7. The method of claim 4, wherein presenting the preview of the content data in the second page comprises: causing the second script to present a preview of the content data in the second page based on the image object, the rich text editor object, and an order between the image object and the rich text editor object.
- 8. An apparatus for data processing, comprising: An acquisition module configured to acquire content data in a first page, the content data indicating images and/or text arranged in a predetermined order in the first page; a creation module configured to traverse the content data in the predetermined order, wherein during the traversing, In response to determining that the currently traversed content data is the image, creating an image object corresponding to the image in a second page, the image object indicating an image path and image attributes of the image; Creating a rich text editor object corresponding to the text in the second page in response to determining that the currently traversed content data is the text; A rendering module configured to render a preview of the content data in the second page based on the created image object, the created rich text editor object, and an order between the image object and the rich text editor object, and And the sending module is configured to send the content data presented in the second page to a server in response to receiving a confirmation instruction.
- 9. An electronic device, comprising: At least one processing unit, and At least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, which when executed by the at least one processing unit, cause the electronic device to perform the method of any one of claims 1 to 7.
- 10. A computer readable storage medium having stored thereon a computer program executable by a processor to implement the method of any of claims 1 to 7.
- 11. A computer program product comprising computer executable instructions which when executed by a processor implement the method of any one of claims 1 to 7.
Description
Method, apparatus, device and readable medium for data processing Technical Field Example embodiments of the present disclosure relate generally to the field of computer technology and, more particularly, relate to methods, apparatuses, devices, and computer-readable storage media for data processing. Background With the development of internet technology, people increasingly make shopping through the internet. In the context of online shopping, the merchandise may be promoted by a promotional document, which typically includes images and/or text. When mature and stable propaganda documents are already provided in some channels, and the same commodity needs to be propaganda by using the same propaganda document in other channels, the images and/or texts in the propaganda document are uploaded and/or copied in sequence in a manual mode, and meanwhile, whether the images and/or texts are wrong or not and whether the sequences are consistent or not is checked in a manual mode, so that the efficiency is low and the errors are easy to occur. Disclosure of Invention In a first aspect of the present disclosure, there is provided a method for data processing, comprising obtaining content data in a first page, the content data indicating images and/or text arranged in a predetermined order in the first page, traversing the content data in the predetermined order, wherein during traversing, in response to determining that the currently traversed content data is an image, creating an image object corresponding to the image in a second page, the image object indicating an image path and image properties of the image, in response to determining that the currently traversed content data is text, creating a text-corresponding rich text editor object in the second page, rendering a preview of the content data in the second page based on the created image object, the created rich text editor object, and an order between the image object and the rich text editor object, and in response to receiving the first instruction, sending the content data rendered in the second page to a server. In a second aspect of the present disclosure, there is provided an apparatus for data processing, comprising an acquisition module configured to acquire content data in a first page, the content data indicating images and/or text arranged in a predetermined order in the first page, a creation module configured to traverse the content data in the predetermined order, wherein during the traversing, in response to determining that the currently traversed content data is an image, an image object corresponding to the image is created in a second page, the image object indicating an image path and an image attribute of the image, in response to determining that the currently traversed content data is text, a text-corresponding rich text editor object is created in the second page, a presentation module configured to present a preview of the content data in the second page based on the created image object, the created rich text editor object, and an order between the image object and the rich text editor object, and a transmission module configured to transmit the content data presented in the second page to a server in response to receiving a confirmation instruction. In a third aspect of the present disclosure, an electronic device is provided. The electronic device comprises at least one processing unit, and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions when executed by the at least one processing unit cause the electronic device to perform the method of the first aspect of the disclosure. In a fourth aspect of the present disclosure, a computer-readable storage medium is provided. The computer readable storage medium has stored thereon a computer program executable by a processor to perform the method according to the first aspect of the present disclosure. In a fifth aspect of the present disclosure, there is provided a computer program product comprising computer executable instructions, wherein the computer executable instructions when executed by a processor implement the method according to the first aspect of the present disclosure. It should be understood that what is described in this summary is not intended to limit the critical or essential features of the embodiments of the disclosure nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following description. Drawings The above and other features, advantages, and aspects of various implementations of the present disclosure will become more apparent hereinafter with reference to the following detailed description in conjunction with the accompanying drawings. In the drawings, wherein like or similar reference numerals denote like or similar elements, in which: FIG. 1 illustrates a schematic diagram of