Data processing method and device, storage medium and electronic equipment

Through difference analysis and code optimization of interface layout information in application development, the problem of control mismatch in multi-language environments is solved, automatic adjustment of control size and layout is realized, and multi-language code development efficiency and interface harmony are improved.

CN118567772APending Publication Date: 2024-08-30CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 9 Cited by

Patent Information

Application Number
CN202410740191.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In multi-language application development, due to differences in character length and page layout requirements in different languages, text and controls do not match, resulting in cumbersome data processing processes and reducing the efficiency of multi-lingual code development.

Method used

Perform difference analysis by obtaining the first interface layout information and the second interface layout information of the target application to determine the target controls with differences, and obtain the target code segment from the source code based on the target control information, combined with the predetermined prompt word template and optimization Model, optimize the target code segment in the source code, and automatically adjust the display size of the control to adapt to different language environments.

Benefits of technology

Automatically adjust the size and layout of interface controls, allowing the controls to adapt to the length of text in different languages, ensuring that the interface maintains visual harmony in various language environments, making it easier for users to operate and reducing the need for multilingual text adaptation. Reduce labor costs and improve development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567772A
    Figure CN118567772A
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, a storage medium and electronic equipment, and the method comprises the steps: obtaining first interface layout information and second interface layout information of a target application, executing a difference analysis operation on the first interface layout information and the second interface layout information, determining a target control with a difference, and sending the target control to a server; target control information corresponding to the target control is determined; obtaining a target code segment from a source code of the target application according to the target control information; determining a target cue word template from a predetermined cue word template set according to the target control information; and inputting the target cue word template and the target code segment into the target optimization model, optimizing the target code segment in the source code to obtain a first code, and replacing the source code with the first code. Through the method and the device, the technical problem of relatively low multilingual code development efficiency caused by a tedious data processing flow is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computers, and more specifically, to a data processing method, device, storage medium, and electronic device. Background Art

[0002] At present, in the process of developing multi-language versions of applications, due to the significant differences in character length and page layout requirements of different languages, when switching between different languages, the problem of text and control mismatch often occurs. In related technologies, it mainly depends on developers to check the display results of each interface one by one during the multi-language adaptation process, and further manually modify the code segments corresponding to the controls. The entire data processing process is too complicated. That is, due to the cumbersome data processing process, the technical problem of low efficiency of multi-language code development occurs.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, storage medium and electronic device to at least solve the technical problem of low efficiency in multi-language code development due to complicated data processing procedures.

[0005] According to one aspect of the present application, a data processing method is provided, including: obtaining first interface layout information and second interface layout information of a target application, performing a difference analysis operation on the first interface layout information and the second interface layout information, determining a target control with a difference, and determining target control information corresponding to the target control, wherein the first interface layout information and the second interface layout information represent interface layout information associated with different languages, the first interface layout information includes first boundary information of the target control, the second interface layout information includes second boundary information of the target control, the first boundary information is different from the second boundary information, and the target control information includes interface layout information corresponding to the parent control of the target control; obtaining a target code segment from the source code of the target application according to the target control information, wherein the target code segment represents a code segment in the source code associated with the parent control, and the source code corresponds to the second interface layout information; determining a target prompt word template from a predetermined prompt word template set according to the target control information; inputting the target prompt word template and the target code segment into a target optimization model, optimizing the target code segment in the source code to obtain a first code, and replacing the source code with the first code, wherein the target optimization model is used to optimize the display size of each element in the target control.

[0006] According to another aspect of the present application, a data processing device is provided, comprising: a first acquisition module, configured to acquire first interface layout information and second interface layout information of a target application, perform a difference analysis operation on the first interface layout information and the second interface layout information, determine a target control with a difference, and determine target control information corresponding to the target control, wherein the first interface layout information and the second interface layout information represent interface layout information associated with different languages, the first interface layout information includes first boundary information of the target control, the second interface layout information includes second boundary information of the target control, the first boundary information is different from the second boundary information, and the target control information includes the target control interface layout information corresponding to the parent control of the target application; a second acquisition module, used to acquire a target code segment from the source code of the target application according to the target control information, wherein the target code segment represents a code segment in the source code associated with the parent control, and the source code corresponds to the second interface layout information; a determination module, used to determine a target prompt word template from a predetermined prompt word template set according to the target control information; an optimization module, used to input the target prompt word template and the target code segment into a target optimization model, optimize the target code segment in the source code to obtain a first code, and replace the source code with the first code, wherein the target optimization model is used to optimize the display size of each element in the target control.

[0007] Optionally, the device is used to obtain the first interface layout information and the second interface layout information of the target application in the following manner: setting a first language for the target application; determining the first interface layout information corresponding to the first language; switching the language of the target application from the first language to a second language; and determining the second interface layout information corresponding to the second language.

[0008] Optionally, the device is used to perform a difference analysis operation on the first interface layout information and the second interface layout information in the following manner to determine a target control with a difference, wherein the target control information corresponding to the target control is determined by: obtaining first coordinate parameters and second coordinate parameters corresponding to each element in the first interface layout information and the second interface layout information; when the first coordinate parameters and the second coordinate parameters corresponding to any element are different, determining the control corresponding to any element as the target control; searching for the parent control from the first interface layout information or the second interface layout information according to the target control, and determining the target control information.

[0009] Optionally, the device is used to obtain a target code segment from the source code of the target application according to the target control information in the following manner: determining a first control identifier of the target control or a second control identifier of the parent control according to the target control information; using the first control identifier or the second control identifier to search for a code segment associated with the parent control and mark it to obtain the target code segment.

[0010] Optionally, the device is used to determine a target prompt word template from a predetermined prompt word template set according to the target control information in the following manner: determine a difference type of the target element according to the coordinate parameters of each element in the target control information, wherein, when the target control information indicates that the target element overlaps with a first element, the target element represents the target control, and the target control is a touchable control, the difference type is overlap between controls; when the target control information indicates that the target element overlaps with a second element, the target element represents an element in the target control, and the target control is a non-touchable control, the difference type is determined to be overlap between elements; determine the target prompt word template according to the difference type, wherein, when the difference type is overlap between controls, the target prompt word template is used to indicate adjustment of the size of the target control, and when the difference type is overlap between elements, the target prompt word template is used to indicate adjustment of the interval between the target element and the second element.

[0011] Optionally, the device is used to input the target prompt word template and the target code segment into a target optimization model in the following manner, optimize the target code segment in the source code, and obtain a first code, including at least one of the following: when the difference type indicates that there is overlap between controls, input the target prompt word template and the target code segment into a target optimization model, call a text translation optimization module to optimize the target code segment to obtain the first code, and use the first code to replace the source code, wherein the length of the display content associated with the target control in the source code is greater than the length of the display content associated with the target control in the first code; when the difference type indicates that there is overlap between controls, input the target prompt word template and the target code segment into a target optimization model, call a text translation optimization module to optimize the target code segment to obtain the first code, and replace the source code with the first code. The code segment is input into a target optimization model, a font size optimization module is called to optimize the target code segment to obtain the first code, and the first code is used to replace the source code, wherein the font size of the display content associated with the target control in the source code is larger than the font size of the display content associated with the target control in the first code; when the difference type indicates overlap between elements, the target prompt word template and the target code segment are input into a target optimization model, a layout optimization module is called to optimize the target code segment to obtain the first code, and the first code is used to replace the source code, wherein the spacing between the target element and the second element in the source code is different from the spacing between the target element and the second element in the first code.

[0012] Optionally, the device is used to replace the source code with the first code in the following manner: obtain the updated target code segment output by the target optimization model; and replace the target code segment in the source code with the updated target code segment to obtain the first code.

[0013] Optionally, the device is also used to: after replacing the source code with the first code, repeat the following steps until the target control does not exist; use the first code to determine the third interface layout information of the target application, perform the difference analysis operation on the first interface layout information and the third interface layout information to determine whether the target control exists; if the target control exists, optimize the target code segment in the first code to obtain a second code, and replace the first code with the second code; if the target control does not exist, update the first code to the target application.

[0014] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0015] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0016] In an embodiment of the present application, by acquiring first interface layout information and second interface layout information of a target application, performing a difference analysis operation on the first interface layout information and the second interface layout information, determining a target control with a difference, and determining target control information corresponding to the target control, wherein the first interface layout information and the second interface layout information represent interface layout information associated with different languages, the first interface layout information includes first boundary information of the target control, the second interface layout information includes second boundary information of the target control, the first boundary information is different from the second boundary information, and the target control information includes interface layout information corresponding to a parent control of the target control; obtaining a target code segment from the source code of the target application according to the target control information, wherein the target code segment represents a code segment in the source code associated with the parent control. The code segment corresponds to the second interface layout information; the target prompt word template is determined from a predetermined prompt word template set according to the target control information; the target prompt word template and the target code segment are input into the target optimization model, the target code segment in the source code is optimized to obtain the first code, and the source code is replaced with the first code, wherein the target optimization model is used to optimize the display size of each element in the target control. The application realizes automatic adjustment of the size and layout of the interface control, so that the control can adapt to the length of texts in different languages, ensures that the interface maintains visual harmony in various language environments, is convenient for users to operate, reduces the labor cost in the multi-language text adaptation process, and further solves the technical problem of low efficiency of multi-language code development due to cumbersome data processing procedures. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a hardware structure block diagram of a mobile terminal according to a data processing method of an embodiment of the present application;

[0018] Figure 2 is a flow chart of a data processing method according to an embodiment of the present application;

[0019] Figure 3 is a flowchart of a data processing method according to an embodiment of the present application;

[0020] Figure 4 is a flowchart of another data processing method according to an embodiment of the present application;

[0021] Figure 5is a flowchart of another data processing method according to an embodiment of the present application;

[0022] Figure 6 is a flowchart of another data processing method according to an embodiment of the present application;

[0023] Figure 7 is a flowchart of another data processing method according to an embodiment of the present application;

[0024] Figure 8 It is a structural block diagram of a data processing device according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0027] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretation:

[0028] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a data processing method according to an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and a terminal device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0029] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the data processing methods in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implementing the above-mentioned methods. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] Optionally, in this embodiment, the above data processing method can also be implemented by a server, or implemented by the terminal device and the server together.

[0032] The above is only an example and is not specifically limited in this embodiment.

[0033] Optionally, as an optional implementation, Figure 2 is a flow chart of a data processing method according to an embodiment of the present application. Figure 2 As shown, the method for processing the above data includes:

[0034] S202, obtaining first interface layout information and second interface layout information of the target application, performing a difference analysis operation on the first interface layout information and the second interface layout information, determining a target control with a difference, and determining target control information corresponding to the target control, wherein the first interface layout information and the second interface layout information represent interface layout information associated with different languages, the first interface layout information includes first boundary information of the target control, the second interface layout information includes second boundary information of the target control, the first boundary information is different from the second boundary information, and the target control information includes interface layout information corresponding to a parent control of the target control;

[0035] Optionally, in an embodiment of the present application, the target applications may include but are not limited to game applications, social media applications, fitness applications, education applications, business applications, music applications, etc. These applications may run on mobile phones, tablet computers or computers to provide users with functions such as interaction with other users, entertainment, learning or business activities; the first interface layout information and the second interface layout information may include but are not limited to control type, control number, text, text size, control border, touch properties, parent control type, parent control number, parent control border and other information.

[0036] Optionally, in an embodiment of the present application, the above-mentioned first interface layout information and the second interface layout information may include several identical controls, and any one of the controls may be determined as a target control. The target control may include but is not limited to an input box, a text box, a button, a menu bar, etc. The target control information corresponding to the above-mentioned target control refers to the interface layout information of the target control and the interface layout information corresponding to the parent control of the target control, etc.

[0037] For example, it is assumed that the target control is a button control, the coordinates of the upper left corner of the button control on the screen are (100, 200), the width is 100, and the height is 50.

[0038] Optionally, in an embodiment of the present application, the above-mentioned first boundary information of the target control is different from the above-mentioned second boundary information. The first boundary information can be understood as information on the position and size of the target control on the screen in the first interface layout information, which may include but is not limited to information such as vertex coordinates, width and height of the control, that is, the preset range of the target control in the first interface layout; the second boundary information can be understood as information on the position and size of the target control on the screen in the second interface layout information, which may include but is not limited to information such as vertex coordinates, width and height of the control, that is, the preset range of the target control in the second interface layout. In other words, due to different language representations corresponding to the same text, the preset range of the target control required to carry the text is different.

[0039] In an exemplary embodiment, Figure 3 This is a flow chart of a data processing method according to an embodiment of the present application. It is assumed that the target application includes two interfaces, namely: the first interface is an English language interface, and the first interface corresponds to the first interface layout information; the second interface is a Chinese language interface, and the second interface corresponds to the second interface layout information. First, the first interface layout information is obtained, including but not limited to information such as the position and size of each control, and the second interface layout information is obtained, including but not limited to information such as the position and size of each control; then, the first interface layout information is compared with the second interface layout information, and the control with different boundary information of the control can be determined from the English language interface and the Chinese language interface as the target control.

[0040] For example, as Figure 3 shown: The target control is a text box, and the text displayed on the English language interface is "hello, world!", and the text displayed on the Chinese language interface is "你好,世界!". Correspondingly, the first boundary information includes that the size required for the text box is 500 pixels long and 200 pixels wide; while the second boundary information includes that the size required for the text box is 1000 pixels long and 200 pixels wide, so as to ensure that the text displayed under different language interfaces can be completely displayed and maintain the consistency of the interface design.

[0041] Furthermore, if the target control has a parent control, for example, the target control is a text box and the parent control is a container, the embodiments of the present application can also be used to determine the boundary information of the parent control, that is, the above first boundary information and the above second boundary information also include the preset ranges required for the parent control on different interfaces.

[0042] S204. Obtain a target code segment from the source code of the target application according to the target control information, where the target code segment represents the code segment in the source code associated with the parent control, and the source code corresponds to the second interface layout information;

[0043] Optionally, in the embodiments of the present application, the above source code can be represented in multiple programming languages, and the present application does not limit this. The above target code segment refers to the code segment corresponding to the parent control of the target control in the code corresponding to the second interface layout information, that is, the target code segment is the code segment in the source code associated with the parent control, which can be used to define the attributes and behaviors of the target control to achieve specific functions or effects. The above source code refers to the source file written by the programmer, which contains the code logic, variable definitions, function definitions, etc. of each control and layout in the second interface layout information.

[0044] Exemplarily, when obtaining the target code segment, the target code segment related to the control can be located from the source code according to the target control information first, and then the code related to the target control can be modified by using the target code segment to meet the requirements or fix problems.

[0045] S206. Determine a target prompt word template from a pre-determined set of prompt word templates according to the target control information;

[0046] Optionally, in the embodiments of the present application, the above set of prompt word templates may include but is not limited to several prompt word templates, and one or more of the several prompt word templates can be determined as the above target prompt word template. The above target prompt word template may include but is not limited to an optimized layout constraint template, an optimized translation template, a reduced font size template, an optimized layout template, etc.

[0047] Exemplarily, the first boundary information and the second boundary information can be obtained through the target control information, and then, by comparing the first boundary information with the second boundary information, it is determined whether the target control overlaps, and the layout constraint template is optimized for matching the overlapping template controls.

[0048] In an exemplary embodiment, the type of the target control can also be determined based on the touch properties in the target control information. When the target control is a button, the touch properties of the target control are matched with optimized translation and font size reduction templates. Furthermore, if the target control can be filled with text, the text character width can be calculated using the optimized layout template to determine whether it is appropriate for the size of the target control, and then, the optimized layout template can be matched for inappropriate target controls.

[0049] S208, inputting the target prompt word template and the target code segment into the target optimization model, optimizing the target code segment in the source code to obtain a first code, and using the first code to replace the source code, wherein the target optimization model is used to optimize the display size of each element in the target control.

[0050] Optionally, in an embodiment of the present application, the above-mentioned target optimization model may include but is not limited to an LLM model (large language model), a neural visual network model, etc., wherein a large language model refers to a language model with a large number of parameters and training data. This model can better capture the complexity and contextual information of the language, thereby improving the performance of natural language processing tasks such as text generation, machine translation, and dialogue systems. Large language models are usually based on deep learning techniques, such as recurrent neural networks (RNNs) or transformers, and are trained using large-scale corpora.

[0051] Optionally, in an embodiment of the present application, the above-mentioned first code refers to the source code after optimization processing by the target optimization model. The first code is used instead of the source code to ensure that the interface display corresponding to the first interface layout information and the second interface layout information is the same, automatically analyze and adjust the size of the target control, and optimize the overall layout of the interface.

[0052] Exemplarily, a target prompt word template and a target code segment are input into the target optimization model, and the target optimization model is used to automatically analyze the display size of the target control in the target code segment and optimize it to make it more in line with design requirements or user needs. During the optimization process, the target optimization model will adjust the target control in the target code segment according to the guidance information in the target prompt word template, including but not limited to adjusting the size, spacing, position, etc. of the target control.

[0053] In an exemplary embodiment, the model optimizes the target code segment using the target prompt word template to obtain an optimized target code segment, and then replaces the code segment of the parent control corresponding to the target code segment in the source code. After processing the parent layout code segment of the target control that needs to be optimized, the above-mentioned first code is obtained.

[0054] In an exemplary embodiment, Figure 4 is a flow chart of another data processing method according to an embodiment of the present application, such as Figure 4 As shown, including but not limited to:

[0055] S402, obtaining first interface layout information, including display boundaries of all controls;

[0056] S404, obtaining second interface layout information, including display boundaries of all controls;

[0057] S406, comparing the difference in control view information between the first interface layout information and the second interface layout information, acquiring view information with layout difference as target control information, and using the corresponding control as the target control;

[0058] S408, determining a target code segment from the source code according to the difference target control information;

[0059] S410: Match a suitable target prompt word template from a prompt word template set according to the target code segment.

[0060] Furthermore, after determining the target prompt word template, the target prompt word template and the target code segment can be input into the target optimization model, and then the target optimization model is used to optimize the target code segment to obtain a first code, and the first code is used to replace the source code. Figure 5 is a flow chart of another data processing method according to an embodiment of the present application, such as Figure 5 As shown, including but not limited to:

[0061] S502, obtaining a target code segment;

[0062] S504, obtaining a target prompt word template generated by a pre-processing module, where the pre-processing module is used to implement the above steps S402 to S410;

[0063] S506, inputting the target code segment and the target prompt word template into the target optimization model;

[0064] S508, the target optimization model performs text adaptation task planning according to the target code segment and the target prompt word template, that is, matches the task to be executed according to the input target code segment and the target prompt word template;

[0065] S510-1, the target prompt word template is a simplified translation text template, and the task to be executed is a simplified translation text task;

[0066] S510-1, the target prompt word template is an optimized layout template, and the task to be executed is an optimized layout task;

[0067] S510-1, the target prompt word template is a text font size adjustment template, and the task to be executed is a font size adjustment task;

[0068] S512, the target optimization model automatically executes the task and generates an optimized target code segment;

[0069] S514, using a post-processing module to replace the target code segment to obtain a first code;

[0070] S516, using the first code instead of the source code to check the interface layout, and judging whether the check passes. If so, executing S518, if not, executing S504;

[0071] S518, end.

[0072] Through the embodiment of the present application, the first interface layout information and the second interface layout information of the target application are obtained, and a difference analysis operation is performed on the first interface layout information and the second interface layout information to determine the target control with a difference, and determine the target control information corresponding to the target control, wherein the first interface layout information and the second interface layout information represent interface layout information associated with different languages, the first interface layout information includes first boundary information of the target control, the second interface layout information includes second boundary information of the target control, the first boundary information is different from the second boundary information, and the target control information includes interface layout information corresponding to the parent control of the target control; a target code segment is obtained from the source code of the target application according to the target control information, wherein the target code segment represents the code associated with the parent control in the source code. The code segment corresponds to the second interface layout information; the target prompt word template is determined from a predetermined prompt word template set according to the target control information; the target prompt word template and the target code segment are input into the target optimization model, the target code segment in the source code is optimized to obtain the first code, and the source code is replaced with the first code, wherein the target optimization model is used to optimize the display size of each element in the target control. The application realizes automatic adjustment of the size and layout of the interface control, so that the control can adapt to the length of texts in different languages, ensures that the interface maintains visual harmony in various language environments, is convenient for users to operate, reduces the labor cost in the multi-language text adaptation process, and further solves the technical problem of low efficiency of multi-language code development due to cumbersome data processing procedures.

[0073] As an optional solution, the above-mentioned obtaining of the first interface layout information and the second interface layout information of the target application includes: setting a first language for the above-mentioned target application; determining the above-mentioned first interface layout information corresponding to the above-mentioned first language; switching the language of the above-mentioned target application from the above-mentioned first language to the second language; and determining the above-mentioned second interface layout information corresponding to the above-mentioned second language.

[0074] Optionally, in an embodiment of the present application, the first language and the second language are different, the text in the first interface layout information is displayed in the first language, and the text in the second interface layout information is displayed in the second language. The language switching of the target application may be achieved by means including but not limited to touch screen, voice, gesture, etc. After the language of the target application is switched from the first language to the second language, the corresponding interface information is also switched from the first interface layout information to the second interface layout information.

[0075] Exemplarily, the first language is Chinese and the second language is English. Correspondingly, when the language of the target application is Chinese, the corresponding interface information is the first interface layout information; when the language of the target application is English, the corresponding interface information is the second interface layout information.

[0076] In an exemplary embodiment, the first language is English, and the first interface layout information includes: the top navigation bar of the interface includes main function buttons, the page content is displayed in a concise and clear manner, the buttons and texts use easy-to-understand English vocabulary, and by clicking the language switch button on the interface, the language of the application is switched to Chinese. The second language is Chinese, and the second interface layout information includes: the top navigation bar of the interface remains unchanged, the buttons and texts are changed to Chinese, and the layout is adjusted to adapt to Chinese language habits, such as reading from left to right.

[0077] Through the embodiment of the present application, a first language is set for the target application, first interface layout information corresponding to the first language is determined, the language of the target application is switched from the first language to the second language, and second interface layout information corresponding to the second language is determined, thereby ensuring that interfaces using different languages ​​can still maintain an overall style and conform to the usage habits of users using different languages.

[0078] As an optional scheme, the above-mentioned difference analysis operation is performed on the above-mentioned first interface layout information and the above-mentioned second interface layout information to determine the target control with differences, and the above-mentioned determination of the target control information corresponding to the above-mentioned target control includes: obtaining the first coordinate parameter and the second coordinate parameter corresponding to each element in the above-mentioned first interface layout information and the above-mentioned second interface layout information; when the above-mentioned first coordinate parameter and the above-mentioned second coordinate parameter corresponding to any element are different, determining the control corresponding to any one of the above elements as the above-mentioned target control; searching the above-mentioned parent control from the above-mentioned first interface layout information or the above-mentioned second interface layout information according to the above-mentioned target control, and determining the above-mentioned target control information.

[0079] Optionally, in an embodiment of the present application, the first coordinate parameter and the second coordinate parameter correspond to the same element, and the coordinate information of the element in the interface corresponding to the first interface layout information is represented as the first coordinate parameter, and the coordinate information of the element in the interface corresponding to the second interface layout information is represented as the second coordinate parameter.

[0080] Furthermore, if the first coordinate parameter and the second coordinate parameter of an element are different, it means that the position of the element in the interface corresponding to the above-mentioned first interface layout information is different from the position of the element in the interface corresponding to the above-mentioned second interface layout information, that is, the boundary information of the element has changed, and thus, the element can be determined as the above-mentioned target control.

[0081] In an exemplary embodiment, the target application interface includes a button A and an input box B. In the above-mentioned first interface layout information, the coordinate information of button A is "[200, 400]", and in the above-mentioned second interface layout information, the coordinate information of input box B is "[600, 500]"; in the above-mentioned first interface layout information, the coordinate information of input box B is "[600, 400]", and in the above-mentioned second interface layout information, the coordinate information of input box B is "[600, 400]", that is, the first coordinate parameter and the second coordinate parameter of button A are different, and the first coordinate parameter and the second coordinate parameter of input box B are the same. Therefore, the target control includes button A but does not include input box B.

[0082] Exemplarily, after determining the target control, you can continue to search for its parent control in the first or second interface layout information according to the target control to obtain the target control information, which may include but is not limited to the target control's ID, position, size, text content and other properties.

[0083] Through the embodiments of the present application, the first coordinate parameters and the second coordinate parameters corresponding to each element in the first interface layout information and the second interface layout information are obtained; when the first coordinate parameters and the second coordinate parameters corresponding to any element are different, the control corresponding to any element is determined as the target control; according to the target control, the parent control is searched from the first interface layout information or the second interface layout information, and the target control information is determined, so as to achieve the purpose of quickly and conveniently determining the target control in the two interface layout information, and then, more accurately perform layout adjustment or interface adaptation work.

[0084] As an optional scheme, the above-mentioned method of obtaining the target code segment from the source code of the above-mentioned target application according to the above-mentioned target control information includes: determining the first control identifier of the above-mentioned target control or the second control identifier of the above-mentioned parent control according to the above-mentioned target control information; using the above-mentioned first control identifier or the above-mentioned second control identifier to search for the code segment associated with the above-mentioned parent control and mark it to obtain the above-mentioned target code segment.

[0085] Optionally, in the embodiment of the present application, the first control identifier and the second control identifier may be represented by, but not limited to, text, symbols, character strings, etc.

[0086] In an exemplary embodiment, the target control is a button, and the button is placed in a container. Further, the target control is a button, and the parent control is a container. According to the target control information, the first control identifier of the target control is determined to be "btn Submit", and the second control identifier of the parent control is determined to be "parent Container". The first control identifier "btn Submit" is used to search for a code segment associated with the parent control "parent Container", including but not limited to event processing functions or related codes of button click events, for example, the operation or processing logic of the "btn Submit" control. Further, the target code segment is obtained by searching for and marking the code segment associated with the parent control.

[0087] In another exemplary embodiment, the code segment associated with the parent control "parent Container" may also be directly searched according to the second control identifier "parentContainer" of the parent control, including but not limited to the relevant codes of the event processing function or button click event.

[0088] As an optional scheme, the above-mentioned determining the target prompt word template from a predetermined prompt word template set according to the above-mentioned target control information includes: determining the difference type of the target element according to the coordinate parameters of each element in the above-mentioned target control information, wherein, when the above-mentioned target control information indicates that the above-mentioned target element overlaps with the first element, the above-mentioned target element represents the above-mentioned target control, and the above-mentioned target control is a touch-sensitive control, the above-mentioned difference type is overlap between controls; when the above-mentioned target control information indicates that the above-mentioned target element overlaps with the second element, the above-mentioned target element represents an element in the above-mentioned target control, and the above-mentioned target control is a non-touch-sensitive control, the above-mentioned difference type is overlap between elements; determining the above-mentioned target prompt word template according to the above-mentioned difference type, wherein, when the above-mentioned difference type is overlap between controls, the above-mentioned target prompt word template is used to indicate adjustment of the size of the above-mentioned target control, and when the above-mentioned difference type is overlap between elements, the above-mentioned target prompt word template is used to indicate adjustment of the interval between the above-mentioned target element and the above-mentioned second element.

[0089] Optionally, in an embodiment of the present application, the target element is located at a different position from the first element and the second element, and there may be overlap between them, that is, the target element may intersect or overlap with the first element and the second element.

[0090] In an exemplary embodiment, the target element may represent the above-mentioned target control, and the first element may represent another control different from the target control, and the two may include but are not limited to having the same or different parent controls. At this time, if the target control is a touch-sensitive control, that is, the user can interact with the target control through touch operations including but not limited to touch operations implemented on a touch screen, or touch operations performed by input devices such as a mouse, keyboard, and stylus, then the above-mentioned difference type is determined to be an overlap between controls, indicating that the coordinate parameters of the target control and the control represented by the first element can be obtained through the above-mentioned target control information, and after comparing the coordinate parameters, it is determined that the target control on the interface may overlap or overlap with the control represented by the first element.

[0091] For example, Figure 6 is a flow chart of another data processing method according to an embodiment of the present application, such as Figure 6 As shown, the target control is button A, the target element represents button A, and clicking button A can jump from the current interface to interface A; the first control is button B, the first element represents button B, and clicking button B can jump from the current interface to interface B. There is overlap between button A and button B, and the difference type is determined to be overlap between controls.

[0092] In another exemplary embodiment, the target element can also represent an element in the above-mentioned target control, and the above-mentioned target control is a non-touchable control, that is, the user cannot interact with the target control through touch operations. At this time, if it is determined through the target control information that the above-mentioned target element overlaps with the second element, the difference type can be determined as an overlap between elements, wherein the second element may include but is not limited to an element within the target control, or an element outside the target control.

[0093] For example, Figure 7 is a flow chart of another data processing method according to an embodiment of the present application, such as Figure 7 As shown, the target control is input box A, and the target element represents the text content of input box A, which is "Hello..."; the first control is input box B, and the second element represents the text content of input box B, which is "Please enter". The text content of input box A overlaps with the text content of input box B, causing the text content of input box B to be incorrectly displayed as "Enter", indicating that the coordinate parameters of the target element and the second element can be obtained through the above target control information, and after comparing the coordinate parameters, the difference type is determined as overlap between elements.

[0094] Furthermore, the target prompt word template can be determined according to the difference type. If the difference type is overlap between controls, the target prompt word template is determined as a template that can indicate adjustment of the size of the target control. Conversely, if the difference type is overlap between elements, the target prompt word template is determined as a template that can indicate adjustment of the interval between the target element and the second element.

[0095] Through the embodiments of the present application, the difference type of the target element is determined according to the coordinate parameters of each element in the target control information. When the difference type is overlap between controls, the target prompt word template is used to indicate the adjustment of the size of the target control. When the difference type is overlap between elements, the target prompt word template is used to indicate the adjustment of the interval between the target element and the second element, so as to determine a more accurate target prompt word template, which is convenient for the subsequent adjustment of the target code corresponding to the target control based on the target prompt word template.

[0096] As an optional solution, the target prompt word template and the target code segment are input into a target optimization model, and the target code segment in the source code is optimized to obtain a first code, including at least one of the following:

[0097] In the case where the above difference type indicates overlap between controls, the above target prompt word template and the above target code segment are input into the target optimization model, the text translation optimization module is called to optimize the above target code segment to obtain the above first code, and the above first code is used to replace the above source code, wherein the length of the display content associated with the above target control in the above source code is greater than the length of the display content associated with the above target control in the above first code; in the case where the above difference type indicates overlap between controls, the above target prompt word template and the above target code segment are input into the target optimization model, the font size optimization module is called to optimize the above target code segment to obtain the above first code, and the above first code is used to replace the above source code, wherein the font size of the display content associated with the above target control in the above source code is greater than the font size of the display content associated with the above target control in the above first code; in the case where the above difference type indicates overlap between elements, the above target prompt word template and the above target code segment are input into the target optimization model, the layout optimization module is called to optimize the above target code segment to obtain the above first code, and the above first code is used to replace the above source code, wherein the spacing between the above target element and the above second element in the above source code is different from the spacing between the above target element and the above second element in the above first code.

[0098] In an exemplary embodiment, first, the target prompt word template and the target code segment are input into the target optimization model, the text translation optimization module is called to optimize the target code segment, and the optimized target code segment is used to replace the relevant part of the target code segment in the source code to obtain a first code. Then, the first code is used to implement the interface display of the above-mentioned target application, so that the length of the display content associated with the target control becomes shorter, ensuring that the display content of the target control can be fully displayed, that is, the text display content on the target control in the interface implemented using the unoptimized source code will exceed the preset range of the target control. Through the embodiment of the present application, automatic optimization and replacement of the code is achieved to ensure that the text display content does not exceed the preset range of the target control.

[0099] For example, it may include but is not limited to using an external large model service that supports multiple languages, specifically executing the call to the translation service and post-processing of the translation results, and returning the simplified translation result corresponding to the input text as the result of the text translation optimization module.

[0100] In another exemplary embodiment, first, the target prompt word template and the target code segment are input into the target optimization model, the font size optimization module is called to optimize the target code segment, and the optimized target code segment is used to replace the relevant part of the source code where the target code segment is located to obtain the first code, and then, the first code is used to implement the interface display of the above-mentioned target application, reduce the font size of the display content associated with the target control, and ensure that when the controls overlap, the font size of the display content can better adapt to the page layout.

[0101] For example, the font size optimization module is called to run the code related to character size calculation to obtain the appropriate font size that can be displayed for the text under fixed size conditions. The text width calculation can be expressed as:

[0102]

[0103] Where n represents the number of characters contained in the display content associated with the target control, fA represents the font size, and W fA Indicates the text width of the displayed content when the font size is fA, glyph_W i,fA Indicates the glyph width corresponding to the i-th character in the displayed content when the font size is fA in the Freetype font object. Each glyph width is divided by 64 to convert the FreeType unit into pixels. fB indicates the target font size, W fB Indicates the text width when the font size is fB, that is, the maximum width that the target control can display.

[0104] In another exemplary embodiment, first, the target prompt word template and the target code segment are input into the target optimization model, the layout optimization module is called to optimize the target code segment, and the optimized target code segment is used to replace the relevant part of the source code where the target code segment is located to obtain the first code. Then, the first code is used to implement the interface display of the above-mentioned target application, and the spacing between the target element and the above-mentioned second element is flexibly adjusted to quickly solve the problem of different spacing between elements, so that the interface layout is more reasonable and beautiful.

[0105] For example, the font size optimization module is called to optimize the layout code of the target control, and the relevant layout adjustment rules are obtained by querying the layout knowledge base. Combined with the input view information, the target code segment after layout optimization is generated. The layout knowledge base may include layout optimization methods for different controls, interface style related information (such as control spacing), etc.

[0106] As an optional solution, the above-mentioned use of the above-mentioned first code to replace the above-mentioned source code includes: obtaining the above-mentioned updated target code segment output by the above-mentioned target optimization model; using the above-mentioned updated target code segment to replace the above-mentioned target code segment in the above-mentioned source code to obtain the above-mentioned first code.

[0107] Exemplarily, the target optimization model outputs an optimization result, which includes the updated target code segment mentioned above. The location of the corresponding target code segment can be first found from the source code, and the updated target code segment is used to replace the non-updated target code segment. Then, the source code after the target code segment is replaced is determined as the above-mentioned first code segment.

[0108] As an optional solution, after replacing the above-mentioned source code with the above-mentioned first code, the above-mentioned method also includes: repeating the following steps until the above-mentioned target control does not exist; using the above-mentioned first code to determine the third interface layout information of the above-mentioned target application, performing the above-mentioned difference analysis operation on the above-mentioned first interface layout information and the above-mentioned third interface layout information to determine whether the above-mentioned target control exists; if the above-mentioned target control exists, optimizing the above-mentioned target code segment in the above-mentioned first code to obtain the second code, and using the above-mentioned second code to replace the above-mentioned first code; if the above-mentioned target control does not exist, updating the above-mentioned first code to the above-mentioned target application.

[0109] It should be noted that the above-mentioned target code segment may include but is not limited to several code segments. Then, these several code segments are optimized through the above-mentioned target code segment, so that they are replaced respectively with the optimized code segments. When these several code segments are replaced, the above-mentioned first code segment is obtained.

[0110] Optionally, in an embodiment of the present application, the third interface layout information represents interface layout information implemented using the first code, which is different from the first interface layout information and the second interface layout information.

[0111] If, through the above difference analysis operation, the above third interface layout information still has the problem of overlapping controls and overlapping elements, then continue to optimize the target code segment corresponding to the target control, generate the second code, and iterate the operation until the above target control does not exist, that is, the third interface layout information can fully display each control without the above control overlapping and element overlapping problems. At this time, update the above first code to the above target application. The first code is used to construct the interface of the target application to ensure that the interface can maintain visual harmony and user convenience in various language environments.

[0112] The above is only an example, and this application does not make any specific limitation.

[0113] Obviously, the embodiments described above are only part of the embodiments of the present application, rather than all the embodiments.

[0114] The present application is described in detail below with reference to specific embodiments:

[0115] Exemplarily, the embodiments of the present application solve the problems of mismatch between interface text and controls and mutual influence between adjacent controls due to text length when the application interface is adapted in multiple languages. Through the embodiments of the present application, it is possible to automatically adjust the size and layout of interface controls based on a large model, and automatically adapt to the length of texts in different languages, ensuring that the interface maintains visual harmony and user convenience in various language environments, reducing the labor cost in the process of multilingual text adaptation, and improving the efficiency of multilingual adaptation development.

[0116] Through the embodiments of the present application, an intelligent layout optimization engine is introduced to automatically analyze the text length and adjust the control size, and automatically rearrange the adjacent controls, so that perfect adaptation can be achieved without human intervention, which greatly improves the automation and intelligence of development and reduces the risk of errors and omissions; on the other hand, by automating the interface adjustment process, the need for adjusting the interface one by one during the multilingual application text adaptation process is reduced, thereby significantly reducing the complexity and cost of multilingual adaptation work, and multilingual versions can be launched more quickly and conveniently.

[0117] Specifically, the embodiment of the present application proposes a method for automatically adjusting the size and layout of controls in an application interface when processing multi-language adaptation, in order to deal with the interface layout problems caused by text length differences, including a pre-processing module, a large model reasoning module, and a post-processing module, specifically layout code disassembly, prompt word generation, large model reasoning based on text adaptation templates, code replacement, and layout verification. Based on the layout information in the text content and code, the code understanding and generation capabilities of the large model are used to achieve automatic adjustment of the control size and layout, including but not limited to:

[0118] S1, pre-processing module, the layout implementation steps in the pre-processing module include: obtaining the original layout view information (the above-mentioned first interface layout information), obtaining the target language layout view information (the above-mentioned second interface layout information), view information difference analysis, view information matching with XML code segments, and generating matching XML prompt words. The specific implementation method is as follows:

[0119] S1-1, obtaining the layout view information of the original and target languages, inserting the code for obtaining the view information into the xml code (the above source code), selecting the default language on the running device, opening the relevant application to obtain the original layout view information, switching the system language (the above first language) to the target language (the above second language), and obtaining the layout view information of the application corresponding to the target language, including but not limited to control type, ID, text, text size, control boundary, touch properties, parent control type, parent control ID, parent control boundary and other information.

[0120] S1-2, view information difference analysis, through the view information difference analysis code, traversing the control view information, it is possible to obtain the related controls whose interface control boundaries have changed after switching the language and the corresponding parent controls.

[0121] S1-3, the view information is matched with the XML code segment, and the control number with differences is displayed. The parent control code of the element to which it belongs can be queried in the original XML code. The relevant parent control code segment showing the changes is extracted from the original XML.

[0122] S1-4, generate prompt words matching xml, analyze the view information of all elements in the above parent control. Based on the boundary information, it can be known whether the elements overlap, and the overlapping controls are matched with optimized layout constraint templates. Based on the touch properties, it can be known whether the element belongs to a button, and the touchable properties are matched with optimized translation and font size reduction templates. Calculate the text character width, determine whether it is suitable for the control size, and match the optimized layout template for inappropriate controls.

[0123] S2, large model reasoning module, the model reasoning module includes Prompt (prompt word), text task planning, text adaptation specific task execution, and large model answer result generation. The text adaptation task planning method is to match the specific execution task according to the input description information. Among them, the text adaptation specific task is a text adaptation method that needs to be defined in advance, and the definition content includes name, description information, and specific execution method.

[0124] It is understandable that the embodiments of the present application can also perform text adaptation functions such as simplifying text translation, optimizing layout, and reducing font size by calling external tools during the large model reasoning process. The large model combines user input and the results of the Agent tool operation to generate the final answer. Based on the LlamaIndex framework, an Agent that can be operated by code is built to implement the function of a coding assistant. Among them, LlamaIndex is a framework for managing and optimizing data indexes, which can help users query and access data in the database more efficiently. The specific implementation methods of simplifying text translation, optimizing layout, and reducing font size in the Agent tool are as follows:

[0125] S2-1, simplified text translation. The translation agent is responsible for simplifying the text translation task. It can be an external large model service that supports multiple languages. It specifically executes the call to the translation service and post-processes the translation results, and returns the simplified translation result corresponding to the input text.

[0126] S2-2, optimize the layout, call the layout optimization agent, and optimize the layout code of the overlapping controls. By querying the layout knowledge base to obtain the relevant layout adjustment rules, combined with the input view information, generate the layout optimized xml code, where the layout knowledge base covers the layout optimization methods of different controls, as well as interface style related information (such as control spacing), etc.

[0127] S2-3, reduce the font size. When the text display finds a fixed size control, call the font size reduction agent to run the character size calculation related code to obtain the appropriate font size that can be displayed for the text under the fixed size condition.

[0128] S3, post-processing module, the post-processing part of text adaptation includes model output processing to code replacement. Extract the optimized parent control xml code segment from the model result, filter out the comments and other instructions in the output result, find the corresponding parent layout node from the original xml, and replace the original node code with the code segment optimized by the large model. After processing all the parent layout code segments that need to be optimized in sequence, save the results and replace the original xml file.

[0129] S4, layout verification, after replacing the interface layout code, obtain the layout view information of the target language again, traverse the controls to determine whether the text character width matches the control size, and determine whether there is overlap through the control view boundary information. Perform secondary optimization on the layout code where the text and controls do not match or where the controls overlap.

[0130] Through the embodiments of the present application, the text adaptation problem of the application interface in different language environments is quickly solved, and the control size and layout in the application interface are automatically adjusted through the large model, including but not limited to: automatically testing the page text adaptation results, specifically, obtaining the layout view information through an automatic script, and then automatically implementing the interface view difference analysis, and associating the difference view with the corresponding XML code, so as to quickly locate the code in the interface where the text display does not meet the requirements; automatically matching the prompt word template according to XML, specifically, automatically selecting the target prompt word template based on the XML code, analyzing the view information of all elements in the selected parent control code segment, and knowing whether the elements overlap according to the boundary information, and matching the overlapping controls with the optimized layout constraint template; knowing whether the element belongs to a button according to the touch attribute, and matching the touchable attribute with the optimized translation and font size reduction template; calculating the text character width, judging whether it is appropriate with the control size, and matching the inappropriate control with the optimized layout template.

[0131] Exemplarily, the embodiment of the present application realizes the layout perception capability by combining the large model with the view information. Compared with the direct input of the layout code in the related art, the model cannot know the interface display problem, cannot judge whether the text matches the control, and cannot judge whether there is overlap between the controls, so it cannot make corresponding modifications to the input layout code. The embodiment of the present application can match the layout code with the view information, and use the mathematical and logical capabilities of the large model to perceive the control position according to the control boundary, thereby realizing the perception capability of the interface layout; when using the large model for layout optimization, first query the customized related adjustment rules from the knowledge base. Allow the user to adjust the spacing of each control of the interface according to personal preferences. Not only improve the usability of the application, but also improve the adaptability of the target optimization model to different styles of interfaces; realize text adaptation through Agent, allow developers to customize the logic of text processing and layout adjustment, so that the present application is not limited to automatic processing, but can also be fine-tuned according to the needs of specific applications. This provides developers with greater flexibility and control, helps to develop more complex and feature-rich applications, solves the problems and limitations of the prior art in multi-language interface design, and provides an efficient, flexible and user-friendly solution.

[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can essentially or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, disk, or optical disk), and includes a number of instructions for enabling a front-end device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application. The information collected in the above embodiments is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse. The above embodiments are based on big data analysis of personal information, and / or use artificial intelligence technology to make automated decisions to make decisions that have a significant impact on personal rights and interests. The technical solution will provide users with corresponding operation entrances for users to choose to agree or refuse the automated decision-making results; if the user chooses to refuse, the expert decision-making process will be entered.

[0133] According to another aspect of the embodiments of the present application, a system access device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0134] Figure 8 is a structural block diagram of a data processing device according to an embodiment of the present application, such as Figure 8 As shown, the device comprises:

[0135] A first acquisition module 802 is used to acquire first interface layout information and second interface layout information of a target application, perform a difference analysis operation on the first interface layout information and the second interface layout information, determine a target control with a difference, and determine target control information corresponding to the target control, wherein the first interface layout information and the second interface layout information represent interface layout information associated with different languages, the first interface layout information includes first boundary information of the target control, the second interface layout information includes second boundary information of the target control, the first boundary information is different from the second boundary information, and the target control information includes interface layout information corresponding to a parent control of the target control;

[0136] A second acquisition module 804 is used to acquire a target code segment from the source code of the target application according to the target control information, wherein the target code segment represents a code segment associated with the parent control in the source code, and the source code corresponds to the second interface layout information;

[0137] A determination module 806, configured to determine a target prompt word template from a predetermined prompt word template set according to target control information;

[0138] The optimization module 808 is used to input the target prompt word template and the target code segment into the target optimization model, optimize the target code segment in the source code to obtain the first code, and use the first code to replace the source code, wherein the target optimization model is used to optimize the display size of each element in the target control.

[0139] As an optional solution, the device is used to obtain the first interface layout information and the second interface layout information of the target application in the following manner: setting the first language for the target application; determining the first interface layout information corresponding to the first language; switching the language of the target application from the first language to the second language; and determining the second interface layout information corresponding to the second language.

[0140] As an optional solution, the device is used to perform a difference analysis operation on the first interface layout information and the second interface layout information to determine the target control with differences and determine the target control information corresponding to the target control: obtain the first coordinate parameters and the second coordinate parameters corresponding to each element in the first interface layout information and the second interface layout information; when the first coordinate parameters and the second coordinate parameters corresponding to any element are different, determine the control corresponding to any element as the target control; search for the parent control from the first interface layout information or the second interface layout information according to the target control, and determine the target control information.

[0141] As an optional solution, the device is used to obtain the target code segment from the source code of the target application according to the target control information in the following manner: determine the first control identifier of the target control or the second control identifier of the parent control according to the target control information; use the first control identifier or the second control identifier to find the code segment associated with the parent control and mark it to obtain the target code segment.

[0142] As an optional scheme, the device is used to determine a target prompt word template from a predetermined prompt word template set according to the target control information in the following manner: determine the difference type of the target element according to the coordinate parameters of each element in the target control information, wherein, when the target control information indicates that the target element overlaps with the first element, the target element represents the target control, and the target control is a touchable control, the difference type is overlap between controls; when the target control information indicates that the target element overlaps with the second element, the target element represents an element in the target control, and the target control is a non-touchable control, the difference type is overlap between elements; determine the target prompt word template according to the difference type, wherein, when the difference type is overlap between controls, the target prompt word template is used to indicate adjustment of the size of the target control, and when the difference type is overlap between elements, the target prompt word template is used to indicate adjustment of the interval between the target element and the second element.

[0143] As an optional solution, the device is used to input the target prompt word template and the target code segment into the target optimization model in the following manner, optimize the target code segment in the source code, and obtain the first code, including at least one of the following: when the difference type indicates that the controls overlap, input the target prompt word template and the target code segment into the target optimization model, call the text translation optimization module to optimize the target code segment to obtain the first code, and use the first code to replace the source code, wherein the length of the display content associated with the target control in the source code is greater than the length of the display content associated with the target control in the first code; when the difference type indicates that the controls overlap, input the target prompt word template and the target code segment into the target optimization model, call the text translation optimization module to optimize the target code segment to obtain the first code, and replace the source code with the first code. The target optimization model is input into the target optimization model, the font size optimization module is called to optimize the target code segment to obtain the first code, and the source code is replaced by the first code, wherein the font size of the display content associated with the target control in the source code is larger than the font size of the display content associated with the target control in the first code; when the difference type indicates overlap between elements, the target prompt word template and the target code segment are input into the target optimization model, the layout optimization module is called to optimize the target code segment to obtain the first code, and the source code is replaced by the first code, wherein the spacing between the target element and the second element in the source code is different from the spacing between the target element and the second element in the first code.

[0144] As an optional solution, the device is used to replace the source code with the first code in the following manner: obtain an updated target code segment output by the target optimization model; and replace the target code segment in the source code with the updated target code segment to obtain the first code.

[0145] As an optional solution, the device is also used to: after replacing the source code with the first code, repeat the following steps until the target control does not exist; use the first code to determine the third interface layout information of the target application, perform a difference analysis operation on the first interface layout information and the third interface layout information, and determine whether there is a target control; if the target control exists, optimize the target code segment in the first code to obtain the second code, and replace the first code with the second code; if the target control does not exist, update the first code to the target application.

[0146] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0147] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0148] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0149] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0150] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0151] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0152] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0153] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0154] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data processing method, characterized in that: include: Acquire first interface layout information and second interface layout information of a target application, perform a difference analysis operation on the first interface layout information and the second interface layout information, determine a target control with a difference, and determine target control information corresponding to the target control, wherein the first interface layout information and the second interface layout information represent interface layout information associated with different languages, the first interface layout information includes first boundary information of the target control, the second interface layout information includes second boundary information of the target control, the first boundary information is different from the second boundary information, and the target control information includes interface layout information corresponding to a parent control of the target control; Acquire a target code segment from the source code of the target application according to the target control information, wherein the target code segment represents a code segment in the source code associated with the parent control, and the source code corresponds to the second interface layout information; Determining a target prompt word template from a predetermined prompt word template set according to the target control information; The target prompt word template and the target code segment are input into a target optimization model, the target code segment in the source code is optimized to obtain a first code, and the source code is replaced with the first code, wherein the target optimization model is used to optimize the display size of each element in the target control.

2. The method according to claim 1, characterized in that: The step of obtaining the first interface layout information and the second interface layout information of the target application includes: Setting a first language for the target application; Determining the first interface layout information corresponding to the first language; Switching the language of the target application from the first language to a second language; Determine the second interface layout information corresponding to the second language.

3. The method according to claim 1, characterized in that The performing a difference analysis operation on the first interface layout information and the second interface layout information to determine a target control with a difference, and the determining target control information corresponding to the target control, includes: Obtaining first coordinate parameters and second coordinate parameters corresponding to each element in the first interface layout information and the second interface layout information; In the case that the first coordinate parameter and the second coordinate parameter corresponding to any element are different, determining the control corresponding to the any element as the target control; The parent control is searched for from the first interface layout information or the second interface layout information according to the target control, and the target control information is determined.

4. The method according to claim 1, characterized in that The acquiring the target code segment from the source code of the target application according to the target control information includes: Determine a first control identifier of the target control or a second control identifier of the parent control according to the target control information; The code segment associated with the parent control is searched and marked using the first control identifier or the second control identifier to obtain the target code segment.

5. The method according to claim 1, characterized in that The step of determining a target prompt word template from a predetermined prompt word template set according to the target control information includes: Determining the difference type of the target element according to the coordinate parameters of each element in the target control information, wherein, when the target control information indicates that the target element overlaps with a first element, the target element represents the target control, and the target control is a touchable control, the difference type is an overlap between controls; and when the target control information indicates that the target element overlaps with a second element, the target element represents an element in the target control, and the target control is a non-touchable control, determining that the difference type is an overlap between elements; The target prompt word template is determined according to the difference type, wherein when the difference type is overlap between controls, the target prompt word template is used to indicate adjustment of the size of the target control, and when the difference type is overlap between elements, the target prompt word template is used to indicate adjustment of the interval between the target element and the second element.

6. The method according to claim 5, characterized in that The step of inputting the target prompt word template and the target code segment into a target optimization model, optimizing the target code segment in the source code, and obtaining a first code includes at least one of the following: In the case where the difference type indicates an overlap between controls, inputting the target prompt word template and the target code segment into a target optimization model, calling a text translation optimization module to optimize the target code segment to obtain the first code, and replacing the source code with the first code, wherein the length of the display content associated with the target control in the source code is greater than the length of the display content associated with the target control in the first code; In the case where the difference type indicates that there is an overlap between controls, the target prompt word template and the target code segment are input into a target optimization model, a font size optimization module is called to optimize the target code segment to obtain the first code, and the first code is used to replace the source code, wherein the font size of the display content associated with the target control in the source code is larger than the font size of the display content associated with the target control in the first code; When the difference type indicates overlap between elements, the target prompt word template and the target code segment are input into a target optimization model, a layout optimization module is called to optimize the target code segment to obtain the first code, and the source code is replaced with the first code, wherein the spacing between the target element and the second element in the source code is different from the spacing between the target element and the second element in the first code.

7. The method according to claim 1, characterized in that The using the first code to replace the source code comprises: Obtaining the updated target code segment output by the target optimization model; The target code segment in the source code is replaced with the updated target code segment to obtain the first code.

8. The method according to claim 7, characterized in that After replacing the source code with the first code, the method further includes: Repeat the following steps until the target control does not exist; Determine the third interface layout information of the target application by using the first code, perform the difference analysis operation on the first interface layout information and the third interface layout information, and determine whether the target control exists; In the case where the target control exists, optimizing the target code segment in the first code to obtain a second code, and replacing the first code with the second code; In a case where the target control does not exist, the first code is updated to the target application.

9. A data processing device, characterized in that: include: a first acquisition module, configured to acquire first interface layout information and second interface layout information of a target application, perform a difference analysis operation on the first interface layout information and the second interface layout information, determine a target control with a difference, and determine target control information corresponding to the target control, wherein the first interface layout information and the second interface layout information represent interface layout information associated with different languages, the first interface layout information includes first boundary information of the target control, the second interface layout information includes second boundary information of the target control, the first boundary information is different from the second boundary information, and the target control information includes interface layout information corresponding to a parent control of the target control; a second acquisition module, configured to acquire a target code segment from the source code of the target application according to the target control information, wherein the target code segment represents a code segment in the source code associated with the parent control, and the source code corresponds to the second interface layout information; A determination module, configured to determine a target prompt word template from a predetermined prompt word template set according to the target control information; The optimization module is used to input the target prompt word template and the target code segment into a target optimization model, optimize the target code segment in the source code to obtain a first code, and use the first code to replace the source code, wherein the target optimization model is used to optimize the display size of each element in the target control.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 8 when executed by a processor.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Cboth translation method, device and equipment, medium and program product

    CN119721059A

  • Advertising translation method, apparatus, device, medium, and program product

    CN119721059B

  • User interface processing method and device, equipment, storage medium and program product

    CN119759478A

  • Game prototype interface image generation method and system

    CN119917096A

  • Self-adaptive adjustment method and system for system development data

    CN119961041A