WO2023030095A1 - 内容处理方法与电子设备 - Google Patents

内容处理方法与电子设备 Download PDF

Info

Publication number
WO2023030095A1
WO2023030095A1 PCT/CN2022/114234 CN2022114234W WO2023030095A1 WO 2023030095 A1 WO2023030095 A1 WO 2023030095A1 CN 2022114234 W CN2022114234 W CN 2022114234W WO 2023030095 A1 WO2023030095 A1 WO 2023030095A1
Authority
WO
WIPO (PCT)
Prior art keywords
content
source code
image slice
code
slice
Prior art date
Application number
PCT/CN2022/114234
Other languages
English (en)
French (fr)
Inventor
车元
Original Assignee
花瓣云科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 花瓣云科技有限公司 filed Critical 花瓣云科技有限公司
Publication of WO2023030095A1 publication Critical patent/WO2023030095A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0482Interaction with lists of selectable items, e.g. menus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Definitions

  • the present application relates to the field of computer technology, in particular to a content processing method and electronic equipment.
  • CP content provider
  • media content such as text, image, audio and video
  • the content created by CP is generally coded by Hyper Text Markup Language (HTML).
  • HTML is an open standard and has no strict requirements on coding style.
  • Each CP can, according to its own technical capabilities and aesthetic standards, Choose different coding styles to achieve the same style effect.
  • the coding style supported by the platform and browser used to display the content may be different from the HTML coding style adopted by the CP; and due to security requirements and other reasons, the HTML elements of the content are usually regularized. Therefore, the content created by the CP When displayed on different platforms, the display effect may be abnormal.
  • the main way for CP to determine the abnormality is to compare the style effects of the same content on different platforms by taking screenshots and comparing them to determine the different style effects, but this method cannot locate the cause of the difference.
  • the present application provides a content processing method and an electronic device, which are used to help CP locate the cause of the difference in content style effect.
  • the embodiment of the present application provides a content processing method, including:
  • the first The rendering result includes a first image slice and a second image slice
  • the second rendering result includes a third image slice and a fourth image slice
  • the first content comparison result includes differences between the first image slice and the third image slice, and the second image slice and the fourth image slice are the same;
  • the content processing method provided by the embodiment of the present application can compare the style effect and source code of the target content on different platforms according to the source code information corresponding to the target content on different platforms, and determine the source code that causes the inconsistent style effect. This method can locate the source code that caused the difference.
  • the first code information is source code information of the original source code of the first target content
  • the second code information is the standardized
  • the source code information of the source code, the standardized source code is obtained by standardizing the original source code.
  • the first code information includes: the original source code of the first target content, or a webpage link corresponding to the original source code of the first target content;
  • the second code information includes the standardized source code of the first target content.
  • the first content comparison result includes: the first rendering result, the second rendering result, and the first image slice and the an indicator icon corresponding to the third image slice;
  • the source code comparison operation for the first image slice and the third image slice is: a click operation for the display area where the first image slice or the third image slice is located, or a click operation for the indication icon.
  • the indication icon can help the user to better identify the difference image slices; and the convenience of the user operation can be improved by providing various ways of implementing the source code comparison operation.
  • the method further includes:
  • the second content comparison result includes the rendering result corresponding to the original source code and the rendering corresponding to the modified standardized source code Comparison between results.
  • the user can modify the standardized source code before publishing the content, thereby reducing the content display difference of the first target content when the content is published on the target platform.
  • the display interface where the second content comparison result is located includes: an automatic correction button for automatically modifying the standardized source code;
  • the code modification operation includes: a code editing operation for the standardized source code in the second content comparison result, and/or a click operation for the automatic correction button.
  • the method before receiving the user's code modification operation, the method further includes: displaying a code modification suggestion of the standardized source code corresponding to the third image slice. This can improve the user's code modification efficiency.
  • the method further includes:
  • a prompt message indicating that the submission is successful is displayed.
  • the first code information is the source code information corresponding to the first target content on the first platform
  • the second code information is the source code information of the first target content Corresponding source code information on the second platform.
  • the first rendering result further includes a fifth image slice, and the fifth image slice is an image slice corresponding to non-text content in the first target content;
  • the first content comparison result includes a correspondence between the first image slice and the third image slice, and a correspondence between the second image slice and the fourth image slice;
  • the image slice corresponding to the fifth image slice is not included in the first content comparison result.
  • the comparison is performed on the image slices corresponding to the text content, and the comparison is not performed on the image slices corresponding to the non-text content, which can improve the accuracy of the comparison result.
  • the difference code elements between the source code corresponding to the first image slice and the source code corresponding to the third image slice are highlighted in the source code comparison result. In this way, the cause of the difference can be located more precisely, and the user can easily identify the difference code elements.
  • the generating and displaying the first content comparison result includes:
  • the image slices of the first rendering result corresponding to each group are compared with the image slices of the second rendering result respectively, and a first content comparison result is generated and displayed.
  • performing comparison on image slices can improve comparison efficiency, and can facilitate subsequent and more accurate positioning of the cause of the difference in style effect.
  • the method further includes:
  • the rendering engine of the first browser to render the target source code
  • obtaining a third rendering result and calling the rendering engine of the second browser to render the target source code
  • the code is rendered to obtain a fourth rendering result
  • the target source code is obtained according to the source code information of the second target content
  • the third rendering result includes a sixth image slice and a seventh image slice
  • the The fourth rendering result includes an eighth image slice and a ninth image slice
  • the third content comparison result includes differences between the sixth image slice and the eighth image slice, and the seventh image slice and the ninth image slice are the same;
  • the style effects of the target content on different browsers can be compared, and the source code of the target content can be analyzed to help users locate the source code that causes inconsistent style effects.
  • a difference code element in the target source code that causes a difference between the sixth image slice and the eighth image slice is highlighted in the source code analysis result.
  • the difference code elements that cause inconsistent style effects can be determined, which can help users understand the differences in the processing of HTML elements by browsers, so that users can try not to use HTML elements that are not supported by browsers when creating content. , to reduce the content display differences when the content is displayed on different browsers.
  • the embodiment of the present application provides a content processing method, the method includes:
  • the first device displays a first content input interface
  • the first device receives source code information of the first target content input by the user and a first content comparison operation for the first target content;
  • the first device sends the source code information of the first target content and a content comparison request to the second device;
  • the second device determines the first source code and the second source code of the first target content according to the source code information
  • the second device performs page rendering according to the first source code to obtain a first rendering result, and performs page rendering according to the second source code to obtain a second rendering result;
  • the first rendering result includes a first image slice and a second image slice, the second rendering result includes a third image slice and a fourth image slice;
  • the second device generates and returns a first content comparison result to the first device;
  • the first content comparison result includes differences between the first image slice and the third image slice, and the second image slice and the fourth image slice are the same;
  • the first device displays the first content comparison result
  • the first device receives a user's source code comparison operation for the first image slice and the third image slice, and sends a source code comparison request for the first image slice and the third image slice to the second device;
  • the second device generates and returns a source code comparison result of the first image slice and the third image slice to the first device;
  • the first device displays a source code comparison result of the first image slice and the third image slice.
  • the first source code is source code information of the original source code of the first target content
  • the first source code is the source code information of the second device according to the first
  • the source code information of the target content is obtained
  • the second source code is the standardized source code of the first target content
  • the standardized source code is obtained after the second device standardizes the original source code.
  • the source code information includes: the original source code of the first target content, or a web page link corresponding to the original source code of the first target content.
  • the first content comparison result includes: the first rendering result, the second rendering result, and the first image slice and the an indicator icon corresponding to the third image slice;
  • the source code comparison operation for the first image slice and the third image slice is: a click operation for the display area where the first image slice or the third image slice is located, or a click operation for the indication icon.
  • the method further includes:
  • the first device receives the user's code modification operation, modifies the standardized source code, and sends the code modification result to the second device;
  • the second device returns the second content comparison result to the first device;
  • the second content comparison result includes a comparison result between the rendering result corresponding to the original source code and the rendering result corresponding to the modified standardized source code ;
  • the first device displays the second content comparison result.
  • the display interface where the second content comparison result is located includes: an automatic correction button for automatically modifying the standardized source code;
  • the code modification operation includes: a code editing operation for the standardized source code in the second content comparison result, and/or a click operation for the automatic correction button.
  • the method before the CP receives the user's code modification operation, the method further includes:
  • the second device generates and returns to the first device a code modification suggestion of the standardized source code corresponding to the third image slice;
  • the first device displays the code modification suggestion.
  • the method further includes:
  • the first device receives a user's content release operation, and sends a content release request to the second device;
  • the second device returns a response message to the first device
  • the first device displays a prompt message that the submission is successful.
  • the source code information includes: source code information corresponding to the first target content on the first platform and the second platform, and the first source code is the The source code corresponding to the first platform, the second source code is the source code corresponding to the second platform.
  • the first rendering result further includes a fifth image slice, and the fifth image slice is an image slice corresponding to non-text content in the first target content;
  • the first content comparison result includes a correspondence between the first image slice and the third image slice, and a correspondence between the second image slice and the fourth image slice;
  • the image slice corresponding to the fifth image slice is not included in the first content comparison result.
  • the difference code elements between the source code corresponding to the first image slice and the source code corresponding to the third image slice are highlighted in the source code comparison result.
  • generating the first content comparison result includes:
  • the image slices of the first rendering result corresponding to each group are compared with the image slices of the second rendering result to generate a first content comparison result.
  • the method further includes:
  • the first device displays a second content input interface
  • the first device receives the source code information of the second target content input by the user, and the user's selection operation on the first browser and the second browser;
  • the first device receives the user's content comparison operation on the second target content, and sends a content comparison request corresponding to the second target content to the second device, and the content comparison request carries the source of the second target content code information;
  • the second device After the second device obtains the target source code according to the source code information of the third target content, it invokes the rendering engine of the first browser to render the target source code, obtains a third rendering result, and invokes the second browser
  • the rendering engine renders the target source code to obtain a fourth rendering result;
  • the third rendering result includes a sixth image slice and a seventh image slice, and the fourth rendering result includes an eighth image slice and a ninth image slice;
  • the second device generates and returns a third content comparison result to the first device;
  • the third content comparison result includes differences between the sixth image slice and the eighth image slice, and the seventh image slice and the ninth image slice are the same;
  • the first device displays the third content comparison result
  • the first device receives a user's source code analysis operation for the sixth image slice and the eighth image slice, and sends a source code analysis request for the sixth image slice and the eighth image slice to the second device;
  • the second device generates and returns the source code analysis results of the sixth image slice and the eighth image slice to the first device;
  • the first device displays source code analysis results of the sixth image slice and the eighth image slice.
  • a difference code element in the target source code that causes a difference between the sixth image slice and the eighth image slice is highlighted in the source code analysis result.
  • an embodiment of the present application provides an electronic device, including: a memory and a processor, the memory is used to store a computer program; the processor is used to execute the method described in the first aspect above, or the second A method performed by the first device or the second device in the aspect.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the method described in the first aspect or any implementation manner of the first aspect is implemented.
  • the embodiment of the present application provides a computer program product.
  • the computer program product runs on the electronic device
  • the electronic device executes the method described in the first aspect above, or the first device or the second device in the second aspect above 2. The method performed by the device.
  • an embodiment of the present application provides a chip system, including a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the method described in the first aspect above, or The method performed by the first device or the second device in the second aspect above.
  • the chip system may be a single chip, or a chip module composed of multiple chips.
  • FIG. 1 is a schematic structural diagram of a content processing system provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of the content creation interface provided by the embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a content processing method provided by an embodiment of the present application.
  • FIG. 4 is a schematic interface diagram of the content input process provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of the original content style provided by the embodiment of the present application.
  • FIG. 6 is a schematic diagram of the code segmentation results provided by the embodiment of the present application.
  • FIG. 7 is a schematic interface diagram of the content comparison process provided by the embodiment of the present application.
  • FIG. 8 is a schematic flow chart of the content comparison process provided by the embodiment of the present application.
  • FIG. 9 is a schematic diagram of image segmentation results provided by the embodiment of the present application.
  • FIG. 10 is a schematic diagram of the establishment process of the image slice matching relationship provided by the embodiment of the present application.
  • FIG. 11 is a schematic diagram of code segmentation results provided by the embodiment of the present application.
  • Fig. 12 is a schematic diagram of image comparison results provided by the embodiment of the present application.
  • FIG. 13 is a schematic flowchart of another content processing method provided by the embodiment of the present application.
  • FIG. 14 is a schematic interface diagram of the platform content comparison process provided by the embodiment of the present application.
  • FIG. 15 is a schematic flowchart of another content processing method provided by the embodiment of the present application.
  • FIG. 16 is a schematic interface diagram of the browser content comparison process provided by the embodiment of the present application.
  • FIG. 17 is a schematic structural diagram of a content processing device provided by an embodiment of the present application.
  • FIG. 18 is a schematic structural diagram of a CP device provided in an embodiment of the present application.
  • FIG. 19 is a schematic structural diagram of a server provided by an embodiment of the present application.
  • Figure 1 is a schematic structural diagram of the content processing system provided by the embodiment of the application, as shown in Figure 1, the content processing system provided by this embodiment may include: CP equipment 100.
  • the CP device 100 may be an electronic device with processing and display functions, such as a notebook computer, a desktop computer, or a tablet computer.
  • a desktop computer is taken as an example for illustration.
  • the content service platform 200 can be deployed on one or more servers.
  • the terminal device 300 may be a display device such as a mobile phone, a tablet computer, a notebook computer, or a desktop computer.
  • a mobile phone is taken as an example for illustration.
  • the content service platform 200 can provide an account authentication function.
  • a user ie CP
  • the content service platform 200 can provide users with content services such as content creation, content management, and content distribution.
  • the CP can create, publish, and manage content on the content service platform 200 through the CP device 100, and check the content distribution effect.
  • the content service platform 200 can review the content to be released before publishing the content, and distribute the content to the terminal device 300 after the review is passed; end users can view the content on the terminal device 300 Content distributed by the content service platform 200 .
  • the content release modules used to implement the content release in the content service platform 200 may all be deployed in the same server, or may be deployed on different servers after their functions are split.
  • the content review function can be deployed in the first server
  • the content distribution function of the content release module can be deployed in the second server; after receiving the content release request from the CP device, the first server can review the content to be released, After passing the review, the content can be sent to the second server, and the second server can distribute the content to the terminal device 300 according to the preference of the terminal user.
  • FIG. 2 exemplarily shows a schematic view of the content creation interface.
  • the user can access the content service platform 200 on the CP device 100, open the platform page, and select the "Creation” menu under the navigation menu 11 of the platform page.
  • the "Article” option opens Content Editor 12.
  • the content editor 12 may include a function menu bar 121 , an editing control bar 122 and a content editing area 123 .
  • the function menu bar 121 may include: a "Publish” button, a "Republish” button, a “Save” button, a "Preview” button, and the like.
  • Editing control bar 122 may include: undo input control, restore input control, font editing control (here exemplarily shows bold, italic and underline controls), paragraph setting control (here exemplarily shows left alignment, centering, right alignment, and both ends alignment controls) and other functional controls (the import link control 1221 and the content comparison control 1222 are exemplarily shown here) and the like.
  • the content editing area 123 is used for inputting content. When the user just opens the content editor 12, prompt information can be displayed in the content editing area 123.
  • exemplary prompt information includes: "Please enter the title" and "Please enter the text”.
  • the user can combine the controls in the editing control bar 122 to edit the title and text of the content in the content editing area 123, and then click the "publish” button in the function menu bar 121 to publish the content, or click "preview” before publishing the content
  • the button preview content shows the result.
  • the user can also save the edited content as a draft through the "Save” button, and then can view and re-edit the draft through the "Management” menu in the navigation menu 11 . Users can also view and re-edit published content through the "Administration" menu, and republish content through the "Republish” button.
  • the CP can also synchronize the created content to the content service platform 200 through the CP device 100 for publishing or management.
  • the contents synchronized by CP include but are not limited to those published on its own website, published on other platforms and offline documents.
  • the ways for the CP to synchronize content with the content service platform 200 may include but not limited to the following ways:
  • Method 1 copying content and posting it to the content service platform 200 .
  • the user can open the content editor 12 of the content service platform 200 on the CP device 100, copy the created content to the content editing area 123, and then click the "publish" button in the function menu bar 121, to synchronize the content to the content service platform 200 .
  • the display result and the HTML source code (hereinafter referred to as the source code) of the content can be copied; after the user copies the content into the content editing area 123, the CP device 100 can obtain the content according to the user's input operation
  • the display result and source code of the content are displayed in the content editing area 123, and the source code of the content is synchronized to the content service platform 200.
  • Method 2 The import link is synchronized by the content service platform 200 .
  • the user can import the uniform resource locator (uniform resource locator, URL) link of the created content through the import link control 1221 in the edit control column 122, and send the URL link of the content to the content service platform 200,
  • the content service platform 200 can access the link to obtain the source code of the content.
  • Method 3 push the content to the content service platform 200 through the interface.
  • the user can set the interface address of the content service platform 200 for receiving content on the server providing the content (herein referred to as the content server), and the content server can actively push content to the content service platform 200 in batches through the interface address.
  • the user can also set the interface address of the content server for pushing content on the content service platform 200 through the CP device 100, so that the content service platform 200 saves the interface address as a trusted address, and establishes an association between the interface address and the user account.
  • Method 4 Provide an interface and the content service platform 200 pulls the content.
  • the user can set the interface address of the content server for providing content on the content service platform 200 through the CP device 100, and the content service platform 200 can actively pull content from the content server in batches through this interface, that is, content service
  • the platform 200 can actively send a content acquisition request to the content server, and the content server can send the content to the content service platform 200 after receiving the content acquisition request.
  • the user can also set the interface address of the content service platform 200 for pulling content on the content server, so that the content service platform 200 saves the interface address as a trusted address.
  • the content service platform 200 can, according to the coding style and security requirements supported by itself, perform the HTML source code (herein referred to as the original content) corresponding to the CP-synchronized content (herein referred to as Original source code) is standardized, saved as standardized source code, and then the standardized content corresponding to the standardized source code is published.
  • HTML source code herein referred to as the original content
  • Original source code CP-synchronized content
  • the content service platform 200 can also provide a content comparison function. Before synchronizing the content to the content service platform 200, the CP can use the content comparison function to compare the original content with the corresponding The style effect of the standardized content; if the style effect of the original content is inconsistent with the style effect of the corresponding standardized content, the CP can further compare the source code of the original content (that is, the original source code) with the source code of the standardized content (that is, the standardized content) through the content comparison function.
  • the modified source code ( Herein referred to as the target source code) is synchronized to the content service platform 200.
  • the content editor 12 may provide a content comparison control 1222 , and the CP may use the content comparison function provided by the content service platform 200 by clicking this control before synchronizing content.
  • the CP can also use the content comparison function to compare the content after synchronizing the content, and then republish the content through the “Republish” button in the content editor 12 after modifying the source code.
  • the CP uses the above method 1 or method 2 to synchronize content, it can use the content comparison function to perform content comparison before synchronizing the content, and then synchronize the content to the content service platform 200 .
  • the CP uses the above method 3 or method 4 to synchronize content, after the content synchronization is completed, you can view and re-edit the synchronized content through the "Management" menu.
  • When re-editing the synchronized content use the content comparison function to compare the content. Then the content is synchronized to the content service platform 200 .
  • the content service platform 200 can also provide a content automatic correction function.
  • the CP can modify the standardized source code through the content automatic correction function.
  • the content comparison function provided by the content service platform 200 can also support the CP to compare any two content styles.
  • the CP can use the content comparison function to compare the style effects and source codes of the same content on different platforms to determine whether different platforms have different HTML elements. Cleaning rules to identify HTML elements that may affect the style effect (i.e. differential code elements) that are not supported by each platform, so that when CP creates content in the future, it can try not to use differential code elements that are not supported by the platform based on the identification results, so as to Reduce the difference in content display effect when content is published on different platforms.
  • style effect i.e. differential code elements
  • CP can also use the content comparison function to compare the style effect of the same content displayed on different browsers, and locate the HTML element that causes the difference (that is, the difference code element), and identify the difference in the processing of HTML elements by different browsers.
  • the difference code element that causes the difference
  • Part or all of the content processing process of the above content comparison function and content automatic correction function can be executed on the content service platform 200 , and various processing results generated during the content processing process can be displayed on the CP device 100 .
  • the content service platform 200 may include a content creation module, a content release module, a content management module, a content comparison module, and a content automatic correction module for realizing the above-mentioned content services, wherein the content release module and the content management module Part of the functions, the content creation module, the content comparison module and the content automatic correction module can be integrated in the system of the CP device or integrated in a certain application program (herein referred to as the target application program).
  • the target application program Taking the application program as an example, the user can perform content comparison, content correction and content creation through the target application program on the CP device; after the user creates or corrects the content, he can publish the content through the target application program.
  • the content to be published can be sent to the content service platform 200, and then the content service platform 200 distributes the content; the target application program can also obtain the content distribution result from the content service platform 200, and the user can check the content distribution effect on the target application program, and Content management is possible.
  • most of the content processing processes are executed on the content service platform 200 as an example for illustration.
  • FIG. 3 is a schematic flowchart of a content processing method provided in the embodiment of the present application. As shown in FIG. 3, the method may include the following steps:
  • the CP device receives a user's content input operation, and sends source code information of the target content to the content service platform.
  • users can use the content comparison function provided by the content service platform to perform content comparison before synchronizing content with the content service platform.
  • the user can input content by copying content or importing a link, that is, the user's content input operation can be the operation of copying the target content to the content editing area 123, or importing the corresponding content of the target content.
  • the source code information of the target content may be the source code of the target content or the URL link corresponding to the target content.
  • the following uses importing a URL link as an example for illustrative description.
  • Fig. 4 exemplarily shows the process of inputting content by importing links.
  • the exemplary URL here is: http://abc.com; after the user enters the URL and clicks the "OK" button in the dialog box 20, the CP device can set The link (that is, the source code information of the target content) is sent to the content service platform.
  • the user can also cancel the import of the URL by clicking the “Cancel” button in the dialog box 20 .
  • click operations in the embodiments of the present application may also be implemented through voice input operations.
  • the click operation is taken as an example in this embodiment for illustration.
  • the content service platform obtains the original source code of the target content according to the source code information of the target content, identifies the source code corresponding to the text content and the source code corresponding to the redundant content in the original source code of the target content, and identifies the source code corresponding to the text content
  • the code is standardized to obtain standardized source code.
  • the content service platform After the content service platform receives the source code information of the target content sent by the CP device (that is, the above URL link), it can access the link to obtain the source code of the target content (herein referred to as the original source code).
  • the content uploaded by the user to the content service platform through the CP device may not meet the requirements of the content service platform.
  • the content service platform After the content service platform obtains the target content, it can standardize the original source code of the target content according to the coding style and security requirements supported by itself. , to improve the consistency and security of data in the content service platform.
  • the redundant content in the target content other than the text content may affect the style comparison, in order to improve the accuracy of the content comparison results
  • the redundant content in the original source code of the target content can be removed first, and then the source code corresponding to the text content can be standardized, which can also improve the standardization processing efficiency.
  • the content service platform may use a web page text extraction algorithm to identify the source code corresponding to the text content and the source code corresponding to the redundant content in the original source code of the target content.
  • the web page text extraction algorithm can be, for example, a web page text extraction algorithm based on text density. This algorithm is based on the principle that there are more texts and symbols in the text content and fewer texts and symbols in the redundant content. , text and pictures are used as nodes, calculate the text density and symbol density of each node, and then determine whether each node belongs to the text content or redundant content according to the text density and symbol density of each node.
  • webpage text extraction algorithm adopted by the content service platform is not limited to the aforementioned webpage text extraction algorithm based on text density, and other webpage text extraction algorithms can also be used, which is not particularly limited in this embodiment.
  • redundant content may include floating window advertisements, related reading, left navigation bar, right navigation bar, and bottom navigation bar, etc.
  • the display effect of these contents is usually dynamic and variable, which may affect the subsequent content comparison. compare results.
  • the content service platform can segment the original source code of the target content, and after determining the node corresponding to the main text content (here referred to as the text node) and the node corresponding to the redundant content (here referred to as the redundant node), it can Mark the paragraphs where the text nodes are located as text paragraphs, and mark the paragraphs where redundant nodes are located as redundant paragraphs.
  • the image content can be identified according to the img tag
  • the text segment can be identified according to the tags used to identify paragraphs such as p tag and section tag, and then each text segment and image can be regarded as a paragraph respectively.
  • the target content is the content corresponding to http://abc.com
  • the display result of the original source code of the target content (here referred to as the original content style) is shown in Figure 5, the target content
  • the original source code is:
  • the original source code of the target content can be divided into 6 paragraphs, among which, paragraph 11 corresponds to "title”, and its source code includes: “ ⁇ h1>title ⁇ /h1>".
  • Paragraph 12 corresponds to "AAAAAAAAAAAAA”
  • Paragraph 13 corresponds to "BBBBBB”
  • Paragraph 15 corresponds to "CCCCCCCCCCC”
  • the content service platform can standardize the paragraphs marked as body content, specifically, it can delete or replace non-compliant HTML elements (that is, HTML elements not supported by the content service platform).
  • class in the above original source code is used to indicate the style of the label div, which is customized by other browsers/platforms; paragraph 4 is a redundant paragraph, and there is also label b, which do not meet the specifications of the content service platform.
  • the obtained standardized source code is:
  • the content service platform After the content service platform obtains the standardized source code, it can also segment the standardized source code, and then establish the corresponding relationship between the segmentation results of the original source code and the segmentation results of the standardized source code for use in subsequent content comparisons.
  • the standardized source code when segmenting, it can be segmented in a manner similar to that of the original source code.
  • the standardized source code is obtained based on the original source code, in this embodiment, it can also be determined directly based on the segmentation result of the original source code.
  • the segmentation result of the standardized source code means that the paragraphs obtained after the paragraphs in the original source code have been standardized are treated as a paragraph of the standardized source code; at the same time, based on this principle, the content service platform can also obtain the segmentation results of the original source code and Correspondence between segmentation results of normalized source code.
  • paragraph 21 corresponds to paragraph 11
  • its source code includes: " ⁇ h1>Title ⁇ /h1>”.
  • Paragraph 22 corresponds to paragraph 12
  • its source code includes: " ⁇ p>AAAAAAAAAAAA ⁇ /p>”.
  • Paragraph 23 corresponds to paragraph 13
  • its source code includes: " ⁇ p>BBBBBB ⁇ /p>”.
  • Paragraph 24 corresponds to paragraph 15, and its source code includes: " ⁇ p>CCCCCCCCCCC ⁇ /p>".
  • the content service platform returns the standardized source code of the target content to the CP device.
  • the content service platform After the content service platform standardizes the original source code of the target content, it can send the obtained standardized source code to the CP device.
  • the CP device displays standardized content corresponding to the standardized source code.
  • the CP device After the CP device receives the standardized source code sent by the content service platform, it can load and render the standardized source code, and display the style effect of the corresponding standardized content in the content editing area 123 (here called Normalized Content Styles).
  • the CP device receives the user's content comparison operation, and sends a content comparison request to the content service platform.
  • the text content "BBBBBB” in the original source code of the target content uses the label b to realize the bold display effect. Since the content service platform does not support the label b, after standardizing the original source code of the target content , the label b corresponding to the text content "BBBBBB” in the standardized source code is deleted, as shown in (c) in Figure 4, "BBBBBB” in the standardized content has no bold display effect.
  • users can use the content comparison function provided by the content service platform to compare the style effect of the target content and the corresponding standardized content, and determine the differences that cause the inconsistent style effect.
  • FIG. 7 exemplarily shows a schematic interface diagram of the content comparison process.
  • the user can click the content comparison control 1222 to perform content comparison.
  • the CP device may send a content comparison request to the content service platform, requesting the content service platform to perform content comparison.
  • the content comparison request may carry the identifier of the target content, so that the content service platform can determine the target content.
  • the content service platform loads and renders the original source code and the standardized source code, and compares the first rendering result corresponding to the original source code with the second rendering result corresponding to the standardized source code to generate the first content compare results.
  • the content service platform can determine the target content to be compared according to the identifier carried in the content comparison request, and then extract the original source code and standardized source code of the target content for content comparison.
  • the content service platform can use the same rendering engine to load the original source code and standardized source code of the rendering target content, so as to compare the rendering result corresponding to the original source code (herein referred to as the first rendering result) and the rendering result corresponding to the standardized source code. result (referred to here as the second rendering result).
  • HTML elements supported by the content service platform are different from those supported by other platforms/browsers, in this embodiment, in order to improve the accuracy of the comparison results, different rendering engines can be used to load the original source code and Standardize source code.
  • the original source code of the target content can be rendered by the rendering engine of a highly compatible browser (herein referred to as the first browser), and the standardized source code can be rendered by the browser adopted by the content service platform (herein referred to as the first browser).
  • Two browsers) rendering engine rendering Two browsers rendering engine rendering.
  • the content service platform may compare the two rendering results to determine whether there is a difference between the first rendering result and the second rendering result.
  • both the first rendering result and the second rendering result may be in image format, and the content service platform may perform an image comparison between the first rendering result and the second rendering result to determine whether there is a difference between the two screenshots.
  • the content service platform can compare the first rendering result and the second rendering result after slicing, see FIG. 8 , which is the flow of the content comparison process provided by the embodiment of the present application Schematic diagram, as shown in Figure 8, the content comparison process may include the following steps:
  • the content service platform can use a related image segmentation algorithm to perform image segmentation on the two generated images, where the image segmentation algorithm can be a threshold-based segmentation algorithm, a region-based segmentation algorithm, or an edge-based segmentation algorithm, etc.
  • the image segmentation algorithm can be a threshold-based segmentation algorithm, a region-based segmentation algorithm, or an edge-based segmentation algorithm, etc.
  • the embodiment does not specifically limit this.
  • Fig. 9 exemplarily shows the image segmentation result, as shown in (a) in Fig. 9, the original content style (ie the first rendering result) shown in Fig. 5, after image segmentation, six first Image slices: image slice 11 to image slice 16 .
  • the standardized content style shown in FIG. 4 can obtain five second image slices after image segmentation: image slice 21 - image slice 25 .
  • the first image slice and the second image slice are obtained, they can be matched and compared for image comparison.
  • the first image slice may include a slice corresponding to redundant content (that is, a redundant image slice).
  • the redundant image slice in the first image slice may be removed first.
  • an image recognition algorithm based on computer vision can be used to identify redundant image slices in the first image slice, and then an image comparison technique can be used to compare the first image slice and the second image slice to establish A matching relationship (or a corresponding relationship) between the first image slice and the second image slice.
  • redundant image slices in the first image slice may also be determined based on the original source code and the standardized source code of the target content, and a link between the first image slice and the second image slice may be established. matching relationship.
  • Fig. 10 is a schematic diagram of the process of establishing the image slice matching relationship provided by the embodiment of the present application. As shown in Fig. 10, the process may include the following steps:
  • the content service platform may perform code segmentation on the original source code according to the segmentation result of the original source code determined in step S102, perform code segmentation on the standardized source code according to the segmentation result of the standardized source code, and divide the Each paragraph acts as a code slice.
  • Figure 11 exemplarily shows the result of code segmentation, as shown in (a) in Figure 11, the exemplary original source code in step S102, after code segmentation, can obtain 6 first code slices: code slice 31 (corresponding to paragraph 11), code slice 32 (corresponding to paragraph 12), code slice 33 (corresponding to paragraph 13), code slice 34 (corresponding to paragraph 14), code slice 35 (corresponding to paragraph 15), code slice 36 (corresponding to paragraph 16) .
  • the exemplary standardized source code in step S102, after code segmentation can obtain 5 second code slices: code slice 41 (corresponding to paragraph 21), code slice 42 (corresponding to paragraph 22), code slice 43 (corresponding to paragraph 23), code slice 44 (corresponding to paragraph 24), code slice 45 (corresponding to paragraph 25).
  • S1062b Determine a redundant code slice and a text code slice in the first code slice according to the source code corresponding to the redundant content, and establish a correspondence between the text code slice and the second code slice in the first code slice.
  • the paragraph where the source code corresponding to the redundant content is located is a redundant paragraph, and according to the code slice corresponding to the redundant paragraph, the redundant code slice in the first code slice can be determined.
  • the redundant paragraph 14 in FIG. 6 corresponds to the code slice 34 in FIG. 11 , and the code slice 34 is the redundant code slice in the first code slice.
  • the corresponding relationship between the segmentation result of the original source code and the segmentation result of the standardized source code established in step S102 the corresponding relationship between the segmentation result of the original source code and the first code slice, the standardized source code
  • the corresponding relationship between the segmentation result of the segment and the second code slice can be used to obtain the corresponding relationship between the text code slice and the second code slice in the first code slice.
  • code slice 31 corresponds to code slice 41
  • code slice 32 corresponds to code slice 42
  • code slice 33 corresponds to code slice 43
  • code slice 35 corresponds to code slice 44
  • code slice 36 corresponds to code slice 45 .
  • the content service platform may establish an association relationship between the first image slice and the first code slice according to the sequence between the first code slices and the sequence between the first image slices (that is, the first image slice and the first code slice). a relationship).
  • the horizontally distributed image slices can be converted into vertically distributed images from top to bottom in order from left to right slice.
  • the first association relationship can be obtained: the image slice 11 (the first image slice) is associated with the code slice 31 (the first code slice), the image slice 12 is associated with the code slice 32, Image slice 13 is associated with code slice 33 , image slice 14 is associated with code slice 34 , image slice 15 is associated with code slice 35 , and image slice 16 is associated with code slice 36 .
  • the initial association result may be verified to obtain the final first association relationship.
  • the first image slice and the first code slice can be divided into two types: text slice and picture slice.
  • image text recognition technology such as optical character recognition (OCR) technology
  • OCR optical character recognition
  • the text slice and the picture slice in the first image slice are determined according to the text recognition result
  • the picture slice and the text slice in the first code slice are identified according to HTML tags and code text recognition technology.
  • image slice 11 image slice 12, image slice 13, and image slice 15 are text slices
  • image slice 16 is a picture slice
  • the code Slice 31 , code slice 32 , code slice 33 and code slice 35 are text slices
  • code slice 36 is a picture slice.
  • the algorithm determines the image similarity between the first image slice and the first code slice, and determines that the first image slice is associated with the first code slice when the image similarity reaches a second preset threshold.
  • the second association relationship can be obtained: the image slice 21 (the second image slice) is associated with the code slice 41 (the second code slice), the image slice 22 is associated with the code slice 42, and the image slice 23 is associated with the code slice 43, the image slice 24 is associated with the code slice 44, and the image slice 25 is associated with the code slice 45.
  • the redundant image slices in the first association relationship are removed first, and the redundant image slices are is the first image slice corresponding to the redundant code slice.
  • the code slice 34 in FIG. 11 is a redundant code slice in the first code slice; as described in step S1062c, the first image slice associated with the code slice 34 is the image slice 14 in FIG. 9 , then The image slice 14 is a redundant image slice.
  • the redundant image slices are removed, according to the correspondence between the text code slices and the second code slices in the first code slices, the first association relationship between the first image slices and the first code slices, and the second image slices
  • the second association relationship with the second code slice can determine the matching relationship between the first image slice and the second image slice.
  • the code slice 31 corresponds to the code slice 41 (the second code slice); see step S1062c, the code slice 31 and the image slice 11 (the first image slice), and the code slice 41 is associated with the image slice 21 (the second image slice), as shown in FIG. 12 , it can be obtained that the image slice 11 matches the image slice 21.
  • image slice 12 matches image slice 22
  • image slice 13 matches image slice 23
  • image slice 15 matches image slice 24
  • image slice 16 matches image slice 25 .
  • the image slice 14 is a redundant image slice and does not participate in image comparison.
  • an image comparison algorithm can be used to determine the first image slice and the image similarity between the second image slice, and then determine the image comparison result of the pair of image slices according to the relationship between the image similarity and a preset similarity threshold (herein referred to as the third preset threshold). For example, when the image similarity is greater than or equal to a third preset threshold, it can be considered that the style of the first image slice is consistent with the matching second image slice; when the image similarity is less than the third preset threshold, it can be It is considered that there is a difference in style between the first image slice and the matched second image slice.
  • the image comparison results of the first image slice and the second image slice are: the style of image slice 11 is consistent with that of image slice 21, the style of image slice 12 is consistent with that of image slice 22, and the style of image slice 13 and image slice 23 exists The difference is that image slice 15 has the same style as image slice 24, and image slice 16 has the same style as image slice 25.
  • the content service platform can superimpose the first rendering result, the second rendering result and the image comparison result to generate a content comparison result (herein referred to as the first content comparison result) .
  • the content comparison result may include image slices with different style effects between the first rendering result and the second rendering result, or may include image slices with the same style effect between the first rendering result and the second rendering result.
  • the first content comparison result may include a first rendering result and a second rendering result, wherein the first rendering result and the second rendering result may be arranged horizontally for easy comparison, and images with differences in the image comparison results Slices (referred to here as differential rendering results) can be indicated by icons.
  • the first content comparison result may include a corresponding relationship (that is, a matching relationship) between image slices, for example, a rectangular frame may be displayed around the corresponding first image slice and the second image slice, so that the corresponding first image slice An image slice and a second image slice are located in the same rectangular frame; it is also possible to highlight the image slice and the image slice corresponding to the image slice when the mouse moves to the area where a certain image slice is located or the corresponding icon position, wherein the highlighted
  • the display method can be a floating display method or a preset fill color displayed in the image slice, etc.
  • the content service platform may render the first content comparison result, and then send it to the CP device for display for the user to view.
  • the content service platform returns the first content comparison result to the CP device.
  • the CP device displays the first content comparison result.
  • the CP device may display the first content comparison result in a pop-up content comparison pop-up window 30 .
  • the original content style is arranged on the left side of the content comparison pop-up window 30
  • the standardized content style is arranged on the right side of the content comparison pop-up window 30, and the image corresponding to "BBBBBB" in the image comparison result
  • the image corresponding to "BBBBBB” in the image comparison result There is a difference between the slices (the image slice 13 and the image slice 23 ), and the rendering result of the difference is indicated by the icon 31 located in the area where the image slice 13 is located.
  • FIG. 7 only shows one difference rendering result as an example, and the first content comparison result may also include multiple difference rendering results, and each difference rendering result can be displayed through the corresponding icon 31. instruct.
  • FIG. 7 is only an example showing the arrangement of the first rendering result and the second rendering result in the first content comparison result, and the indication method adopted for the difference rendering results in the image comparison result, which is not intended to In order to limit the present application, the embodiment of the present application does not specifically limit the specific display style of the first content comparison result.
  • a scroll bar can be added in the display area of the original content style and the standardized content style, wherein a scroll bar can be displayed in the display area of the original content style and the display area of the standardized content style; for It is more convenient for users to view the content comparison results.
  • the CP device can also display a linked scroll bar 32 in the display area between the original content style and the standardized content style, that is, by sliding the scroll bar , the original content style and the standardized content style displayed in the content comparison pop-up window 30 can be controlled at the same time.
  • the first content comparison result may also include the correspondence between image slices, and the user may move the mouse to the area where the image slices are located to view the correspondence between image slices.
  • the CP device may float and display the first image slice and its corresponding second image slice.
  • the CP device receives the user's source code comparison operation on the target difference rendering result in the first content comparison result, and sends a source code comparison request to the content service platform.
  • the style effect of "BBBBBB” in the target content is inconsistent with the style effect of the corresponding standardized content.
  • Users can compare the source code through the source code comparison function in the content comparison function to check the inconsistency. s reason.
  • the source code comparison operation for the user to trigger the source code comparison function may be the operation of clicking the icon 31 , or the operation of clicking the area where the target difference rendering result is located as shown in (c) of FIG. 7 .
  • the first content comparison result may also include the correspondence between image slices
  • the CP device may also display the correspondence between image slices according to the position of the mouse relation. For example, as shown in (c) of FIG. 7 , when the user moves the mouse to the area where the first image slice corresponding to "BBBBBB" is located, the CP device may float and display the first image slice and its corresponding second image slice.
  • the user can select any one of the differential rendering results as the target differential rendering result, and then continue to select after modifying the standardized source code corresponding to the differential rendering result Other differential rendering results for source code comparison and modification.
  • the CP device can respond to the operation and send a source code comparison request to the content service platform, wherein the source code comparison request can carry an identifier for indicating the target difference rendering result to be compared. Specifically, it may be the identification of the first image slice and/or the second image slice in the target differential rendering result, or the identification of the icon 31 used to indicate the target differential rendering result.
  • the content service platform may also return the identifiers of the target difference rendering results to the CP device.
  • the content service platform After receiving the source code comparison request, the content service platform analyzes the difference between the original source code corresponding to the target differential rendering result and the standardized source code, and generates a source code comparison result and modification suggestions of the target differential rendering result.
  • the content service platform After the content service platform receives the source code comparison request sent by the CP device, it can determine the target difference rendering result to be compared according to the identification therein, and then analyze the target difference rendering based on the preset rule set (referred to as the first rule set here). The result corresponds to the difference between the original source code and the normalized source code.
  • the content service platform may pre-collect the HTML elements supported by the first browser and the second browser, and generate a first rule set according to the collected HTML elements, and the first rule set may include HTML element sets ( referred to here as the first element set) and a set of HTML elements with the same style effect (here referred to as the second element set).
  • the HTML elements in the first element set may specifically be elements that do not affect the style effect among the HTML elements supported by the second browser;
  • the second element set may include multiple element groups, and each element group may include at least one first browser HTML elements supported by the browser and at least one HTML element supported by the second browser, the HTML elements in the same element group have the same style effect.
  • the original source code and the standardized source code corresponding to the target differential rendering result are the first code slice and the second code slice corresponding to the target differential rendering result.
  • the content service platform can first compare the different elements in the two code slices, and then remove elements with the same style effect from the different elements based on the first rule set without affecting the style effect , to get the HTML element (herein referred to as the diff code element) that causes the target diff rendering result.
  • the content service platform After the content service platform determines the difference code elements, it can generate a source code comparison result according to the original source code, standardized source code and difference code elements corresponding to the target difference rendering result.
  • the source code comparison result can include the original source code and the standardized source code corresponding to the target difference rendering result, the original source code and the standardized source code can be arranged horizontally for comparison, and the difference code elements can be obtained by using Highlight with a different color, underline or highlight.
  • the content service platform can render the source code comparison result, and then send it to the CP device for display for users to view.
  • the content service platform can also provide modification suggestions.
  • the content service platform may pre-generate the second rule set according to the HTML elements supported by the first browser and the second browser.
  • the second rule set may include multiple element groups, and each element group may include at least one The HTML elements supported by the first browser and at least one HTML element supported by the second browser have the same or similar style effects of the HTML elements in the same element group.
  • the content service platform can determine HTML elements having the same or similar style effects as the difference code elements according to the second rule set, and then generate modification suggestions.
  • the content service platform can generate a modification based on the element group Suggestion: Change " ⁇ p>BBBBBB ⁇ /p>" to: " ⁇ p> ⁇ strong>BBBBBB ⁇ /strong>”.
  • the content service platform can render the source code comparison results and modification suggestions together, and then send them to the CP device for display. Among them, modified elements can also be highlighted.
  • the content service platform returns the source code comparison result and modification suggestion of the target difference rendering result to the CP device.
  • the CP device displays the source code comparison result and modification suggestion of the object difference rendering result.
  • the CP device may display the source code comparison result and modification suggestion in the pop-up source code comparison pop-up window 40 .
  • the original source code is arranged on the left side of the source code comparison pop-up window 40 in the source code comparison result
  • the standardized source code is arranged on the right side of the source code comparison pop-up window 40
  • the code corresponding to "BBBBBB” in the source code comparison result The difference code elements in the slices (code slice 33 and code slice 43) are underlined. Suggested changes are located below the source code comparison results, where the modified elements are grayed out.
  • the arrangement of the original source code and the standardized source code in the source code comparison result may be similar to the arrangement of the first rendering result and the second rendering result in the first content comparison result.
  • the difference code element and the modification element in the modification suggestion can also be indicated in other ways, and this embodiment does not specifically limit the specific display style of the source code comparison result and the modification suggestion.
  • the CP device receives the user's code modification operation, and modifies the standardized source code.
  • the user can modify the standardized source code, so that the style effect of the original content is as consistent as possible with the style effect of the corresponding standardized content.
  • the user can manually modify the standardized source code.
  • the user can modify the original source code in the original source code display column in the source code comparison pop-up window 40, and then click the "manually modify" button 41 to complete the source code modification.
  • the content service platform can provide the function of automatic content correction, and users can also use this function to automatically correct the standardized source code.
  • the user can directly click the "automatic correction" button 42, and the CP device can automatically modify the standardized source code according to the modification suggestion.
  • the CP device sends the code modification result to the content service platform.
  • the CP device can send the code modification result to the content service platform.
  • the content service platform After receiving the code modification result, the content service platform updates the standardized source code of the target content according to the code modification result, returns to step S106, and generates a second content comparison result.
  • the content service platform After the content service platform receives the code modification result sent by the CP device, it can update the standardized source code of the target content according to the result, then reload the original source code and the standardized source code of the rendered target content, and compare the content to generate new content
  • the comparison result (that is, the second content comparison result) is then returned to the CP device.
  • the CP device modifies " ⁇ p>BBBBBB ⁇ /p>" in the standardized source code to: “ ⁇ p> ⁇ strong>BBBBBB ⁇ /strong>", In this way, "BBBBBB” in the normalized content will appear bold.
  • the content service platform returns the second content comparison result to the CP device.
  • the CP device displays the second content comparison result.
  • the CP device After the CP device receives the second content comparison result, it can update the content comparison result displayed in the content comparison pop-up window 30. At this time, "BBBBBB" in the standardized content style is displayed in bold , matching the original content style.
  • the CP device receives the user's content comparison exit operation, exits the content comparison interface, and displays the standardized content corresponding to the modified standardized source code.
  • the user can continue to modify the standardized source code, and if the still existing target difference rendering result is within the acceptable range of the user, the user can also directly release it.
  • the CP device receives the user's content release operation, and sends a content release request to the content service platform.
  • the user can save the modified standardized content, or click the "publish" button in the function menu bar 121 as shown in (f) in FIG. 7 to publish the content.
  • the CP device may send a content publishing request to the content service platform, wherein the content publishing request may carry the identifier of the target content.
  • the content service platform After receiving the content release request, the content service platform returns a response message to the CP device.
  • the content service platform may return a response message to the CP device to inform the CP device that the content service platform has successfully received the request.
  • the content service platform can determine the standardized content corresponding to the target content to be released according to the identification in the content publishing request, and then publish it. Before publishing, the content service platform can also review the content to be released first, and after the review passes Published under the circumstances to improve security.
  • the CP device After receiving the response message, the CP device displays a prompt message that the submission is successful.
  • the CP device may display prompt information 50 as shown in (g) of FIG. 7 to prompt the user to successfully submit the content. Subsequently, the user can view the publishing process of the submitted content through the “management” menu in the navigation menu 11 .
  • the prompt information 50 may not be displayed when the user clicks a position outside the area where the prompt information 50 is located, or may disappear automatically after being displayed for a short period of time (for example, two seconds).
  • the content service platform can distribute the content to the terminal device, as shown in (h) in Figure 7, after the content service platform distributes the content to the terminal device, the terminal user can View the content on the terminal device, and the content is consistent with the style effect of the modified standardized content shown in (g) of FIG. 7 .
  • the content comparison function provided by the content service platform can compare the style effect and source code of the target content and the corresponding standardized content, and determine the difference code element that causes the style effect to be inconsistent.
  • the CP can use the content comparison
  • the function can locate the difference code elements, so as to modify the standardized source code, so as to reduce the content display difference when publishing content on the content service platform; in addition, the content automatic correction function provided by the content service platform can also help CP to automatically modify the standardized source code code to improve the convenience of CP use.
  • the following describes the process for users to compare the style effect and source code of the same content on different platforms through the content comparison function.
  • FIG. 13 is a schematic flowchart of another content processing method provided by the embodiment of the present application. As shown in FIG. 13, the method may include the following steps:
  • the CP device receives source code information corresponding to the target content input by the user on the first platform and the second platform respectively.
  • the content service platform can set a "tool” option under the "creation” menu in the navigation menu 11, and provide a platform content comparison function and a browser content comparison function on the page corresponding to the "tool” option.
  • the user can select the "tool” option under the "creation” menu in the navigation menu 11 of the content service platform to open the tool page 60, wherein the tool page 60 includes platform content comparison tool 61 and browser content comparison tool 62 .
  • the user can select the platform content comparison tool 61 to compare the style effect and source code of the target content on different platforms.
  • the corresponding platform content comparison interface 70 can be opened, wherein, the platform content comparison interface 70 can include platform 1 content input area 71 and platform 2 content Input field 72.
  • the user can input source code information corresponding to the target content on the first platform in the platform 1 content input area 71 , and input source code information corresponding to the target content on the second platform in the platform 2 content input area 71 .
  • each content input area can be configured with a content clearing control 701 and an import link control 702.
  • the user can directly input the source code of the target content on the first platform in the content input area 71 of platform 1, Or copy the target content displayed on the first platform to the platform 1 content input area 71; the user can also input the URL link of the target content on the first platform through the import link control 702, and (b) in Figure 14 is to import
  • the link method is taken as an example for illustration, wherein, the URL of the target content on the first platform is: http://abc1.com, and the URL of the target content on the first platform is: http://abc2.com.
  • the user may also clear the input source code information through the content clearing control 701 .
  • the user can also input the original source code information of the target content in one of the content input area 71 of the platform 1 and the content input area 71 of the platform 2, and input the original source code information of the target content in the other content input area. Enter the source code information of the target content on the target platform to view the cleaning rules of the target platform for HTML elements.
  • the CP device receives the user's content comparison operation, and sends a content comparison request to the content service platform.
  • the content service platform acquires the first source code corresponding to the target content on the first platform and the second source code corresponding to the target content on the second platform according to the content comparison request, and then uses the rendering engine of the target browser to load and render the second source code respectively.
  • the first source code and the second source code compare the rendering result corresponding to the first source code with the rendering result corresponding to the second source code to generate a content comparison result.
  • the content service platform can determine the first source code and the second source code to be compared according to the URL link carried in the content comparison request, and then load and render the first source code and the second source code respectively.
  • source code comparing the rendering result corresponding to the first source code with the rendering result corresponding to the second source code.
  • the rendering engine of the same browser may be used for loading and rendering the first source code and the second source code
  • the used target browser may be the browser used by the content service platform, or a browser with strong compatibility.
  • the first source code is:
  • the second source code is:
  • the specific content comparison process is similar to the content comparison process described in step S106, and will not be repeated here.
  • computer vision-based image recognition algorithms can be used to identify redundant image slices in image slices, and then image comparison techniques can be used to establish matching relationships between image slices; the method shown in Figure 10 can also be used After determining the redundant image slices in the image slices and establishing the correspondence between the code slices of the first source code and the second source code, a matching relationship between the image slices is established based on the correspondence.
  • the content service platform returns the content comparison result to the CP device.
  • the CP device displays a content comparison result.
  • the CP device may display the content comparison result in a pop-up content comparison pop-up window.
  • the display method of the content comparison result is similar to the display method of the content comparison result in step S108, and will not be repeated here.
  • the CP device receives the user's source code comparison operation on the target difference rendering result in the content comparison result, and sends a source code comparison request to the content service platform.
  • step S109 The specific implementation process of this step is similar to that of step S109, and relevant descriptions may refer to step S109, and details are not repeated here.
  • the content service platform After receiving the source code comparison request, the content service platform analyzes the difference between the first source code and the second source code corresponding to each difference rendering result in the content comparison result, determines the difference code element corresponding to each difference rendering result, and generates the target Source code comparison results for differential rendering results.
  • the content service platform After the content service platform receives the source code comparison request sent by the CP device, it can determine the target difference rendering result to be compared according to the identification therein, and then analyze the target difference rendering based on the preset rule set (referred to as the third rule set here). The result corresponds to the difference between the first source code and the second source code.
  • the third rule set may be generated according to pre-collected HTML elements supported by each platform, and similarly, the third rule set may include element set 1 and element set 2 .
  • Element set 1 may include HTML elements that do not affect style effects among HTML elements supported by various platforms;
  • element set 2 may include HTML elements that have the same style effect among HTML elements supported by various platforms.
  • step S110 the process of determining the difference code element according to the third rule set is similar to step S110, and related descriptions may refer to step S110, and details are not repeated here.
  • the content service platform can also analyze the differences between the first source code and the second source code corresponding to other differential rendering results, and determine the difference that leads to each differential rendering result. difference code elements, and then return the determined difference code elements to the CP device.
  • the content service platform can also generate source code comparison results corresponding to other differential rendering results at the same time, and then return them to the CP device.
  • the content service platform can first return the source code comparison results corresponding to the target differential rendering results, and then return The source code comparison results corresponding to other differential rendering results enable the CP device to display the source code comparison results corresponding to the target differential rendering results as soon as possible.
  • the content service platform returns a comparison result of each difference code element and the generated source code to the CP device.
  • the CP device displays the source code comparison result, and saves the difference code elements.
  • the CP device after the CP device receives the source code comparison result corresponding to the target difference rendering result, it can display the source code comparison result for the user to view the difference code that caused the target difference rendering result element.
  • the difference code element is label b, which is underlined.
  • the CP device may save these difference code elements in a file preset by the user. Wherein, the user can pre-set the storage path on the content service platform through the CP device.
  • a "save" button (not shown) may also be provided in the source code comparison pop-up window, through which the user can save the difference code elements in the target file.
  • the platform content comparison function provided by the content service platform can compare the style effect and source code of the target content on the first platform and the second platform, and determine the difference code element that causes the style effect to be inconsistent. It can help CP identify the common code elements supported by each platform, so that CP can try to use common code elements supported by multiple platforms when creating content, and avoid using different code elements of different platforms, so as to reduce the time when content is released on different platforms. content display differences.
  • the following describes the process for users to compare the style effect and source code of the same content on different browsers through the content comparison function.
  • FIG. 15 is a schematic flowchart of another content processing method provided by the embodiment of the present application. As shown in FIG. 15, the method may include the following steps:
  • the CP device receives the source code information of the target content input by the user, and the user's selection operation on browser A and browser B.
  • the user can select the "tool” option under the “creation” menu in the navigation menu 11 of the content service platform, open the tool page 60, and then select the browser content comparison tool 62 to compare the target The style effect and source code of the content on different browsers.
  • the corresponding browser content comparison interface 80 can be opened, wherein, the browser content comparison interface 80 can include a content input area 81 and a browser content comparison interface 80. Select zone 82.
  • the user can input the source code information of the target content in the content input area 81, and select the browser used when rendering the content in the browser selection area 82, four browser options are exemplarily shown here, and The user has selected browser A and browser B.
  • the number of browser options provided in the browser content comparison interface 80 is not limited to four.
  • browser options may not be provided in the browser content comparison interface 80.
  • the content service platform is performing content For comparison, the default rendering engines of the two browsers are used to load the rendering target content.
  • the content input area 81 can be configured with a content clearing control and an import link control.
  • the user can clear the input source code information through the content clearing control, and input the URL link of the target content through the import link control, as shown in FIG. 16 (b) in (b) is an example of an import link method, where the URL of the target content is: http://abc.com.
  • the CP device receives the user's content comparison operation, and sends a content comparison request to the content service platform.
  • the content service platform obtains the target source code according to the content comparison request, and then calls the rendering engines of browser A and browser B to load the rendering target source code, and compares the rendering result corresponding to browser A and the first rendering result corresponding to browser B. Perform a comparison to generate a content comparison result.
  • the content service platform can pre-store the rendering engine of the browser corresponding to each browser option shown in (b) in FIG. Analyze the target source code, browser A and browser B selected by the user, and then call the rendering engines of browser A and browser B to load the rendering target source code, and render the rendering results corresponding to browser A and browser B. Rendering results for comparison.
  • the target source code is the original source code of the target content described in step S102:
  • the target source code, the rendering result corresponding to browser A and the rendering result corresponding to browser B can be sliced in a similar manner as in step S106, and an association relationship between code slices and image slices can be established; After the redundant image slices in the image slices can be identified using an image recognition algorithm based on computer vision, the matching relationship between the image slices can be established using image comparison technology.
  • the specific content comparison process is the same as the content comparison process described in step S106. Similar and will not be repeated here.
  • the content service platform returns the content comparison result to the CP device.
  • the CP device displays a content comparison result.
  • the CP device may display the content comparison result in a pop-up content comparison pop-up window.
  • the display method of the content comparison result is similar to the display method of the content comparison result in step S108, and will not be repeated here.
  • the CP device receives the user's source code analysis operation on the target difference rendering result in the content comparison result, and sends a source code analysis request to the content service platform.
  • step S109 The specific implementation process of this step is similar to that of step S109, and relevant descriptions may refer to step S109, and details are not repeated here.
  • the content service platform After receiving the source code analysis request, the content service platform determines the source code corresponding to each difference rendering result.
  • the source code analysis process may also include S307b.
  • the content service platform analyzes the source code corresponding to each difference rendering result in the content comparison result, determines the difference code element corresponding to each difference rendering result, and generates the target difference rendering result Source code analysis results.
  • the content service platform can determine the target difference rendering result to be compared according to the identification, and then determine the source corresponding to the target difference rendering result according to the association relationship between the code slice and the image slice code, generating a source code analysis result based on the determined source code.
  • the content service platform can also analyze the source code corresponding to the target differential rendering result based on a preset rule set (herein referred to as the fourth rule set), and determine the target The difference code element corresponding to the difference rendering result.
  • a preset rule set herein referred to as the fourth rule set
  • the content service platform may pre-collect HTML elements that may cause differences among HTML elements supported by various browsers to form a fourth rule set.
  • the content service platform When the content service platform analyzes the source code corresponding to the target difference rendering result, it can check the fourth rule set to see if there is an HTML element in the fourth rule set in the source code. The element is determined as a difference code element, and if it does not exist, the entire source code corresponding to the target difference rendering result can be used as a difference code element.
  • class is used to indicate the style of the label div, which is a custom element, which may affect the style effect;
  • label b is not supported in some browsers, that is, label div and label b may cause style effects Differences, these can be collected in the fourth rule set, then the content service platform can determine the difference code elements corresponding to the target difference rendering result according to the fourth rule set, including: label div and label b.
  • the content service platform can return the source code corresponding to the target difference rendering result to the CP device as the source code analysis result (that is, the following step S308a); correspondingly, the CP device displays the target difference rendering result Corresponding source code (that is, the following step S309a).
  • the source code analysis result generated by the content service platform may include the source code and the difference code element corresponding to the target difference rendering result.
  • the difference code elements can be highlighted by adopting different colors, underlining or highlighting.
  • the content service platform may also analyze the source codes corresponding to other differential rendering results to determine the differential code elements that lead to each differential rendering result, Then return the determined difference code elements to the CP device.
  • the content service platform may also simultaneously generate source code analysis results corresponding to other differential rendering results, and then return them to the CP device.
  • the content service platform returns the source code corresponding to the target difference rendering result to the CP device.
  • the content service platform returns each difference code element and the generated source code analysis result to the CP device.
  • the content service platform may return the generated source code analysis result and the determined difference code elements to the CP device.
  • the CP device displays the source code corresponding to the object difference rendering result.
  • the CP device displays the source code analysis result, and saves the difference code elements.
  • the CP device after the CP device receives the source code analysis result corresponding to the target difference rendering result, it can display the source code analysis result for the user to view the difference code that caused the target difference rendering result element.
  • the difference code element includes a tag div and a tag b, which are marked by underlining.
  • the CP device may save these difference code elements in a file preset by the user.
  • a "save" button (not shown) may also be provided in the source code comparison pop-up window, through which the user can save the difference code elements in the target file.
  • redundant code segments in the source code to be rendered may also be removed first, and then loading and rendering, image slicing and code slicing are performed.
  • the browser content comparison function provided by the content service platform can compare the style effects of the target content on different browsers, and can analyze the source code of the target content to determine the difference code that causes the inconsistent style effect element, so that it can help CP understand the difference in how each browser handles HTML elements, so that CP can try not to use HTML elements that are not supported by each browser when creating content, so as to reduce the content when the content is displayed on different browsers Show the difference.
  • the embodiment of the present application provides a content processing device
  • the device embodiment corresponds to the aforementioned method embodiment
  • the present device embodiment does not refer to the aforementioned method embodiment
  • the details will be described one by one, but it should be clear that the device in this embodiment can correspondingly implement all the content in the foregoing method embodiments.
  • Figure 17 is a schematic structural diagram of a content processing device provided in the embodiment of the present application. As shown in Figure 17, the device provided in this embodiment includes:
  • a display module 210 an input module 220 , a processing module 230 and a communication module 240 .
  • the structure shown in the embodiment of the present application does not constitute a specific limitation on the content processing apparatus.
  • the content processing apparatus may include more or less modules than those shown in the figures.
  • the illustrated modules can be implemented in hardware, software or a combination of software and hardware.
  • the display module 210 is used to support the electronic device to perform the interface display operation in the above embodiments and/or other processes used in the technology described herein.
  • the display module can be a touch screen or other hardware or a combination of hardware and software.
  • the input module 220 is used to receive the user's input on the display interface of the electronic device, such as touch input, voice input, gesture input, etc., and the input module is used to support the electronic device to perform the steps of receiving the user's call answering operation in the above embodiments and/or Or other procedures for the techniques described herein.
  • the input module can be a touch screen or other hardware or a combination of hardware and software.
  • the processing module 230 is used to support the electronic device to perform the content processing operations in the above embodiments and/or other processes for the technologies described herein.
  • the communication module 240 is used to support the electronic device to perform operations related to the communication process between other electronic devices in the above embodiments and/or other processes for the technology described herein.
  • the electronic device may be the CP device in the above embodiment or the server in the content service platform.
  • the device provided in this embodiment can execute the above-mentioned method embodiment, and its implementation principle and technical effect are similar, and details are not repeated here.
  • FIG. 18 is a schematic structural diagram of the CP device provided in the embodiment of the present application.
  • the CP device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, Mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and user An identification module (subscriber identification module, SIM) card interface 195 and the like.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the structure shown in the embodiment of the present application does not constitute a specific limitation on the CP device.
  • the CP device may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (sgraphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) wait.
  • application processor application processor
  • AP application processor
  • modem processor graphics processing unit
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit, NPU
  • the controller may be the nerve center and command center of the CP device.
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in processor 110 is a cache memory.
  • the memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the I2C interface is a bidirectional synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (serail clock line, SCL).
  • the I2S interface can be used for audio communication.
  • the PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal.
  • the UART interface is a universal serial data bus for asynchronous communication; the bus can be a bidirectional communication bus, which converts the data to be transmitted between serial communication and parallel communication.
  • the MIPI interface can be used to connect the peripheral devices such as the processor 110 and the display screen 194, the camera 193; the MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI) and the like.
  • the GPIO interface can be configured by software, and the GPIO interface can be configured as a control signal or as a data signal.
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the CP device, and can also be used to transmit data between the CP device and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other CP devices, such as AR devices.
  • the interface connection relationship between modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the CP device.
  • the CP device may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive the charging input of the wired charger through the USB interface 130.
  • the charging management module 140 may receive wireless charging input through a wireless charging coil of the CP device. While the charging management module 140 is charging the battery 142 , it can also supply power to the CP device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • the wireless communication function of the CP device can be realized by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in a CP device can be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the CP device.
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves through the antenna 1 for radiation.
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite system, etc. (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the CP device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the CP device can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division synchronous code division multiple access (time division-synchronous code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN , NFC, FM, and/or IR technology, etc.
  • GSM global system for mobile communications
  • general packet radio service general packet radio service
  • CDMA code division multiple access
  • CDMA broadband Code division multiple access
  • WCDMA wideband code division multiple access
  • time division synchronous code division multiple access time division-synchronous code division multiple access
  • LTE long term evolution
  • BT GNSS
  • WLAN NFC
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GNSS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
  • GPS global positioning system
  • GNSS global navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the CP device realizes the display function through the GPU, the display screen 194, and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos and the like.
  • the display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Mini LED, Micro LED, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the CP device may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the CP device can realize the shooting function through ISP, camera 193 , video codec, GPU, display screen 194 and application processor.
  • the ISP is used for processing the data fed back by the camera 193 .
  • Camera 193 is used to capture still images or video.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals.
  • Video codecs are used to compress or decompress digital video.
  • the NPU is a neural-network (NN) computing processor.
  • NN neural-network
  • applications such as intelligent cognition of CP devices can be realized, such as: image recognition, face recognition, speech recognition, text understanding, etc.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the processor 110 executes various functional applications and data processing of the CP device by executing instructions stored in the internal memory 121 .
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the storage program area can store an operating system and at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the CP device (such as audio data, phonebook, etc.) and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the external memory interface 120 can be used to connect an external memory, such as a Micro SD card, to expand the storage capacity of the CP device.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • the CP device can realize the audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • Speaker 170A also referred to as a "horn” is used to convert audio electrical signals into sound signals.
  • Receiver 170B also called “earpiece”, is used to convert audio electrical signals into sound signals.
  • the microphone 170C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the earphone interface 170D is used for connecting wired earphones.
  • the earphone interface 170D may be a USB interface 130, or a 3.5mm open mobile terminal platform (open mobile terminal platform, OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface.
  • CTIA
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the CP device can receive key input and generate key signal input related to user settings and function control of the CP device.
  • the motor 191 can generate a vibrating reminder.
  • the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the SIM card can be connected and separated from the CP device by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the CP device can support 1 or N SIM card interfaces, and N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc.
  • the CP device provided in this embodiment can execute the processing process of the CP device in the foregoing method embodiment, and its implementation principle and technical effect are similar, and will not be repeated here.
  • FIG. 19 is a schematic structural diagram of the server provided in the embodiment of the present application.
  • the server provided in the present embodiment may include: a memory 310, a processor 320 and Communication module 330 and other components.
  • the memory 310 can be used to store computer programs and modules, and the processor 320 can execute the methods performed by the server in the above method embodiments by running the computer programs and modules stored in the memory 310 .
  • the memory 310 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); The data created by the use of the server (such as audio data, phone book, etc.) and the like.
  • the memory 310 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
  • the processor 320 is the control center of the server. It uses various interfaces and lines to connect various parts of the entire server. By running or executing software programs and/or modules stored in the memory 310, and calling data stored in the memory 310, execution Various functions and processing data of the server, so as to monitor the server as a whole.
  • the processor 320 may include one or more processing units.
  • the communication module 330 can provide applications on the server including wireless local area network (Wireless Local Area Networks, WLAN) (such as Wi-Fi network), Bluetooth, Zigbee, mobile communication network, global navigation satellite system (global navigation satellite system, GNSS), Communication solutions such as frequency modulation (FM), NFC and infrared technology (infrared, IR).
  • the communication module 330 may be one or more devices integrating at least one communication processing module.
  • the communication module 330 may include an antenna, and may receive electromagnetic waves through the antenna, frequency-modulate and filter the electromagnetic wave signals, and send the processed signals to the processor.
  • the communication module 330 can also receive the signal to be sent from the processor 320, frequency-modulate and amplify it, and convert it into electromagnetic wave and radiate it through the antenna.
  • the server can communicate with the CP device through the communication module 330 .
  • FIG. 19 is only an example of a server, and does not constitute a limitation to the server. It may include more or less components than shown in the figure, or combine some components, or arrange different components.
  • the server can be a server with download service and unpacking function at the same time, and can also include two: an application market server providing RPK package download service, and a quick application server providing unpacking function.
  • the server can be a single server or a server cluster, that is, the above-mentioned server, application market server, and quick application server that both have download service and unpacking functions can all be server clusters.
  • the server provided in this embodiment can execute the processing process of the content service platform in the above method embodiment, and its implementation principle and technical effect are similar, and will not be repeated here.
  • the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in the foregoing method embodiment is implemented.
  • An embodiment of the present application further provides a computer program product, which, when the computer program product is run on an electronic device, enables the electronic device to implement the method described in the foregoing method embodiments.
  • An embodiment of the present application further provides a chip system, including a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory, so as to implement the method described in the above method embodiment.
  • the chip system may be a single chip, or a chip module composed of multiple chips.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted via a computer-readable storage medium.
  • the computer instructions may be transmitted from one web site, computer, server, or data center to another web site, computer, server or data center for transmission.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)), etc.
  • the processes can be completed by computer programs to instruct related hardware.
  • the programs can be stored in computer-readable storage media.
  • When the programs are executed may include the processes of the foregoing method embodiments.
  • the aforementioned storage medium may include: ROM or random access memory RAM, magnetic disk or optical disk, and other media capable of storing program codes.
  • the disclosed device/device and method can be implemented in other ways.
  • the device/device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • plural means two or more than two.
  • At least one of the following or similar expressions refer to any combination of these items, including any combination of single items or plural items.
  • at least one of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c can be single or multiple.
  • the term “if” may be construed, depending on the context, as “when” or “once” or “in response to determining” or “in response to detecting “.
  • the phrase “if determined” or “if [the described condition or event] is detected” may be construed, depending on the context, to mean “once determined” or “in response to the determination” or “once detected [the described condition or event] ]” or “in response to detection of [described condition or event]”.
  • references to "one embodiment” or “some embodiments” or the like in the specification of the present application means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application.
  • appearances of the phrases “in one embodiment,” “in some embodiments,” “in other embodiments,” “in other embodiments,” etc. in various places in this specification are not necessarily All refer to the same embodiment, but mean “one or more but not all embodiments” unless specifically stated otherwise.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种内容处理方法与电子设备,其中,该方法包括:显示第一内容输入界面,获取第一目标内容的第一代码信息和第二代码信息,接收到第一内容对比操作后,根据第一代码信息和第二代码信息进行页面渲染,获得第一渲染结果和第二渲染结果,生成并显示第一内容对比结果;其中,第一渲染结果包括第一图像切片和第二图像切片,第二渲染结果包括第三图像切片和第四图像切片;第一内容对比结果包括第一图像切片和第三图像切片存在差异,第二图像切片和第四图像切片相同;接收到用户的源代码对比操作后,显示第一图像切片和第三图像切片的源代码对比结果。该方法帮助CP定位造成内容样式效果出现差异的原因。

Description

内容处理方法与电子设备
本申请要求于2021年08月31日提交国家知识产权局、申请号为202111017379.3、申请名称为“内容处理方法与电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种内容处理方法与电子设备。
背景技术
近年来,互联网内容产业得到了快速发展,在互联网内容产业链中,提供内容的一方称为内容提供者(content provider,CP)。其中,CP可以提供文字、图像、音频和视频等各种媒体内容,通过互联网平台将内容展示给用户。
CP创作的内容一般是通过超文本标记语言(Hyper Text Markup Language,HTML)进行编码的,HTML是一个开放的标准,对编码风格没有严格的要求,各CP可以根据自身的技术能力和审美标准,选择不同的编码风格,实现同样的样式效果。而用于展示内容的平台和浏览器,支持的编码风格可能与CP所采用的HTML编码风格不同;而且由于安全要求等原因,通常也会对内容的HTML元素进行规整,因此,CP创作的内容在不同平台上展示时,显示效果可能会出现异常。
目前,CP确定异常的主要方式是通过将同一内容在不同平台上的样式效果进行截图后对比,来确定差异的样式效果,但是这种方式无法定位造成差异的原因。
发明内容
有鉴于此,本申请提供一种内容处理方法与电子设备,用于帮助CP定位造成内容样式效果出现差异的原因。
为了实现上述目的,第一方面,本申请实施例提供一种内容处理方法,包括:
显示第一内容输入界面;
获取第一目标内容的第一代码信息和第二代码信息;
接收用户针对第一目标内容的第一内容对比操作,根据所述第一代码信息进行页面渲染,获得第一渲染结果,根据所述第二代码信息进行页面渲染,获得第二渲染结果;第一渲染结果包括第一图像切片和第二图像切片,第二渲染结果包括第三图像切片和第四图像切片;
生成并显示第一内容对比结果;所述第一内容对比结果包括第一图像切片和第三图像切片存在差异,第二图像切片和第四图像切片相同;
接收用户针对所述第一图像切片和所述第三图像切片的源代码对比操作,显示第一图像切片和第三图像切片的源代码对比结果。
本申请实施例提供的内容处理方法,可以根据目标内容在不同平台上对应的源代码信息,对比目标内容在不同平台上的样式效果和源代码,确定引起样式效果不一致的源代码,这样用户通过该方法就可以定位引起差异的源代码。
在第一方面的一种可能的实施方式中,所述第一代码信息为所述第一目标内容的原始 源代码的源代码信息,所述第二代码信息为所述第一目标内容的标准化源代码的源代码信息,所述标准化源代码是对所述原始源代码经过标准化处理后得到的。
通过上述实施方式,可以帮助用户在目标平台发布内容前,了解目标平台对第一目标内容的原始源代码的标准化处理结果和引起样式效果不一致的标准化源代码,从而用户可以在发布第一目标内容前先对引起样式效果不一致的标准化源代码进行修改,来减小第一目标内容在目标平台发布内容时的内容展示差异。
在第一方面的一种可能的实施方式中,所述第一代码信息包括:所述第一目标内容的原始源代码,或,所述第一目标内容的原始源代码对应的网页链接;所述第二代码信息包括所述第一目标内容的标准化源代码。
通过上述实施方式,可以为用户提供多样化的源代码信息输入方式,提高用户使用的便利性。
在第一方面的一种可能的实施方式中,所述第一内容对比结果中包括:所述第一渲染结果、所述第二渲染结果,以及与存在差异的所述第一图像切片和所述第三图像切片相对应的指示图标;
针对所述第一图像切片和第三图像切片的源代码对比操作为:针对所述第一图像切片或第三图像切片所在显示区域的点击操作,或,针对所述指示图标的点击操作。
上述实施方式中,通过指示图标可以帮助用户更好的识别差异图像切片;通过提供多样化的源代码对比操作实现方式,可以提高用户操作的便利性。
在第一方面的一种可能的实施方式中,所述方法还包括:
接收用户的代码修改操作,修改所述标准化源代码,并显示第二内容对比结果;所述第二内容对比结果中包括所述原始源代码对应的渲染结果与修改后的标准化源代码对应的渲染结果之间的对比结果。
上述实施方式中,通过提供代码修改功能,可以使用户在发布内容前对标准化源代码进行修改,从而减小第一目标内容在目标平台发布内容时的内容展示差异。
在第一方面的一种可能的实施方式中,所述第二内容对比结果所在的显示界面中包括:用于进行自动修改标准化源代码的自动修正按钮;
所述代码修改操作包括:针对所述第二内容对比结果中标准化源代码的代码编辑操作,和/或,针对所述自动修正按钮的点击操作。
上述实施方式中,通过提供多样化的代码修改方式,可以满足用户的不同需求;另外,通过提供自动修正功能,还可以帮助用户自动修改标准化源代码,提高用户使用的便利性。
在第一方面的一种可能的实施方式中,在所述接收用户的代码修改操作之前,所述方法还包括:显示所述第三图像切片对应的标准化源代码的代码修改建议。这样可以提高用户的代码修改效率。
在第一方面的一种可能的实施方式中,所述方法还包括:
接收用户的内容发布操作,向服务器发送内容发布请求;
在接收到服务器返回的响应消息后,显示提交成功的提示信息。
在第一方面的一种可能的实施方式中,所述第一代码信息为所述第一目标内容在第一平台上对应的源代码信息,所述第二代码信息为所述第一目标内容在第二平台上对应的源代码信息。
通过上述实施方式,可以对比目标内容在第一平台和第二平台上的样式效果和源代码,帮助用户定位引起样式效果不一致的源代码。
在第一方面的一种可能的实施方式中,所述第一渲染结果中还包括第五图像切片,第五图像切片为所述第一目标内容中非正文内容对应的图像切片;
所述第一内容对比结果中包括所述第一图像切片与所述第三图像切片之间的对应关系、所述第二图像切片与所述第四图像切片之间的对应关系;
所述第一内容对比结果中不包括所述第五图像切片对应的图像切片。
上述实施方式中,针对正文内容对应的图像切片进行对比,非正文内容对应的图像切片不进行对比,这样可以提高对比结果的准确性。
在第一方面的一种可能的实施方式中,所述源代码对比结果中突出显示所述第一图像切片对应的源代码与所述第三图像切片对应的源代码之间的差异代码元素。这样可以更精确的定位出引起差异的原因,并可以方便用户识别差异代码元素。
在第一方面的一种可能的实施方式中,所述生成并显示第一内容对比结果,包括:
确定所述第一渲染结果的图像切片和所述第二渲染结果的图像切片之间的对应关系;
分别对每组相对应的第一渲染结果的图像切片和第二渲染结果的图像切片进行对比,生成并显示第一内容对比结果。
上述实施方式中,针对图像切片进行对比,可以提高对比效率,并可以便于后续更准确的定位引起样式效果差异的原因。
在第一方面的一种可能的实施方式中,所述方法还包括:
显示第二内容输入界面;
接收用户输入的第二目标内容的源代码信息,以及用户针对第一浏览器和第二浏览器的选择操作;
接收用户针对所述第二目标内容的内容对比操作,调用所述第一浏览器的渲染引擎对目标源代码进行渲染,获得第三渲染结果,调用所述第二浏览器的渲染引擎对目标源代码进行渲染,获得第四渲染结果;所述目标源代码是根据所述第二目标内容的源代码信息获取到的,所述第三渲染结果包括第六图像切片和第七图像切片,所述第四渲染结果包括第八图像切片和第九图像切片;
生成并显示第三内容对比结果;所述第三内容对比结果包括第六图像切片和第八图像切片存在差异,第七图像切片和第九图像切片相同;
接收用户针对所述第六图像切片和所述第八图像切片的源代码分析操作,显示所述第六图像切片和所述第八图像切片的源代码分析结果。
上述实施方式中,可以对比目标内容在不同浏览器上的样式效果,并可以分析目标内容的源代码,帮助用户定位引起样式效果不一致的源代码。
在第一方面的一种可能的实施方式中,所述源代码分析结果中突出显示所述目标源代码中导致所述第六图像切片和所述第八图像切片存在差异的差异代码元素。
上述实施方式中,可以确定引起样式效果不一致的差异代码元素,这样就可以帮助用户了解各浏览器对HTML元素的处理差异,从而用户可以在创作内容时尽量不使用各浏览器不支持的HTML元素,以减小内容在不同浏览器上展示时的内容展示差异。
第二方面,本申请实施例提供一种内容处理方法,该方法包括:
第一设备显示第一内容输入界面;
第一设备接收用户输入的第一目标内容的源代码信息和针对第一目标内容的第一内容对比操作;
第一设备向第二设备发送所述第一目标内容的源代码信息和内容对比请求;
第二设备根据所述源代码信息确定第一目标内容的第一源代码和第二源代码;
第二设备根据所述第一源代码进行页面渲染,获得第一渲染结果,根据所述第二源代码进行页面渲染,获得第二渲染结果;第一渲染结果包括第一图像切片和第二图像切片,第二渲染结果包括第三图像切片和第四图像切片;
第二设备生成并向第一设备返回第一内容对比结果;所述第一内容对比结果包括第一图像切片和第三图像切片存在差异,第二图像切片和第四图像切片相同;
第一设备显示所述第一内容对比结果;
第一设备接收用户针对所述第一图像切片和所述第三图像切片的源代码对比操作,向第二设备发送针对所述第一图像切片和所述第三图像切片的源代码对比请求;
第二设备生成并向第一设备返回所述第一图像切片和所述第三图像切片的源代码对比结果;
第一设备显示所述第一图像切片和所述第三图像切片的源代码对比结果。
在第二方面的一种可能的实施方式中,所述第一源代码为所述第一目标内容的原始源代码的源代码信息,所述第一源代码是第二设备根据所述第一目标内容的源代码信息获取的;所述第二源代码为所述第一目标内容的标准化源代码,所述标准化源代码是第二设备对所述原始源代码经过标准化处理后得到的。
在第二方面的一种可能的实施方式中,所述源代码信息包括:所述第一目标内容的原始源代码,或,所述第一目标内容的原始源代码对应的网页链接。
在第二方面的一种可能的实施方式中,所述第一内容对比结果中包括:所述第一渲染结果、所述第二渲染结果,以及与存在差异的所述第一图像切片和所述第三图像切片相对应的指示图标;
针对所述第一图像切片和第三图像切片的源代码对比操作为:针对所述第一图像切片或第三图像切片所在显示区域的点击操作,或,针对所述指示图标的点击操作。
在第二方面的一种可能的实施方式中,所述方法还包括:
第一设备接收用户的代码修改操作,修改所述标准化源代码,并向第二设备发送代码修改结果;
第二设备向第一设备返回所述第二内容对比结果;所述第二内容对比结果中包括所述原始源代码对应的渲染结果与修改后的标准化源代码对应的渲染结果之间的对比结果;
第一设备显示第二内容对比结果。
在第二方面的一种可能的实施方式中,所述第二内容对比结果所在的显示界面中包括:用于进行自动修改标准化源代码的自动修正按钮;
所述代码修改操作包括:针对所述第二内容对比结果中标准化源代码的代码编辑操作,和/或,针对所述自动修正按钮的点击操作。
在第二方面的一种可能的实施方式中,在所述CP接收用户的代码修改操作之前,所述方法还包括:
第二设备生成并向第一设备返回所述第三图像切片对应的标准化源代码的代码修改建议;
第一设备显示所述代码修改建议。
在第二方面的一种可能的实施方式中,所述方法还包括:
第一设备接收用户的内容发布操作,向第二设备发送内容发布请求;
第二设备向第一设备返回响应消息;
第一设备显示提交成功的提示信息。
在第二方面的一种可能的实施方式中,所述源代码信息包括:所述第一目标内容在第一平台和第二平台上对应的源代码信息,所述第一源代码为所述第一平台对应的源代码,所述第二源代码为所述第二平台对应的源代码。
在第二方面的一种可能的实施方式中,所述第一渲染结果中还包括第五图像切片,所述第五图像切片为所述第一目标内容中非正文内容对应的图像切片;
所述第一内容对比结果中包括所述第一图像切片与所述第三图像切片之间的对应关系、所述第二图像切片与所述第四图像切片之间的对应关系;
所述第一内容对比结果中不包括所述第五图像切片对应的图像切片。
在第二方面的一种可能的实施方式中,所述源代码对比结果中突出显示所述第一图像切片对应的源代码与所述第三图像切片对应的源代码之间的差异代码元素。
在第二方面的一种可能的实施方式中,生成第一内容对比结果,包括:
确定所述第一渲染结果的图像切片和所述第二渲染结果的图像切片之间的对应关系;
分别对每组相对应的第一渲染结果的图像切片和第二渲染结果的图像切片进行对比,生成第一内容对比结果。
在第二方面的一种可能的实施方式中,所述方法还包括:
第一设备显示第二内容输入界面;
第一设备接收用户输入的第二目标内容的源代码信息,以及用户针对第一浏览器和第二浏览器的选择操作;
第一设备接收用户针对所述第二目标内容的内容对比操作,向第二设备发送所述第二目标内容对应的内容对比请求,所述内容对比请求中携带有所述第二目标内容的源代码信息;
第二设备根据所述第三目标内容的源代码信息获取目标源代码后,调用所述第一浏览器的渲染引擎对目标源代码进行渲染,获得第三渲染结果,调用所述第二浏览器的渲染引擎对目标源代码进行渲染,获得第四渲染结果;所述第三渲染结果包括第六图像切片和第七图像切片,所述第四渲染结果包括第八图像切片和第九图像切片;
第二设备生成并向第一设备返回第三内容对比结果;所述第三内容对比结果包括第六图像切片和第八图像切片存在差异,第七图像切片和第九图像切片相同;
第一设备显示所述第三内容对比结果;
第一设备接收用户针对所述第六图像切片和所述第八图像切片的源代码分析操作,向第二设备发送针对所述第六图像切片和所述第八图像切片的源代码分析请求;
第二设备生成并向所述第一设备返回所述第六图像切片和所述第八图像切片的源代码分析结果;
第一设备显示所述第六图像切片和所述第八图像切片的源代码分析结果。
在第二方面的一种可能的实施方式中,所述源代码分析结果中突出显示所述目标源代码中导致所述第六图像切片和所述第八图像切片存在差异的差异代码元素。
第三方面,本申请实施例提供一种电子设备,包括:存储器和处理器,存储器用于存储计算机程序;处理器用于在调用计算机程序时执行上述第一方面所述的方法,或者上述第二方面中第一设备或第二设备所执行的方法。
第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述第一方面或第一方面的任一实施方式所述的方法。
第五方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行上述第一方面所述的方法,或者上述第二方面中第一设备或第二设备所执行的方法。
第六方面,本申请实施例提供一种芯片***,包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现上述第一方面所述的方法,或者上述第二方面中第一设备或第二设备所执行的方法。其中,所述芯片***可以为单个芯片,或者多个芯片组成的芯片模组。
可以理解的是,上述第二方面至第六方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
附图说明
图1为本申请实施例提供的内容处理***的结构示意图;
图2为本申请实施例提供的内容创作界面示意图;
图3为本申请实施例提供的一种内容处理方法的流程示意图;
图4为本申请实施例提供的内容输入过程的界面示意图;
图5为本申请实施例提供的原始内容样式示意图;
图6为本申请实施例提供的代码分段结果示意图;
图7为本申请实施例提供的内容对比过程的界面示意图;
图8为本申请实施例提供的内容对比过程的流程示意图;
图9为本申请实施例提供的图像分割结果示意图;
图10为本申请实施例提供的图像切片匹配关系建立过程示意图;
图11为本申请实施例提供的代码分割结果示意图;
图12为本申请实施例提供的图像对比结果示意图;
图13为本申请实施例提供的另一种内容处理方法的流程示意图;
图14为本申请实施例提供的平台内容对比过程的界面示意图;
图15为本申请实施例提供的又一种内容处理方法的流程示意图;
图16为本申请实施例提供的浏览器内容对比过程的界面示意图;
图17为本申请实施例提供的内容处理装置的结构示意图;
图18为本申请实施例提供的CP设备的结构示意图;
图19为本申请实施例提供的服务器的结构示意图。
具体实施方式
下面结合本申请实施例中的附图对本申请实施例进行描述。本申请实施例的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
首先介绍本申请实施例涉及的***,请参阅图1,图1为本申请实施例提供的内容处理***的结构示意图,如图1所示,本实施例提供的内容处理***可以包括:CP设备100、内容服务平台200和终端设备300。
其中,CP设备100可以是笔记本电脑、台式电脑或平板电脑等具备处理和显示功能的电子设备,图1中以台式电脑为例进行示例性说明。内容服务平台200可以布署在一台或多台服务器上。终端设备300可以是手机、平板电脑、笔记本电脑或台式电脑等显示设备,图1中以手机为例进行示例性说明。
内容服务平台200可以提供账号认证功能,用户(即CP)可以通过CP设备100在内容服务平台200中注册账号,通过登录账号登录内容服务平台200,以获取内容服务平台200提供的服务。
内容服务平台200可以向用户提供内容创作、内容管理和内容分发等内容服务,CP可以通过CP设备100在内容服务平台200上创作、发布、管理内容,查看内容分发效果。
内容服务平台200接收到CP设备的内容发布请求后,在发布内容前,可以先对待发布的内容进行审核,审核通过后可以将内容分发给终端设备300;终端用户则可以在终端设备300上查看内容服务平台200分发的内容。
其中,内容服务平台200中用于实现的内容发布的内容发布模块可以均部署在同一服务器中,也可以进行功能拆分后部署在不同的服务器上。例如,可以将内容审核功能部署在第一服务器中,将内容发布模块的内容分发功能部署在第二服务器中;第一服务器接收到CP设备的内容发布请求后,可以对待发布的内容进行审核,审核通过后可以将内容发送给第二服务器,第二服务器可以根据终端用户的喜好向终端设备300分发内容。
图2示例性的示出了内容创作界面示意图,如图2所示,用户可以在CP设备100上访问内容服务平台200,打开平台页面,在平台页面的导航菜单11中选择“创作”菜单下的“文章”选项,打开内容编辑器12。
参见图2,内容编辑器12中可以包括功能菜单栏121、编辑控件栏122和内容编辑区123。其中,功能菜单栏121中可以包括:“发布”按钮、“重新发布”按钮、“保存”按钮和“预览”按钮等。编辑控件栏122中可以包括:撤消键入控件、恢复键入控件、字体编辑控件(此处示例性的示出了加粗、斜体和下划线控件)、段落设置控件(此处示例性的示出了左对齐、居中、右对齐和两端对齐控件)和其他功能控件(此处示例性的示出了导入链接控件1221和内容对比控件1222)等。内容编辑区123用于输入内容,在用户刚打开内容编辑器12时,内容编辑区123中可以显示提示信息,此处示例性的包括提示信息:“请输入标题”和“请输入正文”。
用户可以结合编辑控件栏122中的控件,在内容编辑区123中编辑内容的标题和正文,然后可以点击功能菜单栏121中的“发布”按钮发布内容,或者可以在发布内容前点击“预览”按钮预览内容显示结果。用户也可以通过“保存”按钮将编辑的内容保存为草稿,后续可以通过导航菜单11中的“管理”菜单查看和重新编辑草稿。用户还可以通过“管理”菜单查看和重新编辑已发布的内容,然后通过“重新发布”按钮重新发布内容。
CP也可以将已创作的内容通过CP设备100同步到内容服务平台200上,进行发布或 管理。其中,CP同步的内容包括但不限于已经在自身网站发布的、已经在其他平台发布的和离线文档。
具体地,CP向内容服务平台200同步内容的方式可以包括但不限于如下几种方式:
方式一:复制内容发布到内容服务平台200。
继续参见上述图2,用户可以在CP设备100上打开内容服务平台200的内容编辑器12,将已创作的内容复制到内容编辑区123中,然后点击功能菜单栏121中的“发布”按钮,以将内容同步到内容服务平台200。
其中,用户在复制内容时,可以复制到内容的显示结果和HTML源代码(以下简称源代码);用户将内容复制到内容编辑区123中后,CP设备100可以根据用户的输入操作获取到内容的显示结果和源代码,在内容编辑区123中显示内容的显示结果,并将内容的源代码同步到内容服务平台200。
方式二:导入链接由内容服务平台200同步内容。
参见上述图2,用户可以通过编辑控件栏122中的导入链接控件1221导入已创作的内容的统一资源定位符(uniform resource locator,URL)链接,将该内容的URL链接发送给内容服务平台200,内容服务平台200可以访问该链接获取内容的源代码。
方式三:通过接口推送内容到内容服务平台200。
用户可以在提供内容的服务器(此处称为内容服务器)上设置内容服务平台200的用于接收内容的接口地址,内容服务器可以通过该接口地址主动向内容服务平台200批量推送内容。用户也可以通过CP设备100在内容服务平台200上设置内容服务器的用于推送内容的接口地址,使内容服务平台200将该接口地址保存为信任地址,建立该接口地址与用户账号的关联关系。
方式四:提供接口由内容服务平台200拉取内容。
与方式三类似,用户可以通过CP设备100在内容服务平台200上设置内容服务器的用于提供内容的接口地址,内容服务平台200可以通过该接口主动从内容服务器上批量拉取内容,即内容服务平台200可以主动向内容服务器发送内容获取请求,内容服务器接收到内容获取请求后可以将内容发送给内容服务平台200。同样的,用户也可以在内容服务器上设置内容服务平台200的用于拉取内容的接口地址,使内容服务平台200将该接口地址保存为信任地址。
CP将内容同步到内容服务平台200上后,内容服务平台200可以根据自身支持的编码风格和安全要求,对CP同步的内容(此处称为原始内容)对应的HTML源代码(此处称为原始源代码)进行标准化处理后,保存为标准化源代码,然后发布标准化源代码对应的标准化内容。
内容服务平台200对CP同步的原始内容进行标准化处理后,得到的标准化源代码对应的标准化内容可能与CP同步的原始内容的样式效果不一致。为了减小这种内容展示效果的差异,本实施例中,内容服务平台200还可以提供内容对比功能,CP在将内容同步到内容服务平台200前,可以通过内容对比功能对比原始内容与对应的标准化内容的样式效果;如果原始内容的样式效果与对应的标准化内容的样式效果不一致,CP可以通过内容对比功能进一步对比原始内容的源代码(即原始源代码)与标准化内容的源代码(即标准化源代码),确定引起样式效果不一致的差异点;然后CP可以对标准化源代码进行修改, 使得原始内容的样式效果与对应的标准化内容的样式效果一致,修改完之后再将修改后的源代码(此处称为目标源代码)同步到内容服务平台200。
例如图2中所示的,内容编辑器12中可以提供内容对比控件1222,CP在同步内容前可以通过点击该控件使用内容服务平台200提供的内容对比功能。
可以理解的是,CP也可以在同步内容后使用内容对比功能进行内容对比,然后在修改完源代码之后,通过内容编辑器12中的“重新发布”按钮重新发布内容。例如,CP在采用上述方式一或方式二同步内容时,可以在同步内容前,先采用内容对比功能进行内容对比,然后将内容同步到内容服务平台200。CP在采用上述方式三或方式四同步内容时,可以在内容同步完之后,通过“管理”菜单查看和重新编辑已同步的内容,在重新编辑已同步内容时,采用内容对比功能进行内容对比,然后将内容同步到内容服务平台200。
为了方便CP使用,内容服务平台200还可以提供内容自动修正功能,当原始内容的样式效果与对应的标准化内容的样式效果不一致时,CP可以通过内容自动修正功能修改标准化源代码。
另外,内容服务平台200提供的内容对比功能还可以支持CP对比任意两份内容样式,例如,CP可以通过内容对比功能对比同一内容在不同平台上的样式效果和源代码,确定不同平台对HTML元素的清洗规则,识别各平台不支持的可能会影响样式效果的HTML元素(即差异代码元素),这样CP在后续创作内容时,可以根据识别结果尽可能不使用平台不支持的差异代码元素,以减小内容在不同平台上发布时内容展示效果的差异。
CP也可以通过内容对比功能对比同一内容在不同浏览器上展示时的样式效果,并定位造成差异的HTML元素(即差异代码元素),识别不同浏览器对HTML元素的处理差异,这样CP在后续创作内容时,可以根据识别结果尽可能不使用浏览器不支持的差异代码元素,以减小内容在不同浏览器上展示效果的差异。
上述内容对比功能和内容自动修正功能的部分或全部内容处理过程可以在内容服务平台200上执行,内容处理过程中生成的各处理结果可以在CP设备100上展示。
可以理解的是,内容服务平台200可以包括用于实现上述各内容服务的内容创作模块、内容发布模块、内容管理模块、内容对比模块和内容自动修正模块等,其中,内容发布模块和内容管理模块的部分功能、内容创作模块、内容对比模块和内容自动修正模块可以集成在CP设备的***中或者集成在某一应用程序(此处称为目标应用程序)中。以应用程序为例,用户可以通过CP设备上的目标应用程序进行内容对比、内容修正和内容创作;用户创作或修正完内容后,可以通过目标应用程序发布内容,在进行发布时,目标应用程序可以将待发布的内容发送给内容服务平台200,然后内容服务平台200进行内容分发;目标应用程序还可以从内容服务平台200获取内容分发结果,用户可以在目标应用程序上查看内容分发效果,并可以进行内容管理。本申请实施例中后续以大部分内容处理过程在内容服务平台200上执行为例进行示例性说明。
下面对上述内容处理***的内容处理过程进行详细说明。
图3为本申请实施例提供的一种内容处理方法的流程示意图,如图3所示,该方法可以包括如下步骤:
S101、CP设备接收用户的内容输入操作,向内容服务平台发送目标内容的源代码信息。
如前所述,用户在向内容服务平台同步内容前,可以先使用内容服务平台提供的内容对比功能进行内容对比。在进行内容对比时,用户可以通过复制内容的方式或者导入链接的方式输入内容,即,用户的内容输入操作可以是向内容编辑区123中复制目标内容的操作,也可以是导入目标内容对应的URL链接的操作,对应的,目标内容的源代码信息可以是目标内容的源代码或者目标内容对应的URL链接。为了便于说明,下面以导入URL链接为例进行示例性说明。
图4示例性示出了通过导入链接方式输入内容的过程。如图4中的(a)所示,用户在CP设备上打开内容服务平台的内容编辑器12后,可以选择导入链接控件1221;然后可以在弹出的对话框20中输入待同步的目标内容的URL,如图4中的(b)所示,此处示例性的URL为:http://abc.com;用户输入完URL,点击对话框20中的“确定”按钮后,CP设备可以将该链接(即目标内容的源代码信息)发送给内容服务平台。
如图4中的(b)所示,用户也可以通过点击对话框20中的“取消”按钮取消导入URL。
可以理解的是,本申请实施例中的各种点击操作也可以通过语音输入操作实现,为了便于说明,本实施例中以点击操作为例进行示例性说明。
S102、内容服务平台根据目标内容的源代码信息获取目标内容的原始源代码,识别目标内容的原始源代码中正文内容对应的源代码和冗余内容对应的源代码,并对正文内容对应的源代码进行标准化处理,得到标准化源代码。
内容服务平台接收到CP设备发送的目标内容的源代码信息(即上述URL链接)后,可以***获取目标内容的源代码(此处称为原始源代码)。
用户通过CP设备上传到内容服务平台的内容可能不符合内容服务平台的要求,内容服务平台获取到目标内容后,可以根据自身支持的编码风格和安全要求,对目标内容的原始源代码进行标准化处理,以提高内容服务平台中数据的一致性和安全性。
考虑到后续在进行内容对比时,目标内容中除正文内容之外的冗余内容可能会影响样式对比,为了提高内容对比结果的准确性,本实施例中,在对目标内容进行标准化处理前,可以先去除目标内容的原始源代码中冗余内容对应的源代码,然后针对正文内容对应的源代码进行标准化处理,这样也可以提高标准化处理效率。
具体地,内容服务平台可以采用网页正文提取算法识别出目标内容的原始源代码中正文内容对应的源代码和冗余内容对应的源代码。其中,网页正文提取算法例如可以是基于文本疏密度的网页正文提取算法,该算法是基于正文内容中文本和符号比较多,冗余内容中文本和符号比较少的原理,将内容中的HTML标签、文本和图片均作为节点,计算每个节点的文本密度和符号密度,然后根据各节点的文本密度和符号密度确定各节点是属于正文内容还是冗余内容。
可以理解的是,内容服务平台采用的网页正文提取算法不限于上述基于文本疏密度的网页正文提取算法,还可以采用其他网页正文提取算法,本实施例对此不做特别限定。
其中,冗余内容可以包括浮窗广告、相关阅读、左侧导航栏、右侧导航栏和底部导航栏等,这些内容的显示效果通常是动态可变的,在后续进行内容对比时可能会影响对比结果。
内容服务平台可以对目标内容的原始源代码进行分段,在确定出正文内容对应的节点(此处称为正文节点)和冗余内容对应的节点(此处称为冗余节点)后,可以将正文节点 所在的段落标记为正文段落,将冗余节点所在的段落标记为冗余段落。
其中,在进行分段时,可以根据img标签识别图片内容,根据p标签和section标签等用于标识段落的标签识别文字分段,然后将每个文字分段和图片分别作为一个段落。
继续以上述图4为例,假设目标内容为http://abc.com对应的内容,目标内容的原始源代码的显示结果(此处称为原始内容样式)如图5中所示,目标内容的原始源代码为:
<h1>标题</h1>
<div class="test"><p>AAAAAAAAAAAAA</p></div>
<div class="test"><p><b>BBBBBB</b></p></div>
<div class="right-sidebar"><div class="show-monitor"></div>
<div class="test"><a aria-label="“xxx"class="article-item"href="yyy"></a></div>
<div class="test"><p>CCCCCCCCCCC</p></div>
<img src="图片.jpg">
则如图6中的(a)所示,目标内容的原始源代码可以分为6个段落,其中,段落11对应“标题”,其源代码包括:“<h1>标题</h1>”。段落12对应“AAAAAAAAAAAAA”,其源代码包括:“<div class="test"><p>AAAAAAAAAAAAA</p></div>”。段落13对应“BBBBBB”,其源代码包括:“<div class="test"><p><b>BBBBBB</b></p></div>”。段落14对应浮窗广告,其源代码包括:“<div class="right-sidebar"><div class="show-monitor"></div>”和“<div class="test"><a aria-label="“xxx"class="article-item"href="yyy"></a></div>”。段落15对应“CCCCCCCCCCC”,其源代码包括:“<div class="test"><p>CCCCCCCCCCC</p></div>”。段落16对应图片,其源代码包括:“<img src="图片.jpg">”。
在进行标准化处理时,内容服务平台可以针对标记为正文内容的段落进行标准化处理,具体可以删除或替换不符合规范的HTML元素(即内容服务平台不支持的HTML元素)。例如,上述原始源代码中class用于指示标签div的样式,是其他浏览器/平台自定义的;段落4属于冗余段落,还有标签b,这些都不符合内容服务平台的规范,上述原始源代码经过标准化处理后,得到的标准化源代码为:
<h1>标题</h1>
<p>AAAAAAAAAAAAA</p>
<p>BBBBBB</p>
<p>CCCCCCCCCCC</p>
<img src="图片.jpg">
内容服务平台得到标准化源代码后,也可以对标准化源代码进行分段,然后建立原始源代码的分段结果与标准化源代码的分段结果之间的对应关系,以供后续内容对比时使用。
其中,在进行分段时,可以采用与原始源代码类似的方式分段,考虑到标准化源代码是基于原始源代码得到的,本实施例中,也可以直接基于原始源代码的分段结果确定标准化源代码的分段结果,即将原始源代码中的段落经过标准化处理后得到的段落作为标准化源代码的一个段落;同时,基于此原理,内容服务平台也可以得到原始源代码的分段结果与标准化源代码的分段结果之间的对应关系。
如图6中的(b)所示,目标内容的原始源代码可以分为5个段落,其中,段落21对应段落11,其源代码包括:“<h1>标题</h1>”。段落22对应段落12,其源代码包括:“<p>AAAAAAAAAAAAA</p>”。段落23对应段落13,其源代码包括:“<p>BBBBBB</p>”。段落24对应段落15,其源代码包括:“<p>CCCCCCCCCCC</p>”。段落25对应段落16,其源代码包括:“<img src="图片.jpg">”。
S103、内容服务平台向CP设备返回目标内容的标准化源代码。
内容服务平台对目标内容的原始源代码进行标准化处理后,可以将得到的标准化源代码发送给CP设备。
S104、CP设备显示标准化源代码对应的标准化内容。
如图4中的(c)所示,CP设备接收到内容服务平台发送的标准化源代码后,可以加载渲染标准化源代码,在内容编辑区123中显示出对应的标准化内容的样式效果(此处称为标准化内容样式)。
S105、CP设备接收用户的内容对比操作,向内容服务平台发送内容对比请求。
如图5所示,目标内容的原始源代码中文本内容“BBBBBB”是采用标签b实现加粗显示效果的,内容服务平台由于不支持标签b,在对目标内容的原始源代码经过标准化处理后,标准化源代码中文本内容“BBBBBB”对应的标签b被删除,如图4中的(c)所示,标准化内容中“BBBBBB”没有加粗显示效果。
针对上述情况,用户可以通过内容服务平台提供的内容对比功能对比目标内容与对应的标准化内容的样式效果,确定出引起样式效果不一致的差异点。
图7示例性的示出了内容对比过程的界面示意图,如图7中的(a)所示,用户可以点击内容对比控件1222进行内容对比。CP设备接收到用户的操作后,可以向内容服务平台发送内容对比请求,请求内容服务平台进行内容对比。
其中,该内容对比请求中可以携带目标内容的标识,以便于内容服务平台确定目标内容。
S106、内容服务平台接收到内容对比请求后,加载渲染原始源代码和标准化源代码,并对原始源代码对应的第一渲染结果和标准化源代码对应的第二渲染结果进行对比,生成第一内容对比结果。
内容服务平台接收到内容对比请求后,可以根据内容对比请求中携带的标识确定待对比的目标内容,然后提取出目标内容的原始源代码和标准化源代码进行内容对比。
具体地,内容服务平台可以采用同一渲染引擎加载渲染目标内容的原始源代码和标准化源代码,以对比原始源代码对应的渲染结果(此处称为第一渲染结果)和标准化源代码对应的渲染结果(此处称为第二渲染结果)。
考虑到内容服务平台支持的HTML元素与其他平台/浏览器支持的HTML不尽相同,本实施例中,为了提高对比结果的准确性,可以采用不同的渲染引擎加载渲染目标内容的原始源代码和标准化源代码。
其中,目标内容的原始源代码可以采用兼容性强的浏览器(此处称为第一浏览器)的渲染引擎渲染,标准化源代码可以采用内容服务平台所采用的浏览器(此处称为第二浏览器)的渲染引擎渲染。
第一渲染结果的样式效果可以参见图5,第二渲染结果的样式效果可以参见图4中的 (c)。在渲染得到第一渲染结果和第二渲染结果后,内容服务平台可以对这两个渲染结果进行对比,确定第一渲染结果和第二渲染结果是否存在差异。
具体地,第一渲染结果和第二渲染结果可以均为图片格式,内容服务平台可以对第一渲染结果和第二渲染结果进行图像对比,确定两个截图是否存在差异。
为了更精确的定位差异点,本实施例中,内容服务平台可以对第一渲染结果和第二渲染结果进行切片后对比,参见图8,图8为本申请实施例提供的内容对比过程的流程示意图,如图8所示,内容对比过程可以包括如下步骤:
S1061、分别对第一渲染结果和第二渲染结果进行图像分割,得到第一渲染结果对应的各个第一图像切片和第二渲染结果对应的各个第二图像切片。
具体地,内容服务平台可以采用相关的图像分割算法对生成的两个图像进行图像分割,其中,图像分割算法可以是基于阈值的分割算法、基于区域的分割算法或基于边缘的分割算法等,本实施例对此不做特别限定。
图9示例性的示出了图像分割结果,如图9中的(a)所示,图5中所示原始内容样式(即第一渲染结果),经过图像分割后,可以得到6个第一图像切片:图像切片11~图像切片16。如图9中的(b)所示,图4中所示标准化内容样式(即第二渲染结果),经过图像分割后,可以得到5个第二图像切片:图像切片21~图像切片25。
S1062、去除第一图像切片中的冗余切片后,对第一图像切片与第二图像切片进行匹配,得到第一图像切片与第二图像切片之间的匹配关系。
在得到第一图像切片和第二图像切片后,可以将两者匹配后进行图像对比。其中,第一图像切片中可能会包括冗余内容对应的切片(即冗余图像切片),本实施例中,在进行切片匹配前,可以先去除第一图像切片中的冗余图像切片。
具体地,在一种实现方式中,可以采用基于计算机视觉的图像识别算法来识别第一图像切片中的冗余图像切片,然后可以采用图像对比技术对比第一图像切片和第二图像切片,建立第一图像切片与第二图像切片之间的匹配关系(亦可成为对应关系)。
具体地,在另一种实现方式中,也可以基于目标内容的原始源代码和标准化源代码来确定第一图像切片中的冗余图像切片,以及建立第一图像切片与第二图像切片之间的匹配关系。
图10为本申请实施例提供的图像切片匹配关系建立过程示意图,如图10所示,该过程可以包括如下步骤:
S1062a、分别对原始源代码和标准化源代码进行代码分割,得到原始源代码对应的各个第一代码切片和标准化源代码对应的各个第二代码切片。
具体地,内容服务平台可以根据步骤S102中确定的原始源代码的分段结果对原始源代码进行代码分割,根据标准化源代码的分段结果对标准化源代码进行代码分割,将分段结果中的每个段落作为一个代码切片。
图11示例性的示出了代码分割结果,如图11中的(a)所示,步骤S102中的示例性原始源代码,经过代码分割后,可以得到6个第一代码切片:代码切片31(对应段落11)、代码切片32(对应段落12)、代码切片33(对应段落13)、代码切片34(对应段落14)、代码切片35(对应段落15)、代码切片36(对应段落16)。如图11中的(b)所示,步骤S102中的示例性标准化源代码,经过代码分割后,可以得到5个第二代码切片:代码 切片41(对应段落21)、代码切片42(对应段落22)、代码切片43(对应段落23)、代码切片44(对应段落24)、代码切片45(对应段落25)。
S1062b、根据冗余内容对应的源代码确定第一代码切片中的冗余代码切片和正文代码切片,并建立第一代码切片中正文代码切片与第二代码切片之间的对应关系。
如前所述,冗余内容对应的源代码所在的段落为冗余段落,根据冗余段落对应的代码切片,可以确定出第一代码切片中的冗余代码切片。图6中的冗余段落14对应图11中的代码切片34,该代码切片34即为第一代码切片中的冗余代码切片。
然后,基于步骤S102中建立的原始源代码的分段结果与标准化源代码的分段结果之间的对应关系、原始源代码的分段结果与第一代码切片之间的对应关系、标准化源代码的分段结果与第二代码切片之间的对应关系,即可得到第一代码切片中正文代码切片与第二代码切片之间的对应关系。
参见图11,代码切片31对应代码切片41、代码切片32对应代码切片42、代码切片33对应代码切片43、代码切片35对应代码切片44、代码切片36对应代码切片45。
S1062c、建立第一图像切片与第一代码切片之间的第一关联关系、第二图像切片与第二代码切片之间的第二关联关系。
内容服务平台在得到第一代码切片后,可以根据第一代码切片之间的前后顺序与第一图像切片之间的前后顺序建立第一图像切片与第一代码切片之间的关联关系(即第一关联关系)。
其中,纵向分布的图像切片中越靠上,则顺序越靠前,如果存在横向分布的图像切片,可以按从左到右的顺序将横向分布的图像切片转换为从上往下的纵向分布的图像切片。
参见图9和图11,按照上述前后顺序关系,可以得到第一关联关系:图像切片11(第一图像切片)与代码切片31(第一代码切片)关联、图像切片12与代码切片32关联、图像切片13与代码切片33关联、图像切片14与代码切片34关联、图像切片15与代码切片35关联、图像切片16与代码切片36关联。
为了提高确定的关联关系的准确性,在按照上述前后顺序关系关联第一图像切片与第一代码切片的过程中,可以对初始关联结果进行校验,得到最终的第一关联关系。
具体地,第一图像切片和第一代码切片可以分为文本切片和图片切片两类,在进行校验时,可以采用图像文本识别技术(例如光学字符识别(optical character recognition,OCR)技术)识别第一图像切片中的文本,根据文本识别结果确定第一图像切片中的文本切片和图片切片;根据HTML标签和代码文本识别技术识别第一代码切片中的图片切片和文本切片。例如图9所示的第一图像切片中,图像切片11、图像切片12、图像切片13和图像切片15为文本切片,图像切片16为图片切片;图11所示的第一代码切片中,代码切片31、代码切片32、代码切片33和代码切片35为文本切片,代码切片36为图片切片。
然后可以对比相关联的第一图像切片与第一代码切片是否均属于文本切片或图片切片,若均属于文本切片,则可以采用文本对比算法确定第一图像切片的文本识别结果与第一代码切片的文本识别结果之间的文本相似度,在文本相似度达到第一预设阈值的情况下,确定该第一图像切片与第一代码切片相关联;若均属于图片切片,则可以采用图像对比算法确定第一图像切片与第一代码切片之间的图像相似度,在图像相似度达到第二预设阈值的情况下,确定该第一图像切片与第一代码切片相关联。
第二关联关系的建立方式与第一关联关系的建立方式类似,此处不再赘述。参见图9和图11,可以得到第二关联关系:图像切片21(第二图像切片)与代码切片41(第二代码切片)关联、图像切片22与代码切片42关联、图像切片23与代码切片43关联、图像切片24与代码切片44关联、图像切片25与代码切片45关联。
S1062d、根据冗余代码切片去除第一关联关系中的冗余图像切片后,根据上述第一代码切片中正文代码切片与第二代码切片之间的对应关系、第一关联关系和第二关联关系,建立第一图像切片与第二图像切片之间的匹配关系。
具体地,第一图像切片中存在冗余切片,在建立第一图像切片与第二图像切片之间的匹配关系前,先去除第一关联关系中的冗余图像切片,该冗余图像切片即为冗余代码切片对应的第一图像切片。如步骤S1062b所述,图11中的代码切片34为第一代码切片中的冗余代码切片;如步骤S1062c所述,代码切片34关联的第一图像切片为图9中的图像切片14,则该图像切片14即为冗余图像切片。
去除上述冗余图像切片后,根据上述第一代码切片中正文代码切片与第二代码切片之间的对应关系、第一图像切片与第一代码切片之间的第一关联关系、第二图像切片与第二代码切片之间的第二关联关系,即可确定第一图像切片与第二图像切片之间的匹配关系。
以图11中的代码切片31(第一代码切片)为例,参见步骤S1062b,上述对应关系中,代码切片31对应代码切片41(第二代码切片);参见步骤S1062c,代码切片31与图像切片11(第一图像切片)关联,代码切片41与图像切片21(第二图像切片)关联,则如图12所示,可以得到,图像切片11与图像切片21匹配。同理,图像切片12与图像切片22匹配,图像切片13与图像切片23匹配,图像切片15与图像切片24匹配,图像切片16与图像切片25匹配。其中,图像切片14为冗余图像切片,不参与图像对比。
S1063、对匹配关系中的每对相匹配的第一图像切片和第二图像切片进行图像对比,根据图像对比结果生成第一内容对比结果。
在确定出第一图像切片与第二图像切片之间的匹配关系后,对于该匹配关系中每对相匹配的第一图像切片和第二图像切片,可以采用图像对比算法确定该第一图像切片和第二图像切片之间的图像相似度,然后根据该图像相似度与预设的相似度阈值(此处称为第三预设阈值)的关系确定该对图像切片的图像对比结果。例如,当该图像相似度大于或等于第三预设阈值时,可以认为该第一图像切片与相匹配的第二图像切片的样式一致;当该图像相似度小于第三预设阈值时,可以认为该第一图像切片与相匹配的第二图像切片的样式存在差异。
如图12所示,第一图像切片与第二图像切片的图像对比结果为:图像切片11与图像切片21样式一致,图像切片12与图像切片22样式一致,图像切片13与图像切片23样式存在差异,图像切片15与图像切片24样式一致,图像切片16与图像切片25样式一致。
在确定出各对图像切片的图像对比结果后,内容服务平台可以将第一渲染结果、第二渲染结果和图像对比结果叠加在一起,生成内容对比结果(此处称为第一内容对比结果)。
具体地,内容对比结果中可以包括第一渲染结果和第二渲染结果中样式效果存在差异的图像切片,也可以包括第一渲染结果和第二渲染结果中样式效果相同的图像切片。可选地,第一内容对比结果中可以包括第一渲染结果和第二渲染结果,其中,第一渲染结果和第二渲染结果可以横向排布,以便于对比,图像对比结果中存在差异的图像切片(此处称 为差异渲染结果)可以通过图标指示出来。
另外,第一内容对比结果中可以包括图像切片之间的对应关系(即匹配关系),例如,可以在相对应的第一图像切片和第二图像切片的周围显示矩形框,使相对应的第一图像切片和第二图像切片位于同一矩形框中;也可以在鼠标移动到某一图像切片所在区域或对应的图标位置时,突出显示该图像切片和该图像切片对应的图像切片,其中,突出显示方式可以是浮动显示方式或在图像切片中显示预设的填充色等。
内容服务平台可以渲染出该第一内容对比结果,然后发送给CP设备进行显示,以供用户查看。
S107、内容服务平台向CP设备返回第一内容对比结果。
S108、CP设备显示第一内容对比结果。
如图7中的(b)所示,CP设备接收到第一内容对比结果后,可以在弹出的内容对比弹窗30中显示第一内容对比结果。示例性的,第一内容对比结果中原始内容样式排布在内容对比弹窗30的左侧,标准化内容样式排布在内容对比弹窗30的右侧,图像对比结果中“BBBBBB”对应的图像切片(图像切片13与图像切片23)存在差异,该差异渲染结果通过位于图像切片13所在区域的图标31进行指示。
可以理解的是,上述图7中只是示例性示出了一处差异渲染结果,第一内容对比结果中也可能包括多处差异渲染结果,则每处差异渲染结果均可以通过对应的图标31进行指示。
另外,上述图7只是示例性的示出了第一内容对比结果中第一渲染结果和第二渲染结果的排布方式,以及图像对比结果中的差异渲染结果所采用的指示方式,其并非用于限定本申请,本申请实施例对第一内容对比结果的具体显示样式不做特别限定。
另外,当目标内容较长时,可以在原始内容样式与标准化内容样式的显示区域中增加滚动条,其中,可以在原始内容样式的显示区域和标准化内容样式的显示区域分别显示一个滚动条;为了更加方便用户查看内容对比结果,如图7中的(b)所示,CP设备也可以在原始内容样式与标准化内容样式之间的显示区域显示一个联动的滚动条32,即通过滑动该滚动条,可以同时控制内容对比弹窗30所显示的原始内容样式和标准化内容样式。
如步骤S106中所述,第一内容对比结果中也可以包括图像切片之间的对应关系,用户可以将鼠标移动到图像切片所在区域查看图像切片之间的对应关系。例如图7中的(b)所示的,用户将鼠标移动到“AAAAAAAAAAAAA”对应的第一图像切片所在区域时,CP设备可以浮动显示该第一图像切片和其对应的第二图像切片。
S109、CP设备接收用户针对第一内容对比结果中目标差异渲染结果的源代码对比操作,向内容服务平台发送源代码对比请求。
如图7中的(b)所示,目标内容中“BBBBBB”的样式效果与对应的标准化内容的样式效果不一致,用户则可以通过内容对比功能中的源代码对比功能对比源代码,查看引起不一致的原因。
具体地,用户触发源代码对比功能的源代码对比操作可以是点击图标31的操作,也可以是图7中的(c)所示的点击目标差异渲染结果所在区域的操作等。
如步骤S106中所述,第一内容对比结果中也可以包括图像切片之间的对应关系,则在用户触发源代码对比操作前,CP设备也可以根据鼠标的位置显示出图像切片之间的对应 关系。例如图7中的(c)所示的,用户将鼠标移动到“BBBBBB”对应的第一图像切片所在区域时,CP设备可以浮动显示该第一图像切片和其对应的第二图像切片。
当第一内容对比结果中存在多处差异渲染结果时,用户可以选择任意一处差异渲染结果作为目标差异渲染结果,然后在后续修改完该处差异渲染结果对应的标准化源代码后,可以继续选择其他差异渲染结果进行源代码对比和修改。
CP设备接收到源代码对比操作后,可以响应该操作,向内容服务平台发送源代码对比请求,其中,该源代码对比请求中可以携带用于指示待对比的目标差异渲染结果的标识,该标识具体可以是目标差异渲染结果中第一图像切片和/或第二图像切片的标识,也可以是用于指示该目标差异渲染结果的图标31的标识。
内容服务平台在向CP设备返回第一内容对比结果时可以将各目标差异渲染结果的标识一并返回给CP设备。
S110、内容服务平台接收到源代码对比请求后,分析目标差异渲染结果对应的原始源代码与标准化源代码的差异,生成目标差异渲染结果的源代码对比结果和修改建议。
内容服务平台接收到CP设备发送的源代码对比请求后,可以根据其中的标识确定待对比的目标差异渲染结果,然后基于预设的规则集(此处称为第一规则集)分析目标差异渲染结果对应的原始源代码与标准化源代码的差异。
其中,内容服务平台可以预先收集第一浏览器和第二浏览器所支持的HTML元素,根据收集的HTML元素生成第一规则集,该第一规则集中可以包括不影响样式效果的HTML元素集(此处称为第一元素集)和具有相同样式效果的HTML元素集(此处称为第二元素集)。
第一元素集中的HTML元素具体可以是第二浏览器所支持的HTML元素中不影响样式效果的元素;第二元素集中可以包括多个元素组,每个元素组中可以包括至少一个第一浏览器支持的HTML元素和至少一个第二浏览器支持的HTML元素,同一元素组中的HTML元素的样式效果相同。
目标差异渲染结果对应的原始源代码与标准化源代码即为目标差异渲染结果对应的第一代码切片和第二代码切片。内容服务平台在分析两个代码切片的差异时,可以先对比出两个代码切片中不相同的元素,然后基于第一规则集去除不相同的元素中具有相同样式效果的元素和不影响样式效果的元素,得到导致出现目标差异渲染结果的HTML元素(此处称为差异代码元素)。
继续以前述举例为例,图像对比结果中“BBBBBB”对应的图像切片(图像切片13与图像切片23)存在差异,其中,图像切片13关联的第一代码切片为代码切片33,图像切片23关联的第二代码切片为代码切片43,代码切片33的源代码包括:“<div class="test"><p><b>BBBBBB</b></p></div>”,代码切片44的源代码包括:“<p>BBBBBB</p>”。通过对比可知,代码切片33中div元素和b元素为差异代码元素。其中,div元素中class元素用于指示div的样式。
内容服务平台确定出差异代码元素后,可以根据目标差异渲染结果对应的原始源代码、标准化源代码和差异代码元素,生成源代码对比结果。
其中,与内容对比结果类似,源代码对比结果中可以包括目标差异渲染结果对应的原始源代码和标准化源代码,原始源代码和标准化源代码可以横向排布以便于对比,差异代 码元素可以通过采用不同颜色、加下划线或高亮方式突出显示。内容服务平台可以渲染出该源代码对比结果,然后发送给CP设备进行显示,以供用户查看。
为了提高用户使用的便利性,内容服务平台也可以提供修改建议。
具体实现时,内容服务平台可以根据第一浏览器和第二浏览器所支持的HTML元素预先生成第二规则集,第二规则集中可以包括多个元素组,每个元素组中可以包括至少一个第一浏览器支持的HTML元素和至少一个第二浏览器支持的HTML元素,同一元素组中的HTML元素的样式效果相同或相似。
内容服务平台可以根据该第二规则集确定与差异代码元素具有相同或相似样式效果的HTML元素,然后生成修改建议。
例如,第二规则集中某个元素组中包括第一浏览器支持的标签b和第二浏览器支持的标签strong,两个标签均表示加粗效果,则内容服务平台根据该元素组可以生成修改建议:将“<p>BBBBBB</p>”修改为:“<p><strong>BBBBBB</strong>”。
内容服务平台可以一并渲染出源码对比结果和修改建议,然后发送给CP设备进行显示。其中,修改元素也可以突出显示。
S111、内容服务平台向CP设备返回目标差异渲染结果的源代码对比结果和修改建议。
S112、CP设备显示目标差异渲染结果的源代码对比结果和修改建议。
如图7中的(d)所示,CP设备接收到源代码对比结果和修改建议后,可以在弹出的源码对比弹窗40中显示源代码对比结果和修改建议。示例性的,源代码对比结果中原始源代码排布在源码对比弹窗40的左侧,标准化源代码排布在源码对比弹窗40的右侧,源代码对比结果中“BBBBBB”对应的代码切片(代码切片33与代码切片43)中的差异代码元素具有下划线。修改建议位于源代码对比结果的下方,其中的修改元素显示为灰色。
可以理解的是,源代码对比结果中原始源代码和标准化源代码的排布方式可以与第一内容对比结果中第一渲染结果和第二渲染结果的排布方式类似,源代码对比结果中的差异代码元素和修改建议中的修改元素也可以采用其他方式指示,本实施例对源代码对比结果和修改建议的具体显示样式不做特别限定。
S113、CP设备接收用户的代码修改操作,修改标准化源代码。
用户查看了源代码对比结果后,可以修改标准化源代码,使得原始内容的样式效果与对应的标准化内容的样式效果尽可能一致。
具体地,用户可以手动修改标准化源代码,例如,用户可以在源码对比弹窗40中原始源代码显示栏中修改原始源代码,然后点击“手动修改”按钮41,完成源代码修改。
如前所述,为了便于用户使用,内容服务平台可以提供内容自动修正功能,用户也可以采用该功能自动修正标准化源代码。例如图7中的(d)所示的,用户可以直接点击“自动修正”按钮42,CP设备则可以根据修改建议自动对标准化源代码进行修改。
S114、CP设备向内容服务平台发送代码修改结果。
具体地,用户点击了“手动修改”按钮41或“自动修正”按钮42后,CP设备可以将代码修改结果发送给内容服务平台。
S115、内容服务平台接收到代码修改结果后,根据代码修改结果更新目标内容的标准化源代码,返回执行步骤S106,生成第二内容对比结果。
内容服务平台接收到CP设备发送的代码修改结果后,可以根据该结果更新目标内容 的标准化源代码,然后重新加载渲染目标内容的原始源代码和标准化源代码,并进行内容对比,生成新的内容对比结果(即第二内容对比结果),然后返回给CP设备。
继续以前述举例为例,假设用户采用了内容自动修正功能,CP设备将标准化源代码中“<p>BBBBBB</p>”修改为:“<p><strong>BBBBBB</strong>”,这样标准化内容中的“BBBBBB”则会显示出加粗效果。
S116、内容服务平台向CP设备返回第二内容对比结果。
S117、CP设备显示第二内容对比结果。
如图7中的(e)所示,CP设备接收到第二内容对比结果后,可以更新内容对比弹窗30中显示的内容对比结果,此时,标准化内容样式中的“BBBBBB”加粗显示,与原始内容样式一致。
S118、CP设备接收用户的内容对比退出操作,退出内容对比界面,并显示修改后的标准化源代码对应的标准化内容。
如图7中的(e)所示,用户通过内容对比结果确认修改后的标准化源代码对应的标准化内容符合要求时,可以点击退出控件33退出内容对比界面,即关闭内容对比弹窗30,并可以更新内容编辑区123中显示的内容,在内容编辑区123中显示修改后的标准化内容。
可以理解的是,如果内容对比结果中仍然存在目标差异渲染结果,用户可以继续修改标准化源代码,如果仍然存在的目标差异渲染结果在用户的可接受范围内,用户也可以直接发布。
S119、CP设备接收用户的内容发布操作,向内容服务平台发送内容发布请求。
用户在退出内容对比界面后,可以保存修改后的标准化内容,也可以如图7中的(f)所示的,点击功能菜单栏121中的“发布”按钮,以发布该内容。
CP设备接收到用户点击“发布”按钮的操作(即内容发布操作)后,可以向内容服务平台发送内容发布请求,其中,内容发布请求中可以携带目标内容的标识。
S120、内容服务平台接收到内容发布请求后,向CP设备返回响应消息。
内容服务平台接收到内容发布请求后,可以向CP设备返回响应消息,以告知CP设备内容服务平台已成功接收到请求。
另外,内容服务平台可以根据内容发布请求中的标识确定待发布的目标内容对应的标准化内容,然后进行发布,其中,在发布之前,内容服务平台也可以先对待发布的内容进行审核,在审核通过的情况下发布,以提高安全性。
S121、CP设备接收到响应消息后,显示提交成功的提示信息。
CP设备接收到响应消息后,可以显示如图7中的(g)所示的提示信息50,以提示用户以成功提交内容。后续,用户可以通过导航菜单11中的“管理”菜单查看已提交的内容的发布进程。
其中,该提示信息50可以在用户点击提示信息50所在区域之外的位置时不再显示,也可以在显示一个较短的时间(例如两秒)后自动消失。
CP提交的修改后的标准化内容如果审核通过,内容服务平台可以将内容分发给终端设备,如图7中的(h)所示,内容服务平台将内容分发到终端设备上后,终端用户则可以在终端设备上查看该内容,该内容与图7中的(g)中所示的修改后的标准化内容的样式效果一致。
本实施例提供的技术方案中,内容服务平台提供的内容对比功能,可以对比目标内容与对应的标准化内容的样式效果和源代码,确定引起样式效果不一致的差异代码元素,这样CP通过该内容对比功能就可以定位差异代码元素,从而对标准化源代码进行修改,以减小在内容服务平台发布内容时的内容展示差异;另外,内容服务平台提供的内容自动修正功能还可以帮助CP自动修改标准化源代码,提高CP使用的便利性。
下面介绍用户通过内容对比功能对比同一内容在不同平台上的样式效果和源代码的过程。
请参见图13,图13为本申请实施例提供的另一种内容处理方法的流程示意图,如图13所示,该方法可以包括如下步骤:
S201、CP设备接收用户输入的目标内容分别在第一平台和第二平台上对应的源代码信息。
具体地,内容服务平台可以在导航菜单11中“创作”菜单下设置“工具”选项,在“工具”选项对应的页面中提供平台内容对比功能和浏览器内容对比功能。例如图14中的(a)所示的,用户可以在内容服务平台的导航菜单11中选择“创作”菜单下的“工具”选项,打开工具页面60,其中,工具页面60中包括平台内容对比工具61和浏览器内容对比工具62。用户可以选择平台内容对比工具61对比目标内容在不同平台上的样式效果和源代码。
可以理解的是,上述只是示例性示出一种平台内容对比功能和浏览器内容对比功能的实现方式,其并非用于限定本申请,本申请对平台内容对比功能和浏览器内容对比功能的具体界面实现方式不做特别限定。
如图14中的(b)所示,用户选择平台内容对比工具61后,可以打开对应的平台内容对比界面70,其中,平台内容对比界面70中可以包括平台1内容输入区71和平台2内容输入区72。用户可以在平台1内容输入区71中输入目标内容在第一平台上对应的源代码信息,在平台2内容输入区71中输入目标内容在第二平台上对应的源代码信息。
另外,每个内容输入区均可以配置内容清除控件701和导入链接控件702,以第一平台为例,用户可以在平台1内容输入区71中直接输入目标内容在第一平台上的源代码,或者将第一平台上显示的目标内容复制到平台1内容输入区71;用户也可以通过导入链接控件702输入目标内容在第一平台上的URL链接,图14中的(b)即是以导入链接方式为例进行示例性说明,其中,目标内容在第一平台上的URL为:http://abc1.com,目标内容在第一平台上的URL为:http://abc2.com。
其中,用户在输入源代码信息的过程中,也可以通过内容清除控件701清除已输入的源代码信息。
可以理解的是,本实施例中,用户也可以在平台1内容输入区71和平台2内容输入区71中的其中一个内容输入区中输入目标内容的原始源代码信息,在另一内容输入区中输入目标内容在目标平台上的源代码信息,以查看目标平台对HTML元素的清洗规则。
S202、CP设备接收用户的内容对比操作,向内容服务平台发送内容对比请求。
如图14中的(b)所示,用户输入完URL后,可以点击平台内容对比界面70中的“确定”按钮;CP设备接收到用户点击该“确定”按钮的操作(即内容对比操作)后,可以将 两个URL链接(即目标内容在第一平台和第二平台上对应的源代码信息)携带在内容对比请求中发送给内容服务平台。
S203、内容服务平台根据内容对比请求获取目标内容在第一平台上对应的第一源代码和目标内容在第二平台上对应的第二源代码,然后分别采用目标浏览器的渲染引擎加载渲染第一源代码和第二源代码,对第一源代码对应的渲染结果和第二源代码对应的渲染结果进行对比,生成内容对比结果。
与步骤S106类似,内容服务平台接收到内容对比请求后,可以根据内容对比请求中携带的URL链接确定待对比的第一源代码和第二源代码,然后分别加载渲染第一源代码和第二源代码,对第一源代码对应的渲染结果和第二源代码对应的渲染结果进行对比。
其中,加载渲染第一源代码和第二源代码可以采用同一浏览器的渲染引擎,所采用的目标浏览器可以是内容服务平台所采用的浏览器,也可以是兼容性较强的浏览器。
示例性的,第一源代码为:
<h1>标题</h1>
<div class="test"><p>AAAAAAAAAAAAA</p></div>
<div class="test"><p>BBBBBB</p></div>
<div class="test"><p>CCCCCCCCCCC</p></div>
<img src="图片.jpg">
第二源代码为:
<h1>标题</h1>
<div class="test"><p>AAAAAAAAAAAAA</p></div>
<div class="test"><p><b>BBBBBB</b></p></div>
<div class="right-sidebar"><div class="show-monitor"></div>
<div class="test"><a aria-label="“xxx"class="article-item"href="yyy"></a></div>
<div class="test"><p>CCCCCCCCCCC</p></div>
<img src="图片.jpg">
具体的内容对比过程与步骤S106中所述的内容对比过程类似,此处不再赘述。在匹配图像切片时,可以采用基于计算机视觉的图像识别算法来识别图像切片中的冗余图像切片,然后采用图像对比技术建立图像切片之间的匹配关系;也可以采用图10中所示的方式,确定图像切片中的冗余图像切片,并建立第一源代码与第二源代码的代码切片之间的对应关系后,基于该对应关系建立图像切片之间的匹配关系。
S204、内容服务平台向CP设备返回内容对比结果。
S205、CP设备显示内容对比结果。
如图14中的(c)所示,CP设备接收到内容对比结果后,可以在弹出的内容对比弹窗中显示内容对比结果。该内容对比结果的显示方式与步骤S108中内容对比结果的显示方式类似,此处不再赘述。
S206、CP设备接收用户针对内容对比结果中目标差异渲染结果的源代码对比操作,向内容服务平台发送源代码对比请求。
如图14中的(c)所示,内容对比结果中“BBBBBB”在第一平台和第二平台上的显示效果不一致,此时,用户可以通过内容对比功能中的源代码对比功能对比源代码,查看 引起不一致的原因。
该步骤的具体实现过程与步骤S109类似,相关描述可以参见步骤S109,此处不再赘述。
S207、内容服务平台接收到源代码对比请求后,分析内容对比结果中各差异渲染结果对应的第一源代码与第二源代码的差异,确定各差异渲染结果对应的差异代码元素,并生成目标差异渲染结果的源代码对比结果。
内容服务平台接收到CP设备发送的源代码对比请求后,可以根据其中的标识确定待对比的目标差异渲染结果,然后基于预设的规则集(此处称为第三规则集)分析目标差异渲染结果对应的第一源代码和第二源代码的差异。
其中,第三规则集可以根据预先收集的各个平台所支持的HTML元素生成,同样的,第三规则集中可以包括元素集1和元素集2。元素集1中可以包括各个平台所支持的HTML元素中不影响样式效果的HTML元素;元素集2中可以包括各个平台所支持的HTML元素中具有相同样式效果的HTML元素。
具体地,根据第三规则集确定差异代码元素的过程与步骤S110类似,相关描述可以参见步骤S110,此处不再赘述。
本实施例中,在存在多处差异渲染结果的情况下,内容服务平台还可以一并分析其他的差异渲染结果对应的第一源代码和第二源代码的差异,确定导致各差异渲染结果的差异代码元素,然后将确定的差异代码元素一并返回给CP设备。
内容服务平台也可以同时生成其他差异渲染结果对应的源代码对比结果,然后返回给CP设备,其中,为了提升用户体验,内容服务平台可以先返回目标差异渲染结果对应的源代码对比结果,然后返回其他差异渲染结果对应的源代码对比结果,使CP设备可以尽快显示出目标差异渲染结果对应的源代码对比结果。
S208、内容服务平台向CP设备返回各差异代码元素和生成的源代码对比结果。
S209、CP设备显示源代码对比结果,并保存差异代码元素。
具体地,如图14中的(d)所示,CP设备接收到目标差异渲染结果对应的源代码对比结果后,可以显示该源代码对比结果,供用户查看引起该目标差异渲染结果的差异代码元素。例如图14中所示的,差异代码元素为标签b,其通过下划线进行标记。
另外,CP设备接收到内容服务平台返回的差异代码元素后,可以将这些差异代码元素保存在用户预先设置的文件中。其中,用户可以预先通过CP设备在内容服务平台上设置保存路径。或者,也可以在源码对比弹窗中提供“保存”按钮(未示出),用户可以通过该按钮将差异代码元素保存在目标文件中。
本实施例提供的技术方案中,内容服务平台提供的平台内容对比功能,可以对比目标内容在第一平台和第二平台上的样式效果和源代码,确定引起样式效果不一致的差异代码元素,这样就可以帮助CP识别各平台支持的通用代码元素,从而CP可以在创作内容时尽量使用多个平台均支持的通用代码元素,避免使用不同平台的差异代码元素,以减小内容在不同平台发布时的内容展示差异。
下面介绍用户通过内容对比功能对比同一内容在不同浏览器上的样式效果和源代码的过程。
请参见图15,图15为本申请实施例提供的又一种内容处理方法的流程示意图,如图15所示,该方法可以包括如下步骤:
S301、CP设备接收用户输入的目标内容的源代码信息,以及用户针对浏览器A和浏览器B的选择操作。
如图16中的(a)所示的,用户可以在内容服务平台的导航菜单11中选择“创作”菜单下的“工具”选项,打开工具页面60,然后选择浏览器内容对比工具62对比目标内容在不同浏览器上的样式效果和源代码。
如图16中的(b)所示,用户选择浏览器内容对比工具62后,可以打开对应的浏览器内容对比界面80,其中,浏览器内容对比界面80中可以包括内容输入区81和浏览器选择区82。用户可以在内容输入区81中输入目标内容的源代码信息,在浏览器选择区82中选择在进行内容渲染时所采用的浏览器,此处示例性的示出了四个浏览器选项,且用户选择了浏览器A和浏览器B。
可以理解的是,浏览器内容对比界面80中提供的浏览器选项的数量不限于四个,另外,浏览器内容对比界面80中也可以不提供浏览器选项,对应的,内容服务平台在进行内容对比时采用默认的两个浏览器的渲染引擎加载渲染目标内容。
与平台内容对比界面70类似,内容输入区81可以配置有内容清除控件和导入链接控件,用户可以通过内容清除控件清除已输入的源代码信息,通过导入链接控件输入目标内容的URL链接,图16中的(b)即是以导入链接方式为例进行示例性说明,其中,目标内容的URL为:http://abc.com。
S302、CP设备接收用户的内容对比操作,向内容服务平台发送内容对比请求。
如图16中的(b)所示,用户输入完URL,并选择完浏览器后,可以点击浏览器内容对比界面80中的“确定”按钮;CP设备接收到用户点击该“确定”按钮的操作(即内容对比操作)后,可以将URL链接(即目标内容的源代码信息)和用户选择的浏览器信息携带在内容对比请求中发送给内容服务平台。
S303、内容服务平台根据内容对比请求获取目标源代码,然后分别调用浏览器A和浏览器B的渲染引擎加载渲染目标源代码,对浏览器A对应的渲染结果和浏览器B对应的第渲染结果进行对比,生成内容对比结果。
内容服务平台可以预先存储图16中的(b)所示的各浏览器选项对应的浏览器的渲染引擎,内容服务平台接收到内容对比请求后,可以根据内容对比请求中携带的URL链接确定待分析的目标源代码、用户选择的浏览器A和浏览器B,然后分别调用浏览器A和浏览器B的渲染引擎加载渲染目标源代码,对浏览器A对应的渲染结果和浏览器B对应的渲染结果进行对比。
示例性的,目标源代码为步骤S102中所述的目标内容的原始源代码:
<h1>标题</h1>
<div class="test"><p>AAAAAAAAAAAAA</p></div>
<div class="test"><p><b>BBBBBB</b></p></div>
<div class="right-sidebar"><div class="show-monitor"></div>
<div class="test"><a aria-label="“xxx"class="article-item"href="yyy"></a></div>
<div class="test"><p>CCCCCCCCCCC</p></div>
<img src="图片.jpg">
在进行内容对比时,可以采用与步骤S106中类似的方式对目标源代码、浏览器A对应的渲染结果和浏览器B对应的渲染结果进行切片,建立代码切片与图像切片之间的关联关系;并可以采用基于计算机视觉的图像识别算法来识别图像切片中的冗余图像切片后,采用图像对比技术建立图像切片之间的匹配关系,具体的内容对比过程与步骤S106中所述的内容对比过程类似,此处不再赘述。
S304、内容服务平台向CP设备返回内容对比结果。
S305、CP设备显示内容对比结果。
如图16中的(c)所示,CP设备接收到内容对比结果后,可以在弹出的内容对比弹窗中显示内容对比结果。该内容对比结果的显示方式与步骤S108中内容对比结果的显示方式类似,此处不再赘述。
S306、CP设备接收用户针对内容对比结果中目标差异渲染结果的源代码分析操作,向内容服务平台发送源代码分析请求。
如图16中的(c)所示,内容对比结果中“BBBBBB”在浏览器A和浏览器B上的显示效果不一致,此时,用户可以通过内容对比功能中的源代码分析功能分析源代码,查看引起不一致的原因。
该步骤的具体实现过程与步骤S109类似,相关描述可以参见步骤S109,此处不再赘述。
S307a、内容服务平台接收到源代码分析请求后,确定各差异渲染结果对应的源代码。
在一些实施例中,源代码分析过程还可以包括S307b、内容服务平台分析内容对比结果中各差异渲染结果对应的源代码,确定各差异渲染结果对应的差异代码元素,并生成目标差异渲染结果的源代码分析结果。
内容服务平台接收到CP设备发送的源代码对比请求后,可以根据其中的标识确定待对比的目标差异渲染结果,然后根据代码切片与图像切片之间的关联关系,确定目标差异渲染结果对应的源代码,根据确定的源代码生成源代码分析结果。
为了更精确的定位造成差异渲染结果的原因,本实施例中,内容服务平台还可以基于预设的规则集(此处称为第四规则集)分析目标差异渲染结果对应的源代码,确定目标差异渲染结果对应的差异代码元素。
其中,内容服务平台可以预先收集各个浏览器所支持的HTML元素中可能引起差异的HTML元素,形成第四规则集。
内容服务平台在分析目标差异渲染结果对应的源代码时,可以查看第四规则集,看该源代码中是否存在第四规则集中的HTML元素,若存在,则将与第四规则集中相同的HTML元素确定为差异代码元素,若不存在,可以将目标差异渲染结果对应的整段源代码作为差异代码元素。
例如上述目标源代码中,class用于指示标签div的样式,属于自定义元素,其可能会影响样式效果;标签b在有些浏览器中不支持,即标签div和标签b可能会引起样式效果的差异,这些都可以收集在第四规则集中,则内容服务平台根据该第四规则集可以确定出目标差异渲染结果对应的差异代码元素包括:标签div和标签b。
在未确定差异代码元素的情况下,内容服务平台可以将目标差异渲染结果对应的源代 码作为源代码分析结果返回给CP设备(即下述步骤S308a);对应的,CP设备显示目标差异渲染结果对应的源代码(即下述步骤S309a)。
在确定出差异代码元素的情况下,与步骤S110类似,内容服务平台生成的源代码分析结果中可以包括目标差异渲染结果对应的源代码和差异代码元素。其中,差异代码元素可以通过采用不同颜色、加下划线或高亮方式突出显示。
与步骤S207类似,本实施例中,在存在多处差异渲染结果的情况下,内容服务平台还可以一并分析其他的差异渲染结果对应的源代码,确定导致各差异渲染结果的差异代码元素,然后将确定的差异代码元素一并返回给CP设备。
内容服务平台也可以同时生成其他差异渲染结果对应的源代码分析结果,然后返回给CP设备。
S308a、内容服务平台向CP设备返回目标差异渲染结果对应的源代码。
S308b、内容服务平台向CP设备返回各差异代码元素和生成的源代码分析结果。
在内容服务平台确定出差异代码元素的情况下,内容服务平台可以将生成的源代码分析结果和确定的差异代码元素返回给CP设备。
S309a、CP设备显示目标差异渲染结果对应的源代码。
S309b、CP设备显示源代码分析结果,并保存差异代码元素。
具体地,如图16中的(d)所示,CP设备接收到目标差异渲染结果对应的源代码分析结果后,可以显示该源代码分析结果,供用户查看引起该目标差异渲染结果的差异代码元素。例如图16中所示的,差异代码元素包括标签div和标签b,其通过下划线进行标记。
与步骤S209类似,CP设备接收到内容服务平台返回的差异代码元素后,可以将这些差异代码元素保存在用户预先设置的文件中。或者,也可以在源码对比弹窗中提供“保存”按钮(未示出),用户可以通过该按钮将差异代码元素保存在目标文件中。
可以理解的是,上述各实施例中,在加载渲染源代码之前,也可以先去除待渲染的源代码中的冗余代码段,然后进行加载渲染、图像切片和代码切片。
本实施例提供的技术方案中,内容服务平台提供的浏览器内容对比功能,可以对比目标内容在不同浏览器上的样式效果,并可以分析目标内容的源代码,确定引起样式效果不一致的差异代码元素,这样就可以帮助CP了解各浏览器对HTML元素的处理差异,从而CP可以在创作内容时尽量不使用各浏览器不支持的HTML元素,以减小内容在不同浏览器上展示时的内容展示差异。
本领域技术人员可以理解,以上各实施例是示例性的,并非用于限定本申请。在可能的情况下,以上步骤中的一个或者几个步骤的执行顺序可以进行调整,也可以进行选择性组合,得到一个或多个其他实施例。本领域技术人员可以根据需要从上述步骤中任意进行选择组合,凡是未脱离本申请方案实质的,都落入本申请的保护范围。
基于同一构思,作为对上述方法的实现,本申请实施例提供了一种内容处理装置,该装置实施例与前述方法实施例对应,为便于阅读,本装置实施例不再对前述方法实施例中的细节内容进行逐一赘述,但应当明确,本实施例中的装置能够对应实现前述方法实施例中的全部内容。
图17为本申请实施例提供的内容处理装置的结构示意图,如图17所示,本实施例提 供的装置包括:
显示模块210、输入模块220、处理模块230和通信模块240。
可以理解的是,本申请实施例示意的结构并不构成对内容处理装置的具体限定。在本申请另一些实施例中,内容处理装置可以包括比图示更多或更少的模块。图示的模块可以以硬件,软件或软件和硬件的组合实现。
其中,显示模块210用于支持电子设备执行上述实施例中的界面显示操作和/或用于本文所描述的技术的其它过程。显示模块可以是触摸屏或其他硬件或硬件与软件的综合体。
输入模块220用于接收用户在电子设备的显示界面上的输入,如触摸输入、语音输入、手势输入等,输入模块用于支持电子设备执行上述实施例中接收用户的接听通话操作的步骤和/或用于本文所描述的技术的其它过程。输入模块可以是触摸屏或其他硬件或硬件与软件的综合体。
处理模块230用于支持电子设备执行上述实施例中的内容处理操作和/或用于本文所描述的技术的其它过程。
通信模块240用于支持电子设备执行上述实施例中与其他电子设备之间的通信过程相关的操作和/或用于本文所描述的技术的其它过程。
其中,该电子设备可以是上述实施例中的CP设备或内容服务平台中的服务器。
本实施例提供的装置可以执行上述方法实施例,其实现原理与技术效果类似,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述***中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
基于同一构思,本申请实施例还提供一种CP设备,请参阅图18,图18为本申请实施例提供的CP设备的结构示意图。
CP设备可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
可以理解的是,本申请实施例示意的结构并不构成对CP设备的具体限定。在本申请另一些实施例中,CP设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(sraphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是CP设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了***的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
I2C接口是一种双向同步串行总线,包括一根串行数据线(serial data line,SDA)和一根串行时钟线(serail clock line,SCL)。I2S接口可以用于音频通信。PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。UART接口是一种通用串行数据总线,用于异步通信;该总线可以为双向通信总线,它将要传输的数据在串行通信与并行通信之间转换。MIPI接口可以被用于连接处理器110与显示屏194,摄像头193等***器件;MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。GPIO接口可以通过软件配置,GPIO接口可以被配置为控制信号,也可被配置为数据信号。USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为CP设备充电,也可以用于CP设备与***设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他CP设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对CP设备的结构限定。在本申请另一些实施例中,CP设备也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口 130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过CP设备的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为CP设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
CP设备的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。CP设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在CP设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在CP设备上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星***(global navigation satellite system,GNSS),调频(frequency modulation,FM),近场通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,CP设备的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得CP设备可以通过无线通信技术与网络以及其他设备通信。所述无线通信技 术可以包括全球移动通讯***(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分同步码分多址(time division-synchronous code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位***(global positioning system,GPS),全球导航卫星***(global navigation satellite system,GNSS),北斗卫星导航***(beidou navigation satellite system,BDS),准天顶卫星***(quasi-zenith satellite system,QZSS)和/或星基增强***(satellite based augmentation systems,SBAS)。
CP设备通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Mini LED,Micro LED,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,CP设备可以包括1个或N个显示屏194,N为大于1的正整数。
CP设备可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。摄像头193用于捕获静态图像或视频。数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。视频编解码器用于对数字视频压缩或解压缩。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现CP设备的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行CP设备的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作***,以及至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储CP设备使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
外部存储器接口120可以用于连接外部存储器,例如Micro SD卡,实现扩展CP设备的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
CP设备可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。耳机接口170D用于连接有线耳机。耳机接口170D可以是USB接口130,也可以是3.5mm的开放移动CP设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。CP设备可以接收按键输入,产生与CP设备的用户设置以及功能控制有关的键信号输入。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过***SIM卡接口195,或从SIM卡接口195拔出,实现和CP设备的接触和分离。CP设备可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。
本实施例提供的CP设备可以执行上述方法实施例中CP设备的处理过程,其实现原理与技术效果类似,此处不再赘述。
基于同一构思,本申请实施例还提供一种服务器,图19为本申请实施例提供的服务器的结构示意图,如图19所示,本实施例提供的服务器可以包括:存储器310、处理器320和通信模块330等部件。
其中,存储器310可用于存储计算机程序以及模块,处理器320通过运行存储在存储器310的计算机程序以及模块可以执行上述方法实施例中服务器所执行的方法。存储器310可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作***、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据服务器的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器310可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
处理器320是服务器的控制中心,利用各种接口和线路连接整个服务器的各个部分,通过运行或执行存储在存储器310内的软件程序和/或模块,以及调用存储在存储器310内的数据,执行服务器的各种功能和处理数据,从而对服务器进行整体监控。可选的,处理器320可包括一个或多个处理单元。
通信模块330可以提供应用在服务器上的包括无线局域网(Wireless Local Area Networks,WLAN)(如Wi-Fi网络)、蓝牙、Zigbee、移动通信网络、全球导航卫星***(global navigation satellite system,GNSS)、调频(frequency modulation,FM)、NFC和红外技术(infrared,IR)等通信的解决方案。通信模块330可以是集成至少一个通信处理模块的一个或多个器件。该通信模块330可以包括天线,可以通过天线接收电磁波,将电磁波信号调 频以及滤波处理,将处理后的信号发送到处理器。通信模块330还可以从处理器320接收待发送的信号,对其进行调频、放大,经天线转为电磁波辐射出去。服务器可以通过该通信模块330与CP设备进行通信。
本领域技术人员可以理解,图19仅仅是服务器的举例,并不构成对服务器的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
其中,服务器可以是一个同时具备下载服务和拆包功能的服务器,也可以包括两个:一个为提供RPK包下载服务的应用市场服务器,一个为提供拆包功能的快应用服务器。
服务器可以是单独的服务器,也可以是服务器集群,即上述同时具备下载服务和拆包功能的服务器、应用市场服务器和快应用服务器均可以是服务器集群。
本实施例提供的服务器可以执行上述方法实施例中内容服务平台的处理过程,其实现原理与技术效果类似,此处不再赘述。
本申请实施例还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述方法实施例所述的方法。
本申请实施例还提供一种计算机程序产品,当计算机程序产品在电子设备上运行时,使得电子设备执行时实现上述方法实施例所述的方法。
本申请实施例还提供一种芯片***,包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现上述方法实施例所述的方法。其中,所述芯片***可以为单个芯片,或者多个芯片组成的芯片模组。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者通过所述计算机可读存储介质进行传输。所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线)或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如软盘、硬盘或磁带)、光介质(例如DVD)、或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,该流程可以由计算机程序来指令相关的硬件完成,该程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法实施例的流程。而前述的存储介质可以包括:ROM或随机存储记忆体RAM、磁碟或者光盘等各种可存储程序代码的介质。
在本申请中出现的对步骤进行的命名或者编号,并不意味着必须按照命名或者编号所指示的时间/逻辑先后顺序执行方法流程中的步骤,已经命名或者编号的流程步骤可以根据要实现的技术目的变更执行次序,只要能达到相同或者相类似的技术效果即可。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
在本申请所提供的实施例中,应该理解到,所揭露的装置/设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
应当理解,在本申请说明书和所附权利要求书的描述中,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或模块的过程、方法、***、产品或设备不必限于清楚地列出的那些步骤或模块,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或模块。
在本申请的描述中,除非另有说明,“/”表示前后关联的对象是一种“或”的关系,例如,A/B可以表示A或B;本申请中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。
并且,在本申请的描述中,除非另有说明,“多个”是指两个或多于两个。“以下至少一项”或其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b,或c中的至少一项,可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (18)

  1. 一种内容处理方法,其特征在于,包括:
    显示第一内容输入界面;
    获取第一目标内容的第一代码信息和第二代码信息;
    接收用户针对第一目标内容的第一内容对比操作,根据所述第一代码信息进行页面渲染,获得第一渲染结果,根据所述第二代码信息进行页面渲染,获得第二渲染结果;第一渲染结果包括第一图像切片和第二图像切片,第二渲染结果包括第三图像切片和第四图像切片;
    生成并显示第一内容对比结果;所述第一内容对比结果包括第一图像切片和第三图像切片存在差异,第二图像切片和第四图像切片相同;
    接收用户针对所述第一图像切片和所述第三图像切片的源代码对比操作,显示第一图像切片和第三图像切片的源代码对比结果。
  2. 根据权利要求1所述的方法,其特征在于,所述第一代码信息为所述第一目标内容的原始源代码的源代码信息,所述第二代码信息为所述第一目标内容的标准化源代码的源代码信息,所述标准化源代码是对所述原始源代码经过标准化处理后得到的。
  3. 根据权利要求2所述的方法,其特征在于,所述第一代码信息包括:所述第一目标内容的原始源代码,或,所述第一目标内容的原始源代码对应的网页链接。
  4. 根据权利要求2或3所述的方法,其特征在于,所述第一内容对比结果中包括:所述第一渲染结果、所述第二渲染结果,以及与存在差异的所述第一图像切片和所述第三图像切片相对应的指示图标;
    针对所述第一图像切片和第三图像切片的源代码对比操作为:针对所述第一图像切片或第三图像切片所在显示区域的点击操作,或,针对所述指示图标的点击操作。
  5. 根据权利要求2-4任一项所述的方法,其特征在于,所述方法还包括:
    接收用户的代码修改操作,修改所述标准化源代码,并显示第二内容对比结果;所述第二内容对比结果中包括所述原始源代码对应的渲染结果与修改后的标准化源代码对应的渲染结果之间的对比结果。
  6. 根据权利要求5所述的方法,其特征在于,所述第二内容对比结果所在的显示界面中包括:用于进行自动修改标准化源代码的自动修正按钮;
    所述代码修改操作包括:针对所述第二内容对比结果中标准化源代码的代码编辑操作,和/或,针对所述自动修正按钮的点击操作。
  7. 根据权利要求5或6所述的方法,其特征在于,在所述接收用户的代码修改操作之前,所述方法还包括:
    显示所述第三图像切片对应的标准化源代码的代码修改建议。
  8. 根据权利要求2-7任一项所述的方法,其特征在于,所述方法还包括:
    接收用户的内容发布操作,向服务器发送内容发布请求;
    在接收到服务器返回的响应消息后,显示提交成功的提示信息。
  9. 根据权利要求1所述的方法,其特征在于,所述第一代码信息为所述第一目标内容在第一平台上对应的源代码信息,所述第二代码信息为所述第一目标内容在第二平台上对应的源代码信息。
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述第一渲染结果中还包括第五图像切片,所述第五图像切片为所述第一目标内容中非正文内容对应的图像切片;
    所述第一内容对比结果中包括所述第一图像切片与所述第三图像切片之间的对应关系、所述第二图像切片与所述第四图像切片之间的对应关系;
    所述第一内容对比结果中不包括所述第五图像切片对应的图像切片。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述源代码对比结果中突出显示所述第一图像切片对应的源代码与所述第三图像切片对应的源代码之间的差异代码元素。
  12. 根据权利要求1-11任一项所述的方法,其特征在于,所述生成并显示第一内容对比结果,包括:
    确定所述第一渲染结果的图像切片和所述第二渲染结果的图像切片之间的对应关系;
    分别对每组相对应的第一渲染结果的图像切片和第二渲染结果的图像切片进行对比,生成并显示第一内容对比结果。
  13. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    显示第二内容输入界面;
    接收用户输入的第二目标内容的源代码信息,以及用户针对第一浏览器和第二浏览器的选择操作;
    接收用户针对所述第二目标内容的内容对比操作,调用所述第一浏览器的渲染引擎对目标源代码进行渲染,获得第三渲染结果,调用所述第二浏览器的渲染引擎对目标源代码进行渲染,获得第四渲染结果;所述目标源代码是根据所述第二目标内容的源代码信息获取到的,所述第三渲染结果包括第六图像切片和第七图像切片,所述第四渲染结果包括第八图像切片和第九图像切片;
    生成并显示第三内容对比结果;所述第三内容对比结果包括第六图像切片和第八图像切片存在差异,第七图像切片和第九图像切片相同;
    接收用户针对所述第六图像切片和所述第八图像切片的源代码分析操作,显示所述第六图像切片和所述第八图像切片的源代码分析结果。
  14. 根据权利要求13所述的方法,其特征在于,所述源代码分析结果中突出显示所述目标源代码中导致所述第六图像切片和所述第八图像切片存在差异的差异代码元素。
  15. 一种电子设备,其特征在于,包括:存储器和处理器,所述存储器用于存储计算机程序;所述处理器用于在调用所述计算机程序时执行如权利要求1-14任一项所述的方法。
  16. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-14任一项所述的方法。
  17. 一种计算机程序产品,其特征在于,当计算机程序产品在电子设备上运行时,使得电子设备执行如权利要求1-14任一项所述的方法。
  18. 一种芯片***,其特征在于,所述芯片***包括处理器,所述处理器与存储器耦合,所述处理器执行存储器中存储的计算机程序,以实现如权利要求1-14任一项所述的方法。
PCT/CN2022/114234 2021-08-31 2022-08-23 内容处理方法与电子设备 WO2023030095A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111017379.3A CN115729541A (zh) 2021-08-31 2021-08-31 内容处理方法与电子设备
CN202111017379.3 2021-08-31

Publications (1)

Publication Number Publication Date
WO2023030095A1 true WO2023030095A1 (zh) 2023-03-09

Family

ID=85291906

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/114234 WO2023030095A1 (zh) 2021-08-31 2022-08-23 内容处理方法与电子设备

Country Status (2)

Country Link
CN (1) CN115729541A (zh)
WO (1) WO2023030095A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455320A (zh) * 2013-05-23 2013-12-18 华为软件技术有限公司 页面处理方法、装置及***
CN108319483A (zh) * 2018-01-30 2018-07-24 腾讯科技(深圳)有限公司 网页处理方法、装置、终端及存储介质
CN108920203A (zh) * 2017-07-13 2018-11-30 成都广达新网科技股份有限公司 一种页面加载方法及设备
US20210092373A1 (en) * 2019-09-25 2021-03-25 Facebook Technologies, Llc Sliced encoding and decoding for remote rendering
CN113032708A (zh) * 2021-04-02 2021-06-25 广州博恒信息科技有限责任公司 一种无代码Web开发***

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455320A (zh) * 2013-05-23 2013-12-18 华为软件技术有限公司 页面处理方法、装置及***
CN108920203A (zh) * 2017-07-13 2018-11-30 成都广达新网科技股份有限公司 一种页面加载方法及设备
CN108319483A (zh) * 2018-01-30 2018-07-24 腾讯科技(深圳)有限公司 网页处理方法、装置、终端及存储介质
US20210092373A1 (en) * 2019-09-25 2021-03-25 Facebook Technologies, Llc Sliced encoding and decoding for remote rendering
CN113032708A (zh) * 2021-04-02 2021-06-25 广州博恒信息科技有限责任公司 一种无代码Web开发***

Also Published As

Publication number Publication date
CN115729541A (zh) 2023-03-03

Similar Documents

Publication Publication Date Title
US11900924B2 (en) Semantic parsing method and server
US10049147B2 (en) Method, apparatus and terminal for processing documents
US11574114B2 (en) Techniques for view capture and storage for mobile applications
CN105740263B (zh) 页面显示方法和装置
WO2019080873A1 (zh) 一种批注生成的方法及相关装置
WO2021249318A1 (zh) 一种投屏方法和终端
WO2020233556A1 (zh) 一种通话内容处理方法和电子设备
WO2022078295A1 (zh) 一种设备推荐方法及电子设备
EP4354286A1 (en) Rapid application processing method, electronic device and rapid application system
US20230273902A1 (en) File Opening Method and Device
US20230305680A1 (en) Method for invoking capability of another device, electronic device, and system
CN104965907A (zh) 结构化对象的生成方法及装置
WO2023030095A1 (zh) 内容处理方法与电子设备
CN109948095B (zh) 显示网页内容的方法、装置、终端及存储介质
CN112487218B (zh) 内容处理方法、***、装置、计算设备和存储介质
CN111327766B (zh) 信息分享方法、终端及可读存储介质
CN108460128B (zh) 文档管理方法及装置、电子装置及可读存储介质
WO2020253057A1 (zh) 页面数据传输的控制方法及相关设备
CN114666441B (zh) 一种调用其他设备能力的方法、电子设备、***和存储介质
WO2023046028A1 (zh) 用于分布式显示的屏幕识别方法、介质及电子设备
WO2024140002A1 (zh) 一种存储空间的管理方法、装置、电子设备及存储介质
WO2022089276A1 (zh) 一种收藏处理的方法及相关装置
WO2022089259A1 (zh) 设备通信方法、***和装置
WO2023125832A1 (zh) 图片分享方法和电子设备
WO2024104094A1 (zh) 截图分享方法及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22863234

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE