Code conversion method and device, equipment, storage medium and program product
By decoupling JSP code from framework syntax and using multi-dimensional knowledge base rules for automated conversion, the problems of low efficiency, high cost, and poor consistency in the migration from JSP to Vue are solved, achieving efficient and accurate code conversion and rapid iteration.
Patent Information
- Application Number
- CN202511723269.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-17
AI Technical Summary
In existing technologies, migrating a banking system built on JSP to the Vue framework relies on manual operations, resulting in low conversion efficiency, high labor costs, poor migration consistency, and a high risk of introducing errors.
By obtaining the code of the page generated by the server, the strong coupling between the source code and the specific framework syntax is removed. The code is then transformed into structured code using component mapping tables, framework syntax mapping tables, unstructured case rules, and custom rules to generate code that conforms to the client architecture.
It significantly improves conversion efficiency and consistency, reduces reliance on developer skills, supports rapid iteration and updates of front-end projects, and reduces development costs and error rates.
Smart Images

Figure CN121541880A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, and in particular to a code conversion method, apparatus, device, storage medium, and program product. Background Technology
[0002] With the rapid development of internet technology, front-end development technologies are constantly being updated and iterated. JSP (JavaServer Pages), as an early server-side rendering technology, has been widely used in many enterprise applications. JSP is a method of generating pages based on the server side. However, with the development of modern front-end frameworks, frameworks such as Vue (Vue.js) and React (React.js), with their advantages of componentization, responsiveness, and data-driven approaches, have gradually become the mainstream choice for front-end development.
[0003] In existing technologies, migrating a JSP-based banking system to the Vue framework typically relies on developers manually performing code conversion and architecture refactoring. This process involves multiple aspects, including front-end and back-end separation of responsibilities, interface abstraction, component encapsulation, and route configuration, requiring a deep understanding of both Java back-end technology and the Vue front-end framework.
[0004] Existing migration methods heavily rely on manual operations, resulting in low conversion efficiency, high labor costs, poor migration consistency, and susceptibility to errors. Therefore, there is an urgent need for a technical solution that can efficiently and accurately convert JSP to Vue, thereby reducing migration costs and improving the reliability and efficiency of the modernization process. Summary of the Invention
[0005] This application provides a code conversion method, apparatus, device, storage medium, and program product to solve the technical problems of existing migration methods that rely heavily on manual operation, resulting in low conversion efficiency, high labor costs, poor migration consistency, and easy introduction of errors.
[0006] Firstly, this application provides a code conversion method, the method comprising:
[0007] Obtain the first code to be converted, process the first code to obtain the first intermediate code; the first code is the code for the server to generate the page;
[0008] The first intermediate code is transformed based on the preset knowledge base rules to obtain the second intermediate code. The knowledge base rules include: component mapping relationship table, framework syntax mapping relationship table, unstructured case rules and custom rules. The component mapping relationship table is used to map relationships based on component type, the framework syntax mapping relationship table is used to map relationships based on syntax type, the unstructured case rules are used to define the reference range for the transformation from the first intermediate code to the second intermediate code, and the custom rules are used to customize the transformation rules from the first intermediate code to the second intermediate code.
[0009] The second code is generated based on the second intermediate code; the second code is the client architecture code for building the user interface.
[0010] Secondly, this application provides a code conversion apparatus, the apparatus comprising:
[0011] The acquisition module is used to acquire the first code to be converted, process the first code to obtain the first intermediate code; the first code is the code for generating the page on the server side;
[0012] The conversion module is used to convert the first intermediate code based on preset knowledge base rules to obtain the second intermediate code. The knowledge base rules include: component mapping relationship table, framework syntax mapping relationship table, unstructured case rules and custom rules. The component mapping relationship table is used to perform relationship mapping based on component type, the framework syntax mapping relationship table is used to perform relationship mapping based on syntax type, the unstructured case rules are used to define the reference range for the conversion from the first intermediate code to the second intermediate code, and the custom rules are used to customize the conversion rules from the first intermediate code to the second intermediate code.
[0013] The generation module is used to generate second code based on the second intermediate code; the second code is the client architecture code for building the user interface.
[0014] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0015] The memory stores the instructions that the computer executes;
[0016] The processor executes computer-executable instructions stored in memory to implement the method as described in any of the first aspects.
[0017] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.
[0018] Fifthly, this application provides a computer program product including a computer program that, when executed by a processor, implements the method as described in any of the first aspects.
[0019] The code conversion method, apparatus, device, storage medium, and program product provided in this application convert the first code of the server-generated page into an intermediate representation, decoupling the source code from the specific framework syntax to obtain first intermediate code. Then, based on multi-dimensional knowledge base rules, including component mapping tables, framework syntax mapping tables, unstructured case rules, and custom rules, the first intermediate code is structurally converted to obtain second intermediate code. This ensures the accuracy and adaptability of the conversion process at the syntax, component, and business logic levels, thereby generating second code that conforms to the client architecture based on the second intermediate code. In this way, this application reduces reliance on developer skills by constructing an automated code conversion process, significantly improving conversion efficiency and consistency. Configurable knowledge base rules ensure scalability and flexibility, supporting rapid iterative updates of front-end projects and solving the problems of low efficiency, high cost, poor consistency, and error susceptibility caused by heavy reliance on manual operations. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0022] Figure 2 A flowchart illustrating a code conversion method provided in an embodiment of this application;
[0023] Figure 3 This is a schematic diagram of the structure of a code conversion system provided in an embodiment of this application;
[0024] Figure 4 A schematic diagram illustrating the construction of knowledge base rules provided in an embodiment of this application;
[0025] Figure 5 A flowchart illustrating an optional code conversion method provided in an embodiment of this application;
[0026] Figure 6 This is a schematic diagram of the structure of a code conversion device provided in an embodiment of this application;
[0027] Figure 7 This is a schematic block diagram of an electronic device provided in an embodiment of this application.
[0028] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0029] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0030] It should be noted that the code conversion method, apparatus, device, storage medium and program product provided in this application can be used in the field of financial technology, or in any field other than financial technology. The application field of the code conversion method, apparatus, device, storage medium and program product in this application is not limited.
[0031] It should be noted that, in this application, the terms "exemplary" or "for example" are used to indicate that something is being described as an example, illustration, or illustration. Any embodiment or design described as "exemplary" or "for example" in this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0032] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0033] The following is an explanation of the technical terms used in this application.
[0034] Large model: can refer to a machine learning model with a large number of parameters and a complex computational structure. This large model can adopt a deep neural network architecture to process massive amounts of parameter data and can handle more complex tasks and data. In this application, large model can be understood as a machine learning model.
[0035] Knowledge base: This can refer to a system that provides external knowledge support for large models. It is used to store, organize, and retrieve structured or unstructured information. It can be used in conjunction with large models as an external data source to enhance the large models' ability to process professional domain or real-time information.
[0036] Abstract Syntax Tree (AST): This refers to a tree-like representation of the abstract syntactic structure of source code. Each node in an AST represents a syntactic unit in the source code, such as a tag, script fragment, expression, variable declaration, or function call.
[0037] Compared to technologies like Vue and React, JSP technology has certain shortcomings in performance and flexibility. Therefore, transforming JSP technology into modern front-end framework technologies, such as Vue, has become an important requirement in the front-end development field.
[0038] In existing technologies, when migrating a JSP-based banking system to the Vue framework, the lack of conversion tools for transforming JSP to Vue typically requires developers to manually perform code conversion and architecture refactoring. This process involves multiple aspects such as front-end and back-end separation of responsibilities, interface abstraction, component encapsulation, and route configuration, requiring a deep understanding of both Java back-end technology and the Vue front-end framework.
[0039] Because existing migration methods rely heavily on manual operations and require high skill levels from developers, they suffer from problems such as low conversion efficiency, high labor costs, poor migration consistency, and susceptibility to errors. Furthermore, they are not conducive to the rapid iteration and updates of front-end projects.
[0040] To address the aforementioned issues, this application provides a code conversion method. It converts the first code generated by the server into an intermediate representation, decoupling the source code from the specific framework syntax to obtain first intermediate code. Then, based on multi-dimensional knowledge base rules, including component mapping tables, framework syntax mapping tables, unstructured case rules, and custom rules, the first intermediate code undergoes a structured conversion to obtain second intermediate code. This ensures the accuracy and adaptability of the conversion process at the syntax, component, and business logic levels, thereby generating second code that conforms to the client-side architecture. In this way, by constructing an automated code conversion process, this application reduces reliance on developer skills, significantly improves conversion efficiency and consistency, and ensures scalability and flexibility through configurable knowledge base rules, thus supporting rapid iterative updates of front-end projects. It solves the problems of low efficiency, high cost, poor consistency, and error susceptibility caused by heavy reliance on manual operations.
[0041] For example, this application can be applied to projects that enterprises need to migrate from multiple different server-side technologies (such as JSP, Thymeleaf) to the same client-side framework. Figure 1 This is a schematic diagram of an application scenario provided in an embodiment of this application, such as... Figure 1 As shown, the application scenario includes the user's terminal device 101 and the code conversion system 102.
[0042] The code conversion system 102 can take the first code to be converted, such as a JSP file, from the terminal device 101. Further, it parses the syntax structure of the JSP file to generate first intermediate code, such as an Abstract Syntax Tree (AST) or Intermediate Representation (IR). Further, it calls knowledge base rules to restructure and syntactically replace the first intermediate code, generating second intermediate code, which is then converted into the second code of the target client framework, such as a Vue Single-File Component (SFC) file.
[0043] For example, the knowledge base rules are invoked to restructure and syntactically replace the first intermediate code, generating the second intermediate code. This includes: using a component mapping table to map server-side components to client-side components, such as converting a JSP datepicker component instance into a Vue instance. <el-date-picker>The server-side syntax is converted to client-side framework syntax using a framework syntax mapping table, such as converting JSTL (Jakarta Standard Tag Library) expressions. <c:foreach>The expression `v-for` is converted to Vue. Unconventional code patterns are handled using unstructured case rules. Conversion references are provided through similar case matching, or code conversion is performed based on user-defined rules that extend specific business logic. This application embodiment does not specifically limit the process of generating the second intermediate code.
[0044] Optionally, after generating the second code, the code conversion system 102 can send the second code to a terminal device 101 for visual display, allowing the user to view and correct it, thus outputting second code that can be directly integrated into modern front-end projects. This user is typically a developer.
[0045] In this way, the above-mentioned automated conversion method transforms the old JSP technology into modern front-end framework technology, reducing the time and effort spent on manual coding, providing front-end developers with a convenient way to upgrade their technology, reducing development costs, and helping to promote the development of front-end technology.
[0046] Optional, Figure 2 This is a schematic diagram of the structure of a code conversion system provided in an embodiment of this application, such as... Figure 2 As shown, the code conversion system includes a user input layer, a front-end code conversion system, and a code generation layer. The front-end code conversion system includes a front-end code conversion module, a component conversion module, a knowledge base module, and a large model module.
[0047] The system comprises three modules: a large model module for semantic understanding of the initial code and related resource files to generate an intermediate representation, i.e., the first intermediate code; a knowledge base module for storing predefined knowledge base rules, including key information such as component mapping tables, framework syntax mapping tables, unstructured case rules, and custom rules; a component conversion module for converting the first intermediate code based on the component mapping tables to obtain converted components, for example, converting the jQuery component library in JSP syntax to a Vue component library; and a front-end code conversion module for converting the first intermediate code based on the framework syntax mapping tables to obtain converted code, for example, converting JSP code to Vue code.
[0048] Optionally, the first code and related resource files are obtained from the user input layer, which is used to obtain the first code to be converted and related resource files uploaded by the user. The code generation layer is used to generate the second code based on the conversion results of the front-end code conversion system and the knowledge base rules.
[0049] The terminal device can also be referred to as a user terminal, user equipment (UE), mobile station (MS), mobile terminal, or terminal. In practical applications, user terminals include, for example, desktop computers, laptops, personal digital assistants (PDAs), personal computers (PCs), smartphones, tablets, in-vehicle devices, wearable devices (such as smartwatches and smart bracelets), and smart home devices (such as smart display devices). This application does not specifically limit the types of devices mentioned.
[0050] It should be noted that the specific application scenarios of the code conversion method in this application embodiment are not specifically limited. The above are just examples. For example, this application can not only be applied to the migration of bank system architecture, but also to converting legacy World Wide Web (Web) systems that use server-side rendering technologies such as JSP into a front-end and back-end separation architecture based on modern client-side frameworks such as Vue and React, or further converting server-side rendering code into cross-platform client code, such as bank mini-programs, mobile application interface code of financial systems, etc.
[0051] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0052] Figure 3 This is a flowchart illustrating a code conversion method provided in an embodiment of this application, such as... Figure 3 As shown, the execution entity of this code conversion method can be... Figure 1 The code conversion system shown can also be a server. This application embodiment does not specifically limit the execution entity. The code conversion method includes the following steps:
[0053] S301. Obtain the first code to be converted, process the first code to obtain the first intermediate code; the first code is the code for the server to generate the page.
[0054] In this embodiment of the application, the first code may refer to the source code of the server-side page to be converted, for example, it may be a file in JSP, Thymeleaf or other formats. This embodiment of the application does not limit the specific file type corresponding to the first code.
[0055] Optionally, the first intermediate code can be an AST or another intermediate representation (IR).
[0056] For example, by performing component analysis and syntax analysis on the first code, and then constructing an AST based on the analysis results, this process will strip away the `<%@page%>` directives from the source code that are specific to a server-side framework, such as JSP, and transform them into a standardized, abstract tree structure.
[0057] S302. Based on preset knowledge base rules, the first intermediate code is transformed to obtain the second intermediate code. The knowledge base rules include: component mapping relationship table, framework syntax mapping relationship table, unstructured case rules and custom rules. The component mapping relationship table is used to perform relationship mapping based on component type. The framework syntax mapping relationship table is used to perform relationship mapping based on syntax type. The unstructured case rules are used to define the reference range for the transformation from the first intermediate code to the second intermediate code. The custom rules are used to customize the transformation rules from the first intermediate code to the second intermediate code.
[0058] The component mapping table can be used to map server-side components, such as the datepicker component in JSP, to components in the target framework, such as those in Vue. <el-date-picker>It retains functionality and adapts to the client lifecycle.
[0059] The framework syntax mapping table can be used to convert server-side syntax, such as JSTL expressions and EL (Expression Language) expressions, into client-side framework syntax, such as Vue's template syntax and reactive data binding.
[0060] Unstructured case rules can provide transformation references for complex code snippets that cannot be directly mapped, such as UI code with mixed business logic, by matching similar patterns in the historical case library.
[0061] Custom rules allow users to extend rules based on project characteristics, such as special processing for specific business components, to enhance transformation flexibility.
[0062] For example, Figure 4 This is a schematic diagram illustrating the construction of knowledge base rules provided in an embodiment of this application, such as... Figure 4 As shown, a multimodal knowledge base rule system for front-end code transformation is established, including structured rules, unstructured rules, and custom rules. The structured rules include component mapping tables and framework syntax mapping tables, so that the code output by the large model after learning based on the knowledge base rule system is more accurate.
[0063] The framework syntax mapping table mainly involves the mapping of framework syntax, such as a semantic mapping table from JSP syntax to Vue templates. The component mapping table mainly involves the mapping of components, such as the mapping between jQuery UI components and Vue components. jQuery is a JavaScript library. This application embodiment does not limit the specific mapping relationships corresponding to the framework syntax mapping table and the component mapping table; the above are merely illustrative examples.
[0064] Optionally, the JSP syntax to Vue template mapping table is based on syntax types, which can include tag library syntax, EL expressions, and Java code blocks, etc. For example, JSP tag library syntax such as for statements can be mapped. <c:foreach>and if statement <c:if>Transformed into Vue's equivalent directive syntax v-for and v-if to preserve the semantic consistency of data binding.
[0065] Alternatively, JSP's EL expressions can be converted into Vue's interpolation expressions, and the scope can be identified, such as ${user.name} being converted to... This includes converting requestScope to Vue's reactive data. Alternatively, you can refactor Java code blocks in JSP into Vue's methods or computed property logic, such as converting <%...%> to methods:{}.
[0066] The component mapping table maps relationships based on component types. Different page types require different component types. For example, a page's UI (User Interface) components may include buttons, input boxes, etc. This application does not limit the specific content of component types. Taking a clock / datepicker component as an example, the JSP's datepicker component instance xxx.ui.datepicker({...}) can be transformed... <el-date-picker>Alternatively, the configuration items of the datepicker component can be converted according to a specified mapping relationship, such as converting value to v-model and automatically generating reactive variables in data, converting onClick to @click and extracting callback functions to methods.
[0067] In addition to the structured conversion rules mentioned above, the knowledge base module can also store a large number of JSP to Vue conversion examples, enterprise private code snippets, etc., to generate unstructured case rules, thereby addressing specific issues in JSP to Vue conversion, such as handling jQuery plugins and separating server-side and client-side logic.
[0068] Optionally, the accuracy of unstructured case rules generated by the large model can be further improved by learning from these transformation examples and enterprise-specific code snippets through the large model module.
[0069] In addition to structured and unstructured transformation rules, users may have some personalized structure codes in their actual application projects. These structure codes are not included in the above rules. Therefore, users need to formulate their own transformation rules and upload them to the knowledge base module for the large model to learn, thereby generating custom rules.
[0070] In this step, priority scheduling can be achieved through rules. For example, the conversion can be performed first based on the component mapping table, and then based on the framework syntax mapping table. If the above two conversions fail, the conversion can be performed based on unstructured case rules and custom rules, gradually generating second intermediate code that conforms to the target framework specification.
[0071] It should be noted that the embodiments of this application do not specifically limit the order of rule priority scheduling. Optionally, it can also be that the conversion is first based on the framework syntax mapping table, and then based on the component mapping table. If the above two conversions are unsuccessful, the conversion is based on unstructured case rules and custom rules to gradually generate second intermediate code that conforms to the target framework specification, or the priority of unstructured case rules and / or custom rules is higher.
[0072] S303. Generate second code based on the second intermediate code; the second code is the code for building the client architecture of the user interface.
[0073] In this step, based on the abstract representation of the second intermediate code, files conforming to the target framework, such as Vue or React project structure, are generated. For example, the AST is converted into a single-file component (.vue file) for Vue, and the single-file component is then placed into... <template>, <script>、<style>模块后进行组合,生成第二代码,以确保功能一致性和可维护性。
[0074] 可选的,生成的第二代码可直接嵌入现代前端工具链(如Webpack),以支持后续自动化构建和持续集成,其中,Webpack是JavaScript应用程序的静态模块打包器。
[0075] 这样,通过将第一代码转换为第一中间代码,可以剥离与服务端框架的强耦合,为多目标框架转换提供统一基础,该第一中间代码对语法和逻辑进行抽象和规范化,消除原始代码中的冗余和风格差异,从而可以提高后续转换的稳定性。进一步的,通过组件映射、语法映射、案例规则和自定义规则的四层规则体系,兼顾常规语法转换与边缘案例处理,得到第二中间代码,可以减少人工补全需求。并且支持用户通过自定义规则扩展特定转换逻辑,避免因业务特殊性导致转换失败或功能损失,这种基于规则驱动的批量自动化处理,确保了转换后代码风格统一,降低后期维护成本。进一步的,基于第二中间代码输出符合目标客户端框架的第二代码,无需额外人工重构。且基于第二中间代码的层次化生成第二代码,可以确保业务逻辑和数据流在转换过程中未被破坏。
[0076] 因此,本申请通过知识库规则和中间表示层隔离原始代码与生成代码,可以避免直接转换导致的结构性错误,并且使得生成的代码结构清晰、符合现代前端工程规范,便于后续开发和迭代,从而实现从服务端代码到客户端代码的一键式迁移,显著降低重构时间和人力成本。
[0077] 可选的,对第一代码进行处理,得到第一中间代码,包括:
[0078] 基于机器学习模型对第一代码进行解析,得到至少一个逻辑块,逻辑块包括服务端业务处理逻辑代码、客户端视图模版代码、客户端资源代码、执行脚本代码、组件库代码、前后端分离代码;
[0079] 基于至少一个逻辑块,构建第一中间代码。
[0080] 本申请实施例中,机器学习模型可以指的是采用深度学习提前训练好的机器模型,如基于深度学习的神经网络模型,本申请实施例对机器学习模型对应的具体模型类型不作限定。
[0081] 可以理解的是,机器学习模型通过训练可适应不同服务端技术,如可以适用于JSP、Thymeleaf、超文本预处理器(Hypertext Preprocessor,PHP)等服务端技术,无需针对每种技术单独编写解析规则,从而降低维护成本。
[0082] 在本步骤中,基于大模型中的自然语言理解能力与AST解析技术对第一代码进行智能解析,自动识别并分离出不同类型的逻辑块,包括:服务端业务处理逻辑,如JSP中的Java逻辑代码等,客户端视图模板代码,如超文本标记语言(HyperText Markup Language,HTML)模板、JSP标签片段等,客户端资源代码,如层叠样式表(Cascading Style Sheets,CSS)样式、静态资源等,执行脚本代码,如JavaScript脚本逻辑等,组件库代码,如自定义标签库或第三方组件等,前后端分离代码,如异步JavaScript和XML技术(AsynchronousJavaScript and XML,Ajax)调用或应用程序编程接口(Application ProgrammingInterface,API)交互逻辑代码等。
[0083] 进一步的,基于识别出的逻辑块,按目标中间代码规范,如增强的AST或IR结构进行重构,明确标注各逻辑块的类型、依赖关系和边界,形成结构化第一中间代码,如基于HTML结构提取标签层级和静态内容,基于JSTL标签解析逻辑控制标签<c:forEach>、<c:if>等,基于EI表达式${user.name}标记为动态数据的绑定点,基于Scriptlet代码<%...%>,分离Java逻辑代码,以转换为前端状态管理Vuex(Vue.js状态管理库)或Pinia(Vue.js状态管理库)等代码。
[0084] 示例性的,以JSP语法代码片段为<c:forEach items="${users}"var="user">,${user.name},< / c:forEach>为例,解析为JSP对应的AST,即第一中间代码为:
[0085] JSTLForEach (c:forEach)
[0086] ├─ attributes
[0087] │ ├─ items: JspExpression (value="users")
[0088] │ └─ var: StringLiteral (value="user")
[0089] └─ children
[0090] └─ HtmlElement (div)
[0091] └─ children
[0092] └─ JspExpression (value="user.name")
[0093] 以JSP中组件库代码片段new xxx.ui.datepicker({id:'datepicker',value:'value1', onChange:'handleChange',})为例,解析为JSP对应的AST,即第一中间代码为:
[0094] Program
[0095] └─ ExpressionStatement
[0096] └─ NewExpression
[0097] ├─ Callee: MemberExpression (xxx.ui.datepicker)
[0098] │ ├─ Object: MemberExpression (xxx.ui)
[0099] │ │ ├─ Object: Identifier (xxx)
[0100] │ │ └─ Property: Identifier (ui)
[0101] │ └─ Property: Identifier (datepicker)
[0102] └─ Arguments
[0103] └─ ObjectExpression
[0104] ├─ Property (id: 'datepicker')
[0105] ├─ Property (value: 'value1')
[0106] └─ Property (onChange: 'handleChange')
[0107] 这样,本申请通过机器学习模型,可以识别传统规则难以处理的混合代码模式,如业务逻辑与视图深度耦合的代码,减少遗漏或误分割,并且本申请基于机器学习模型可以自动分离服务端逻辑与客户端代码,为后续转换阶段提供更清晰的输入,避免无关代码干扰转换规则,而且该机器学习模型可通过反馈数据持续迭代,形成正向循环,从而可持续进行优化,提高模型处理的准确性。
[0108] 此外,传统方法需人工标注代码边界,而机器学习模型可以自动完成分类,进一步降低迁移项目启动门槛,尤其对代码风格混杂、缺乏文档的遗留系统,机器学习模型能通过模式识别提供更鲁棒的解析结果,提高迁移可行性。
[0109] 可选的,基于预设的知识库规则对第一中间代码进行转换,得到第二中间代码,包括:
[0110] 基于组件映射关系表和框架语法映射关系表对第一中间代码中的关键词进行检索匹配;
[0111] 若检索匹配成功,则从组件映射关系表和框架语法映射关系表中确定第二中间代码;
[0112] 若检索匹配未成功,则基于非结构化案例规则和 / 或自定义规则对第一中间代码进行处理,得到第二中间代码。
[0113] 示例性的,以第一中间代码为具有JSP AST语法结构的代码为例,基于大模型提取该JSP AST语法结构的代码中的组件关键词,通过在组件映射关系表中检索该组件关键词,并找到对应转换组件关键词,从而将JSP组件的AST结构按照映射关系转换为Vue组件的AST结构,例如,转换后Vue组件的AST结构对应的部分代码可以为:
[0114] VueElement (el-date-picker)
[0115] ├─ Attributes
[0116] │ ├─ VueAttribute (id='datepicker')
[0117] │ └─ VueDirective (v-model="value1")
[0118] ├─ Events
[0119] │ └─ VueEvent (@change="handleChange")
[0120] └─ Children: []
[0121] 相应的,还可以基于大模型提取该JSP AST语法结构的代码中的语法关键词,通过在框架语法映射关系表中检索该语法关键词,并找到对应转换语法关键词,从而将JSP语法的AST的代码转换为对应的Vue语法的AST的代码,例如,转换后Vue语法的AST结构对应的部分代码可以为:
[0122] {type:"VueForDirective",expression:"user in users",key:":key=\"user.id\"",children:[{type:"HtmlElement",tag:"div",children:[{type:"VueInterpolation",expression:"user.name"}]}]}。
[0123] 进一步的,若组件关键词和语法关键词均无法匹配,则可以调用非结构化案例规则或自定义规则进行处理,以生成适配的第二中间代码。
[0124] 需要说明的是,本申请实施例对进行基于组件映射关系表和框架语法映射关系表进行转换的顺序不作具体限定,其可以先进行语法映射,在进行组件转换,也可以先进行组件映射,再进行语法映射。
[0125] 这样,本申请通过优先使用结构化规则快速处理第一中间代码,保证转换效率,而针对复杂应用场景下或未定义过的第一中间代码,则可以通过非结构化案例规则和自定义规则进行转换,不仅避免了转换中断,还提升了转换覆盖率。此外,使用非结构化案例规则和 / 或自定义规则对第一中间代码进行处理,可以避免因少量无法匹配的代码导致整体转换失败,从而提升流程鲁棒性,并可以进一步减少手动处理非常规代码的需求,从而节约成本。
[0126] 可选的,非结构化案例规则和自定义规则的确定过程包括:
[0127] 获取上传的代码转换示例、企业私有代码片段和用户定制的需求信息;
[0128] 将代码转换示例和企业私有代码片段输入机器学习模型,得到非结构化案例规则;
[0129] 对需求信息进行解析,生成代码案例,将代码案例输入机器学习模型,得到自定义规则。
[0130] 需要说明的是,由于构建的知识库规则可扩展,本申请不限于JSP转Vue技术,用户还可以自定义组件映射规则,如Vue转React技术等,使得不同框架之间的组件,能够无缝转换,增强了项目的兼容性。
[0131] 可选的,代码转换示例可以为JSP到Vue转换示例,Thymeleaf到Vue转换示例,JSP到React转换示例,Thymeleaf到React转换示例等,本申请实施例对代码转换示例的具体内容和示例类型不作具体限定。
[0132] 企业私有代码片段可以指的是内部特定业务代码,用户定制需求可以指的是特殊组件和 / 或特殊语法的映射要求,本申请实施例对企业私有代码片段和用户定制需求的具体内容不作具体限定,其可以基于企业的需求和企业的类型进行设定,如银行的企业私有代码片段可以为金融部、市场部、业务部,金融科技部等各个部门对应的私有代码片段。
[0133] 示例性的,可以将代码转换示例和企业私有代码片段输入机器学习模型,如序列到序列模型或图神经网络模型,从而自动学习代码规则与转换逻辑,输出可复用的非结构化案例规则。
[0134] 可选的,该机器学习模型还可以对用户定制需求进行自然语言解析,如关键词提取、意图识别等,以生成标准化代码案例,再输入机器学习模型中推导出自定义规则。
[0135] 这样,通过机器学习模型自动从代码转换示例、企业私有代码片段和代码案例中提取转换模式,减少人工总结规则的成本和主观误差,并且机器学习模型可根据随时新增数据和需求迭代更新规则,不断提升规则覆盖率和准确性,尤其机器学习模型能识别非结构化代码中的隐含模式,解决传统规则难以处理的边缘案例。
[0136] 此外,利用私有代码片段训练模型,生成的非结构化案例规则更贴合企业内部业务逻辑,提高应用的适用性。
[0137] 可选的,第一中间代码通过树状的抽象语法结构进行表示,和 / 或,第二中间代码通过树状的抽象语法结构进行表示。
[0138] 在本申请中,通过使用树状结构,如抽象语法树AST作为中间代码的表示形式,可以精确表达代码嵌套层次,如条件分支、循环块等,确保转换前后逻辑等价。
[0139] 示例性的,第一中间代码解析为树形结构第一AST,该第一AST中每个节点对应语法单元,如标签、表达式,从而完整保留源码层次和逻辑关系。将第一AST转换后生成符合目标框架如Vue规范的树形结构第二AST,该第二AST中节点为已映射为客户端语法单元。这样,通过支持仅对源端或目标端使用树表示,或者也可两端均使用,以适配不同转换场景需求。
[0140] 由于树形结构可递归遍历,因此,结合知识规则库和树形结构可高效实现节点匹配、替换和重组,从而提升转换效率,并且树形结构中的树节点可附加转换元数据,如来源位置、规则版本等,便于跟踪转换过程和排查问题。此外,树形结构还可以表示隔离源端与目标端语法差异,使得同一套转换规则可扩展至多目标框架,从而提供应用的灵活性。
[0141] 可选的,基于第二中间代码生成第二代码,包括:
[0142] 将第二中间代码输入机器学习模型中,得到符合预设格式的第三代码;
[0143] 将第三代码进行组件拼接和语法组合,得到第二代码。
[0144] 示例性的,将第二中间代码输入预训练的大模型中,输出符合目标框架语法和工程规范的第三代码,如符合Vue规范的第三代码,进一步的,对第三代码进行结构化整合,即将生成的独立组件代码按UI层级关系组合,拼接成Vue单文件组件(.vue),并将其组合到<template>、<script>、<style>模块中,确保代码逻辑连贯性,从而输出完整、可运行的第二代码,如Vue单文件组件(Single File Component,SFC)文件或React组件文件。
[0145] 这样,本申请基于机器学习模型学习大量代码,进行智能推断和生成,生成更符合用户界面的客户端架构的代码,并且机器学习模型还能够自动化生成代码片段并组装,避免了完全依赖模板拼接可能带来的局限性,此外,机器学习模型能够在生成第二代码过程中进行一定程度的优化,如提取重复逻辑、选择更高效的实现方式等,使其更符合场景需求。
[0146] 可选的,方法还包括:
[0147] 在生成第二代码后,获取人工修正后的第四代码;
[0148] 将第二代码和第四代码进行比对验证,并基于验证结果修正知识库规则。
[0149] 示例性的,在系统自动生成第二代码后,由开发人员对其进行审查和必要的修改,形成优化后的第四代码。进一步的,系统将自动生成的第二代码与人工修正后的第四代码进行差异化比对,确定比对验证的结果,如是组件映射错误、语法转换不准确、还是基于非结构化案例规则转换结果不佳等结果,进而基于比对验证的结果,系统自动或辅助管理员对知识库规则进行迭代更新。
[0150] 例如,若发现某个服务端组件总是被错误映射,则修正组件映射关系表。若某种语法转换总是需要人工调整,则优化框架语法映射关系表。若发现一种新的、无法被现有规则处理的代码模式,则将其作为一个新的非结构化案例规则添加到知识库规则中。此外,还可以根据用户的特定修改习惯,生成新的自定义规则。
[0151] 可选的,修改通常是为了修复转换错误、优化性能或生成符合特定的规范的编码。例如,补充完善Vue文件、将重复UI结构提取为可复用组件、使用状态管理(如pinia或Vuex)替代分散的data(数据)属性、添加注释增强可读性、使用v-once(只渲染一次)或v-memo(依赖缓存)减少静态内容重渲染、懒加载异步组件等修改,以提高代码质量和性能。
[0152] 示例性的,以生成的第二代码为<template>,,<div v-for="user in users":key="user.id">,,,<el-date-picker,id="datepicker",v-model="value1",@change="handleChange" / >,,< / template>,<script>,export default {data(){return{value1:'',users:[]}},methods:{handleChange(val){}}},< / script> For example, users can optimize the generated second code to obtain the fourth code: <template>, <!--User list-->, , <div v-for="user inusers" :key="user.id"> , , , <!--Date selector-->, <el-date-picker, id="datepicker", v-model="value1", type="date", placeholder="Select date", @change="handleChange" / >, ,< / template> , <script>,export default{data(){return{value1:'',users:[{id:1,name:'XX'},{id:2,name:'XX'}]}},methods:{handleChange(val),{console.log('新日期:',val)}}},< / script> .
[0153] The second and fourth codes are compared and verified to determine the content to be optimized, and the knowledge base rules are then revised based on the optimized content.
[0154] In this way, the system can continuously learn from human feedback, achieving continuous optimization to make the next conversion result more accurate, reducing the need for future human intervention. Furthermore, by continuously learning from developers' corrections, the knowledge base rules can cover more edge cases and specific business scenarios, thereby improving the overall quality and reliability of subsequent code conversions. In addition, the system automatically generates the verification results of the second and fourth lines of code and transforms them into reusable rules. This means that the same errors will not be repeated, eliminating the need for repetitive corrections to the automatically generated code and reducing reliance on human intervention.
[0155] For example, Figure 5 A flowchart illustrating an optional code conversion method provided in this application embodiment is shown below. Figure 5 As shown, the main steps of the code conversion system to generate the target converted file (Vue code) after processing the input file (JSP code) include: code parsing, syntax mapping, component conversion, code generation, and code optimization.
[0156] It should be noted that the specific implementation principles of each of the above steps can be found in the description of the above embodiments, and will not be repeated here.
[0157] Therefore, this application uses a large model to perform semantic-level code conversion, and establishes scalable knowledge base rules and provides a two-way verification mechanism to achieve automated front-end cross-framework conversion, which effectively reduces the difficulty and workload of migration, thereby improving the accuracy, reliability and development efficiency of cross-framework front-end code conversion.
[0158] In the foregoing embodiments, the code conversion method provided by the embodiments of this application has been described. To implement the functions of the methods provided by the embodiments of this application, the electronic device serving as the execution subject may include hardware structures and / or software modules, implementing the above functions in the form of hardware structures, software modules, or a combination of hardware structures and software modules. Whether a particular function is executed in the form of hardware structures, software modules, or a combination of hardware structures and software modules depends on the specific application and design constraints of the technical solution.
[0159] For example, Figure 6 This is a schematic diagram of the structure of a code conversion device provided in an embodiment of this application. The code conversion device 600 includes:
[0160] The acquisition module 601 is used to acquire the first code to be converted, process the first code to obtain the first intermediate code; the first code is the code for the server to generate the page;
[0161] The conversion module 602 is used to convert the first intermediate code based on preset knowledge base rules to obtain the second intermediate code. The knowledge base rules include: a component mapping relationship table, a framework syntax mapping relationship table, unstructured case rules, and custom rules. The component mapping relationship table is used to perform relationship mapping based on component type, the framework syntax mapping relationship table is used to perform relationship mapping based on syntax type, the unstructured case rules are used to define the reference range for the conversion from the first intermediate code to the second intermediate code, and the custom rules are used to customize the conversion rules from the first intermediate code to the second intermediate code.
[0162] Module 603 is used to generate second code based on the second intermediate code; the second code is the code for building the client architecture of the user interface.
[0163] Optionally, module 601 is used for:
[0164] The first code is parsed based on a machine learning model to obtain at least one logical block, which includes server-side business processing logic code, client-side view template code, client-side resource code, execution script code, component library code, and front-end / back-end separation code.
[0165] The first intermediate code is constructed based on at least one logical block.
[0166] Optionally, conversion module 602 is specifically used for:
[0167] The keywords in the first intermediate code are retrieved and matched based on the component mapping table and the framework syntax mapping table;
[0168] If the retrieval is successful, the second intermediate code is determined from the component mapping table and the framework syntax mapping table;
[0169] If the search fails to find a match, the first intermediate code is processed based on unstructured case rules and / or custom rules to obtain the second intermediate code.
[0170] Optionally, the code conversion device 600 also includes a module for determining unstructured case rules and custom rules, which determines the model for:
[0171] Get uploaded code conversion examples, enterprise-owned code snippets, and user-customized requirements;
[0172] Input the code transformation example and enterprise proprietary code snippets into the machine learning model to obtain unstructured case rules;
[0173] The requirements information is parsed to generate code examples, which are then input into the machine learning model to obtain custom rules.
[0174] Optionally, the first intermediate code is represented by a tree-like abstract syntax structure, and / or the second intermediate code is represented by a tree-like abstract syntax structure.
[0175] Optionally, module 603 is generated, specifically for:
[0176] The second intermediate code is input into the machine learning model to obtain the third code that conforms to the preset format;
[0177] The third code is combined with components and syntax to obtain the second code.
[0178] Optionally, the code conversion device 600 also includes a correction module, which is used for:
[0179] After generating the second code, obtain the manually corrected fourth code;
[0180] The second and fourth codes are compared and verified, and the knowledge base rules are revised based on the verification results.
[0181] It should be noted that the specific implementation principle and effect of the above-mentioned code conversion device 600 can be found in the relevant description and effect of the above embodiments, and will not be elaborated further here.
[0182] This application also provides an electronic device. Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, the electronic device may include: a processor 701 and a memory 702 communicatively connected to the processor; the memory 702 stores a computer program; the processor 701 executes the computer program stored in the memory 702, causing the processor 701 to perform the method of any of the above embodiments.
[0183] The memory 702 and the processor 701 can be connected via bus 703.
[0184] This application also provides a computer-readable storage medium storing computer program execution instructions, which, when executed by a processor, are used to implement the methods as described in any of the foregoing embodiments of this application.
[0185] This application also provides a chip for executing instructions, which is used to perform the methods in any of the foregoing embodiments executed by an electronic device as described in any of the foregoing embodiments of this application.
[0186] This application also provides a computer program product, which includes a computer program that, when executed by a processor, can implement the methods in any of the foregoing embodiments executed by an electronic device as described in any of the foregoing embodiments of this application.
[0187] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.
[0188] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0189] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0190] The integrated modules implemented as software functional modules described above can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods provided in the various embodiments of this application.
[0191] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0192] The memory may include high-speed random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.
[0193] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0194] The aforementioned storage media can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0195] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. Both the processor and the storage medium can reside in application-specific integrated circuits (ASICs). Alternatively, the processor and storage medium can exist as discrete components in an electronic device or host device.
[0196] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0197] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0198] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0199] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
[0200] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be determined by the protection scope of the claims.< / template> < / c:if> < / c:foreach> < / c:foreach>
Claims
1. A transcoding method, characterized by, The method comprises: acquiring first code to be converted, processing the first code to obtain first intermediate code; the first code is a code for generating a page on a server; converting the first intermediate code based on a preset knowledge base rule to obtain second intermediate code; the knowledge base rule comprises: a component mapping relationship table, a framework syntax mapping relationship table, an unstructured case rule, and a custom rule, the component mapping relationship table is used for relationship mapping based on a component type, the framework syntax mapping relationship table is used for relationship mapping based on a syntax type, the unstructured case rule is used for defining a reference range for conversion of the first intermediate code to the second intermediate code, and the custom rule is used for customizing a conversion rule of the first intermediate code to the second intermediate code; generating second code based on the second intermediate code; the second code is a code for constructing a client architecture of a user interface.
2. The method of claim 1, wherein, The processing of the first code to obtain first intermediate code comprises: parsing the first code based on a machine learning model to obtain at least one logic block, the logic block comprising server business processing logic code, client view template code, client resource code, execution script code, component library code, and front-end / back-end separation code; constructing the first intermediate code based on the at least one logic block.
3. The method of claim 1, wherein, The conversion of the first intermediate code based on the preset knowledge base rule to obtain second intermediate code comprises: searching and matching a keyword in the first intermediate code based on the component mapping relationship table and the framework syntax mapping relationship table; if the search and matching is successful, determining the second intermediate code from the component mapping relationship table and the framework syntax mapping relationship table; if the search and matching is unsuccessful, processing the first intermediate code based on the unstructured case rule and / or the custom rule to obtain the second intermediate code.
4. The method of claim 1, wherein, The determination process of the unstructured case rule and the custom rule comprises: acquiring uploaded code conversion examples, enterprise private code segments, and user customized requirement information; inputting the code conversion examples and the enterprise private code segments into a machine learning model to obtain the unstructured case rule; parsing the requirement information, generating a code case, inputting the code case into the machine learning model to obtain the custom rule.
5. The method of claim 1, wherein, The first intermediate code is represented by a tree-shaped abstract syntax structure, and / or the second intermediate code is represented by a tree-shaped abstract syntax structure.
6. The method of claim 1, wherein, The generation of second code based on the second intermediate code comprises: inputting the second intermediate code into a machine learning model to obtain third code conforming to a preset format; performing component splicing and syntax combination on the third code to obtain the second code.
7. The method of claim 1, wherein, The method further comprises: after the second code is generated, acquiring fourth code that is manually corrected; comparing and verifying the second code and the fourth code, and correcting the knowledge base rule based on a verification result.
8. A transcoding device, characterized by The device comprises: An acquisition module is configured to acquire a first code to be converted, process the first code, and obtain a first intermediate code; the first code is a code for generating a page on a server side; A conversion module is configured to convert the first intermediate code based on a preset knowledge base rule, and obtain a second intermediate code; the knowledge base rule includes a component mapping relationship table, a framework syntax mapping relationship table, an unstructured case rule, and a custom rule; the component mapping relationship table is configured to perform relationship mapping based on a component type; the framework syntax mapping relationship table is configured to perform relationship mapping based on a syntax type; the unstructured case rule is configured to define a reference range for converting the first intermediate code into the second intermediate code; and the custom rule is configured to customize a conversion rule for converting the first intermediate code into the second intermediate code; A generation module is configured to generate a second code based on the second intermediate code; the second code is a code for constructing a client architecture of a user interface.
9. An electronic device, comprising: comprise: a processor, and a memory connected to the processor in communication; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by the processor to implement the method in any one of claims 1 to 7.
11. A computer program product, characterised in that, The computer program is executed by the processor to implement the method in any one of claims 1 to 7.