Multi-language detection method and device for Web end copywriting, equipment and medium
By crawling page copy and performing language detection by responding to detection requests on the web side, the problem that existing multilingual support solutions requires a lot of manual intervention is solved, and efficient and accurate abnormal copy detection is achieved to meet the system update needs.
Patent Information
- Application Number
- CN202411235298.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2024-11-26
AI Technical Summary
The existing multilingual support solutions require a lot of manual intervention, and the detection efficiency and detection accuracy are limited, which cannot meet the system update requirements, and it is difficult to accurately find abnormal copywriting in different languages.
Responding to the detection request through the web side, crawling the page copy, calling the request simulation component to send a behavior request to the copy interface associated with the dynamic copy for language detection, and detecting the static copy based on the detection demand information. If the detection result meets the abnormal conditions, an exception will be generated Indication information output.
Reduce manual intervention, improve detection efficiency, and be able to accurately find abnormal copywriting in different languages to meet system update needs.
Smart Images

Figure CN119025211A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of language detection and display technology, and in particular to a multi-language detection method, device, equipment and medium for Web-side copywriting. Background Art
[0002] As the globalization process accelerates, more and more companies are expanding their businesses to overseas markets. In this process, multilingual support has become one of the important means for companies to improve user experience and increase market competitiveness. In order to better serve users with different language backgrounds, companies have introduced multilingual settings in their web-based systems.
[0003] Currently, common multi-language support mainly includes front-end page translation and back-end maintenance language package translation. Front-end page translation involves converting the text content of the web page into the target language, so that users can browse and operate in the language they are familiar with. The translation of the back-end maintenance language package is to ensure that the system can correctly parse and display content in different languages during the background processing.
[0004] However, existing multilingual support solutions usually require a lot of manual intervention. For example, testers need to manually check the text content of each page and enter the corresponding translation content into the system's language package, which is not only time-consuming and laborious, but also prone to translation errors or omissions. As the system functions are constantly updated and expanded, the translation content needs to be frequently maintained and tested, and its detection efficiency cannot meet the system update requirements. Summary of the invention
[0005] The present invention provides a multi-language detection method, device, equipment and medium for Web-side text, which solves the technical problems that the existing multi-language support solutions require a large amount of manual intervention, have limited detection efficiency and accuracy, cannot meet system update requirements, and are difficult to accurately find abnormal texts in different languages.
[0006] The present invention provides a multi-language detection method for Web-side copywriting, which is applied to the Web side. The method includes:
[0007] In response to the detection request, crawling the page copy; the page copy includes static copy and / or dynamic copy;
[0008] Calling a request simulation component to send a behavior request to a text interface associated with the dynamic text, and performing language detection according to the returned request text to generate a first detection result;
[0009] Testing the static text according to the testing requirement information to generate a second testing result;
[0010] If the first detection result or the second detection result meets the abnormal condition, abnormal indication information corresponding to the page copy is generated and output.
[0011] Optionally, the call request simulation component sends a behavior request to a text interface associated with the dynamic text, and performs language detection according to the returned request text to generate a first detection result, including:
[0012] The calling request simulation component sends a behavior request to the copywriting interface associated with the dynamic copywriting;
[0013] When receiving the request text returned by the text interface, comparing the data language of the request text with the expected language of the webpage;
[0014] If the language of the data is the same as the expected language of the webpage, the detection is passed as the first detection result;
[0015] If the language of the data is different from the expected language of the webpage, failure of the detection is taken as the first detection result.
[0016] Optionally, the detecting the static text according to the detection requirement information to generate a second detection result includes:
[0017] If there is no accuracy detection requirement in the detection requirement information, obtaining the text language corresponding to the static text;
[0018] Comparing the language of the text with the expected language of the webpage, and generating a second detection result according to the comparison result;
[0019] If there is an accuracy detection requirement in the detection requirement information, obtaining a static configuration file corresponding to the static copy;
[0020] A second detection result is generated according to the comparison result between the static configuration file and the preset translation table.
[0021] Optionally, comparing the text language with the expected language of the webpage and generating a second detection result according to the comparison result includes:
[0022] Compare the language of the copy with the expected language of the webpage;
[0023] If the language of the text is the same as the expected language of the webpage, the detection is passed as the second detection result;
[0024] If the language of the text is different from the expected language of the webpage, failure of the detection is taken as the second detection result.
[0025] Optionally, generating a second detection result according to a comparison result of the static configuration file and a preset translation table includes:
[0026] Comparing the static configuration file with a preset translation table;
[0027] If the static configuration file contains a code different from that in the translation table, taking failure of the detection as the second detection result;
[0028] If the static configuration file does not contain any code different from the translation table, the detection passing is taken as the second detection result.
[0029] Optionally, the abnormal condition is that the detection fails; if the first detection result or the second detection result meets the abnormal condition, generating and outputting abnormal indication information corresponding to the page copy, including:
[0030] If the first detection result is that the detection fails, locating the interface path information of the copy interface, generating and outputting the abnormal indication information corresponding to the page copy in a table form;
[0031] If the second detection result is that the detection fails, the element screenshot is located from the static copy or the code position is located from the static configuration file, and abnormal indication information corresponding to the page copy is generated and output in a table form.
[0032] Optionally, the method further comprises:
[0033] If neither the first detection result nor the second detection result meets the abnormal condition, the process jumps to executing the step of responding to the detection request and crawling the page copy.
[0034] A second aspect of the present invention provides a multi-language detection device for a Web-side copy, which is applied to a Web-side, and the device includes:
[0035] A copy crawling module, used to respond to the detection request and crawl the page copy; the page copy includes static copy and / or dynamic copy;
[0036] A dynamic copy detection module, used to call the request simulation component to send a behavior request to the copy interface associated with the dynamic copy, and perform language detection according to the returned request copy to generate a first detection result;
[0037] A static text detection module, used to detect the static text according to the detection requirement information and generate a second detection result;
[0038] The abnormal information output module is used to generate and output abnormal indication information corresponding to the page copy if the first detection result or the second detection result meets the abnormal condition.
[0039] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the multi-language detection method for Web-side copywriting as described in any one of the first aspects of the present invention.
[0040] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the multi-language detection method for Web-side copywriting as described in any one of the first aspects of the present invention is implemented.
[0041] It can be seen from the above technical solutions that the present invention has the following advantages:
[0042] The present invention crawls page text by responding to detection requests through the Web end; the page text includes static text and / or dynamic text; calling the request simulation component to send a behavior request to the text interface associated with the dynamic text, and performing language detection according to the returned request text to generate a first detection result; detecting the static text according to the detection requirement information to generate a second detection result; if the first detection result or the second detection result meets the abnormal condition, abnormal indication information corresponding to the page text is generated and output. Thus, by crawling the page text in real time and performing different detections according to its type, the detection efficiency is effectively improved while reducing manual intervention, and abnormal texts in different languages can be accurately found. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0044] Figure 1 A flowchart of a method for detecting multiple languages of a Web document provided by an embodiment of the present invention;
[0045] Figure 2 This is an overall detection flow chart of a multi-language detection method for Web-side copywriting in an embodiment of the present invention;
[0046] Figure 3 A structural block diagram of a multi-language detection device for Web-side copywriting provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The embodiments of the present invention provide a multi-language detection method, device, equipment and medium for Web-side text, which are used to solve the technical problems that the existing multi-language support solutions require a lot of manual intervention, have limited detection efficiency and accuracy, cannot meet system update requirements, and are difficult to accurately find abnormal texts in different languages.
[0048] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] See also Figure 1 , Figure 1 A flowchart of a method for detecting multiple languages of a Web document provided by an embodiment of the present invention.
[0050] The present invention provides a multi-language detection method for Web-side copywriting, which is applied to the Web side and includes:
[0051] Step 101, in response to the detection request, crawling the page copy; the page copy includes static copy and / or dynamic copy;
[0052] Page copy refers to the text content used in various parts of a web page or on a separate page. It is a text element on a web page used to convey information, guide user behavior, enhance user experience, and promote interaction with users. Page copy can appear in various locations such as the title, subtitle, paragraph, button, link, form, image caption, pop-up window prompt, footer information, etc. on a web page. Static copy and dynamic copy can be included in the same page at the same time. The specific copy type is determined by the corresponding control type. Static copy refers to copy with relatively fixed content. The content itself does not change with user behavior or time, such as a product details page; dynamic copy refers to copy whose content can change or adjust in real time based on user behavior, time, environment and other factors. It usually analyzes user data through algorithms, predicts user intent, and generates copy that is more in line with user needs, such as video ads, dynamic updates on social media, or personalized recommendations.
[0053] In an embodiment of the present invention, the web side responds to the input detection request and crawls the currently displayed page text in real time to obtain the data basis for subsequent processing. For static text, data crawling can be performed by using the requests library and the BeautifulSoup library. For dynamic text, it may be dynamically generated by JavaScript or the data returned by the request backend. At this time, a specific request simulation component can be called, such as a tool such as Selenium to simulate browser behavior or user requests and capture dynamically generated content.
[0054] It should be noted that when crawling page copy, it is necessary to divide it into static copy and dynamic copy. There are many ways to divide it. For example, you can crawl multiple page copy at a certain time interval and compare whether there are completely identical parts in each page copy. If there are completely identical parts and different parts at the same time, it means that the page copy of the current page has both static copy and dynamic copy. At this time, the completely identical parts in the web page copy are classified as static copy, and the different parts are determined as dynamic copy. Subsequent copy detection is performed to detect whether there are any abnormalities in the web page copy in real time. If the page copy is exactly the same each time, it means that the web page copy is static copy; if the different parts of the page copy appear in different positions each time and the content changes continuously, it means that the web page copy is dynamic copy.
[0055] Step 102, calling the request simulation component to send a behavior request to the text interface associated with the dynamic text, and performing language detection according to the returned request text to generate a first detection result;
[0056] The copy interface refers to a technical interface that allows the backend server or system to generate and return dynamic copy content in real time according to preset rules, behavioral requests or environment variables, such as API interface, SDK / library or front-end JavaScript.
[0057] The request simulation component refers to a component that can simulate the operation of the user or the upstream module in the browser, such as click, input or scroll, so as to realize the request simulation of the dynamic web page, such as Selenium.
[0058] In an embodiment of the present invention, a behavior request corresponding to a dynamic copy is generated by calling a request simulation component and sent to a copy interface to receive a request copy returned by the copy interface. The language of the data in the request copy is detected and matched with the expected language of the copy to generate a first detection result to determine whether there is an abnormality in the dynamic copy in the page copy.
[0059] In one example of the present invention, step 102 may include the following sub-steps:
[0060] The call request simulation component sends a behavior request to the copywriting interface associated with the dynamic copywriting;
[0061] When receiving the request text returned by the text interface, compare the data language of the request text with the expected language of the web page;
[0062] If the language of the data is the same as the expected language of the webpage, the first detection result is that the detection is passed;
[0063] If the language of the data is different from the expected language of the webpage, the detection failure is taken as the first detection result.
[0064] In this embodiment, a Selenium script can be called to simulate user behaviors such as clicking a link, filling out a form, or selecting a drop-down menu item, thereby generating a behavior request to the copy interface associated with the dynamic copy, and the copy interface returns the corresponding request copy to the Web end. The Web end can extract the data language from the dynamic copy through the Selenium script, and compare it with the expected language of the web page preset on the page. If the language is the same, it means that the test has passed, and this is used as the first test result, and subsequent operations can continue; if the language is different, it means that the dynamic copy generated by the copy interface at this time is abnormal. At this time, the test failure is used as the first test result, and subsequent operations are waited for to determine the copy interface path and record it.
[0065] Step 103, testing the static text according to the testing requirement information to generate a second testing result;
[0066] Detection requirement information refers to information used to specify the detection content of static text, which may include but is not limited to accuracy detection requirements and language detection requirements. Specific requirements can be expressed in the form of fields or identifiers. This information can be generated by the Web end in response to external user input.
[0067] While detecting the dynamic text, the detection content of the static text can also be determined according to the detection requirement information, so that the static text is detected according to the detection content and a second detection result is generated to determine whether the static text is abnormal.
[0068] In an example of the present invention, step 103 may include the following sub-steps S11-S14:
[0069] S11. If there is no accuracy detection requirement in the detection requirement information, obtain the text language corresponding to the static text;
[0070] In this embodiment, when the detection requirement information is received, the detection requirement information is parsed to determine whether there is a field or identifier represented by the accuracy detection requirement in the detection requirement information. If there is no accuracy detection requirement, it means that only the text language detection is required at this time, and the text language corresponding to the static text can be obtained as the basis for subsequent detection data.
[0071] S12, comparing the language of the text with the expected language of the webpage, and generating a second detection result according to the comparison result;
[0072] Further, S12 may include the following sub-steps:
[0073] Compare the language of the copy with the expected language of the webpage;
[0074] If the language of the copy is the same as the expected language of the webpage, the second test result is that the test is passed;
[0075] If the language of the text is different from the expected language of the webpage, the detection failure is taken as the second detection result.
[0076] In this embodiment, after obtaining the language of the copy, the copy language is compared with the expected language of the web page for detection and judgment. The specific detection means can use the commonly used langdetect or langid library of Python for detection, or further use online APIs such as Google Translate API for testing. The crawled static copy is placed in a text box for detection, so as to determine whether the language of the copy is the same as the expected language of the web page as the second detection result.
[0077] S13. If there is an accuracy detection requirement in the detection requirement information, obtain a static configuration file corresponding to the static copy;
[0078] In another example, if there is an accuracy detection requirement in the detection requirement information, it indicates that the static text needs to be detected for accuracy. In a multi-language scenario, there may be multiple translations of the same language and the same meaning of the static text at the same time. At this time, direct manual comparison of the translation content is labor-intensive and has low detection efficiency. To this end, the static configuration file corresponding to the static text can be obtained as the comparison content.
[0079] The static configuration file refers to the translation configuration file corresponding to the static copy, which may include the unique identifier of the configuration item, source text, translation text, comments, format, conditional translation, and variable corresponding codes. The translation configuration file can be JSON, YAML, or any format required by the project. The generation process can first be provided by the translation team of the page in the form of a table to translate the words, and then converted into configuration files in different languages by developers or machine learning models, and the configuration files are written into the configuration of different static copies.
[0080] S14: Generate a second detection result according to the comparison result between the static configuration file and the preset translation table.
[0081] Further, S14 may include the following sub-steps:
[0082] Compare the static configuration file with the preset translation table;
[0083] If the static configuration file contains codes that are different from the translation table, the second test result is that the test fails;
[0084] If the static configuration file does not contain any code that is different from the translation table, the detection passing is taken as the second detection result.
[0085] In this embodiment, the Web end can first access the translation table (such as Excel or CSV) provided by the translator and the static configuration file deployed by the static copy through a script. Further, the library is used to read the translation table to parse each column in the table to determine the unique identifier, source text and translation text; at the same time, the library is used to read all static configuration files to parse the file structure. Traverse each row of the translation table (that is, each translation item), use its unique identifier for each translation item, and find the corresponding translation code in the static configuration file. If there is no code different from the translation item, the test is determined to be passed; if there is a code different from the translation table in the static configuration file, such as a unique identifier, source text or translation text, it indicates that there may be a problem with the translation at this time, and the failure of the test is used as the second test result. Any inconsistent locations can be quickly discovered by comparing the tables, thereby improving the detection efficiency and effectively determining the bug location of the configuration error.
[0086] Step 104: if the first detection result or the second detection result meets the abnormal condition, abnormal indication information corresponding to the page copy is generated and output.
[0087] In one example of the present invention, the abnormal condition is that the detection fails; step 104 may include the following sub-steps:
[0088] If the first detection result is that the detection fails, the interface path information of the copy interface is located, and abnormal indication information corresponding to the page copy is generated in a table form and output;
[0089] If the second detection result is that the detection fails, the element screenshot is located from the static copy or the code position is located from the static configuration file, and abnormal indication information corresponding to the page copy is generated and output in a table form.
[0090] In the embodiment of the present invention, if the first detection result is that the detection fails, it indicates that the dynamic copy returned by the copy interface at this time has a language abnormality, which may be due to an error in the interface call or the copy interface cannot provide dynamic copy in the language. To further eliminate abnormal situations, the interface path corresponding to the copy interface can be located, and the interface path information, such as the basic URL, version number, resource name and resource identifier, can be obtained in the form of table statistics, and the abnormal indication information corresponding to the page copy is generated and output.
[0091] If the second test result is that the test failed, it indicates that there is an abnormality in the language or translation accuracy of the static text at this time. The specific test type to which the second test result belongs can be determined according to the analysis results of the test requirement information. If the second test result is that the text language test failed, then the element screenshots of each abnormal position of the text can be located from the static text, and all element screenshots can be output in a centralized manner using Excel statistics to inform the technicians of the static text positions that need to be modified. If the second test result is that the accuracy check failed, then according to the comparison results of the static configuration file and the translation table, the abnormal translation code position is located from the static configuration file, and each code position is counted in the table, and abnormal indication information is generated for output.
[0092] Through the output of abnormal indication information in the above table form, a detailed detection report can be automatically generated, including the detected language, abnormal text, code location and element screenshots, etc., to facilitate further analysis and decision-making. Through data feedback and analysis, the language detection model and algorithm can be continuously optimized and improved to improve system performance.
[0093] In addition, in another example of the present invention, when the first test result or the second test result is that the test fails, there is another method for generating abnormal indication information, specifically, locating the problem copy without distinguishing between static copy and dynamic copy, and counting the position or screenshot of the problem copy; judging the development end to which the problem copy belongs, for example, if the problem copy belongs to the front-end copy, indicating that it is a static copy, then directly returning the screenshot of the corresponding position; if the problem copy belongs to the back-end data, indicating that it is a dynamic copy, then locating the corresponding interface information and returning it.
[0094] In another example of the present invention, the method further includes:
[0095] If neither the first detection result nor the second detection result meets the abnormal condition, the process jumps to the step of responding to the detection request and crawling the page copy.
[0096] In this embodiment, if both the first detection result and the second detection result reflect that the page copy has passed the detection, it indicates that the language and accuracy of the web page copy are normal, and the process can jump to step 101 to start a new round of page copy detection.
[0097] In addition, when it is determined that both the first detection result and the second detection result do not meet the abnormal conditions, no processing is required, and a new page copy crawling request is waited for to trigger the process from step 101 to step 104.
[0098] It should be noted that in this embodiment, the copy crawling is divided into the crawling of static copy and dynamic copy, and the detection of various web page copy includes URL detection and API detection, so as to detect the URL and call interface of the web page copy in different languages respectively to determine whether there is any abnormality in its translation. If there is an abnormality, the abnormal indication information can be obtained by taking a screenshot of the web page copy and / or locating the interface, so that the technicians can repair the abnormality of the web page copy in various languages.
[0099] See also Figure 2 , Figure 2 The present invention shows an overall detection flow chart of a multi-language detection method for Web-side copywriting in an embodiment of the present invention.
[0100] In this embodiment, the web page copy is crawled in response to the detection request; it is determined whether the crawled web page copy is a static copy; if it is not a static copy, the web page copy is determined to be a dynamic copy, a request is simulated to access the corresponding copy interface, and the language of the returned data is determined; it is determined whether the language of the data is consistent with the expected language of the web page copy, if so, no processing is performed, if not, the interface path of the copy interface is recorded and Excel statistics are performed, and the corresponding abnormal indication information is returned to the Web end for display; if the crawled web page copy is determined to be a static copy, the static copy can be further tested to determine whether the copy accuracy needs to be tested ; If the accuracy of the copy needs to be detected, the static configuration file and translation table of the static copy are compared to determine whether the two are consistent. If so, no processing is performed. If not, the specific code position is located from the static configuration file and Excel statistics are performed, and the corresponding abnormal indication information is returned to the Web end for display; If the accuracy of the copy does not need to be detected, the copy language of the static copy is directly determined; determine whether the copy language is consistent with the expected language. If so, no processing is performed. If not, locate the screenshots of elements of the copy or the entire static copy in different languages, use Excel statistics and return the corresponding abnormal indication information to the Web end for display.
[0101] In an embodiment of the present invention, the web side responds to the detection request and crawls the page copy; the page copy includes static copy and / or dynamic copy; the request simulation component is called to send a behavior request to the copy interface associated with the dynamic copy, and the language detection is performed according to the returned request copy to generate a first detection result; the static copy is detected according to the detection requirement information to generate a second detection result; if the first detection result or the second detection result meets the abnormal condition, the abnormal indication information corresponding to the page copy is generated and output. Thus, by crawling the page copy in real time and performing different detections according to its type, the detection efficiency is effectively improved while reducing manual intervention, and abnormal copy in different languages can be accurately found.
[0102] See also Figure 3 , Figure 3 A structural block diagram of a multi-language detection device for Web-side copywriting in an embodiment of the present invention is shown.
[0103] The embodiment of the present invention provides a multi-language detection device for a Web-side copywriting, which is applied to a Web-side, and the device includes:
[0104] The copy crawling module 301 is used to respond to the detection request and crawl the page copy; the page copy includes static copy and / or dynamic copy;
[0105] The dynamic copy detection module 302 is used to call the request simulation component to send a behavior request to the copy interface associated with the dynamic copy, and perform language detection according to the returned request copy to generate a first detection result;
[0106] The static text detection module 303 is used to detect the static text according to the detection requirement information and generate a second detection result;
[0107] The abnormal information output module 304 is used to generate and output abnormal indication information corresponding to the page copy if the first detection result or the second detection result meets the abnormal condition.
[0108] Optionally, the dynamic copy detection module 302 is specifically used for:
[0109] The call request simulation component sends a behavior request to the copywriting interface associated with the dynamic copywriting;
[0110] When receiving the request text returned by the text interface, compare the data language of the request text with the expected language of the web page;
[0111] If the language of the data is the same as the expected language of the webpage, the first detection result is that the detection is passed;
[0112] If the language of the data is different from the expected language of the webpage, the detection failure is taken as the first detection result.
[0113] Optionally, the static text detection module 303 includes:
[0114] The copy language acquisition submodule is used to obtain the copy language corresponding to the static copy if there is no accuracy detection requirement in the detection requirement information;
[0115] A language comparison submodule is used to compare the language of the text with the expected language of the webpage, and generate a second detection result according to the comparison result;
[0116] The configuration file acquisition submodule is used to obtain the static configuration file corresponding to the static copy if there is an accuracy detection requirement in the detection requirement information;
[0117] The configuration file comparison submodule is used to generate a second detection result according to the comparison result between the static configuration file and the preset translation table.
[0118] Optionally, the language comparison submodule is specifically used for:
[0119] Compare the language of the copy with the expected language of the webpage;
[0120] If the language of the copy is the same as the expected language of the webpage, the second test result is that the test is passed;
[0121] If the language of the text is different from the expected language of the webpage, the detection failure is taken as the second detection result.
[0122] Optionally, the submodules are compared according to the configuration files and are specifically used for:
[0123] Compare the static configuration file with the preset translation table;
[0124] If the static configuration file contains codes that are different from the translation table, the second test result is that the test fails;
[0125] If the static configuration file does not contain any code that is different from the translation table, the detection passing is taken as the second detection result.
[0126] Optionally, the abnormal condition is that the detection fails; the abnormal information output module 304 is specifically used to:
[0127] If the first detection result is that the detection fails, the interface path information of the copy interface is located, and abnormal indication information corresponding to the page copy is generated in a table form and output;
[0128] If the second detection result is that the detection fails, the element screenshot is located from the static copy or the code position is located from the static configuration file, and abnormal indication information corresponding to the page copy is generated and output in a table form.
[0129] Optionally, the device further comprises:
[0130] The loop detection module is used to jump to the step of responding to the detection request and crawling the page copy if the first detection result and the second detection result do not meet the abnormal conditions.
[0131] An embodiment of the present invention provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the multi-language detection method for Web-side copywriting as described in any embodiment of the present invention.
[0132] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed, the multi-language detection method for Web-side copywriting as described in any embodiment of the present invention is implemented.
[0133] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, modules and sub-modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0134] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0135] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.
[0137] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for an electronic device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0138] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-language detection method for Web-based copywriting, characterized in that: Applied to the Web side, the method includes: In response to the detection request, crawling the page copy; the page copy includes static copy and / or dynamic copy; Calling a request simulation component to send a behavior request to a text interface associated with the dynamic text, and performing language detection according to the returned request text to generate a first detection result; Testing the static text according to the testing requirement information to generate a second testing result; If the first detection result or the second detection result meets the abnormal condition, abnormal indication information corresponding to the page copy is generated and output.
2. The method according to claim 1, characterized in that The call request simulation component sends a behavior request to the text interface associated with the dynamic text, and performs language detection according to the returned request text to generate a first detection result, including: The calling request simulation component sends a behavior request to the copywriting interface associated with the dynamic copywriting; When receiving the request text returned by the text interface, comparing the data language of the request text with the expected language of the webpage; If the language of the data is the same as the expected language of the webpage, the detection is passed as the first detection result; If the language of the data is different from the expected language of the webpage, failure of the detection is taken as the first detection result.
3. The method according to claim 1, characterized in that The detecting the static text according to the detection requirement information to generate a second detection result includes: If there is no accuracy detection requirement in the detection requirement information, obtaining the text language corresponding to the static text; Comparing the language of the text with the expected language of the webpage, and generating a second detection result according to the comparison result; If there is an accuracy detection requirement in the detection requirement information, obtaining a static configuration file corresponding to the static copy; A second detection result is generated according to the comparison result between the static configuration file and the preset translation table.
4. The method according to claim 3, characterized in that The comparing the text language with the expected language of the webpage and generating a second detection result according to the comparison result includes: Compare the language of the copy with the expected language of the webpage; If the language of the text is the same as the expected language of the webpage, the detection is passed as the second detection result; If the language of the text is different from the expected language of the webpage, failure of the detection is taken as the second detection result.
5. The method according to claim 3, characterized in that: According to the comparison result of the static configuration file and the preset translation table, a second detection result is generated, including: Comparing the static configuration file with a preset translation table; If the static configuration file contains a code different from that in the translation table, taking failure of the detection as the second detection result; If the static configuration file does not contain any code different from the translation table, the detection passing is taken as the second detection result.
6. The method according to claim 3, characterized in that: The abnormal condition is that the detection fails; if the first detection result or the second detection result meets the abnormal condition, generating and outputting abnormal indication information corresponding to the page copy, including: If the first detection result is that the detection fails, locating the interface path information of the copy interface, generating and outputting the abnormal indication information corresponding to the page copy in a table form; If the second detection result is that the detection fails, the element screenshot is located from the static copy or the code position is located from the static configuration file, and abnormal indication information corresponding to the page copy is generated and output in a table form.
7. The method according to claim 1, characterized in that The method further comprises: If neither the first detection result nor the second detection result meets the abnormal condition, the process jumps to executing the step of responding to the detection request and crawling the page copy.
8. A multi-language detection device for Web-based copywriting, characterized in that: Applied to the Web side, the device includes: A copy crawling module, used to respond to the detection request and crawl the page copy; the page copy includes static copy and / or dynamic copy; A dynamic copy detection module, used to call the request simulation component to send a behavior request to the copy interface associated with the dynamic copy, and perform language detection according to the returned request copy to generate a first detection result; A static text detection module, used to detect the static text according to the detection requirement information and generate a second detection result; The abnormal information output module is used to generate and output abnormal indication information corresponding to the page copy if the first detection result or the second detection result meets the abnormal condition.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor executes the steps of the multi-language detection method for Web-end copywriting according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the multi-language detection method for Web-side copywriting according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Back-end language switching method and device, equipment and storage medium
CN119645554A
