Data processing method and device, equipment and storage medium
By enabling interactive previewing and syntax feature processing in the code editing and media preview areas, the system solves the problems of low efficiency and difficulty in locating media content, achieving intuitive media content updates and an efficient development process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, media content development is inefficient, user needs change frequently, code needs to be modified repeatedly, and source code is difficult to locate, making it impossible to achieve intuitive updates.
By displaying the target source code in the code editing area and previewing it in the media preview area, updating the display in response to user modification instructions, and processing candidate source code through syntax features to avoid conflicts, a WYSIWYG modification effect is achieved.
It improves the efficiency and accuracy of media content modification, avoids the problems of difficult source code location and unintuitive updates, and enhances development efficiency.
Smart Images

Figure CN115878098B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet technology, and in particular to a data processing method, apparatus, device and storage medium. Background Technology
[0002] With the development of internet technology, internet media content (such as web pages and games) is widely used in life, work, and entertainment, bringing great convenience to users. However, different users have different needs for media content. For example, in the case of interactive web pages, user A may have higher requirements for the content display function, while user B may have higher requirements for the content publishing function. Therefore, media content needs to be developed to meet the needs of different users. Currently, media content development requires technical personnel to have professional coding skills to develop media content through code.
[0003] Since most users of media content lack coding skills, and different users have different development needs for media content, professional technical personnel are required to collect user requirements and then code accordingly to realize media content development. However, user needs may change at any time, or the developed media content may fail to meet the user's actual needs, requiring technical personnel to repeatedly modify the code, resulting in low media content development efficiency. Summary of the Invention
[0004] The technical problem to be solved by the embodiments of this application is to provide a data processing method, apparatus, device and storage medium that can effectively improve the development efficiency of media content.
[0005] One embodiment of this application provides a data processing method, including:
[0006] The target source code edited for the media content is displayed in the code editing area, and the media content is previewed in the media preview area based on the target source code;
[0007] In response to a modification instruction for target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area, and candidate source code for the updated target text is generated.
[0008] The candidate source code is conflict-handled based on its syntactic features to obtain a conflict-handled first source code.
[0009] The target source code displayed in the code editing area is updated based on the first source code to obtain the updated target source code.
[0010] One embodiment of this application provides a data processing apparatus, including:
[0011] The display module is used to display the target source code edited for the media content in the code editing area, and to preview the media content in the media preview area based on the target source code;
[0012] The modification module is used to respond to a modification instruction for target text belonging to the media content in the media preview area, update the display of the target text in the media preview area, and generate candidate source code for the updated target text;
[0013] The processing module is used to perform conflict resolution on the candidate source code according to the syntactic features of the candidate source code, so as to obtain the first source code after conflict resolution.
[0014] An update module is used to update the target source code displayed in the code editing area according to the first source code, so as to obtain the updated target source code.
[0015] This application provides a computer device, including: a processor and a memory;
[0016] The aforementioned memory is used to store computer programs, and the aforementioned processor is used to invoke the aforementioned computer programs to perform the following steps:
[0017] The target source code edited for the media content is displayed in the code editing area, and the media content is previewed in the media preview area based on the target source code;
[0018] In response to a modification instruction for target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area, and candidate source code for the updated target text is generated.
[0019] The candidate source code is conflict-handled based on its syntactic features to obtain a conflict-handled first source code.
[0020] The target source code displayed in the code editing area is updated based on the first source code to obtain the updated target source code.
[0021] One embodiment of this application provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the following steps:
[0022] The target source code edited for the media content is displayed in the code editing area, and the media content is previewed in the media preview area based on the target source code;
[0023] In response to a modification instruction for target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area, and candidate source code for the updated target text is generated.
[0024] The candidate source code is conflict-handled based on its syntactic features to obtain a conflict-handled first source code.
[0025] The target source code displayed in the code editing area is updated based on the first source code to obtain the updated target source code.
[0026] One embodiment of this application provides a computer program product, including a computer program / instructions, which, when executed by a processor, implements the steps of the above-described method:
[0027] The target source code edited for the media content is displayed in the code editing area, and the media content is previewed in the media preview area based on the target source code;
[0028] In response to a modification instruction for target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area, and candidate source code for the updated target text is generated.
[0029] The candidate source code is conflict-handled based on its syntactic features to obtain a conflict-handled first source code.
[0030] The target source code displayed in the code editing area is updated based on the first source code to obtain the updated target source code.
[0031] In this application, by displaying the target source code of the media content in the code preview area and previewing the media content in the media preview area, it is beneficial to modify the media content by modifying the target source code; or, it is beneficial to make WYSIWYG modifications to the media content displayed in the media preview area, that is, the target object can flexibly choose the modification strategy to modify the media content. Furthermore, by responding to modification instructions for the target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area. In other words, when the target object modifies the target text in the media preview area, it can immediately see the effect of the modified target text in the media preview area, i.e., WYSIWYG, which avoids the problem of unintuitive media content updates and improves the efficiency of media content modification. Then, by generating candidate source code for the updated target text, conflict resolution is performed on the candidate source code based on its syntactic features to obtain the first source code after conflict resolution. The target source code displayed in the code editing area is then updated based on the first source code to obtain the updated target source code. This effectively avoids the problem that conflicts in the candidate source code may lead to the inability to recognize certain syntactic codes in the updated target source code, or the problem that certain syntactic codes in the updated target source code may be misrecognized. This improves the accuracy of updating the target source code. Furthermore, the process of updating the target source code does not require manual editing of the source code, thus improving the efficiency of updating the target source code (i.e., improving the development efficiency of media content) and avoiding the problem of difficulty in locating the source code. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a schematic diagram of the architecture of a data processing system provided in this application;
[0034] Figure 2 This application provides a process intent for modifying media content in a media preview area;
[0035] Figure 3 This is a flowchart illustrating a process for modifying source code in a code editing area, as provided in this application.
[0036] Figure 4 This is the flowchart of a data processing method provided in this application;
[0037] Figure 5 This is a schematic diagram of the interface of a code editing area and a media preview area provided in this application;
[0038] Figure 6 This is a schematic diagram of the interface of a code editing area and a media preview area provided in this application;
[0039] Figure 7 This is the flowchart of a data processing method provided in this application;
[0040] Figure 8 This is a schematic diagram illustrating a scenario where media content in a media preview area is modified, as provided in this application.
[0041] Figure 9 This is a schematic diagram illustrating a scenario for generating candidate source code for updated target text, as provided in this application.
[0042] Figure 10 This is a schematic diagram of an interface for modifying source code in a code editing area, as provided in this application;
[0043] Figure 11 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0044] Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0046] The media content in this application can refer to internet products that provide internet services to users, such as multimedia web pages (e.g., forums, online communities), game applications, shopping applications, social applications, content interaction applications, etc. Media content can consist of one or more materials, including tables, text, images, etc. After this media content is published, it is necessary to collect problems encountered by users while using the multimedia content, analyze these problems to obtain user needs regarding the media content, and then, professional technicians need to modify the source code of the media content based on user needs to obtain the modified source code. The media content is then updated based on the modified source code and returned to the user. It is evident that this media content development method has the following drawbacks: 1. Media content updates are not intuitive. Technicians need to repeatedly modify the source code of the media content to determine whether the updated media content meets expectations. 2. Source code location is difficult. For example, when there is a large amount of source code for the media content, it takes a considerable amount of time to find the source code corresponding to the modified media content. For example, when a user wants to modify the font, font size, weight, or other attributes of text in media content, professional technicians need to locate the source code describing the text from the source code of the media content, modify the source code to obtain the modified source code, update the text in the media content based on the modified source code, and then provide the updated media content to the user. If the user is still not satisfied with the text displayed in the updated media content, professional technicians need to modify the modified source code again, resulting in relatively low efficiency in media content development.
[0047] Based on this, this application proposes a data processing method. This method displays the edited target source code for media content in a code editing area. The media content is then previewed in a media preview area based on this target source code, allowing direct modification of the displayed content. When a user needs to modify any text within the media content, this text can be referred to as the target text. By responding to a modification instruction for the target text belonging to the media content in the media preview area, the target text is updated and displayed in that area. In other words, when a user modifies the target text in the media preview area, they can immediately see the effect of the modification—a WYSIWYG approach—avoiding the problem of unintuitive media content updates and improving the efficiency of media content modification. Then, candidate source code for the updated target text is generated. Since the candidate source code may contain incompatibility issues, directly using the candidate source code to update the target source code could easily lead to problems such as certain syntax codes in the updated target source code not being recognized, or errors in the recognition of certain syntax codes in the updated target source code. Therefore, by performing conflict resolution on the candidate source code based on its syntactic features, a first source code with conflict resolution is obtained. The target source code displayed in the code editing area is then updated based on this first source code to obtain the updated target source code. This effectively avoids the problem that conflicts in the candidate source code may prevent certain syntactic codes in the updated target source code from being recognized, or that certain syntactic codes in the updated target source code may be misrecognized. This improves the accuracy of updating the target source code. Furthermore, the update process does not require manual editing of the source code, improving the efficiency of updating the target source code (i.e., improving the development efficiency of media content) and avoiding the problem of difficulty in locating the source code.
[0048] To facilitate a clearer understanding of this application, the data processing system that implements the data processing method of this application is first introduced, such as... Figure 1 As shown, the data processing system includes, for example, Figure 1 As shown, the data processing system includes a server and a terminal.
[0049] In this context, "terminal" can refer to a user-facing device, including a media content editing platform. This platform can be a media content editing webpage, application, etc., such as a Markdown editor or other editors. The terminal can edit or modify the source code of media content through the media content editing platform, or modify the media content (i.e., the media content materials). "Server" refers to the backend service equipment used to provide the media content editing, specifically for setting up the media content editing platform for the terminal and for maintaining the platform.
[0050] It should be noted that the media content editing platform has a media display interface, which refers to the interface used to display media content and its source code. The area within the media display interface used to display the source code of the media content is called the code editing area, and the area used to display the media content itself is called the media preview area. Both the source code displayed in the code editing area and the media content displayed in the media preview area can be modified. The source code displayed in the code editing area and the media content displayed in the media preview area are synchronously updated. This means that when the source code in the code editing area is modified, the media content in the media preview area is updated 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.
[0051] The media display interface of the media content editing platform in this application has two editing modes. One mode is a single-column editing mode, which means that only the code editing area or only the 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; or, when the media preview area is displayed on the media display interface, the code editing area is minimized or hidden. For example, in response to a modification instruction for the target text of the media content in the media preview area, the familiarity of the target object with the source code in the code editing area is obtained. If the familiarity level is less than the familiarity level threshold, it indicates that the target object is a non-technical professional and does not care about how the source code in the code editing area is updated. Therefore, the computer device can use the single-column editing mode to display the media preview area on the media display interface. This is more conducive to viewing the modification effect of the media content in real time, and at the same time, it allows the target object to focus more on the content in the media preview area without being disturbed by the source code in the code editing area. The target object's familiarity with the source code in the code editing area can be determined based on the amount of source code written by the target object within a historical period, or it can be determined based on the code characteristics of the source code in the code editing area, including the quantity and structure of the source code. Another editing mode is a two-column editing mode, which displays both a code editing area and a media preview area on the media display interface. When these areas are displayed, the display parameters of both the code editing area and the media preview area can be adjusted, including size, position, and shape. For example, in response to a modification instruction on the target text of the media content in the media preview area, the target object's familiarity with the source code in the code editing area is obtained. If the familiarity level is greater than or equal to a familiarity threshold, it indicates that the target object is a professional technician who is concerned about how the source code in the code editing area is updated. Therefore, the computer device can use a two-column editing mode to display the media preview area and the code editing area on the media display interface. This allows the target object to monitor changes in the source code in the code editing area in real time while modifying the media content in the media preview area.
[0052] It should be further clarified that "media content can be modified" means that the text, tables, and images in the media content can be modified. Specifically, the text content, text attribute parameters, table content attribute parameters, cell table attribute parameters, image attribute parameters, etc., can be modified. Text attribute parameters include font, font size, font background, font color, font weight, italic font, etc. Table content attribute parameters can include the text content in the table, the text attribute parameters, and the cell table in which the text content is located. Cell table attribute parameters include the number of rows, number of columns, length, width, etc., and image attribute parameters include the image size, format, background color, etc.
[0053] The server can be a single physical server, a server cluster or distributed system consisting of at least two physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. The terminal can be a smart vehicle terminal, smartphone, tablet, laptop, desktop computer, smart speaker, speaker with screen, smartwatch, smart TV, etc., but is not limited to these. The terminals and servers can be directly or indirectly connected via wired or wireless communication. The number of terminals and servers can be one or at least two; this application does not impose any restrictions.
[0054] Optional, Figure 1 The server or terminal in the system can have modules including font editing, font de-analysis, source code location and replacement, syntax parsing engine, language editing area, media preview, etc. These modules allow modification of text in the media preview area. There are two strategies for modifying text in the media preview area: directly modifying the text and modifying the source code in the code editing area. The strategy for directly modifying text in the media preview area is as follows: Figure 2As shown, the implementation process of this modification strategy includes: 1. The media preview module responds to the modification instruction for the target text belonging to the media content in the media preview area and displays the attribute parameter list of the target text. The modification instruction can be an instruction generated by the target object through clicking, swiping, etc., on the target text. The target text refers to the text that the target object needs to modify. The specific content of the modification can be modifying the text content of the target text or modifying the attribute parameters of the target text. The attribute parameter list includes multiple candidate attribute parameters of the target text, such as font, font size, font background, font color, font weight, font italics, etc. 2. The font editing module obtains one or more target candidate attribute parameters selected in the attribute parameter list, sends the target candidate attribute parameters to the font reverse parsing module, and updates the target text display in the media preview area according to the target candidate attribute parameters. 3. The font reverse parsing module generates candidate source code of the updated target text according to the target candidate attribute parameters, performs conflict handling on the candidate source code, obtains the conflict-handled first source code, and sends the first source code to the source code location and replacement module. 4. The source code location and replacement module locates 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 with this first source code to obtain the updated target source code. The target source code refers to the source code in the language editing area before the source code of the target text was updated. 5. The language editing module displays the updated target source code in the code editing area.
[0055] The modification strategy of modifying the source code in the code editing area refers to modifying the source code of the target text in the code editing area to modify the target text in the media preview area; this modification strategy of modifying the source code in the code editing area is as follows: Figure 3 As shown, the implementation process of this modification strategy includes: 1. The language editing module obtains the updated source code of the target text from the code editing area and modifies it. 2. The language editing module converts the updated source code of the target text into the updated markup language information of the target text and sends the updated markup language information of the target text to the syntax parsing engine. 3. The syntax parsing engine renders the updated markup language information of the target text to obtain the rendering result. 4. The media preview module updates the target text in the media preview area according to the rendering result.
[0056] Further, please see Figure 4 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 4 As shown, this method can be derived from... Figure 1 It can be executed by the terminal in the middle, or by Figure 1 The server in the middle can be used to execute it, or it can be executed by... Figure 1The terminal and server in this application work together to execute the method. The device used to execute this method can be collectively referred to as a computer device. The data processing method may include the following steps S101 to S104:
[0057] S101. Display the target source code obtained by editing the media content in the code editing area, and preview the media content in the media preview area based on the target source code.
[0058] In this application, the computer device can display the target source code obtained from editing the media content in the code editing area, and preview the media content in the media preview area based on the target source code. Both the target source code in the code editing area and the media content in the media preview area can be modified. That is to say, by displaying the media content and its target source code in a two-column editing mode of the media content editing platform, it is possible to both modify the text in the media content displayed in the media preview area (what you see is what you get) and modify the text in the media content by modifying the target source code in the code editing area. Users can choose an appropriate modification strategy according to their own needs, improving the flexibility of modifying media content.
[0059] For example, users can choose a modification strategy based on their specific needs. When the target text has few attribute parameters, or when the user is unfamiliar with the source code in the code editing area, they can choose to modify the source code of the target text in the code editing area to modify the target text in the media preview area. When the target text has many and complex attribute parameters, or when the user is unfamiliar with the source code in the code editing area, they can choose to modify the target text belonging to the media content in the media preview area. By choosing different modification strategies for different scenarios, the user's experience and efficiency in editing (i.e., developing) media content can be improved.
[0060] It should be noted that the computer device can divide the media display interface using default display parameters to obtain a code editing area and a media preview area; alternatively, the computer device can predict the modification strategy used by the target object when modifying the media content, and divide the media display interface according to the modification strategy to obtain a code editing area and a media preview area. Here, the modification strategy includes modifying the media content or modifying the target source code of the media content, and the target object can refer to the user corresponding to the terminal used to modify the media content.
[0061] Optionally, the aforementioned prediction of the modification strategy used by the target object when modifying the media content includes the following two implementation methods. The first implementation method includes: obtaining the code characteristics of the target source code of the media content using a computer device. These code characteristics include the number of source codes, the framework of the source code, etc.; determining the complexity of the target source code based on its code characteristics; and predicting the modification strategy used by the target object when modifying the media content based on this complexity. For example, obtaining the number of source codes in the target source code of the media content; determining the complexity of the target source code based on the number of source codes; there is a positive correlation between the number of source codes and the complexity of the target source code, i.e., the more source codes there are, the higher the complexity of the target source code, and vice versa. Therefore, if the complexity of the target source code is greater than a complexity threshold, the modification strategy for modifying the media content is determined as the modification strategy used by the target object when modifying the media content; if the complexity of the target source code is less than or equal to the complexity threshold, the modification strategy for modifying the target source code of the media content is determined as the modification strategy used by the target object when modifying the media content.
[0062] Similarly, the second implementation method includes: The computer device acquires the amount of source code written by the target object over a historical period. The amount of source code written by the target object reflects its familiarity with source code syntax. Therefore, the modification strategy used by the target object when modifying the media content can be predicted based on the amount of source code written. For example, if the target object writes a larger amount of source code, it is more familiar with the source code syntax and is more likely to modify the target source code of the media content. The strategy for modifying the target source code of the media content is then determined as the modification strategy used by the target object when modifying the media content. Conversely, if the target object writes a smaller amount of source code, it is less familiar with the source code syntax and is more likely to modify the media content. The strategy for modifying the media content is then determined as the modification strategy used by the target object when modifying the media content.
[0063] Optionally, the media display interface is divided according to this modification strategy to obtain a code editing area and a media preview area, including: such as Figure 5 As shown, if the modification strategy involves modifying the media content, the media display interface is divided into a code editing area and a media preview area. The media preview area is larger than the code editing area, located on the left side of the media display interface, while the media preview area is on the right side. This facilitates the target object's modification of the media content in the media preview area. Figure 6As shown, if the modification strategy involves modifying 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 code editing area is larger than the media preview area, and the media preview area is located above the code editing area. Alternatively, the code editing area can be located on the right side of the media display interface, and the media preview area can be located on the left side, which facilitates the target object's modification of the target source code within the code editing area.
[0064] S102. In response to a modification instruction for target text belonging to the media content in the media preview area, update the display of the target text in the media preview area and generate candidate source code for the updated target text.
[0065] In this application, when a target object needs to modify text in media content, the computer device responds to the modification instruction for the target text belonging to the media content in the media preview area, modifies the target text in the media preview area, displays the updated target text, and then generates candidate source code for the updated target text. In other words, 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 a timely manner, allowing the target object to view the effect of the modification in real time, thus improving the intuitiveness of modifying the target text.
[0066] Optionally, in response to a modification instruction for target text belonging to the media content in the media preview area, and when the above modification strategy is a strategy for modifying media content, it indicates that the predicted modification strategy is the same as the modification strategy actually used by the target object. Therefore, the media preview area and the code editing area do not need to be adjusted, and the target text can be directly updated and displayed in the media preview area to generate candidate source code for the updated target text.
[0067] Optionally, in response to a modification instruction for target text belonging to the media content in the media preview area, and the above modification strategy is a strategy for modifying the target source code of the media content, it indicates that the predicted modification strategy is different from the modification strategy actually used by the target object. Therefore, the media preview area and the code editing area can be adjusted to obtain the adjusted media preview area and code editing area; the target text is updated and displayed in the adjusted media preview area to generate the candidate source code of the updated target text.
[0068] Optionally, the computer device can adjust the media preview area and the code editing area based on the target object's familiarity with the source code. Specifically, step S202 includes: in response to a modification instruction for the target text belonging to the media content in the media preview area, obtaining the target object's familiarity with the source code in the code editing area; adjusting the media preview area and the code editing area according to the familiarity level to obtain the adjusted media preview area and the adjusted code editing area; updating the display of the target text in the adjusted media preview area; and generating candidate source code for the updated target text. For example, if the familiarity level is less than a familiarity threshold, it indicates that the target object is a non-technical professional and does not care how the source code in the code editing area is updated. Therefore, the computer device can reduce the size of the code editing area, or display the media preview area in a single-column editing mode on the media display interface. This is more conducive to viewing the modification effect of the media content in real time, and at the same time, it helps the target object to focus more on the content in the media preview area without being disturbed by the source code in the code editing area. If the level of familiarity is greater than or equal to the familiarity threshold, it indicates that the target audience is a professional technician. This target audience is more concerned about how the source code in the code editing area is updated. Therefore, the computer device can increase the size of the code editing area and decrease the size of the media preview area. This will help the target audience to pay attention to the changes in the source code in the code editing area in real time when modifying the media content in the media preview area.
[0069] The target object's familiarity with the source code in the code editing area can be determined based on the amount of source code written by the target object during a historical period, or the target object's familiarity with the source code in the code editing area can be determined based on the code characteristics of the source code in the code editing area, including the number of source codes and the structure of the source code, etc.
[0070] S103. Based on the syntactic features of the candidate source code, perform conflict resolution on the candidate source code to obtain the first source code after conflict resolution.
[0071] S104. Update the target source code displayed in the code editing area according to the first source code to obtain the updated target source code.
[0072] In steps S102 and S103, since the candidate source code may contain conflicts such as source code incompatibility, directly using the candidate source code to update the target source code could easily lead to problems such as certain syntax codes in the updated target source code not being recognized, or certain syntax codes in the updated target source code being misrecognized. Therefore, the computer device can perform conflict processing on the candidate source code based on its syntax features to obtain a conflict-processed first source code. The target source code displayed in the code editing area is then updated based on this first source code to obtain the updated target source code. This effectively avoids the problems caused by conflicts in the candidate source code, such as certain syntax codes in the updated target source code not being recognized, or certain syntax codes in the updated target source code being misrecognized. This improves the accuracy of updating the target source code. Furthermore, the update process does not require manual editing of the source code, improving the efficiency of updating the target source code and avoiding the problem of difficulty in locating the source code.
[0073] It should be noted that, in order to maintain the correspondence between the code editing area and the media preview area, after step S104, the computer device can update the media content in the media preview area according to the updated target source code. This avoids the problem of the source code in the code editing area not corresponding to the media content in the media preview area after modification of the source code in the code editing area during conflict resolution. In this application, by displaying the target source code of the media content in the code preview area and previewing the media content in the media preview area, it is beneficial to modify the media content by modifying the target source code; or, it is beneficial to make WYSIWYG modifications to the media content displayed in the media preview area, that is, the target object can flexibly choose the modification strategy to modify the media content. Furthermore, by responding to the modification instruction for the target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area. That is, when the target object modifies the target text in the media preview area, it can immediately see the effect of the target text modification in the media preview area, that is, WYSIWYG, which avoids the problem of unintuitive media content updates and improves the efficiency of media content modification. Then, by generating candidate source code for the updated target text, conflict resolution is performed on the candidate source code based on its syntactic features to obtain the first source code after conflict resolution. The target source code displayed in the code editing area is then updated based on the first source code to obtain the updated target source code. This effectively avoids the problem that conflicts in the candidate source code may lead to the inability to recognize certain syntactic codes in the updated target source code, or the problem that certain syntactic codes in the updated target source code may be misrecognized. This improves the accuracy of updating the target source code. Furthermore, the process of updating the target source code does not require manual editing of the source code, thus improving the efficiency of updating the target source code (i.e., improving the development efficiency of media content) and avoiding the problem of difficulty in locating the source code.
[0074] Further, please see Figure 7 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 7 As shown, this method can be derived from... Figure 1 It can be executed by the terminal in the middle, or by Figure 1 The server in the middle can be used to execute it, or it can be executed by... Figure 1 The method is executed jointly by a terminal and a server. The device used to execute this method in this application can be collectively referred to as a computer device. The method may include at least the following steps S201-S206:
[0075] S201. Display the target source code obtained by editing the media content in the code editing area, and preview the media content in the media preview area based on the target source code.
[0076] S202. In response to a modification instruction for target text belonging to the media content in the media preview area, display the functional components associated with the target text.
[0077] S203. In response to the selection operation of the target candidate attribute parameter in the attribute parameter list, obtain the target candidate attribute parameter obtained based on the triggering operation; update the target text in the media preview area according to the target candidate attribute parameter, and display the updated target text.
[0078] In steps S202 and S203, when a selection operation is detected on target text belonging to media content in the media preview area, a modification instruction for the target text is generated based on the selection operation. This selection operation can be a click, swipe, voice, etc. In response to the modification instruction, a functional component associated with the target text is displayed in the media preview area. This functional component can be the operation bar for the target text, which includes multiple attribute options such as font, font size, font color, font background color, italics, font weight, etc. These attribute options allow modification of the target text's attribute parameters. When a trigger operation is detected on the functional component, in response to the trigger operation, target candidate attribute parameters obtained based on the trigger operation are acquired. The target text is then updated in the media preview area based on these target candidate attribute parameters, 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 seen in the media preview area—what you see is what you get—avoiding the problem of unintuitive media content updates and improving the efficiency of media content modification.
[0079] For example, such as Figure 8 As shown, 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 side-by-side in the media display interface, and the size of the code editing area 21 is the same as the size of the media preview area 22. The source code displayed in the code editing area 21 consists of two lines of source code. The first line of source code is: . using `* (or)` and `** (or)` to represent *italic* and _bold_. The second line of source code is: . using ` / ` to represent / underscore / , using ` ~~ ` indicates ~~ strikethrough ~~ The media content displayed in the media preview area consists of two lines of text. The first line uses * (or) and ** (or) to represent italics and bold, respectively. The second line uses / to represent underscores and uses... ~~ This indicates strikethrough, where the first line of text is derived from the first line of source code, and the second line of text is derived from the second line of source code. For example... Figure 8 As shown, the user selects "Representation" in the first line of text in the media preview area, designating "Representation" as the target text. Below this target text, functional components 23 are displayed, including options for font, font size, font color, font background color, italics, font weight, etc. If the user selects the bold option, "Representation" is displayed in bold in the media preview area 22. Then, the source code in the code editing area is synchronously updated based on the updated target text.
[0080] S204. Generate the candidate source code for the updated target text based on the target candidate attribute parameters.
[0081] Optionally, the computer device can generate candidate source code based on the updated attribute description syntax tree of the target text. Specifically, step S204 may include the following steps s11 to s14:
[0082] s11. Obtain markup language information about the updated target text.
[0083] s12. Parse the markup language information of the updated target text to obtain the attribute information of the updated target text. The attribute information of the updated target text includes multiple attribute parameters of the updated target text and the nesting relationship between the attribute parameters. The multiple attribute parameters include the target attribute parameters.
[0084] s13. Based on the attribute information of the updated target text, generate a first attribute description syntax tree for the updated target text.
[0085] s14. Parse the syntax tree describing the first attribute to obtain the candidate source code of the updated target text.
[0086] In steps s11-s14, the computer device can obtain markup language information about the updated target text. This markup language information describes the attribute information of the updated target text, specifically HTML (Hypertext Markup Language), XML (eXtensible Markup Language), etc. Then, the markup language information of the updated target text can be parsed to obtain the attribute information of the updated target text. This attribute information includes multiple attribute parameters of the updated target text and the nesting relationships between these attribute parameters, including the aforementioned target attribute parameters. Further, the computer device can generate a first attribute description syntax tree for the updated target text based on the attribute information. This first attribute description syntax tree can more intuitively describe the attribute information of the updated target text. Then, the first attribute description syntax tree can be parsed to obtain candidate source code for the updated target text. As can be seen, after the target text in the media preview area is modified, candidate source code for the updated target text can be automatically generated without the need for manual source code writing, thus improving the efficiency of source code generation and the efficiency of developing text in media content.
[0087] Table 1:
[0088]
[0089] For example, markup language information is shown in Table 1, where " <span style="color:rgb(255,0,0);"> Font color ",as well as" <font style="color:rgb(255,0,0);"> Font color< / font> "All of these indicate that the font color is red." <strong> Bold< / strong> This indicates that the text should be bolded. <em> italics< / em> This will display the text in italics. <strong>Bold <em> italics< / em> < / strong> This indicates that the text should be bolded and displayed in italics. Assuming the updated target text is: "Love in the Moment," the markup language for this updated target text is [language name missing]. <strong> <em> Love in the present< / em> < / strong> The updated target text's markup language is parsed to obtain its attribute information. This attribute information reflects the updated target text's attribute parameters, including bold and italic, with a nested relationship between the bold and italic attributes. For example... Figure 9As shown, a computer device can generate a first attribute description syntax tree for the updated target text based on this attribute information. The parent node of this first attribute description syntax tree is the updated target text: "Love in the Present Moment," and the child nodes include the attribute parameters of the updated target text: bold and italic. The connection relationship between child node 1 and child node 2 reflects the nesting relationship between the attribute parameter bold and the attribute parameter italic. Then, the computer device can parse this first attribute description syntax tree to obtain the candidate source code of the updated target text.
[0090] Optionally, the parent node of the first attribute description syntax tree includes the updated target text, and the child nodes connected to the parent node include the attribute parameters of the updated target text. The attribute parameters contained in the connected child nodes have a nested relationship. The computer device can generate candidate source code for the updated target text based on the first attribute description syntax tree. Specifically, step s14 may include the following steps s21 to s23:
[0091] s21. Based on the node path of the first attribute description syntax tree, traverse the child nodes of the first attribute description syntax tree and generate the source code of the attribute parameters in the child nodes of the first attribute description syntax tree.
[0092] s22. Based on the connection relationship between each child node in the first attribute description syntax tree, the source code of the attribute parameters in the child nodes of the first attribute description syntax tree is assembled to obtain the assembled source code of the updated target text.
[0093] s23. Generate candidate source code for the updated target text based on the parent node of the syntax tree described by the first attribute and the assembled source code.
[0094] In steps s21-s23, the computer device can traverse the child nodes of the first attribute description syntax tree according to the node path of the first attribute description syntax tree, generating the source code of the attribute parameters in the child nodes of the first attribute description syntax tree; the node path can refer to top to bottom or left to right. Then, based on the connection relationship between the various child nodes of the first attribute description syntax tree, the source code of each attribute parameter can be assembled to obtain the assembled source code of the updated target text. Next, the updated target text in the parent node of the first attribute description syntax tree is added to the assembled source code to obtain the assembled source code of the updated target text. Since the first attribute description syntax tree can more intuitively describe the attribute parameters of the updated target text, generating candidate source code of the updated target text based on the first attribute description syntax tree can avoid the problem of one or more attribute parameters of the candidate target text being omitted, resulting in low accuracy of the generated candidate source code.
[0095] For example, such as Figure 9 As shown, the computer device can obtain the node path of the first attribute description syntax tree, that is, the node path is from child node 1 to child node 2. According to the child node path, it traverses each child node of the first attribute description syntax tree and generates the source code of the attribute parameters in each child node. The source code in italics is: **, and the source code in bold is: ****. Then, according to the connection relationship between child node 1 and child node 2, the source code in italics and the source code in bold are assembled to obtain the assembled source code, which is: ******. Finally, the updated target text is added to the assembled source code to obtain the candidate source code, that is, the candidate source code is: ***Love in the present moment***.
[0096] S205. Based on the syntactic features of the candidate source code, perform conflict resolution on the candidate source code to obtain the first source code after conflict resolution.
[0097] Optionally, the computer device can handle conflicts in syntax codes with nested relationships. Specifically, step S205 may include the following steps s31 to s33:
[0098] s31. Parse the candidate source code to obtain its syntactic features; these syntactic features are used to reflect the nested syntax code in the candidate source code.
[0099] s32. Obtain the outer and inner syntax codes from the nested syntax codes.
[0100] s34. Perform conflict resolution on the outer and inner syntax codes respectively to obtain the first source code after conflict resolution.
[0101] In steps s31-s33, the computer device can parse the candidate source code to obtain its syntactic features. These syntactic features reflect nested syntax codes within the candidate source code, and the outer and inner syntax codes are extracted from these nested syntax codes. The nested syntax codes can include at least two layers of syntax codes. The outer syntax code can be the outermost layer of the nested syntax codes, and the inner syntax code can be any syntax code within the nested syntax codes excluding the outermost layer; alternatively, the outer syntax code can be any syntax code within the nested syntax codes excluding the innermost layer, and the inner syntax code can be any syntax code within the nested syntax codes excluding the innermost layer. Further, the outer and inner syntax codes can be separated (or transformed) to eliminate conflicts in the candidate source code, resulting in a conflict-resolved first source code. By handling conflicts in the candidate source code, the problems of certain syntax codes in the updated target source code not being recognized or being misrecognized can be effectively avoided, thus improving the accuracy of updating the target source code.
[0102] For example, the candidate source code might contain nested syntax: *bold text inside **italic text** outside of italics. *bold text inside italics outside of italics* can be called the outer syntax code, and **italic text** can be called the inner syntax code. Here, *x* represents setting the text to italics, and **x** represents setting the text to bold. If the candidate source code is directly used to update the target source code, the candidate source code will be incorrectly identified as: *bold text inside italics* outside of italics*, meaning both the content syntax code and the outer syntax code will be incorrectly identified. Therefore, conflict resolution can be implemented between the outer and inner syntax codes, such as by adding a space between them. This results in the first source code after conflict resolution: *bold text inside **italic text** outside of italics*, which will then be correctly identified as: *bold text inside italics outside of italics*.
[0103] It should be noted that the computer device can use the following three conflict resolution methods to resolve conflicts between the outer and inner syntax codes respectively, to obtain the first source code after conflict resolution:
[0104] The first conflict resolution method involves converting the inner or outer syntax code into markup language, and describing the updated target text using a mixture of markup language information and source code to eliminate conflicts in the candidate source code. Specifically, this first conflict resolution method may include: converting the inner syntax code into markup language information, and using the converted first markup language information and the outer syntax code as the conflict-resolved first source code; or, converting the outer syntax code into markup language information, and using the converted second markup language information and the inner syntax code as the conflict-resolved first source code.
[0105] The second conflict resolution method involves deleting either the inner or outer syntax code to eliminate conflicts in the candidate source code. Specifically, this second conflict resolution method may include: retaining the inner syntax code and deleting the outer syntax code to obtain the conflict-resolved first source code; or retaining the outer syntax code and deleting the inner syntax code to obtain the conflict-resolved first source code.
[0106] The third conflict resolution method involves separating the inner and outer syntax codes to eliminate conflicts in the candidate source code. Specifically, this method may involve separating the outer and inner syntax codes to obtain the conflict-resolved first source code. This separation can refer to adding a separator, such as a space, between the outer and inner syntax codes.
[0107] Optionally, adjacent syntax codes in the candidate source code may also have conflict issues. The computer device can separate adjacent syntax codes to eliminate conflicts and obtain a conflict-resolved first source code. For example, if the candidate source code is: **bold text inside *italic text**** also outside italics**, then *bold text inside italics** and * also outside italics* can be considered adjacent syntax codes. If the target source code is updated using the candidate source code, the syntax code * also outside italics* may not be recognized. Therefore, spaces can be added to the adjacent syntax codes to obtain the conflict-resolved first source code, such as: **bold text inside *italic text**** also outside italics*.
[0108] S206. Update the target source code displayed in the code editing area according to the first source code to obtain the updated target source code.
[0109] Optionally, the computer device locates the 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:
[0110] s41. Calculate the target paragraph identifier of the updated target text in the media preview area.
[0111] s42. Based on the target paragraph identifier, determine the second source code used to describe the target text from the code editing area.
[0112] s43. Replace the second source code of the target text displayed in the code editing area with the first source code to obtain the updated target source code.
[0113] In steps s41-s43, the computer device can count the target paragraph identifier of the updated target text in the media preview area. This target paragraph identifier can refer to the identifier used to locate the updated target text in the media preview area, specifically the paragraph number or line number of the updated target text. Further, based on the target paragraph identifier, the second source code describing the target text can be located from the code editing area. The first source code can then replace the second source code displayed in the code editing area to obtain the updated target source code. By using the target paragraph identifier of the updated target text in the media preview area, the second source code to be replaced in the code editing area can be accurately located, improving the accuracy of updating the target source code.
[0114] Optionally, step s42 above may include the following steps s51 to s53:
[0115] s51. Get the number of the first paragraph in the code editing area and the number of the second paragraph in the media preview area.
[0116] s52. If the number of the first paragraph is the same as the number of the second paragraph, then the source code in the code editing area that is identified as the target paragraph is determined as the second source code of the target text.
[0117] s53. If the number of the first paragraph is different from the number of the second paragraph, then the paragraph identifiers of each source code in the code editing area are corrected, and the corrected paragraph identifiers in the code editing area are used as the source code of the target paragraph identifier, which is determined as the second source code of the target text.
[0118] In steps s51-s53, the total number of paragraphs corresponding to the source code in the code editing area is usually the same as the total number of paragraphs corresponding to the media content in the media preview area. However, when the code editing area includes code explanation information or a paragraph describes a large number of attribute parameters, the total number of paragraphs corresponding to the source code in the code editing area may differ from the total number of paragraphs corresponding to the media content in the media preview area. Therefore, the computer device can obtain the total number of paragraphs corresponding to the source code in the code editing area as the first number of paragraphs, and obtain the total number of paragraphs corresponding to the media content in the media preview area as the second number of paragraphs. If the first number of paragraphs and the second number of paragraphs are the same, it indicates that the code editing area does not include code explanation information, and that there is no situation in the code editing area where some paragraphs describe a large number of attribute parameters. In other words, the source code with the same paragraph identifier in the code editing area and the media preview area is associated with the media content. For example, the source code with the target paragraph identifier in the code editing area is used to describe the target text, and the updated target text is displayed in the paragraph with the target paragraph identifier in the media preview area. Therefore, if the number of the first paragraph and the number of the second paragraph are the same, the computer device can identify the source code in the code editing area whose paragraph identifier is the target paragraph identifier as the second source code of the target text. If the number of the first paragraph and the number of the second paragraph are not the same, it indicates that the code editing area includes code explanation information, or that there are some paragraphs in the code editing area that describe a large number of attribute parameters. In other words, the source code in the code editing area with the same paragraph identifier as the media preview area is not associated with the media content. For example, the paragraph in the media preview area with the paragraph identifier of the target paragraph identifier displays the updated target text, while the source code in the code editing area with the paragraph identifier of the target paragraph identifier does not describe the target text. Therefore, the computer device can correct the paragraph identifiers of each source code in the code editing area to make the number of paragraphs in the code editing area the same as the number of paragraphs in the media preview area. Then, the source code in the code editing area with the corrected paragraph identifier of the target paragraph identifier is identified as the second source code of the target text. By using the target paragraph identifier of the updated target text in the media preview area, the source code that needs to be modified can be located in the code editing area, improving the accuracy of source code location and the accuracy of updating the target source code.
[0119] Optionally, when the target source code includes code explanation information, the computer device can correct the segment markers of the source code in the code editing area by removing the segment markers of the code explanation information; specifically, s53 above may include the following steps s61 to s63:
[0120] s61. Parse the source code in the code editing area to obtain the code explanation information in the code editing area.
[0121] s62. Remove the paragraph marker from the code explanation information in the code editing area.
[0122] s63. After the paragraph markers of the code explanation information in the code editing area are removed, the paragraph markers of the remaining source code in the code editing area are regenerated to obtain the corrected paragraph markers; the remaining source code is the code in the target source code excluding the code explanation information.
[0123] In steps s61-s63, if the code editing area includes code explanation information, the number of paragraphs corresponding to the source code in the code editing area will be greater than the number of paragraphs in the media content in the media preview area. This will cause the source code in the code editing area and the media preview area with the same paragraph identifiers to be unrelated to the media content. Therefore, the computer device can parse the source code in the code editing area to obtain the code explanation information and remove the paragraph identifiers of the code explanation information in the code editing area. Further, after the paragraph identifiers of the code explanation information in the code editing area are removed, the paragraph identifiers of the remaining source code in the code editing area are regenerated to obtain the corrected paragraph identifiers, i.e., the paragraph identifiers following the paragraph identifiers of the code explanation information are updated. By removing the code identifiers of the code explanation information, the accuracy of locating the source code that needs modification (i.e., the source code used to describe the target text) is improved.
[0124] Optionally, when a certain paragraph in the target source code describes a large number of attribute parameters, the computer device can modify the paragraph identifier of the source code in the code editing area by adding a paragraph identifier for that paragraph; specifically, s53 above may include the following steps s71 to s74:
[0125] s71. Parse the source code in the code editing area to obtain the number of attribute parameters for each paragraph in the code editing area.
[0126] s72. Identify the paragraph identifiers of candidate paragraphs whose number of attribute parameters exceeds the threshold value from the code editing area.
[0127] s73. Update the paragraph identifier of the candidate paragraph based on the number of attribute parameters of the candidate paragraph.
[0128] s74. After updating the paragraph identifier of the candidate paragraph, the paragraph identifiers of the remaining paragraphs in the code editing area are corrected to obtain the corrected paragraph identifiers; the remaining paragraphs are the paragraphs in the code editing area that are located after the candidate paragraph.
[0129] In steps s71-s74, because the number of attribute parameters for a certain paragraph exceeds the attribute parameter number threshold, the total number of paragraphs corresponding to the source code in the code editing area will be less than the number of paragraphs in the media content in the media preview area. Consequently, the source code with the same paragraph identifier in the code editing area and the media preview area will be unrelated to the media content. Therefore, the computer device can parse the source code in the code editing area to obtain the number of attribute parameters for each paragraph in the code editing area. Further, it can determine the paragraph identifiers corresponding to candidate paragraphs whose attribute parameter numbers exceed the attribute parameter number threshold from the code editing area. Then, the paragraph identifier of the candidate paragraph can be increased according to the number of attribute parameters. After updating the paragraph identifier of the candidate paragraph, the paragraph identifiers following the candidate paragraph in the code editing area are updated to obtain the corrected paragraph identifiers. By updating the paragraph identifiers of candidate paragraphs whose attribute parameter numbers exceed the attribute parameter number threshold, the accuracy of locating the source code that needs modification (i.e., the source code used to describe the target text) is improved.
[0130] Optionally, the computer device can update the target source program information based on the attribute description syntax tree. Specifically, s43 may include the following steps s81 to s83:
[0131] s81. Generate a second attribute description syntax tree based on the first source code; generate a third attribute description syntax tree based on the second source code.
[0132] s82. Identify attribute parameter pairs that have differences, the attribute parameter pairs including 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.
[0133] s83. Obtain the source code used to describe the first attribute parameter from the first source code, and replace the source code used to describe the second attribute parameter in the second source code with the source code of the first attribute parameter to obtain the updated target source code.
[0134] In steps s81-s83, the computer device can generate a second attribute description syntax tree based on the first source code; generate a third attribute description syntax tree based on the second source code; compare the first and second attribute description syntax trees to obtain attribute parameter pairs with differences. These attribute parameter pairs include 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. In other words, the first attribute parameter is obtained by modifying the second attribute parameter of the target text using the target object. That is, the source code in the code editing area used to describe the second attribute parameter is the source code that needs to be updated. Therefore, the source code describing the first attribute parameter is obtained from the first source code, and this source code replaces the source code describing the second attribute parameter in the second source code, resulting in the updated target source code. The attribute description syntax tree allows for the location of the source code that needs updating, improving the accuracy of source code location.
[0135] Optionally, the method may further include the following steps s91 to s93:
[0136] s91. In response to a modification instruction for the source code in the code editing area used to describe the updated target text, obtain the modified third source code.
[0137] s92. Convert the third source code into the markup language information of the updated target text.
[0138] s93. Render the markup language information of the updated target text in the media preview area to obtain the rendering result, and update the updated target text based on the rendering result.
[0139] In steps s91-s93, the computer device can 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 the source code in the code editing area used to describe the updated target text, the device can obtain the modified third source code, convert the third source code into markup language information of the updated target text, render the markup language information of the updated target text in the media preview area, obtain a rendering result, and update the updated target text based on the rendering result. The text in the media preview area is updated by modifying the source code in the code editing area.
[0140] For example, such as Figure 10As shown, the media display interface includes a code editing area 21 and a media preview area 22, which are placed side-by-side within the media display interface. 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 is: . using `* (or)` and `** (or)` to represent *italic* and _bold_. The second line of source code is: . using ` / ` to represent / underscore / , using ` ~~ ` indicates ~~ strikethrough ~~ The media content displayed in the media preview area consists of two lines of text. The first line uses * (or) and ** (or) to represent italics and bold, respectively. The second line uses / to represent underscores and uses... ~~ This indicates strikethrough, where the first line of text is derived from the first line of source code, and the second line of text is derived from the second line of source code. For example... Figure 10 In the code editing area, if the user adds the following source code to the "Representation" source code: !! (!!!#f9cb9c!!!), the added source code is used to instruct the font background color of "Representation" to be set to brown. After obtaining the modified source code of "Representation", the display effect of "Representation" in the media preview area can be updated synchronously according to the modified source code, that is, the font background of "Representation" is rendered as brown.
[0141] In this application, by displaying the target source code of the media content in the code preview area and previewing the media content in the media preview area, it is beneficial to modify the media content by modifying the target source code; or, it is beneficial to make WYSIWYG modifications to the media content displayed in the media preview area, that is, the target object can flexibly choose the modification strategy to modify the media content. Furthermore, by responding to modification instructions for the target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area. In other words, when the target object modifies the target text in the media preview area, it can immediately see the effect of the modified target text in the media preview area, i.e., WYSIWYG, which avoids the problem of unintuitive media content updates and improves the efficiency of media content modification. Then, by generating candidate source code for the updated target text, conflict resolution is performed on the candidate source code based on its syntactic features to obtain the first source code after conflict resolution. The target source code displayed in the code editing area is then updated based on the first source code to obtain the updated target source code. This effectively avoids the problem that conflicts in the candidate source code may lead to the inability to recognize certain syntactic codes in the updated target source code, or the problem that certain syntactic codes in the updated target source code may be misrecognized. This improves the accuracy of updating the target source code. Furthermore, the process of updating the target source code does not require manual editing of the source code, thus improving the efficiency of updating the target source code (i.e., improving the development efficiency of media content) and avoiding the problem of difficulty in locating the source code.
[0142] Please see Figure 11 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application. The aforementioned data processing apparatus can be a computer program (including program code) running on a computer device; for example, the data processing apparatus is application software. This apparatus can be used to execute corresponding steps in the methods provided in the embodiments of this application. Figure 11 As shown, the data processing device may include: a display module 111, a modification module 112, a processing module 113, and an update module 114.
[0143] The display module is used to display the target source code edited for the media content in the code editing area, and to preview the media content in the media preview area based on the target source code;
[0144] The modification module is used to respond to a modification instruction for target text belonging to the media content in the media preview area, update the display of the target text in the media preview area, and generate candidate source code for the updated target text;
[0145] The processing module is used to perform conflict resolution on the candidate source code according to the syntactic features of the candidate source code, so as to obtain the first source code after conflict resolution.
[0146] An update module is used to update the target source code displayed in the code editing area according to the first source code, so as to obtain the updated target source code.
[0147] Optionally, in response to a modification instruction for target text belonging to the media content in the media preview area, the modification module updates the display of the target text in the media preview area and generates candidate source code for the updated target text, including:
[0148] In response to a modification instruction for target text belonging to the media content in the media preview area, a functional component associated with the target text is displayed;
[0149] In response to a trigger operation on the functional component, the target candidate attribute parameters obtained based on the trigger operation are acquired;
[0150] The target text is updated in the media preview area according to the target candidate attribute parameters, and the updated target text is displayed;
[0151] The updated candidate source code for the target text is generated based on the target candidate attribute parameters.
[0152] Optionally, the modification module generates candidate source code for the updated target text based on the target candidate attribute parameters, including:
[0153] Obtain markup language information about the updated target text;
[0154] The markup language information of the updated target text is parsed to obtain the attribute information of the updated target text. The attribute information of the updated target text includes multiple attribute parameters of the updated target text and the nesting relationship between the attribute parameters. The multiple attribute parameters include the target attribute parameters.
[0155] Based on the attribute information of the updated target text, a first attribute description syntax tree for the updated target text is generated;
[0156] The first attribute description syntax tree is parsed to obtain the candidate source code of the updated target text.
[0157] Optionally, the parent node of the first attribute description syntax tree includes the updated target text, and the child nodes connected to the parent node include the attribute parameters of the updated target text. The attribute parameters contained in the connected child nodes have a nested relationship.
[0158] The modification module parses the first attribute description syntax tree to obtain the candidate source code of the updated target text, including:
[0159] Based on the node path of the first attribute description syntax tree, traverse the child nodes of the first attribute description syntax tree to generate the source code of the attribute parameters in the child nodes of the first attribute description syntax tree.
[0160] Based on the connection relationship between each child node in the first attribute description syntax tree, the source code of the attribute parameters in the child nodes of the first attribute description syntax tree is assembled to obtain the assembled source code of the updated target text.
[0161] The updated target text candidate source code is generated based on the parent node of the first attribute description syntax tree and the assembled source code.
[0162] Optionally, the processing module performs conflict resolution on the candidate source code based on the syntactic features of the candidate source code to obtain a conflict-resolved first source code, including:
[0163] The candidate source code is parsed to obtain its syntactic features; these syntactic features are used to reflect the nested syntax code in the candidate source code.
[0164] Obtain the outer and inner syntax codes from the nested syntax codes;
[0165] Conflict resolution is performed on the outer syntax code and the inner syntax code respectively to obtain the first source code after conflict resolution.
[0166] Optionally, the processing module performs conflict resolution on the outer syntax code and the inner syntax code respectively to obtain the first source code after conflict resolution, including:
[0167] The inner syntax code is converted into markup language information, and the resulting first markup language information and the outer syntax code are used as the first source code after conflict resolution; or...
[0168] The outer syntax code is converted into markup language information, and the converted second markup language information and the inner syntax code are determined as the first source code after conflict resolution.
[0169] Optionally, the processing module performs conflict resolution on the outer syntax code and the inner syntax code respectively to obtain the first source code after conflict resolution, including:
[0170] The inner syntax code is retained, and the outer syntax code is deleted to obtain the first source code after conflict resolution; or...
[0171] The outer syntax code is retained, and the inner syntax code is deleted to obtain the first source code after conflict resolution.
[0172] Optionally, the processing module performs conflict resolution on the outer syntax code and the inner syntax code respectively to obtain the first source code after conflict resolution, including:
[0173] The outer syntax code and the inner syntax code are separated to obtain the first source code after conflict resolution.
[0174] Optionally, the update module updates the target source code displayed in the code editing area according to the first source code to obtain the updated target source code, including:
[0175] The updated target text is identified by its target paragraph identifier in the media preview area.
[0176] Based on the target paragraph identifier, a second source code for describing the target text is determined from the code editing area;
[0177] The second source code of the target text displayed in the code editing area is replaced with the first source code to obtain the updated target source code.
[0178] Optionally, the update module determines the second source code of the target text from the code editing area based on the target paragraph identifier, including:
[0179] Obtain the number of the first paragraph in the code editing area and the number of the second paragraph in the media preview area;
[0180] If the number of the first paragraph is the same as the number of the second paragraph, then the source code in the code editing area that is identified as the target paragraph is determined as the second source code of the target text;
[0181] If the number of the first paragraph is different from the number of the second paragraph, then the paragraph identifiers of each source code in the code editing area are corrected, and the corrected paragraph identifiers in the code editing area are used as the source code of the target paragraph identifier, which is determined as the second source code of the target text.
[0182] Optionally, the update module corrects the paragraph markers of each source code in the code editing area, including:
[0183] The source code in the code editing area is parsed to obtain the code explanation information in the code editing area;
[0184] Remove the paragraph markers from the code explanation information in the code editing area;
[0185] After the paragraph markers of the code explanation information in the code editing area are removed, the paragraph markers of the remaining source code in the code editing area are regenerated to obtain the corrected paragraph markers; the remaining source code is the code in the target source code other than the code explanation information.
[0186] Optionally, the update module corrects the paragraph identifiers of each source code in the code editing area based on the source code in the code editing area, including:
[0187] The source code in the code editing area is parsed to obtain the number of attribute parameters for each paragraph in the code editing area;
[0188] From the code editing area, identify the paragraph identifiers corresponding to candidate paragraphs whose number of attribute parameters is greater than the attribute parameter number threshold;
[0189] The paragraph identifier of the candidate paragraph is updated based on the number of attribute parameters of the candidate paragraph;
[0190] After updating the paragraph identifier of the candidate paragraph, the paragraph identifiers of the remaining paragraphs in the code editing area are corrected to obtain the corrected paragraph identifiers; the remaining paragraphs are the paragraphs in the code editing area that are located after the candidate paragraphs.
[0191] Optionally, the updating module replaces the second source code of the target text displayed in the code editing area with the first source code to obtain the updated target source code, including:
[0192] Generate a second attribute description syntax tree based on the first source code; generate a third attribute description syntax tree based on the second source code;
[0193] Identify attribute parameter pairs that have differences, the attribute parameter pairs including 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;
[0194] Obtain the source code describing the first attribute parameter from the first source code, and replace the source code describing the second attribute parameter in the second source code with the source code describing the first attribute parameter to obtain the updated target source code.
[0195] Optionally, the update module is further configured to, in response to a modification instruction for the source code in the code editing area used to describe the updated target text, obtain the modified third source code;
[0196] The third source code is converted into the markup language information of the updated target text;
[0197] The updated target text's markup language information is rendered in the media preview area to obtain a rendering result, and the updated target text is updated based on the rendering result.
[0198] According to one embodiment of this application, Figure 4 The steps involved in the data processing method shown can be derived from... Figure 11 The data processing device shown is executed by various modules. For example, Figure 4 Step S101 shown can be performed by Figure 11 The display module 111 in the middle is used to execute, Figure 4 Step S102 shown can be performed by Figure 11 The modified module 112 in the middle is used to execute; Figure 4 Step S103 shown can be performed by Figure 11 The processing block 113 in the middle is used for execution; Figure 4 Step S104 shown can be derived from Figure 11 The update module 114 in the middle is used to execute it.
[0199] According to one embodiment of this application, Figure 11 The modules in the data processing apparatus shown can be individually or entirely combined into one or more units, or some of these units can be further divided into at least two functionally smaller sub-units to achieve the same operation without affecting the technical effects of the embodiments of this application. The above modules are based on logical functional division. In practical applications, the function of one module can be implemented by at least two units, or the function of at least two modules can be implemented by one unit. In other embodiments of this application, the data processing apparatus may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by at least two units.
[0200] According to one embodiment of this application, a general-purpose computer device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), can perform operations such as... Figure 4 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 11 The data processing apparatus shown herein, and the data processing method for implementing the embodiments of this application, are described. The computer program described above may be recorded on, for example, a computer-readable recording medium, loaded onto the aforementioned computing device via the computer-readable recording medium, and run therein.
[0201] In this application, by displaying the target source code of the media content in the code preview area and previewing the media content in the media preview area, it is beneficial to modify the media content by modifying the target source code; or, it is beneficial to make WYSIWYG modifications to the media content displayed in the media preview area, that is, the target object can flexibly choose the modification strategy to modify the media content. Furthermore, by responding to modification instructions for the target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area. In other words, when the target object modifies the target text in the media preview area, it can immediately see the effect of the modified target text in the media preview area, i.e., WYSIWYG, which avoids the problem of unintuitive media content updates and improves the efficiency of media content modification. Then, by generating candidate source code for the updated target text, conflict resolution is performed on the candidate source code based on its syntactic features to obtain the first source code after conflict resolution. The target source code displayed in the code editing area is then updated based on the first source code to obtain the updated target source code. This effectively avoids the problem that conflicts in the candidate source code may lead to the inability to recognize certain syntactic codes in the updated target source code, or the problem that certain syntactic codes in the updated target source code may be misrecognized. This improves the accuracy of updating the target source code. Furthermore, the process of updating the target source code does not require manual editing of the source code, thus improving the efficiency of updating the target source code (i.e., improving the development efficiency of media content) and avoiding the problem of difficulty in locating the source code.
[0202] Please see Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 12As shown, the computer device 1000 may include a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include a media content interface 1003 and at least one communication bus 1002. The communication bus 1002 is used to enable communication between these components. The media content interface 1003 may include a display screen and a keyboard; optionally, the media content interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as Wi-Fi). I -F I (Interface). Memory 1005 can be high-speed RAM or non-volatile memory, such as at least one disk storage device. Optionally, memory 1005 can also be at least one storage device located remotely from the aforementioned processor 1001. Figure 12 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a media content interface module, and a device control application.
[0203] exist Figure 12 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; the media content interface 1003 is mainly used to provide an interface for inputting media content; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0204] The target source code edited for the media content is displayed in the code editing area, and the media content is previewed in the media preview area based on the target source code;
[0205] In response to a modification instruction for target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area, and candidate source code for the updated target text is generated.
[0206] The candidate source code is conflict-handled based on its syntactic features to obtain a conflict-handled first source code.
[0207] The target source code displayed in the code editing area is updated based on the first source code to obtain the updated target source code.
[0208] Optionally, the processor 1001 can be used to call a device control application stored in the memory 1005 to update the display of the target text in the media preview area in response to a modification instruction for target text belonging to the media content in the media preview area, and generate candidate source code for the updated target text, including:
[0209] In response to a modification instruction for target text belonging to the media content in the media preview area, a functional component associated with the target text is displayed;
[0210] In response to a trigger operation on the functional component, the target candidate attribute parameters obtained based on the trigger operation are acquired;
[0211] The target text is updated in the media preview area according to the target candidate attribute parameters, and the updated target text is displayed;
[0212] The updated candidate source code for the target text is generated based on the target candidate attribute parameters.
[0213] Optionally, the processor 1001 can be used to call a device control application stored in the memory 1005 to generate candidate source code for the updated target text based on the target candidate attribute parameters, including:
[0214] Obtain markup language information about the updated target text;
[0215] The markup language information of the updated target text is parsed to obtain the attribute information of the updated target text. The attribute information of the updated target text includes multiple attribute parameters of the updated target text and the nesting relationship between the attribute parameters. The multiple attribute parameters include the target attribute parameters.
[0216] Based on the attribute information of the updated target text, a first attribute description syntax tree for the updated target text is generated;
[0217] The first attribute description syntax tree is parsed to obtain the candidate source code of the updated target text.
[0218] Optionally, the parent node of the first attribute description syntax tree includes the updated target text, and the child nodes connected to the parent node include the attribute parameters of the updated target text. The attribute parameters contained in the connected child nodes have a nested relationship.
[0219] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to parse the first attribute description syntax tree and obtain the candidate source code of the updated target text, including:
[0220] Based on the node path of the first attribute description syntax tree, traverse the child nodes of the first attribute description syntax tree to generate the source code of the attribute parameters in the child nodes of the first attribute description syntax tree.
[0221] Based on the connection relationship between each child node in the first attribute description syntax tree, the source code of the attribute parameters in the child nodes of the first attribute description syntax tree is assembled to obtain the assembled source code of the updated target text.
[0222] The updated target text candidate source code is generated based on the parent node of the first attribute description syntax tree and the assembled source code.
[0223] Optionally, the processor 1001 can be used to call a device control application stored in the memory 1005 to perform conflict resolution on the candidate source code according to the syntactic features of the candidate source code, obtaining a conflict-resolved first source code, including:
[0224] The candidate source code is parsed to obtain its syntactic features; these syntactic features are used to reflect the nested syntax code in the candidate source code.
[0225] Obtain the outer and inner syntax codes from the nested syntax codes;
[0226] Conflict resolution is performed on the outer syntax code and the inner syntax code respectively to obtain the first source code after conflict resolution.
[0227] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to perform conflict resolution on the outer syntax code and the inner syntax code respectively, to obtain the conflict-resolved first source code, including:
[0228] The inner syntax code is converted into markup language information, and the resulting first markup language information and the outer syntax code are used as the first source code after conflict resolution; or...
[0229] The outer syntax code is converted into markup language information, and the converted second markup language information and the inner syntax code are determined as the first source code after conflict resolution.
[0230] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to perform conflict resolution on the outer syntax code and the inner syntax code respectively, to obtain the conflict-resolved first source code, including:
[0231] The inner syntax code is retained, and the outer syntax code is deleted to obtain the first source code after conflict resolution; or...
[0232] The outer syntax code is retained, and the inner syntax code is deleted to obtain the first source code after conflict resolution.
[0233] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to perform conflict resolution on the outer syntax code and the inner syntax code respectively, to obtain the conflict-resolved first source code, including:
[0234] The outer syntax code and the inner syntax code are separated to obtain the first source code after conflict resolution.
[0235] Optionally, the processor 1001 can be used to call a device control application stored in the memory 1005 to update the target source code displayed in the code editing area according to the first source code, thereby obtaining the updated target source code, including:
[0236] The updated target text is identified by its target paragraph identifier in the media preview area.
[0237] Based on the target paragraph identifier, a second source code for describing the target text is determined from the code editing area;
[0238] The second source code of the target text displayed in the code editing area is replaced with the first source code to obtain the updated target source code.
[0239] Optionally, the processor 1001 can be used to invoke a device control application stored in the memory 1005 to determine the second source code of the target text from the code editing area based on the target paragraph identifier, including:
[0240] Obtain the number of the first paragraph in the code editing area and the number of the second paragraph in the media preview area;
[0241] If the number of the first paragraph is the same as the number of the second paragraph, then the source code in the code editing area that is identified as the target paragraph is determined as the second source code of the target text;
[0242] If the number of the first paragraph is different from the number of the second paragraph, then the paragraph identifiers of each source code in the code editing area are corrected, and the corrected paragraph identifiers in the code editing area are used as the source code of the target paragraph identifier, which is determined as the second source code of the target text.
[0243] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to perform correction processing on the paragraph markers of each source code in the code editing area, including:
[0244] The source code in the code editing area is parsed to obtain the code explanation information in the code editing area;
[0245] Remove the paragraph markers from the code explanation information in the code editing area;
[0246] After the paragraph markers of the code explanation information in the code editing area are removed, the paragraph markers of the remaining source code in the code editing area are regenerated to obtain the corrected paragraph markers; the remaining source code is the code in the target source code other than the code explanation information.
[0247] Optionally, the processor 1001 can be used to call a device control application stored in the memory 1005 to perform correction processing on the segment markers of each source code in the code editing area according to the source code in the code editing area, including:
[0248] The source code in the code editing area is parsed to obtain the number of attribute parameters for each paragraph in the code editing area;
[0249] From the code editing area, identify the paragraph identifiers corresponding to candidate paragraphs whose number of attribute parameters is greater than the attribute parameter number threshold;
[0250] The paragraph identifier of the candidate paragraph is updated based on the number of attribute parameters of the candidate paragraph;
[0251] After updating the paragraph identifier of the candidate paragraph, the paragraph identifiers of the remaining paragraphs in the code editing area are corrected to obtain the corrected paragraph identifiers; the remaining paragraphs are the paragraphs in the code editing area that are located after the candidate paragraphs.
[0252] Optionally, the processor 1001 can be used to call a device control application stored in the memory 1005 to implement a second source code that replaces the target text displayed in the code editing area with the first source code, resulting in an updated target source code, including:
[0253] Generate a second attribute description syntax tree based on the first source code; generate a third attribute description syntax tree based on the second source code;
[0254] Identify attribute parameter pairs that have differences, the attribute parameter pairs including 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;
[0255] Obtain the source code describing the first attribute parameter from the first source code, and replace the source code describing the second attribute parameter in the second source code with the source code describing the first attribute parameter to obtain the updated target source code.
[0256] Optionally, the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0257] In response to a modification instruction for the source code in the code editing area used to describe the updated target text, obtain the modified third source code;
[0258] The third source code is converted into the markup language information of the updated target text;
[0259] The updated target text's markup language information is rendered in the media preview area to obtain a rendering result, and the updated target text is updated based on the rendering result.
[0260] In this application, by displaying the target source code of the media content in the code preview area and previewing the media content in the media preview area, it is beneficial to modify the media content by modifying the target source code; or, it is beneficial to make WYSIWYG modifications to the media content displayed in the media preview area, that is, the target object can flexibly choose the modification strategy to modify the media content. Furthermore, by responding to modification instructions for the target text belonging to the media content in the media preview area, the target text is updated and displayed in the media preview area. In other words, when the target object modifies the target text in the media preview area, it can immediately see the effect of the modified target text in the media preview area, i.e., WYSIWYG, which avoids the problem of unintuitive media content updates and improves the efficiency of media content modification. Then, by generating candidate source code for the updated target text, conflict resolution is performed on the candidate source code based on its syntactic features to obtain the first source code after conflict resolution. The target source code displayed in the code editing area is then updated based on the first source code to obtain the updated target source code. This effectively avoids the problem that conflicts in the candidate source code may lead to the inability to recognize certain syntactic codes in the updated target source code, or the problem that certain syntactic codes in the updated target source code may be misrecognized. This improves the accuracy of updating the target source code. Furthermore, the process of updating the target source code does not require manual editing of the source code, thus improving the efficiency of updating the target source code (i.e., improving the development efficiency of media content) and avoiding the problem of difficulty in locating the source code.
[0261] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 4 and the preceding text Figure 7 The description of the data processing method in the corresponding embodiments can also be performed as described above. Figure 11 The description of the data processing apparatus in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.
[0262] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned data processing device. The computer program includes program instructions, and when the processor executes the program instructions, it can execute the aforementioned... Figure 4 and Figure 7 The data processing method described in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application.
[0263] As an example, the above program instructions can be deployed and executed on a single computer device, or deployed and executed on at least two computer devices located in one location, or executed on at least two computer devices distributed in at least two locations and interconnected by a communication network. At least two computer devices distributed in at least two locations and interconnected by a communication network can form a blockchain network.
[0264] The aforementioned computer-readable storage medium can be an internal storage unit of the data processing apparatus or computer device provided in any of the foregoing embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium can include both internal and external storage units of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.
[0265] The terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish different media content, not to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0266] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the foregoing description. Figure 4 and Figure 7 The data processing method described in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer program product involved in this application, please refer to the description of the method embodiments of this application.
[0267] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this application.
[0268] The methods and related apparatuses provided in this application are described with reference to the method flowcharts and / or structural diagrams provided in this application. Specifically, each block of the method flowchart and / or structural diagram, as well as combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to create a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing device, generate instructions for implementing the process. Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 A schematic diagram of one or more processes and / or structures. Figure 1 The functions specified in one or more boxes. 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, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 A process or multiple processes and / or structures illustrate the steps of the functions specified in one or more boxes.
[0269] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. A data processing method, characterized by, The method comprises the following steps: displaying target source code edited for media content in a code editing area, previewing the media content in a media preview 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, updating and displaying the target text in the media preview area; generating candidate source code of the updated target text; if there are syntax codes with adjacent relationships in the candidate source code, performing separation processing on the syntax codes with adjacent relationships to obtain first source code after conflict processing; if the syntax features of the candidate source code indicate that there are outer-layer syntax codes and inner-layer syntax codes with nested relationships in the candidate source code, performing conflict processing on the outer-layer syntax codes and the inner-layer syntax codes respectively to obtain first source code after conflict processing; counting target paragraph identifiers of the updated target text in the media preview area; determining second source code for describing the target text from the code editing area according to the target paragraph identifiers; 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 attribute parameter pairs with differences, the attribute parameter pairs including 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; obtaining source code for describing the first attribute parameter from the first source code, replacing 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 updated target source code.
2. The method of claim 1, wherein, The method further comprises the following steps: in response to a modification instruction for target text belonging to the media content in the media preview area, updating and displaying the target text in the media preview area; generating candidate source code of the updated target text, comprising the following steps: in response to a modification instruction for target text belonging to the media content in the media preview area, displaying a function component associated with the target text; in response to a triggering operation on the function component, obtaining target candidate attribute parameters based on the triggering operation; updating and displaying the updated target text in the media preview area according to the target candidate attribute parameters; 3. The method of claim 2, wherein, generating candidate source code of the updated target text according to the target candidate attribute parameters. The method further comprises the following steps: obtaining markup language information about the updated target text; parsing the markup language information of the updated target text to obtain attribute information of the updated target text, the attribute information of the updated target text including multiple attribute parameters of the updated target text and nested relationships between the attribute parameters, and the multiple attribute parameters including target attribute parameters; generating a first attribute description syntax tree of the updated target text according to the attribute information of the updated target text; The first attribute description syntax tree is parsed to obtain the candidate source code of the updated target text.
4. The method of claim 3, wherein, The parent node of the first attribute description syntax tree includes the updated target text, the child node connected with the parent node includes the attribute parameter of the updated target text, and the attribute parameters included in the child nodes having the connection relationship have a nested relationship; The parsing of the first attribute description syntax tree to obtain the candidate source code of the updated target text comprises: According to the node path of the first attribute description syntax tree, the child nodes of the first attribute description syntax tree are traversed to generate the source code of the attribute parameters in the child nodes of the first attribute description syntax tree; Based on the connection relationship between each child node in the first attribute description syntax tree, the source code of the attribute parameters in the child nodes of the first attribute description syntax tree is assembled to obtain the assembled source code of the updated target text; According to the parent node of the first attribute description syntax tree and the assembled source code, the candidate source code of the updated target text is generated.
5. The method of claim 1, wherein, The method further comprises: The candidate source code is parsed to obtain the syntax features of the candidate source code; the syntax features are used to reflect the syntax code having a nested relationship in the candidate source code; The outer syntax code and the inner syntax code are obtained from the syntax code having a nested relationship.
6. The method of claim 5, wherein, The conflict processing of the outer syntax code and the inner syntax code respectively to obtain the first source code after conflict processing comprises: The inner syntax code is converted into markup language information, and the first markup language information obtained by conversion and the outer syntax code are determined as the first source code after conflict processing; or The outer syntax code is converted into markup language information, and the second markup language information obtained by conversion and the inner syntax code are determined as the first source code after conflict processing.
7. The method of claim 5, wherein, The conflict processing of the outer syntax code and the inner syntax code respectively to obtain the first source code after conflict processing comprises: The inner syntax code is retained, and the outer syntax code is deleted to obtain the first source code after conflict processing; or The outer syntax code is retained, and the inner syntax code is deleted to obtain the first source code after conflict processing.
8. The method of claim 5, wherein, The conflict processing of the outer syntax code and the inner syntax code respectively to obtain the first source code after conflict processing comprises: The outer syntax code and the inner syntax code are subjected to separation processing to obtain the first source code after conflict processing.
9. The method of claim 1, wherein, The second source code of the target text is determined from the code editing area according to the target paragraph identifier, comprising: The first paragraph quantity in the code editing area and the second paragraph quantity in the media preview area are obtained; If the first paragraph quantity is the same as the second paragraph quantity, the source code of the paragraph identifier in the code editing area is determined as the second source code of the target text. If the first paragraph number and the second paragraph number are different, the paragraph identification of each source code in the code editing area is corrected, the source code in the code editing area after correction is identified as the target paragraph identification, and the second source code of the target text is determined.
10. The method of claim 9, wherein, The correction processing of the paragraph identification of each source code in the code editing area includes: The source code in the code editing area is parsed to obtain code interpretation information in the code editing area; The paragraph identification of the code interpretation information in the code editing area is removed; After the paragraph identification of the code interpretation information in the code editing area is removed, the paragraph identification of the remaining source code in the code editing area is regenerated to obtain the corrected paragraph identification; the remaining source code is the code in the target source code except the code interpretation information.
11. The method of claim 9, wherein, The correction processing of the paragraph identification of each source code in the code editing area includes: The source code in the code editing area is parsed to obtain the attribute parameter number of each paragraph in the code editing area; The paragraph identification corresponding to the candidate paragraph with an attribute parameter number greater than the attribute parameter number threshold is determined from the code editing area; The paragraph identification of the candidate paragraph is updated according to the attribute parameter number of the candidate paragraph; After updating the paragraph identification of the candidate paragraph, the paragraph identification of the remaining paragraph in the code editing area is corrected to obtain the corrected paragraph identification; the remaining paragraph is the paragraph after the candidate paragraph in the code editing area.
12. The method of claim 1, wherein, The method further includes: In response to a modification instruction for the source code in the code editing area for describing the updated target text, a third source code obtained by modification is acquired; The third source code is converted into markup language information of the updated target text; The markup language information of the updated target text is rendered in the media preview area to obtain a rendering result, and the updated target text is updated according to the rendering result.
13. A data processing apparatus, characterized by: It includes: The display module is used for displaying the target source code edited for the media content in the code editing area, and previewing the media content in the media preview area according to the target source code; The modification module is used for updating and displaying the target text in the media preview area in response to a modification instruction for the target text belonging to the media content in the media preview area, and generating candidate source code of the updated target text; The processing module is used for separating the syntax code with adjacent relationship if the syntax code with adjacent relationship exists in the candidate source code to obtain the first source code after conflict processing; if the syntax feature of the candidate source code indicates that the outer syntax code and the inner syntax code with nested relationship exist in the candidate source code, the outer syntax code and the inner syntax code are processed respectively to obtain the first source code after conflict processing. an updating module configured to count a target paragraph identifier of the updated target text in the media preview area; determine a second source code for describing the target text from the code editing area according to the target paragraph identifier; generate a second attribute description syntax tree according to the first source code and a third attribute description syntax tree according to the second source code; identify an attribute parameter pair with a difference, the attribute parameter pair including 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; obtain source code for describing the first attribute parameter from the first source code, replace source code for describing the second attribute parameter in the second source code with the source code for describing the first attribute parameter, and obtain updated target source code.
14. A computer device, comprising: comprising: a processor and a memory; the processor is connected with the memory; the memory is configured to store program code; the processor is configured to call the program code to execute the method in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program includes program instructions. When the program instructions are executed by the processor, the processor executes the method in any one of claims 1-12.
16. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the steps of the method in any one of claims 1-12.
Citation Information
Patent Citations
A code inspection method and device, a storage medium and a processor
CN107168872A
Data processing method and device, storage medium and electronic equipment
CN113343655A