CN115878098A - Data processing method, device, equipment and storage medium - Google Patents

Data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115878098A
CN115878098A CN202111156254.9A CN202111156254A CN115878098A CN 115878098 A CN115878098 A CN 115878098A CN 202111156254 A CN202111156254 A CN 202111156254A CN 115878098 A CN115878098 A CN 115878098A
Authority
CN
China
Prior art keywords
source code
code
target text
target
candidate
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202111156254.9A
Other languages
Chinese (zh)
Inventor
王巨宏
刘阳
胡杰雄
魏林贤
崔家维
李成熙
袁琳
杨晓俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202111156254.9A priority Critical patent/CN115878098A/en
Publication of CN115878098A publication Critical patent/CN115878098A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the application discloses a data processing method, a device, equipment and a storage medium, wherein the method comprises the following steps: displaying a target source code edited aiming at media content in a code editing area, and previewing the media content in a media previewing area according to the target source code; responding to a modification instruction aiming at target texts belonging to the media contents in the media preview area, updating and displaying the target texts in the media preview area, and generating candidate source codes of the updated target texts; performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing; and updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code. The method and the device can effectively improve the development efficiency of the media content.

Description

Data processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a data processing method, apparatus, device, and storage medium.
Background
With the development of internet technology, media contents (such as web pages and games) in the internet are widely applied to the fields of life, work, entertainment and the like, and great convenience is brought to the life, the work and the like of users. However, different users have inconsistent requirements for media content, for example, the media content is a content interaction web page, the requirement of the user a on the content display function in the content interaction web page is relatively high, and the requirement of the user B on the content distribution function of the content interaction web page is relatively high. Therefore, media content needs to be developed according to the requirements of different users, and currently, in the development of media content, technicians need to have professional code programming capability to develop the media content through code programming.
Most users using the media content do not have the code programming capability, and different users have different development requirements on the media content, so that professional technicians are required to collect the user requirements and perform corresponding code programming according to the user requirements so as to realize media content development. However, the user's needs may change at any time, or the development effect of the media content fails to meet the actual needs of the user, and a technician is required to repeatedly modify the code, resulting in low development efficiency of the media content.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present application is to provide a data processing method, apparatus, device and storage medium, which can effectively improve the development efficiency of media content.
An embodiment of the present application provides a data processing method, including:
displaying a target source code edited aiming at media content in a code editing area, and previewing the media content in a media previewing area according to the target source code;
responding to a modification instruction aiming at a target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area, and generating a candidate source code of the updated target text;
performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
An embodiment of the present application provides a data processing apparatus, including:
the display module is used for displaying a target source code edited aiming at the media content in a code editing area and previewing the media content in a media previewing area according to the target source code;
the modification module is used for responding to a modification instruction aiming at a target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area, and generating a candidate source code of the updated target text;
the processing module is used for carrying out conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and the updating module is used for updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
One aspect of the present application provides a computer device, comprising: a processor and a memory;
wherein, the memory is used for storing computer programs, and the processor is used for calling the computer programs to execute the following steps:
displaying a target source code edited aiming at media content in a code editing area, and previewing the media content in a media previewing area according to the target source code;
responding to a modification instruction aiming at a target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area, and generating a candidate source code of the updated target text;
performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
An aspect of the embodiments of the present application provides a computer-readable storage medium, where a computer program is stored, where the computer program includes program instructions, and the program instructions, when executed by a processor, perform the following steps:
displaying a target source code edited aiming at media content in a code editing area, and previewing the media content in a media previewing area according to the target source code;
responding to a modification instruction aiming at a target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area, and generating a candidate source code of the updated target text;
performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
An aspect of an embodiment of the present application provides a computer program product, which includes a computer program/instruction, and when executed by a processor, the computer program/instruction implements the steps of the method described above:
displaying a target source code edited aiming at media content in a code editing area, and previewing the media content in a media previewing area according to the target source code;
responding to a modification instruction aiming at a target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area, and generating a candidate source code of the updated target text;
performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
In the application, the target source code of the media content is displayed in the code preview area, and the media content is previewed in the media preview area, so that the modification of the media content is realized by modifying the target source code of the media content; alternatively, the modification strategy for modifying the media content can be flexibly selected by performing the what-you-see-is-what-you-get modification on the media content displayed in the media preview area, i.e., the target object. Furthermore, the target text belonging to the media content in the media preview area is updated and displayed in the media preview area by responding to the modification instruction of the target text in the media preview area, that is, when the target object modifies the target text in the media preview area, the effect after the modification of the target text can be immediately observed in the media preview area, that is, the effect is obtained, the problem that the media content is not intuitive when being updated can be avoided, and the modification efficiency of the media content is improved. Then, generating a candidate source code of the updated target text, performing conflict processing on the candidate code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing, and updating the target source code displayed in the code editing area according to the first source code to obtain the updated target source code, so that the problem that some grammatical codes in the updated target source code cannot be identified due to the conflict in the candidate source code can be effectively avoided, or the problem that some grammatical codes in the updated target source code are identified incorrectly can be avoided, and the accuracy of updating the target source code can be improved; in the updating process of the target source code, the source code does not need to be edited manually, the updating efficiency of the target source code is improved (namely the development efficiency of media content is improved), and the problem of difficult positioning of the source code can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a block diagram illustrating an architecture of a data processing system provided herein;
FIG. 2 is a field flow diagram of a modification of media content in a media preview area as provided herein;
FIG. 3 is a schematic flow chart of modifying source code in a code editing area provided by the present application;
FIG. 4 is a flow diagram of a data processing method provided herein;
FIG. 5 is an interface schematic diagram of a code editing area and a media preview area provided by the present application;
FIG. 6 is an interface diagram of a code editing area and a media preview area provided by the present application;
FIG. 7 is a flow diagram of a data processing method provided herein;
FIG. 8 is a schematic diagram of a scene of modifying media content in a media preview area provided by the present application;
FIG. 9 is a schematic diagram of a scenario for generating candidate source codes of updated target texts according to the present application;
FIG. 10 is a schematic illustration of an interface provided herein for modifying source code in a code editing area;
fig. 11 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The media content in the present application may refer to an internet product providing internet services for a user, for example, the internet product may refer to a multimedia web page (e.g., talk, post), a game application, a shopping application, a social application, a content interaction application, and the like. Media content may be made up of one or more materials, which may include tables, text, images, and the like. After the media contents are released, problems encountered by the user in the process of using the multimedia contents need to be collected, the problems encountered by the user are analyzed to obtain the requirements of the user on the media contents, then professional technicians are needed to modify source codes of the media contents based on the requirements of the user on the media contents to obtain modified source codes, the media contents are updated according to the modified source codes, and the updated media contents are returned to the user. It can be seen that the media content development method has the following defects: 1. media content updates are not intuitive. A technician is required to make repeated modifications to the source code of the media content to know whether the updated media content is as expected. 2. Source code positioning is difficult. For example, when the source codes of the media contents are more, it takes a longer time to observe to find the source codes corresponding to the modified media contents. For example, when a user wishes to modify attribute parameters such as font, font size, and thickness of a text in media content, a professional technician is required to locate a source code describing the text from the source code of the media content, then modify the source code of the text to obtain a modified source code, update the text in the media content according to the modified source code, and feed back the updated media content to the user.
Based on this, the present application proposes a data processing method, by displaying an edited target source code for media content in a code editing area, and previewing the media content in a media preview area according to the target source code, the displayed media content in the media preview area is allowed to be directly modified. When the user needs to modify any text in the media content, the text can be called target text, and the target text is updated and displayed in the media preview area by responding to a modification instruction of the target text belonging to the media content in the media preview area. That is to say, when the user modifies the target text in the media preview area, the effect after the modification of the target text can be immediately observed in the media preview area, that is, what you see is what you get, so that the problem that the media content is not intuitive to update can be avoided, and the modification efficiency of the media content is improved. Then, a candidate source code of the updated target text is generated, because a conflict problem such as source code incompatibility may exist in the candidate source code, if the candidate source code is directly adopted to update the target source code, a problem that some grammar codes in the updated target source code cannot be identified easily occurs, or a problem that some grammar codes in the updated target source code are identified incorrectly occurs easily occurs. Therefore, the candidate code is subjected to conflict processing according to the grammatical features of the candidate source code to obtain a first source code after conflict processing, and the target source code displayed in the code editing area is updated according to the first source code to obtain an updated target source code, so that the problem that some grammatical codes in the updated target source code cannot be identified due to conflict in the candidate source code can be effectively avoided, or the problem that some grammatical codes in the updated target source code are identified incorrectly is solved, and the accuracy of updating the target source code can be improved; in the updating process of the target source code, the source code does not need to be edited manually, the updating efficiency of the target source code is improved (namely the development efficiency of the media content is improved), and the problem of difficult positioning of the source code can be avoided.
In order to facilitate a clearer understanding of the present application, a data processing system implementing the data processing method of the present application is first introduced, as shown in fig. 1, and the data processing system includes a server and a terminal, as shown in fig. 1.
The terminal may be a user-oriented device, the terminal includes a media content editing platform, the media content editing platform may be a media content editing web page, a media content editing application program, and the like, for example, the media content editing platform may be a Markdown editor, or another editor. The terminal may edit or modify the source code of the media content through the media content editing platform, or may modify the media content (i.e., the material of the media content) through the media content editing platform. The server may be a background service device for providing the media content editing, and may be specifically configured to set up the media content editing platform for the terminal and maintain the media content editing platform.
The media content editing platform has a media display interface, and the media display interface is an interface for displaying media content and source codes of the media content. A region for displaying a source code of media content in the media display interface is called a code editing region, a region for displaying the media content in the media display interface is called a media preview region, both the source code displayed in the code editing region and the media content displayed in the media preview region are allowed to be modified, the source code displayed in the code editing region and the media content displayed in the media preview region have a synchronous updating relationship, and the synchronous updating relationship refers to: when the source code in the code editing area is modified, updating the media content in the media preview area according to the modified source code; or when the media content in the media preview area is modified, the source code in the code editing area is updated according to the modified media content.
The media display interface of the media content editing platform in the application has two editing modes, wherein one editing mode is a single-column editing mode, and the single-column editing mode is that only a code editing area or only a media preview area is displayed on the media display interface. For example, when the code editing area is displayed on the media display interface, the media preview area is minimized or hidden from display; alternatively, the code editing area is minimized or hidden from display while the media preview area is displayed on the media display interface. For example, in response to a modification instruction for a target text of media content in the media preview area, acquiring the familiarity degree of a target object with respect to the source code in the code editing area, and if the familiarity degree is less than the familiarity degree threshold, indicating that the target object is a non-professional technician, the target object is not concerned about how the source code in the code editing area is updated, so that the computer device can display the media preview area on the media display interface in a single-column editing mode, which is more beneficial to viewing the modification effect on the media content in real time, and is beneficial to enabling the target object to concentrate more on the content in the media preview area without being disturbed by the source code in the code editing area. The familiarity of the target object with the source code in the code editing area may be determined according to the source code amount written by the target object in the historical time period, or the familiarity of the target object with the source code in the code editing area may be determined according to the code characteristics of the source code in the code editing area, wherein the code characteristics include the number of the source codes, the structure of the source codes and the like. The other editing mode is a double-column editing mode, the double-column editing mode is that a code editing area and a media preview area are displayed on the media display interface, when the code editing area and the media preview area are displayed on the media display interface, display parameters of the code editing area and display parameters of the media preview area are both allowed to be adjusted, and the display parameters comprise size, position, shape and the like. For example, in response to a modification instruction for a target text of media content in the media preview area, acquiring the familiarity degree of the target object with respect to the source code in the code editing area, and if the familiarity degree is greater than or equal to the familiarity degree threshold, indicating that the target object is a professional, the target object is more concerned with how the source code in the code editing area is updated, so that the computer device may display the media preview area and the code editing area on the media display interface in a two-column editing mode, which is beneficial for the target object to pay attention to changes of the source code in the code editing area in real time when modifying the media content in the media preview area.
It should be further noted that, the media content may be allowed to be modified as follows: the materials of the text, the table, the image and the like in the media content allow modification, and specifically, the text content, the attribute parameter of the text, the table content attribute parameter, the unit table attribute parameter, the attribute parameter of the image and the like in the media content may be modified, the attribute parameter of the text includes a font, a font size, a font background, a font color, a font thickness, a font italic and the like, the table content attribute parameter may include the text content in the table, the attribute parameter of the text and the unit table in which the text content is located, the unit table attribute parameter includes a unit table line number, a column number, a length, a width and the like, and the attribute parameter of the image includes a size, a format, a background color and the like of the image.
The server may be an independent physical server, a server cluster or a distributed system formed by at least two physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content Delivery Network (CDN), big data and an artificial intelligence platform. The terminal may be, but is not limited to, an intelligent vehicle-mounted terminal, a smart phone, a tablet computer, a notebook computer, a desktop computer, an intelligent sound box, a sound box with a screen, an intelligent watch, an intelligent television, and the like. Each terminal and each server may be directly or indirectly connected through a wired or wireless communication manner, and the number of the terminals and the number of the servers may be one or at least two, which is not limited herein.
Optionally, the server or the terminal in fig. 1 may have a font editing module, a font inverse parsing module, a source code positioning and replacing module, a syntax parsing engine, a language editing area, a media preview module, and the like, through which modification of text in the media preview area may be implemented, where modification strategies for text in the media preview area include two strategies, namely, directly modifying text in the media preview area and modifying source code in the code editing area. Fig. 2 shows a modification policy for directly modifying text in a media preview area, and an implementation process of the modification policy includes: 1. the media preview module displays a list of attribute parameters of a target text belonging to the media content in the media preview area in response to a modification instruction for the target text. The modification instruction may be an instruction generated by the target object by clicking, sliding, and the like on the target text, where the target text refers to a text that needs to be modified by the target object, the specific modified content may refer to modifying text content of the target text or modifying an attribute parameter of the target text, and the attribute parameter list includes a plurality of candidate attribute parameters of the target text, such as a font, a font size, a font background, a font color, a font thickness, a font italic, and the like. 2. The font editing module acquires any one or more target candidate attribute parameters selected in the attribute parameter list, sends the target candidate attribute parameters to the font inverse analysis module, and updates and displays the target text in the media preview area according to the target candidate attribute parameters. 3. And the font inverse analysis module generates a candidate source code of the updated target text according to the target candidate attribute parameter, performs conflict processing on the candidate source code to obtain a first source code after the conflict processing, and sends the first source code to the source code positioning and replacing module. 4. And the source code positioning and replacing module positions the source code of the target text in the code editing area, and replaces the source code of the target text in the code editing area by adopting the first source code to obtain an updated target source code, wherein the target source code refers to the source code before the source code of the target text is updated in the language editing area. 5. The language editing module displays the updated target source code in the code editing area.
The modification strategy for modifying the source code in the code editing area is to modify the source code of the target text in the code editing area so as to modify the target text in the media preview area; the modification policy for modifying the source code in the code editing area is shown in fig. 3, and the implementation process of the modification policy includes: 1. and the language editing module acquires the source code of the updated target text obtained by modifying the source code of the target text in the code editing area. 2. And the language editing module converts the source code of the updated target text into the markup language information of the updated target text and sends the markup language information of the updated target text to the grammar parsing engine. 3. And rendering the updated markup language information of the target text by the grammar parsing engine to obtain a rendering result. 4. And the media preview module updates the target text in the media preview area according to the rendering result.
Further, please refer to fig. 4, which is a flowchart illustrating a data processing method according to an embodiment of the present application. As shown in fig. 4, the method may be performed by the terminal in fig. 1, the server in fig. 1, or both the terminal and the server in fig. 1, and devices for performing the method in this application may be collectively referred to as computer devices. The data processing method may include the following steps S101 to S104:
s101, displaying a target source code edited by the media content in a code editing area, and previewing the media content in a media preview area according to the target source code.
In the application, the computer device may display the target source code obtained by editing the media content in the code editing area, preview the media content in the media preview area according to the target source code, and allow modification of both the target source code in the code editing area and the media content in the media preview area. That is, the media content and the target source code of the media content are displayed through the double-column editing mode of the media content editing platform, so that the modification of the text in the media content displayed in the media preview area can be realized through what you see is what you get modification, and the modification of the text in the media content can be realized through the modification of the target source code in the code editing area; the user can select a proper modification strategy according to the self requirement, and the flexibility of modifying the media content is improved.
For example, a user can select a modification strategy according to the actual situation of the user, and when the attribute parameters of the target text are less or the user is very much a source code in the code editing area, the user can select to modify the source code of the target text in the code editing area so as to modify the target text in the media preview area; when the attribute parameters of the target text are more and more complex, or the user does not know the source code in the code editing area, the user can select to modify the target text belonging to the media content in the media preview area. By selecting different modification strategies according to different scenes, the editing (i.e. developing) experience and editing efficiency of the media content of the user can be improved.
It should be noted that, the computer device may divide the media display interface by using default display parameters to obtain a code editing area and a media preview area; or, the computer device may predict a modification policy used when the target object modifies the media content, and divide the media display interface according to the modification policy to obtain the code editing area and the media preview area. The modification policy includes modifying the media content or modifying a target source code of the media content, and the target object may refer to a user corresponding to a terminal for modifying the media content.
Optionally, the modification policy used when the predicted target object modifies the media content includes the following two implementation manners, where the first implementation manner includes: the computer equipment acquires code characteristics of target source codes of the media contents, wherein the code characteristics comprise the quantity of the source codes, the frames of the source codes and the like; and determining the complexity of the target source code according to the code characteristics of the target source code, and predicting a modification strategy used by the target object to modify the media content according to the complexity. For example, the source code amount in the target source code of the media content is acquired, the complexity of the target source code is determined according to the source code amount, and the source code amount and the complexity of the target source code have a positive correlation, that is, the more the source code amount, the higher the complexity of the target source code is, and vice versa, that is, the less the source code amount, the lower the complexity of the target source code is. Therefore, if the complexity of the target source code is greater than the complexity threshold, determining the strategy for modifying the media content as the modification strategy used by the target object to modify the media content; and if the complexity of the target source code is less than or equal to the complexity threshold, determining the strategy of modifying the target source code of the media content as the modification strategy used by the target object to modify the media content.
Similarly, the second implementation manner includes: the computer equipment acquires the source code quantity written by the target object in the historical time period, and the source code quantity written by the target object can reflect the familiarity of the target object with the source code grammar, so that the modification strategy used by the target object for modifying the media content can be predicted according to the source code quantity written by the target object. For example, if the target object writes a larger amount of source code, the target object is more familiar with the source code syntax, the target object is more biased towards modifying the target source code of the media content, and the policy for modifying the target source code of the media content is determined as the modification policy used by the target object to modify the media content. On the contrary, if the target object writes a smaller amount of source code, the target object is less familiar with the source code syntax, the target object is more biased to modify the media content, and the strategy for modifying the media content is determined as the modification strategy used by the target object to modify the media content.
Optionally, the dividing the media display interface according to the modification policy to obtain the code editing area and the media preview area includes: as shown in fig. 5, if the modification policy is to modify the media content, the media display interface is divided into a code editing area and a media preview area; the size of the media preview area is larger than that of the code editing area, the code editing area is positioned on the left side of the media display interface, and the media preview area is positioned on the right side of the media display interface, so that the modification of the media content in the media preview area by a target object is facilitated. As shown in fig. 6, if the modification policy is to modify the target source code of the media content, the media display interface is divided into a code editing area and a media preview area; the size of the code editing area is larger than that of the media preview area, and the media preview area is positioned above the code editing area. Of course, the code editing area may be located on the right side of the media display interface, and the media preview area may be located on the left side of the media display interface, which is beneficial for the target object to modify the target source code in the code editing area.
And S102, responding to a modification instruction aiming at the target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area, and generating a candidate source code of the updated target text.
In the application, when a target object needs to modify a text in a media content, a computer device responds to a modification instruction for a target text belonging to the media content in a media preview area, modifies the target text in the media preview area, displays an updated target text, and then generates a candidate source code of the updated target text. That is to say, after the target object modifies the target text in the media preview area, the computer device updates and displays the target text in the media preview area in time, that is, the target object can check the modification effect on the target text in real time, and the intuitiveness of modifying the target text is improved.
Optionally, when the modification instruction for the target text belonging to the media content in the media preview area is responded and the modification policy is a policy for modifying the media content, it indicates that the predicted modification policy is the same as the modification policy actually used by the target object, so that the target text may be directly updated and displayed in the media preview area without adjusting the media preview area and the code editing area, and a candidate source code of the updated target text is generated.
Optionally, when a modification instruction for a target text belonging to the media content in the media preview area is responded and the modification policy is a policy for modifying a target source code of the media content, it is indicated that the predicted modification policy is different from a modification policy actually used by a target object, so that the media preview area and the code editing area can be adjusted to obtain an adjusted media preview area and a code editing area; and updating and displaying the target text in the adjusted media preview area to generate a candidate source code of the updated target text.
Optionally, the computer device may adjust the media preview area and the code edit area based on the familiarity of the target object with the source code. Specifically, step S202 includes: and responding to a modification instruction aiming at a target text belonging to the media content in the media preview area, acquiring the familiarity degree of a target object aiming at the source code in the code editing area, adjusting the media preview area and the code editing area according to the familiarity degree to obtain an adjusted media preview area and an adjusted code editing area, updating and displaying the target text in the adjusted media preview area, and generating a candidate source code of the updated target text. For example, if the familiarity is less than the familiarity threshold, indicating that the target object is a non-professional technician, the target object is not concerned with how the source code in the code editing area is updated, and therefore, the computer device may resize the code editing area, or display the media preview area in a single-bar editing mode on the media display interface, which is more beneficial for viewing the modification effect on the media content in real time, and at the same time, is beneficial for the target object to concentrate more on the content in the media preview area without being disturbed by the source code in the code editing area. If the familiarity is greater than or equal to the familiarity threshold, indicating that the target object is a skilled technician, the target object is more concerned with how the source code in the code editing region is updated, and therefore, the computer device can resize the code editing region and resize the media preview region, which is beneficial for the target object to pay attention to changes in the source code in the code editing region in real time when modifying media content in the media preview region.
The familiarity of the target object with the source code in the code editing area may be determined according to the source code amount written by the target object in the historical time period, or the familiarity of the target object with the source code in the code editing area may be determined according to the code characteristics of the source code in the code editing area, wherein the code characteristics include the number of the source codes, the structure of the source codes and the like.
S103, performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing.
And S104, updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
In steps S102 and S103, since there may be conflict problems such as source code incompatibility in the candidate source code, if the target source code is updated by directly using the candidate source code, it is easy to cause a problem that some syntax codes in the updated target source code cannot be identified, or to cause a problem that some syntax codes in the updated target source code are identified incorrectly. Therefore, the computer device can perform conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing, and update the target source code displayed in the code editing area according to the first source code to obtain an updated target source code, so that the problem that some grammatical codes in the updated target source code cannot be identified due to conflict in the candidate source code can be effectively avoided, or the problem that some grammatical codes in the updated target source code are identified incorrectly can be avoided, and the accuracy of updating the target source code can be improved; in the updating process of the target source code, the source code does not need to be edited manually, the updating efficiency of the target source code is improved, and the problem of difficult positioning of the source code can be avoided.
It should be noted that, in order to keep the code editing area corresponding to the media preview area, after step S104, the computer device may update the media content in the media preview area according to the updated target source code, so as to avoid a problem that the source code of the code editing area does not correspond to the media content in the media preview area after modifying the source code in the code editing area in the process of conflict handling. In the application, the target source code of the media content is displayed in the code preview area, and the media content is previewed in the media preview area, so that the modification of the media content is realized by modifying the target source code of the media content; alternatively, the modification strategy for modifying the media content can be flexibly selected by performing the what-you-see-is-what-you-get modification on the media content displayed in the media preview area, i.e., the target object. Furthermore, the target text belonging to the media content in the media preview area is updated and displayed in the media preview area by responding to the modification instruction of the target text belonging to the media content in the media preview area, that is, when the target object modifies the target text in the media preview area, the effect after the target text is modified can be immediately checked in the media preview area, that is, what you see is what you get, so that the problem that the media content is not directly updated can be avoided, and the modification efficiency of the media content is improved. Then, generating a candidate source code of the updated target text, performing conflict processing on the candidate code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing, and updating the target source code displayed in the code editing area according to the first source code to obtain the updated target source code, so that the problem that some grammatical codes in the updated target source code cannot be identified due to the conflict in the candidate source code can be effectively avoided, or the problem that some grammatical codes in the updated target source code are identified incorrectly can be avoided, and the accuracy of updating the target source code can be improved; in the updating process of the target source code, the source code does not need to be edited manually, the updating efficiency of the target source code is improved (namely the development efficiency of the media content is improved), and the problem of difficult positioning of the source code can be avoided.
Further, please refer to fig. 7, which is a flowchart illustrating a data processing method according to an embodiment of the present application. As shown in fig. 7, the method may be performed by the terminal in fig. 1, the server in fig. 1, or both the terminal and the server in fig. 1, and devices for performing the method in this application may be collectively referred to as computer devices. Wherein the method may at least comprise the following S201-S206:
s201, displaying a target source code edited by the media content in a code editing area, and previewing the media content in a media preview area according to the target source code.
And S202, responding to a modification instruction aiming at the target text belonging to the media content in the media preview area, and displaying the functional component associated with the target text.
S203, responding to the selection operation aiming at the target candidate attribute parameters in the attribute parameter list, and acquiring the target candidate attribute parameters obtained based on the trigger operation; and updating the target text in the media preview area according to the target candidate attribute parameters, and displaying the updated target text.
In steps S202 and S203, when a selection operation for a target text belonging to the media content in the media preview area is detected, a modification instruction for the target text is generated according to the selection operation; the selection operation may be a click, a slide, a voice, and so on. In response to the modification instruction, displaying a functional component associated with the target text in the media preview area, where the functional component may be an operation bar of the target text, and the operation bar includes a plurality of attribute options, and the attribute options include options of font, font size, font color, font background color, italics, font weight, and the like, and through which the attribute parameters of the target text can be modified. When the trigger operation aiming at the functional component is detected, the target candidate attribute parameter obtained based on the trigger operation is obtained in response to the trigger operation, the target text is updated in the media preview area according to the target candidate attribute parameter, and the updated target text is displayed. By displaying the updated target text in the media preview area, the effect of the modified target text can be immediately checked in the media preview area, namely the effect of the modified target text is immediately seen, so that the problem that the media content is not directly updated can be avoided, and the modification efficiency of the media content is improved.
For example, as shown in fig. 8, the media display interface includes a code editing area 21 and a media preview area 22, the code editing area 21 and the media preview area 22 are arranged side by side in the media display interface, and the size of the code editing area 21 is the same as that of the media preview area 22. The source code displayed in the code editing area 21 includes two lines of source code, the first line of source code being: using "", and "", to denote italics and bold, the second line source code is: using "/" to denote/underline/, using "" ~~ ' expression ~~ Deletion line ~~ (ii) a The media content displayed in the media preview area includes two lines of text, the first line of text being: using and representing italics and bold, the second line of text is: use/show underline, use ~~ And representing a strikethrough, wherein the first line of text is obtained according to the first line of source code, and the second line of text is obtained according to the second line of source code. As shown in fig. 8, the user has selected "representation" in the first line of text in the media preview area,the "representation" is determined as the target text, and the functional component 23 of the target text is displayed below the target text, and the functional component 23 includes options of font, font size, font color, font background color, italics, font weight, and the like. If the user selects the bold option, the representation is displayed bold in the media preview area 22 and the source code in the code editing area is then updated synchronously according to the updated target text.
And S204, generating a candidate source code of the updated target text according to the target candidate attribute parameter.
Optionally, the computer device may generate the candidate source code according to the updated attribute description syntax tree of the target text, and specifically, the step S204 may include the following steps S11 to S14:
and s11, acquiring markup language information about the updated target text.
And s12, analyzing the markup language information of the updated target text to obtain attribute information of the updated target text, wherein the attribute information of the updated target text comprises a plurality of attribute parameters of the updated target text and a nesting relation among the attribute parameters, and the attribute parameters comprise the target attribute parameters.
And s13, generating a first attribute description syntax tree related to the updated target text according to the attribute information of the updated target text.
And s14, analyzing the first attribute description syntax tree to obtain a candidate source code of the updated target text.
In steps s11 to s14, the computer device may obtain Markup Language information about the updated target Text, where the Markup Language information about the updated target Text is used to describe attribute information of the updated target Text, and specifically may refer to HTML (Hyper Text Markup Language), XML (eXtensible Markup Language), and the like. Then, the markup language information of the updated target text can be analyzed to obtain the attribute information of the updated target text, where the attribute information includes multiple attribute parameters of the updated target text and the nesting relationship among the attribute parameters, and the multiple attribute parameters include the target attribute parameter. Further, the computer device may generate a first attribute description syntax tree about the updated target text according to the attribute information of the updated target text, the first attribute description syntax tree being capable of describing the attribute information of the updated target text more intuitively; then, the first attribute description syntax tree may be parsed to obtain candidate source codes of the updated target text. Therefore, after the target text in the media preview area is modified, the candidate source code of the updated target text can be automatically generated, the source code does not need to be manually written, the generation efficiency of the source code is improved, and the development efficiency of the text in the media content is improved.
Table 1:
Figure BDA0003288472780000161
for example, the markup language information is as shown in table 1, and "< span style =" color: rgb (255,0,0) in table 1; "> font color </span >", and "< font style =" color: rgb (255,0,0); "> font color" <font > indicates that the font color is red, < strong > indicates that the text is bolded, < em italic > indicates that the text is displayed in italics, and < strong > italic > </strong > indicates that the text is bolded, bolded and displayed in italics. Assume that the updated target text is: at present, the markup language of the updated target text is < strong > < em > at present, the markup language of the updated target text is analyzed to obtain the attribute information of the updated target text, the attribute information reflects that the attribute parameters of the updated target text comprise bold and italic, and the bold and italic of the attribute parameters have a nested relation. As shown in fig. 9, the computer device may generate a first attribute description syntax tree of the updated target text according to the attribute information, where a parent node of the first attribute description syntax tree is the updated target text: when the current situation exists, the child node comprises the attribute parameters of the updated target text: bold and italics, wherein the connection relation between the child node 1 and the child node 2 is used for reflecting that the bold of the attribute parameters and the italics of the attribute parameters have nesting relation. Then, the computer device may parse the first attribute description syntax tree to obtain the candidate source code of the updated target text.
Optionally, a parent node of the first attribute description syntax tree includes the updated target text, a child node connected to the parent node includes attribute parameters of the updated target text, and attribute parameters respectively included in child nodes having a connection relationship have a nesting relationship; the computer device may generate the candidate source code of the updated target text according to the first attribute description syntax tree, and specifically, the step s14 may include the following steps s21 to s23:
and s21, traversing the child nodes of the first attribute description syntax tree according to the node path of the first attribute description syntax tree, and generating the source code of the attribute parameters in the child nodes of the first attribute description syntax tree.
And s22, based on the connection relation between the child nodes in the first attribute description syntax tree, performing assembly processing on the source codes of the attribute parameters in the child nodes of the first attribute description syntax tree to obtain the updated assembly source codes of the target text.
And s23, generating a candidate source code of the updated target text according to the parent node of the first attribute description syntax tree and the assembly source code.
In steps s21 to s23, the computer device may traverse the child nodes of the first attribute description syntax tree according to the node path of the first attribute description syntax tree, and generate source codes of the attribute parameters in the child nodes of the first attribute description syntax tree; the node path may refer to from top to bottom, left to right. Then, based on the connection relationship between the child nodes of the first attribute description syntax tree, the source code of each attribute parameter may be assembled to obtain an assembly source code of the updated target text, and then, the updated target text in the parent node of the first attribute description syntax tree is added to the assembly source code to obtain an assembly source code of the updated target text. Because the first attribute description syntax tree can describe the attribute parameters of the updated target text more intuitively, the problem that one or more attribute parameters of the candidate target text are omitted to cause low accuracy of the generated candidate source code can be avoided by generating the candidate source code of the updated target text according to the first attribute description syntax tree.
For example, as shown in fig. 9, the computer device may obtain a node path of the first attribute description syntax tree, that is, the node path is from child node 1 to child node 2, traverse each child node of the first attribute description syntax tree according to the node path, and generate a source code of an attribute parameter in each child node, where the source code of the italic font is: * Bold source code is: * Then, according to the connection relationship between the child node 1 and the child node 2, assembling the italic source code and the bold source code to obtain an assembly source code, wherein the assembly source code is as follows: * And finally, adding the updated target text into the assembly source code to obtain a candidate source code, namely: * Love is in the present.
And S205, performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing.
Optionally, the computer device may perform conflict processing on the syntax code having the nesting relationship, and specifically, the step S205 may include the following steps S31 to S33:
s31, analyzing the candidate source code to obtain the grammatical features of the candidate source code; the syntactic characteristic is used for reflecting the syntactic codes with nesting relation in the candidate source codes.
And s32, acquiring an outer layer grammar code and an inner layer grammar code from the grammar codes with the nesting relation.
And s34, performing conflict processing on the outer layer grammar code and the inner layer grammar code respectively to obtain a first source code after the conflict processing.
In steps s31 to s33, the computer device may parse the candidate source code to obtain a syntactic characteristic of the candidate source code, where the syntactic characteristic is used to reflect a syntactic code having a nesting relationship in the candidate source code, and obtain an outer-layer syntactic code and an inner-layer syntactic code from the syntactic code having the nesting relationship. The syntax code with nesting relation can comprise at least two layers of syntax codes, wherein the outer layer syntax code can refer to the outermost syntax code in the syntax codes with nesting relation, and the inner layer syntax code can refer to the syntax code except the outermost syntax code in the syntax codes with nesting relation; alternatively, the outer layer syntax code may refer to syntax codes other than the innermost layer syntax code among the syntax codes having the nesting relationship, and the inner layer syntax code may refer to syntax codes other than the innermost layer syntax code among the syntax codes having the nesting relationship. Further, the outer layer syntax code and the inner layer syntax code may be subjected to separation processing (or conversion processing) to eliminate the collision problem in the candidate source code, so as to obtain the first source code after collision processing. By performing conflict processing on the candidate source codes, the problem that some grammar codes in the updated target source codes cannot be identified due to conflicts in the candidate source codes can be effectively avoided, or the problem that some grammar codes in the updated target source codes are identified incorrectly can be avoided, and the accuracy of updating the target source codes can be improved.
For example, the syntax code with nesting relation in the candidate source code is: * The bold is internally provided with italics outside and can be called outer-layer grammar codes, and the italics can be called inner-layer grammar codes, wherein x represents that the text is set to be italics, and x represents that the text is set to be bold. If the target source code is directly updated by adopting the candidate source code, the candidate source code is wrongly identified as: the bold faces are filled with italics and the outer faces are filled with italics, i.e. both the content grammar code and the outer grammar code are caused to be recognized wrongly. Therefore, the conflict processing may be performed on the outer layer syntax code and the inner layer syntax code, for example, a space symbol is added between the outer layer syntax code and the inner layer syntax code, to obtain a first source code after the conflict processing, where the first source code is: * Bold inside and italic outside, and italic, so that the first source code can be identified as: the inner part of the thickening is provided with an inclined body, and the outer part is also provided with an inclined body.
It should be noted that the computer device may perform conflict processing on the outer layer syntax code and the inner layer syntax code by using the following three conflict processing manners, respectively, to obtain the first source code after the conflict processing:
the first collision processing manner is to convert the inner layer syntax code or the outer layer syntax code into a markup language, and describe the updated target text in a manner of mixing markup language information and source code, so as to eliminate the collision problem in the candidate source code, and the first collision processing manner may specifically include: converting the inner layer grammar code into markup language information, and determining the first markup language information obtained by conversion and the outer layer grammar code as a first source code after conflict processing; or converting the outer layer grammar code into markup language information, and determining the second markup language information and the inner layer grammar code obtained by conversion as the first source code after the conflict processing.
The second collision processing mode is to delete the inner layer syntax code or the outer layer syntax code to eliminate the collision problem in the candidate source code, and the second collision processing mode may specifically include: reserving the inner layer grammar code, deleting the outer layer grammar code, and obtaining a first source code after conflict processing; or, the outer layer grammar code is reserved, the inner layer grammar code is deleted, and the first source code after the conflict processing is obtained.
The third collision processing manner is to perform separation processing on the inner layer syntax code and the outer layer syntax code to eliminate the collision problem in the candidate source code, and the third collision processing manner may specifically include: and performing separation processing on the outer layer grammar codes and the inner layer grammar codes to obtain first source codes after conflict processing. The separation process here may refer to adding a separation symbol, such as a space, between the outer layer syntax code and the inner layer syntax code.
Optionally, the grammars with adjacent relations in the candidate source codes also have a conflict problem, and the computer device may perform separation processing on the grammars with adjacent relations to eliminate the conflict problem in the adjacent grammars, so as to obtain the first source code after conflict processing. For example, the candidate source code is: * The bold inside and the bold outside can be called as grammar codes with adjacent relations, and if the target source codes are updated by adopting the candidate source codes, the grammar codes outside and the italics cannot be identified. Therefore, spaces can be added to the grammar codes with adjacent relations, and the first source code after collision processing is obtained, for example, the first source code is: * Inside the bold is italicized and outside is italicized.
S206, updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
Optionally, the computer device locates a source code describing the target text in the target source code, and updates the target source code, specifically, step S206 may include the following steps S41 to S43:
and s41, counting the target paragraph identifications of the updated target text in the media preview area.
And s42, determining a second source code for describing the target text from the code editing area according to the target paragraph identification.
And s43, replacing the second source code of the target text displayed in the code editing area with the first source code to obtain an updated target source code.
In steps s41 to s43, the computer device may count a target paragraph identifier of the updated target text in the media preview area, where the target paragraph identifier may refer to an identifier for locating the updated target text in the media preview area, and specifically may refer to a paragraph number or a line number where the updated target text is located, and so on. Further, a second source code for describing the target text may be located from the code editing area according to the target paragraph identifier, and the second source code displayed in the code editing area may be replaced with the first source code, so as to obtain an updated target source code. The second source code to be replaced in the code editing area can be accurately positioned through the target paragraph mark of the updated target text in the media preview area, and the accuracy of updating the target source code is improved.
Optionally, the step s42 may include the following steps s51 to s53:
and s51, acquiring the number of first paragraphs in the code editing area and the number of second paragraphs in the media preview area.
And s52, if the number of the first paragraphs is the same as that of the second paragraphs, identifying the paragraphs in the code editing area as the source code of the target paragraph identification, and determining the paragraphs in the code editing area as the second source code of the target text.
s53, if the number of the first paragraphs is not the same as the number of the second paragraphs, performing modification processing on the paragraph identifier of each source code in the code editing area, and determining the paragraph identifier after the modification processing in the code editing area as the source code of the target paragraph identifier and as the second source code of the target text.
In steps s51 to s53, the total number of paragraphs corresponding to the source code in the code editing area is generally the same as the total number of paragraphs corresponding to the media content in the media preview area, but the number of attribute parameters described in the current code editing area including the code interpretation information or a certain paragraph is large, so that the total number of paragraphs corresponding to the source code in the code editing area is different from the total number of paragraphs corresponding to the media content in the media preview area. Accordingly, the computer device may obtain the total number of paragraphs corresponding to the source code in the code editing region as a first number of paragraphs and obtain the total number of paragraphs corresponding to the media content in the media preview region as a second number of paragraphs. If the number of the first paragraph is the same as that of the second paragraph, it indicates that the code editing area does not include the code interpretation information, and there is no situation that the number of the attribute parameters described by some paragraphs in the code editing area is large, that is, the paragraph identifier in the code editing area is associated with the source code having the same paragraph identifier in the media preview area and the media content, for example, the source code whose paragraph identifier in the code editing area is the target paragraph identifier is used to describe the target text, and the updated target text is displayed in the paragraph identified as the target paragraph identifier in the media preview area. Thus, if the first number of paragraphs and the second number of paragraphs are the same, the computer device may identify the paragraph in the code editing region as the source code identified by the target paragraph and determine the second source code for the target text. If the number of the first paragraphs is different from the number of the second paragraphs, it is indicated that the code editing area includes code interpretation information, or there is a case where a large number of attribute parameters are described by some paragraphs in the code editing area, that is, the paragraph identifier in the code editing area is not associated with the source code having the same paragraph identifier in the media preview area, for example, an updated target text is displayed in a paragraph in the media preview area where the paragraph identifier is a target paragraph identifier, and the source code whose paragraph identifier in the code editing area is a target paragraph identifier does not describe the target text. Therefore, the computer device may perform modification processing on the paragraph identifier of each source code in the code editing area so that the number of paragraphs in the code editing area is the same as the number of paragraphs in the media preview area, and then determine the paragraph identifier after modification processing in the code editing area as the source code of the target paragraph identifier, which is the second source code of the target text. And positioning the source code to be modified in the code editing area through the target paragraph mark of the updated target text in the media preview area, so that the positioning accuracy of the source code is improved, and the updating accuracy of the target source code is improved.
Optionally, when the target source code includes the code interpretation information, the computer device may modify the paragraph identifier of the source code in the code editing area in a manner of removing the paragraph identifier of the code interpretation information; specifically, s53 may include the following steps s61 to s63:
and s61, analyzing the source code in the code editing area to obtain the code interpretation information in the code editing area.
And s62, removing the paragraph identification of the code interpretation information in the code editing area.
s63, after the paragraph identifier of the code interpretation information in the code editing area is removed, regenerating the paragraph identifiers of the remaining source codes in the code editing area to obtain the paragraph identifier after the correction processing; the remaining source code is code in the target source code other than the code interpretation information.
In steps s61 to s63, if the code editing area includes the code interpretation information, the number of paragraphs corresponding to the source code in the code editing area is greater than the number of paragraphs of the media content in the media preview area, so that the source code having the same paragraph identification in the code editing area and the media preview area is not related to the media content. Therefore, the computer device can analyze the source code in the code editing area, obtain the code interpretation information in the code editing area, and remove the paragraph identification of the code interpretation information in the code editing area. Further, after the paragraph identifier of the code interpretation information in the code editing area is removed, the paragraph identifiers of the remaining source codes in the code editing area are regenerated to obtain the paragraph identifier after the correction processing, that is, the paragraph identifier located after the paragraph identifier of the code interpretation information is updated. By removing the code identification of the code interpretation information, the accuracy of locating the source code that needs to be modified (i.e. the source code used to describe the target text) is advantageously improved.
Optionally, when the target source code has a large number of attribute parameters described in a paragraph, the computer device may modify the paragraph identifier of the source code in the code editing area by increasing the paragraph identifier of the paragraph; specifically, the step s53 may include the following steps s71 to s74:
and s71, analyzing the source code in the code editing area to obtain the number of attribute parameters of each paragraph in the code editing area.
And s72, determining the paragraph identifiers corresponding to the candidate paragraphs with the attribute parameter number larger than the attribute parameter number threshold value from the code editing area.
And s73, updating the paragraph identification of the candidate paragraph according to the number of the attribute parameters of the candidate paragraph.
s74, after updating the paragraph identifier of the candidate paragraph, performing modification processing on the paragraph identifiers of the remaining paragraphs in the code editing area to obtain a paragraph identifier after modification processing; the remaining paragraphs are paragraphs in the code editing region that follow the candidate paragraph.
In steps s71 to s74, since the number of attribute parameters of a paragraph is greater than the threshold of the number of attribute parameters, the total number of paragraphs corresponding to the source code in the code editing area is smaller than the number of paragraphs of the media content in the media preview area, and thus the source code having the same paragraph identifier in the code editing area and the media preview area is not related to the media content. Therefore, the computer device may analyze the source code in the code editing area to obtain the number of attribute parameters of each paragraph in the code editing area, and further determine, from the code editing area, a paragraph identifier corresponding to a candidate paragraph whose number of attribute parameters is greater than the threshold of the number of attribute parameters. Then, the paragraph id of the candidate paragraph may be increased according to the number of attribute parameters of the candidate paragraph, and after the paragraph id of the candidate paragraph is updated, the paragraph id located after the candidate paragraph in the code editing area is updated, so as to obtain the paragraph id after the modification processing. By updating the paragraph identifiers of the candidate paragraphs with the attribute parameter number larger than the attribute parameter number threshold, the accuracy of locating the source code (i.e. the source code for describing the target text) needing to be modified is improved.
Optionally, the computer device may update the target source program information according to the attribute description syntax tree, and specifically, s43 may include the following steps s81 to s83:
s81, generating a second attribute description syntax tree according to the first source code; a third attribute description syntax tree is generated from the second source code.
s82, identifying the attribute parameter pair with the difference, wherein the attribute parameter pair comprises the first attribute parameter belonging to the second attribute description syntax tree and the second attribute parameter belonging to the third attribute description syntax tree.
s83, obtaining the source code for describing the first attribute parameter from the first source code, and replacing the source code for describing the second attribute parameter in the second source code with the source code for describing the first attribute parameter to obtain the updated target source code.
In steps s 81-s 83, the computer device may generate a second attribute description syntax tree in dependence upon the first source code; and generating a third attribute description syntax tree according to the second source code, and comparing the first attribute description syntax tree with the second attribute description syntax tree to obtain an attribute parameter pair with differences, wherein the attribute parameter pair comprises a first attribute parameter belonging to the second attribute description syntax tree and a second attribute parameter belonging to the third attribute description syntax tree. That is to say, the first attribute parameter is obtained by modifying the second attribute parameter of the target text for the target object, that is, the source code used for describing the second attribute parameter in the code editing region is the source code that needs to be updated, so the source code used for describing the first attribute parameter is obtained from the first source code, and the source code used for describing the second attribute parameter in the second source code is replaced by the source code of the first attribute parameter, so that the updated target source code is obtained. The source code needing to be updated can be positioned through the attribute description syntax tree, and the accuracy of source code positioning is improved.
Optionally, the method may further include the following steps s91 to s93:
and s91, in response to a modification instruction for the source code in the code editing area for describing the updated target text, acquiring a third source code obtained by modification.
And s92, converting the third source code into the markup language information of the updated target text.
And s93, rendering the markup language information of the updated target text in the media preview area to obtain a rendering result, and updating the updated target text according to the rendering result.
In steps s 91-s 93, the computer device may update the updated target text in the media preview area by modifying the source code in the code editing area. Specifically, in response to a modification instruction for a source code in the code editing region, which is used for describing the updated target text, a third source code obtained by modification may be acquired, the third source code may be converted into markup language information of the updated target text, the markup language information of the updated target text may be rendered in the media preview region, a rendering result may be obtained, and the updated target text may be updated according to the rendering result. Updating the text in the media preview area is accomplished by editing the source code in the area.
For example, as shown in fig. 10, the media display interface includes a code editing area 21 and a media preview area 22, the code editing area 21 and the media preview area 22 are arranged side by side in the media display interface, and the size of the code editing area 21 is the same as that of the media preview area 22. The source code displayed in the code editing area 21 includes two lines of source code, where the first line of source code is: using ' or ' and ' or ' to denote italics and bold ', the second row source code is: using "/" to denote/underline/, using "" ~~ ' expression ~~ Deletion line ~~ (ii) a The media content displayed in the media preview area includes two lines of text, the first line of text being: using and representing italics and bold, the second line of text is: use/show underline, use ~~ And representing a deleted line, wherein the first line of text is obtained according to the first line of source code, and the second line of text is obtained according to the second line of source code. As in fig. 10, if the user adds source code to the source code of "representation" in the code editing area: ! | A (I!!! # f9cb9 c!!!) the added source code is used to indicate that the font background color of the "representation" is set to brown, and after the modified source code of the "representation" has been acquired, the display effect of the "representation" in the media preview area can be updated synchronously in accordance with the modified source code, i.e. the font background of the "representation" is rendered brown.
In the application, the target source code of the media content is displayed in the code preview area, and the media content is previewed in the media preview area, so that the modification of the media content is realized by modifying the target source code of the media content; alternatively, the modification strategy for modifying the media content can be flexibly selected by performing the what-you-see-is-what-you-get modification on the media content displayed in the media preview area, i.e., the target object. Furthermore, the target text belonging to the media content in the media preview area is updated and displayed in the media preview area by responding to the modification instruction of the target text in the media preview area, that is, when the target object modifies the target text in the media preview area, the effect after the modification of the target text can be immediately observed in the media preview area, that is, the effect is obtained, the problem that the media content is not intuitive when being updated can be avoided, and the modification efficiency of the media content is improved. Then, generating a candidate source code of the updated target text, performing conflict processing on the candidate code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing, and updating the target source code displayed in the code editing area according to the first source code to obtain the updated target source code, so that the problem that some grammatical codes in the updated target source code cannot be identified due to the conflict in the candidate source code can be effectively avoided, or the problem that some grammatical codes in the updated target source code are identified incorrectly can be avoided, and the accuracy of updating the target source code can be improved; in the updating process of the target source code, the source code does not need to be edited manually, the updating efficiency of the target source code is improved (namely the development efficiency of media content is improved), and the problem of difficult positioning of the source code can be avoided.
Fig. 11 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present disclosure. The data processing means may be a computer program (including program code) running on a computer device, for example, an application software; the apparatus may be used to perform the corresponding steps in the methods provided by the embodiments of the present application. As shown in fig. 11, the data processing apparatus may include: a display module 111, a modification module 112, a processing module 113, and an update module 114.
The display module is used for displaying a target source code edited aiming at the media content in the code editing area and previewing the media content in the media previewing area according to the target source code;
the modification module is used for responding to a modification instruction aiming at a target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area, and generating a candidate source code of the updated target text;
the processing module is used for carrying out conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and the updating module is used for updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
Optionally, the modifying module, in response to a modification instruction for a target text belonging to the media content in the media preview area, performs an update display on the target text in the media preview area, and generates a candidate source code of the updated target text, where the update display includes:
in response to a modification instruction for target text belonging to the media content in the media preview area, displaying a functional component associated with the target text;
responding to a trigger operation aiming at the functional component, and acquiring a target candidate attribute parameter obtained based on the trigger operation;
updating the target text in the media preview area according to the target candidate attribute parameters, and displaying the updated target text;
and generating a candidate source code of the updated target text according to the target candidate attribute parameter.
Optionally, the modifying module generates the candidate source code of the updated target text according to the target candidate attribute parameter, including:
acquiring markup language information about the updated target text;
analyzing the mark language information of the updated target text to obtain attribute information of the updated target text, wherein the attribute information of the updated target text comprises a plurality of attribute parameters of the updated target text and a nesting relation among the attribute parameters, and the attribute parameters comprise the target attribute parameters;
generating a first attribute description syntax tree about the updated target text according to the attribute information of the updated target text;
and analyzing the first attribute description syntax tree to obtain a candidate source code of the updated target text.
Optionally, a parent node of the first attribute description syntax tree includes the updated target text, a child node connected to the parent node includes attribute parameters of the updated target text, and attribute parameters respectively included in child nodes having a connection relationship have a nesting relationship;
the modifying module analyzes the first attribute description syntax tree to obtain the candidate source code of the updated target text, and the modifying module comprises:
traversing child nodes of the first attribute description syntax tree according to the node path of the first attribute description syntax tree to generate source codes of attribute parameters in the child nodes of the first attribute description syntax tree;
based on the connection relation among all the child nodes in the first attribute description syntax tree, assembling the source codes of the attribute parameters in the child nodes of the first attribute description syntax tree to obtain the updated assembled source codes of the target text;
and generating candidate source codes of the updated target text according to the parent node of the first attribute description syntax tree and the assembly source codes.
Optionally, the performing, by the processing module, collision processing on the candidate source code according to the grammatical feature of the candidate source code to obtain a first source code after collision processing, includes:
analyzing the candidate source code to obtain grammatical features of the candidate source code; the grammar features are used for reflecting grammar codes with nesting relations in the candidate source codes;
acquiring an outer layer syntax code and an inner layer syntax code from the syntax code with the nesting relation;
and performing conflict processing on the outer layer grammar code and the inner layer grammar code respectively to obtain a first source code after the conflict processing.
Optionally, the processing module performs conflict processing on the outer layer syntax code and the inner layer syntax code, respectively, to obtain a first source code after the conflict processing, and the process includes:
converting the inner layer grammar code into markup language information, and determining the first markup language information obtained by conversion and the outer layer grammar code as a first source code after conflict processing; or,
and converting the outer layer grammar code into markup language information, and determining the second markup language information and the inner layer grammar code obtained by conversion as a first source code after conflict processing.
Optionally, the processing module performs conflict processing on the outer layer syntax code and the inner layer syntax code respectively to obtain a first source code after the conflict processing, and the method includes:
reserving the inner layer grammar code, deleting the outer layer grammar code, and obtaining a first source code after conflict processing; or,
and reserving the outer layer grammar code, deleting the inner layer grammar code, and obtaining a first source code after conflict processing.
Optionally, the processing module performs conflict processing on the outer layer syntax code and the inner layer syntax code respectively to obtain a first source code after the conflict processing, and the method includes:
and performing separation processing on the outer layer syntax code and the inner layer syntax code to obtain a first source code after collision processing.
Optionally, the updating module updates the target source code displayed in the code editing area according to the first source code to obtain an updated target source code, and includes:
counting the target paragraph marks of the updated target text in the media preview area;
determining a second source code for describing the target text from the code editing area according to the target paragraph identification;
and replacing a second source code of the target text displayed in the code editing area with the first source code to obtain an updated target source code.
Optionally, the determining, by the update module, a second source code of the target text from the code editing area according to the target paragraph identifier includes:
acquiring the number of first paragraphs in the code editing area and the number of second paragraphs in the media preview area;
if the number of the first paragraph is the same as that of the second paragraph, identifying the paragraph in the code editing area as the source code of the target paragraph identification, and determining the paragraph as the second source code of the target text;
and if the number of the first paragraph is different from the number of the second paragraph, modifying paragraph marks of each source code in the code editing area, and determining the paragraph marks after modification in the code editing area as the source code of the target paragraph mark as the second source code of the target text.
Optionally, the updating module performs modification processing on the paragraph identifier of each source code in the code editing area, and the modification processing includes:
analyzing the source code in the code editing area to obtain code interpretation information in the code editing area;
removing paragraph identifiers of the code interpretation information in the code editing area;
after the paragraph identification of the code interpretation information in the code editing area is removed, regenerating the paragraph identification of the remaining source codes in the code editing area to obtain the paragraph identification after correction processing; the residual source code is the code in the target source code except the code interpretation information.
Optionally, the updating module corrects the paragraph identifier of each source code in the code editing area according to the source code in the code editing area, and includes:
analyzing the source code in the code editing area to obtain the number of attribute parameters of each paragraph in the code editing area;
determining paragraph marks corresponding to the candidate paragraphs with the quantity of the attribute parameters larger than the threshold value of the quantity of the attribute parameters from the code editing area;
updating the paragraph mark of the candidate paragraph according to the number of the attribute parameters of the candidate paragraph;
after the paragraph marks of the candidate paragraphs are updated, carrying out correction processing on the paragraph marks of the remaining paragraphs in the code editing area to obtain corrected paragraph marks; the remaining paragraphs are paragraphs in the code editing region that follow the candidate paragraph.
Optionally, the updating module replaces a second source code of the target text displayed in the code editing area with the first source code to obtain an updated target source code, and includes:
generating a second attribute description syntax tree according to the first source code; generating a third attribute description syntax tree according to the second source code;
identifying pairs of attribute parameters having differences, said pairs of attribute parameters including a first attribute parameter belonging to said second attribute description syntax tree and a second attribute parameter belonging to said third attribute description syntax tree;
and acquiring a source code for describing the first attribute parameter from the first source code, and replacing the source code for describing the second attribute parameter in the second source code with the source code for describing the first attribute parameter to obtain an updated target source code.
Optionally, the updating module is further configured to respond to a modification instruction for a source code in the code editing region, where the source code is used to describe the updated target text, and obtain a third source code obtained by modification;
converting the third source code into markup language information of the updated target text;
rendering the markup language information of the updated target text in the media preview area to obtain a rendering result, and updating the updated target text according to the rendering result.
According to an embodiment of the present application, the steps involved in the data processing method shown in fig. 4 may be performed by respective modules in the data processing apparatus shown in fig. 11. For example, step S101 shown in fig. 4 may be performed by the display module 111 in fig. 11, and step S102 shown in fig. 4 may be performed by the modification module 112 in fig. 11; step S103 shown in fig. 4 may be performed by the processing block 113 in fig. 11; step S104 shown in fig. 4 may be performed by the update module 114 in fig. 11.
According to an embodiment of the present application, each module in the data processing apparatus shown in fig. 11 may be respectively or completely combined into one or several units to form the data processing apparatus, or some unit(s) in the data processing apparatus may be further split into at least two sub-units with smaller functions, which may implement the same operation without affecting implementation of technical effects of the embodiment of the present application. The modules are divided based on logic functions, and in practical applications, the functions of one module may also be implemented by at least two units, or the functions of at least two modules may also be implemented by one unit. In other embodiments of the present application, the data processing apparatus may also include other units, and in practical applications, the functions may also be implemented by assistance of other units, and may be implemented by cooperation of at least two units.
According to an embodiment of the present application, the data processing apparatus as shown in fig. 11 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the corresponding method as shown in fig. 4 on a general-purpose computer device such as a computer including a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and the like as well as a storage element, and implementing the data processing method of the embodiment of the present application. The computer program may be recorded on a computer-readable recording medium, for example, and loaded into and executed in the computing apparatus via the computer-readable recording medium.
In the application, the target source code of the media content is displayed in the code preview area, and the media content is previewed in the media preview area, so that the modification of the media content is realized by modifying the target source code of the media content; alternatively, the modification strategy for modifying the media content can be flexibly selected by performing the what-you-see-is-what-you-get modification on the media content displayed in the media preview area, i.e., the target object. Furthermore, the target text belonging to the media content in the media preview area is updated and displayed in the media preview area by responding to the modification instruction of the target text in the media preview area, that is, when the target object modifies the target text in the media preview area, the effect after the modification of the target text can be immediately observed in the media preview area, that is, the effect is obtained, the problem that the media content is not intuitive when being updated can be avoided, and the modification efficiency of the media content is improved. Then, generating a candidate source code of the updated target text, performing conflict processing on the candidate code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing, and updating the target source code displayed in the code editing area according to the first source code to obtain the updated target source code, so that the problem that some grammatical codes in the updated target source code cannot be identified due to the conflict in the candidate source code can be effectively avoided, or the problem that some grammatical codes in the updated target source code are identified incorrectly can be avoided, and the accuracy of updating the target source code can be improved; in the updating process of the target source code, the source code does not need to be edited manually, the updating efficiency of the target source code is improved (namely the development efficiency of the media content is improved), and the problem of difficult positioning of the source code can be avoided.
Fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 12, the computer apparatus 1000 may include: the processor 1001, the network interface 1004, and the memory 1005, and the computer apparatus 1000 may further include: a media content interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The media content interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the selectable media content interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., W) I -F I An interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 1005 may alternatively be at least one memory device located remotely from the processor 1001. As shown in fig. 12, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a media content interface module, and a device control application program.
In the computer device 1000 shown in fig. 12, the network interface 1004 may provide a network communication function; while the media content interface 1003 is primarily an interface for providing input for media content; and the processor 1001 may be used to invoke a device control application stored in the memory 1005 to implement:
displaying a target source code edited aiming at media content in a code editing area, and previewing the media content in a media previewing area according to the target source code;
responding to a modification instruction aiming at target texts belonging to the media contents in the media preview area, updating and displaying the target texts in the media preview area, and generating candidate source codes of the updated target texts;
performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
Optionally, the processor 1001 may be configured to invoke a device control application program stored in the memory 1005 to implement, in response to a modification instruction for target text belonging to the media content in the media preview area, update and display the target text in the media preview area, and generate candidate source code of the updated target text, including:
in response to a modification instruction for target text belonging to the media content in the media preview area, displaying a functional component associated with the target text;
responding to a trigger operation aiming at the functional component, and acquiring a target candidate attribute parameter obtained based on the trigger operation;
updating the target text in the media preview area according to the target candidate attribute parameters, and displaying the updated target text;
and generating a candidate source code of the updated target text according to the target candidate attribute parameter.
Optionally, the processor 1001 may be configured to invoke the device control application stored in the memory 1005, so as to generate the candidate source code of the updated target text according to the target candidate attribute parameter, including:
acquiring markup language information about the updated target text;
analyzing the mark language information of the updated target text to obtain attribute information of the updated target text, wherein the attribute information of the updated target text comprises a plurality of attribute parameters of the updated target text and a nesting relation among the attribute parameters, and the attribute parameters comprise the target attribute parameters;
generating a first attribute description syntax tree about the updated target text according to the attribute information of the updated target text;
and analyzing the first attribute description syntax tree to obtain the candidate source code of the updated target text.
Optionally, a parent node of the first attribute description syntax tree includes the updated target text, a child node connected to the parent node includes attribute parameters of the updated target text, and attribute parameters respectively included in child nodes having a connection relationship have a nesting relationship;
optionally, the processor 1001 may be configured to invoke a device control application program stored in the memory 1005 to implement parsing of the first attribute description syntax tree to obtain the candidate source code of the updated target text, where the parsing includes:
according to the node path of the first attribute description syntax tree, traversing the child nodes of the first attribute description syntax tree, and generating source codes of attribute parameters in the child nodes of the first attribute description syntax tree;
based on the connection relation among all the child nodes in the first attribute description syntax tree, assembling the source codes of the attribute parameters in the child nodes of the first attribute description syntax tree to obtain the updated assembled source codes of the target text;
and generating candidate source codes of the updated target text according to the parent node of the first attribute description syntax tree and the assembly source codes.
Optionally, the processor 1001 may be configured to invoke the device control application program stored in the memory 1005, so as to implement conflict processing on the candidate source code according to the syntactic characteristic of the candidate source code, and obtain the first source code after the conflict processing, where the method includes:
analyzing the candidate source code to obtain grammatical features of the candidate source code; the grammar features are used for reflecting grammar codes with nesting relations in the candidate source codes;
acquiring an outer layer syntax code and an inner layer syntax code from the syntax code with the nesting relation;
and performing conflict processing on the outer layer grammar code and the inner layer grammar code respectively to obtain a first source code after the conflict processing.
Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005, so as to implement conflict processing on the outer layer syntax code and the inner layer syntax code, respectively, to obtain a first source code after the conflict processing, where the process includes:
converting the inner layer grammar code into markup language information, and determining the first markup language information obtained by conversion and the outer layer grammar code as a first source code after conflict processing; or,
and converting the outer layer grammar code into markup language information, and determining the second markup language information and the inner layer grammar code obtained by conversion as a first source code after conflict processing.
Optionally, the processor 1001 may be configured to invoke a device control application program stored in the memory 1005, so as to implement conflict processing on the outer layer syntax code and the inner layer syntax code, respectively, to obtain a first source code after conflict processing, where the method includes:
reserving the inner layer grammar code, deleting the outer layer grammar code, and obtaining a first source code after conflict processing; or,
and reserving the outer layer grammar code, deleting the inner layer grammar code, and obtaining a first source code after conflict processing.
Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005, so as to implement conflict processing on the outer layer syntax code and the inner layer syntax code, respectively, to obtain a first source code after the conflict processing, where the process includes:
and performing separation processing on the outer layer syntax code and the inner layer syntax code to obtain a first source code after collision processing.
Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005, so as to update the target source code displayed in the code editing area according to the first source code, and obtain an updated target source code, where the method includes:
counting the target paragraph marks of the updated target text in the media preview area;
determining a second source code for describing the target text from the code editing area according to the target paragraph identification;
and replacing a second source code of the target text displayed in the code editing area with the first source code to obtain an updated target source code.
Optionally, the processor 1001 may be configured to invoke a device control application stored in the memory 1005, so as to determine, from the code editing area, a second source code of the target text according to the target paragraph identifier, where the method includes:
acquiring the number of first paragraphs in the code editing area and the number of second paragraphs in the media preview area;
if the number of the first paragraph is the same as that of the second paragraph, identifying the paragraph in the code editing area as the source code of the target paragraph identification, and determining the paragraph as the second source code of the target text;
and if the number of the first paragraph is different from the number of the second paragraph, modifying paragraph marks of each source code in the code editing area, and determining the paragraph marks after modification in the code editing area as the source code of the target paragraph mark as the second source code of the target text.
Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005, so as to implement a process of modifying paragraph identifiers of each source code in the code editing area, where the process includes:
analyzing the source code in the code editing area to obtain code interpretation information in the code editing area;
removing paragraph identifiers of the code interpretation information in the code editing area;
after the paragraph identification of the code interpretation information in the code editing area is removed, regenerating the paragraph identification of the remaining source codes in the code editing area to obtain the paragraph identification after correction processing; the residual source code is the code in the target source code except the code interpretation information.
Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005, so as to implement modification processing on paragraph identifiers of each source code in the code editing area according to the source code in the code editing area, where the modification processing includes:
analyzing the source code in the code editing area to obtain the number of attribute parameters of each paragraph in the code editing area;
determining paragraph marks corresponding to the candidate paragraphs with the quantity of the attribute parameters larger than the threshold of the quantity of the attribute parameters from the code editing area;
updating the paragraph identification of the candidate paragraph according to the number of the attribute parameters of the candidate paragraph;
after the paragraph marks of the candidate paragraphs are updated, carrying out correction processing on the paragraph marks of the remaining paragraphs in the code editing area to obtain corrected paragraph marks; the remaining paragraphs are paragraphs in the code editing region that follow the candidate paragraph.
Optionally, the processor 1001 may be configured to invoke the device control application stored in the memory 1005, so as to replace the second source code of the target text displayed in the code editing area with the first source code, and obtain an updated target source code, where the method includes:
generating a second attribute description syntax tree according to the first source code; generating a third attribute description syntax tree according to the second source code;
identifying pairs of attribute parameters having differences, said pairs of attribute parameters including a first attribute parameter belonging to said second attribute description syntax tree and a second attribute parameter belonging to said third attribute description syntax tree;
and acquiring a source code for describing the first attribute parameter from the first source code, and replacing the source code for describing the second attribute parameter in the second source code with the source code for describing the first attribute parameter to obtain an updated target source code.
Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005 to implement:
responding to a modification instruction of the source code for describing the updated target text in the code editing area, and acquiring a third source code obtained by modification;
converting the third source code into markup language information of the updated target text;
rendering the markup language information of the updated target text in the media preview area to obtain a rendering result, and updating the updated target text according to the rendering result.
In the application, the target source code of the media content is displayed in the code preview area, and the media content is previewed in the media preview area, so that the modification of the media content is realized by modifying the target source code of the media content; alternatively, what is seen as what is being modified, i.e., the target object, may be advantageously used to flexibly select a modification strategy for modifying media content by making what is seen as what is being modified of the media content displayed in the media preview area. Furthermore, the target text belonging to the media content in the media preview area is updated and displayed in the media preview area by responding to the modification instruction of the target text in the media preview area, that is, when the target object modifies the target text in the media preview area, the effect after the modification of the target text can be immediately observed in the media preview area, that is, the effect is obtained, the problem that the media content is not intuitive when being updated can be avoided, and the modification efficiency of the media content is improved. Then, generating a candidate source code of the updated target text, performing conflict processing on the candidate code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing, and updating the target source code displayed in the code editing area according to the first source code to obtain the updated target source code, so that the problem that some grammatical codes in the updated target source code cannot be identified due to the conflict in the candidate source code can be effectively avoided, or the problem that some grammatical codes in the updated target source code are identified incorrectly can be avoided, and the accuracy of updating the target source code can be improved; in the updating process of the target source code, the source code does not need to be edited manually, the updating efficiency of the target source code is improved (namely the development efficiency of the media content is improved), and the problem of difficult positioning of the source code can be avoided.
It should be understood that the computer device 1000 described in this embodiment of the present application may perform the description of the data processing method in the embodiment corresponding to fig. 4 and fig. 7, and may also perform the description of the data processing apparatus in the embodiment corresponding to fig. 11, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: an embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program executed by the aforementioned data processing apparatus, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the data processing method in the embodiment corresponding to fig. 4 and fig. 7 can be performed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application.
As an example, the program instructions described above may be executed on one computer device, or on at least two computer devices located at one site, or on at least two computer devices distributed over at least two sites and interconnected by a communication network, and the at least two computer devices distributed over at least two sites and interconnected by the communication network may constitute a blockchain network.
The computer-readable storage medium may be the data processing apparatus provided in any of the foregoing embodiments or an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, provided on the computer device. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the computer device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the computer device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
The terms "first," "second," and the like in the description and claims of embodiments of the present application and in the drawings are used for distinguishing between different media content and not for describing a particular order. Furthermore, the terms "comprises" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or apparatus that comprises a list of steps or elements is not limited to the listed steps or modules, but may alternatively include other steps or modules not listed or inherent to such process, method, apparatus, product, or apparatus.
An embodiment of the present application further provides a computer program product, which includes a computer program/instruction, and when the computer program/instruction is executed by a processor, the description of the data processing method in the embodiment corresponding to fig. 4 and fig. 7 is implemented, and therefore, details will not be repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer program product referred to in the present application, reference is made to the description of the method embodiments of the present application.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The method and the related apparatus provided by the embodiments of the present application are described with reference to the flowchart and/or the structural diagram of the method provided by the embodiments of the present application, and each flow and/or block of the flowchart and/or the structural diagram of the method, and the combination of the flow and/or block in the flowchart and/or the block diagram can be specifically implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block or blocks of the block diagram. These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block or blocks.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and should not be taken as limiting the scope of the present application, so that the present application will be covered by the appended claims.

Claims (18)

1. A data processing method, comprising:
displaying a target source code edited aiming at media content in a code editing area, and previewing the media content in a media previewing area according to the target source code;
in response to a modification instruction for target text belonging to the media content in the media preview area, performing updated display on the target text in the media preview area; generating a candidate source code of the updated target text;
performing conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
2. The method of claim 1, wherein the target text belonging to the media content is displayed in the media preview area updated in response to a modification instruction for the target text in the media preview area; generating candidate source code for updated target text, comprising:
in response to a modification instruction for target text belonging to the media content in the media preview area, displaying a functional component associated with the target text;
responding to a trigger operation aiming at the functional component, and acquiring a target candidate attribute parameter obtained based on the trigger operation;
updating the target text in the media preview area according to the target candidate attribute parameters, and displaying the updated target text;
and generating a candidate source code of the updated target text according to the target candidate attribute parameter.
3. The method of claim 2, wherein the generating the candidate source code for the updated target text according to the target candidate attribute parameter comprises:
acquiring markup language information about the updated target text;
analyzing the mark language information of the updated target text to obtain attribute information of the updated target text, wherein the attribute information of the updated target text comprises a plurality of attribute parameters of the updated target text and a nesting relation among the attribute parameters, and the attribute parameters comprise the target attribute parameters;
generating a first attribute description syntax tree about the updated target text according to the attribute information of the updated target text;
and analyzing the first attribute description syntax tree to obtain the candidate source code of the updated target text.
4. The method according to claim 3, wherein a parent node of the first attribute description syntax tree includes the updated target text, a child node connected to the parent node includes the attribute parameters of the updated target text, and the child nodes having a connection relationship respectively include the attribute parameters having a nesting relationship therebetween;
the analyzing the first attribute description syntax tree to obtain the candidate source code of the updated target text includes:
traversing child nodes of the first attribute description syntax tree according to the node path of the first attribute description syntax tree to generate source codes of attribute parameters in the child nodes of the first attribute description syntax tree;
based on the connection relation among all the child nodes in the first attribute description syntax tree, assembling the source codes of the attribute parameters in the child nodes of the first attribute description syntax tree to obtain the updated assembled source codes of the target text;
and generating candidate source codes of the updated target text according to the parent node of the first attribute description syntax tree and the assembly source codes.
5. The method of claim 1, wherein the performing collision processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after collision processing comprises:
analyzing the candidate source code to obtain grammatical features of the candidate source code; the grammar features are used for reflecting grammar codes with nesting relations in the candidate source codes;
acquiring an outer layer grammar code and an inner layer grammar code from the grammar codes with the nesting relation;
and performing conflict processing on the outer layer grammar code and the inner layer grammar code respectively to obtain a first source code after the conflict processing.
6. The method of claim 5, wherein the performing conflict processing on the outer layer syntax code and the inner layer syntax code, respectively, to obtain a first source code after conflict processing comprises:
converting the inner layer grammar code into markup language information, and determining the first markup language information obtained by conversion and the outer layer grammar code as a first source code after conflict processing; or,
and converting the outer layer grammar code into markup language information, and determining the converted second markup language information and the inner layer grammar code as a first source code after conflict processing.
7. The method of claim 5, wherein the performing conflict processing on the outer layer syntax code and the inner layer syntax code, respectively, to obtain a first source code after conflict processing, comprises:
reserving the inner layer grammar code, deleting the outer layer grammar code, and obtaining a first source code after conflict processing; or,
and reserving the outer layer grammar code, deleting the inner layer grammar code, and obtaining a first source code after conflict processing.
8. The method of claim 5, wherein the performing conflict processing on the outer layer syntax code and the inner layer syntax code, respectively, to obtain a first source code after conflict processing comprises:
and performing separation processing on the outer layer syntax code and the inner layer syntax code to obtain a first source code after collision processing.
9. The method of claim 1, wherein said updating the target source code displayed in the code editing area according to the first source code, resulting in updated target source code, comprises:
counting the target paragraph marks of the updated target text in the media preview area;
determining a second source code for describing the target text from the code editing area according to the target paragraph mark;
and replacing a second source code of the target text displayed in the code editing area by the first source code to obtain an updated target source code.
10. The method of claim 9, wherein said determining a second source code for the target text from the code editing region based on the target paragraph identification comprises:
acquiring the number of first paragraphs in the code editing area and the number of second paragraphs in the media preview area;
if the number of the first paragraph is the same as that of the second paragraph, identifying the paragraph in the code editing area as the source code of the target paragraph identification, and determining the paragraph as the second source code of the target text;
and if the number of the first paragraph is different from the number of the second paragraph, modifying paragraph marks of each source code in the code editing area, and determining the paragraph marks after modification in the code editing area as the source code of the target paragraph mark as the second source code of the target text.
11. The method of claim 10, wherein said modifying the paragraph identification of each source code in the code editing region comprises:
analyzing the source code in the code editing area to obtain code interpretation information in the code editing area;
removing paragraph identifiers of the code interpretation information in the code editing area;
after the paragraph mark of the code interpretation information in the code editing area is removed, regenerating the paragraph marks of the rest source codes in the code editing area to obtain the paragraph mark after correction processing; the residual source code is the code in the target source code except the code interpretation information.
12. The method of claim 10, wherein the modifying the paragraph identifier of each source code in the code editing area according to the source code in the code editing area comprises:
analyzing the source code in the code editing area to obtain the attribute parameter quantity of each paragraph in the code editing area;
determining paragraph marks corresponding to the candidate paragraphs with the quantity of the attribute parameters larger than the threshold of the quantity of the attribute parameters from the code editing area;
updating the paragraph identification of the candidate paragraph according to the number of the attribute parameters of the candidate paragraph;
after the paragraph marks of the candidate paragraphs are updated, carrying out correction processing on the paragraph marks of the remaining paragraphs in the code editing area to obtain corrected paragraph marks; the remaining paragraphs are paragraphs in the code editing region that follow the candidate paragraph.
13. The method of claim 9, wherein replacing a second source code of the target text displayed in the code editing area with the first source code resulting in an updated target source code, comprises:
generating a second attribute description syntax tree according to the first source code; generating a third attribute description syntax tree according to the second source code;
identifying pairs of attribute parameters having differences, said pairs of attribute parameters including a first attribute parameter belonging to said second attribute description syntax tree and a second attribute parameter belonging to said third attribute description syntax tree;
and acquiring a source code for describing the first attribute parameter from the first source code, and replacing the source code for describing the second attribute parameter in the second source code with the source code for describing the first attribute parameter to obtain an updated target source code.
14. The method of claim 1, wherein the method further comprises:
responding to a modification instruction aiming at the source code of the updated target text in the code editing area, and acquiring a third source code obtained by modification;
converting the third source code into markup language information of the updated target text;
rendering the markup language information of the updated target text in the media preview area to obtain a rendering result, and updating the updated target text according to the rendering result.
15. A data processing apparatus, comprising:
the display module is used for displaying a target source code edited aiming at the media content in a code editing area and previewing the media content in a media previewing area according to the target source code;
the modification module is used for responding to a modification instruction aiming at a target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area, and generating a candidate source code of the updated target text;
the processing module is used for carrying out conflict processing on the candidate source code according to the grammatical features of the candidate source code to obtain a first source code after the conflict processing;
and the updating module is used for updating the target source code displayed in the code editing area according to the first source code to obtain an updated target source code.
16. A computer device, comprising: a processor and a memory;
the processor is connected with the memory; the memory is for storing program code, and the processor is for calling the program code to perform the method of any of claims 1 to 14.
17. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-14.
18. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the steps of the method according to any of claims 1-14.
CN202111156254.9A 2021-09-29 2021-09-29 Data processing method, device, equipment and storage medium Pending CN115878098A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111156254.9A CN115878098A (en) 2021-09-29 2021-09-29 Data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111156254.9A CN115878098A (en) 2021-09-29 2021-09-29 Data processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115878098A true CN115878098A (en) 2023-03-31

Family

ID=85756532

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111156254.9A Pending CN115878098A (en) 2021-09-29 2021-09-29 Data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115878098A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116708945A (en) * 2023-04-12 2023-09-05 北京优贝卡科技有限公司 Media editing method, device, equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116708945A (en) * 2023-04-12 2023-09-05 北京优贝卡科技有限公司 Media editing method, device, equipment and storage medium
CN116708945B (en) * 2023-04-12 2024-04-16 半月谈新媒体科技有限公司 Media editing method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110442822B (en) Method, device, equipment and storage medium for displaying small program content
US20080040588A1 (en) Data Processing Device and Data Processing Method
EP1821176A1 (en) Data processing device and data processing method
CN108762743A (en) Data table operation code generation method and device
CN109725965A (en) Cascading style listing maintenance, device, computer equipment and storage medium
CN110580189A (en) method and device for generating front-end page, computer equipment and storage medium
US20100100807A1 (en) Data processing device, and data processing method
US20070208995A1 (en) Document Processing Device and Document Processing Method
US20070198915A1 (en) Document Processing Device And Document Processing Method
CN114564199A (en) Method, device and equipment for generating use page and readable storage medium
CN115576974A (en) Data processing method, device, equipment and medium
CN115878098A (en) Data processing method, device, equipment and storage medium
CN103109289A (en) Web-based script language editing method, system and web client
US20080282143A1 (en) Document Processing Device and Document Processing Method
CN116610558A (en) Code detection method, device, electronic equipment and computer readable storage medium
CN116028062A (en) Target code generation method, NPU instruction display method and device
CN115994517A (en) Information processing method, apparatus, storage medium, device, and program product
EP1744271A1 (en) Document processing device
CN115170700A (en) Method for realizing CSS animation based on Flutter framework, computer equipment and storage medium
CN111277889B (en) Television side page preview method and system
CN113918194A (en) Page component display method and device, electronic equipment and storage medium
US7730105B2 (en) Time sharing managing apparatus, document creating apparatus, document reading apparatus, time sharing managing method, document creating method, and document reading method
CN112068826B (en) Text input control method, system, electronic device and storage medium
CN113709575A (en) Video editing processing method and device, electronic equipment and storage medium
CN113934959A (en) Program preview method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination