Transcoding method and device of window component, equipment, storage medium and computer program product

By determining and utilizing the mapping relationship between window components and page components, parsing and transforming the standard information data of component trees, the problem of low migration efficiency in application migration is solved, and a more efficient migration process is achieved.

CN119718312APending Publication Date: 2025-03-28CHINA MERCHANTS BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411672519.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

During the application migration process, the original application and development platform may adopt different development languages, resulting in low efficiency in menu function migration and slow progress in promoting migration tasks.

Method used

By determining the mapping relationship between window components and page components, analyzing window components, generating component trees, serializing, converting standard information data of component trees, and generating target pages based on page components.

Benefits of technology

It improves the efficiency of application migration, reduces time and labor costs, and lowers the migration threshold.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718312A_ABST
    Figure CN119718312A_ABST
Patent Text Reader

Abstract

The invention discloses a transcoding method and device of a window component, equipment, a storage medium and a computer program product, and relates to the technical field of software development, and the transcoding method comprises the following steps: determining a mapping relation between the window component and a page component; analyzing the window component, identifying to obtain a syntax element of the window component, and generating a component tree of the window component based on the syntax element; serializing the component tree to generate standard information data of the component tree; and based on the mapping relationship between the window component and the page component, carrying out conversion operation on the standard information data of the component tree, and generating a target page based on the page component. According to the application, development transcoding of the window function is carried out through instrumentalization, and the migration efficiency can be improved during application migration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology, and in particular to a method, device, equipment, storage medium and computer program product for transcoding a window component. Background Art

[0002] As software development technology matures, many development platforms are widely used. Enterprises need to migrate large quantities of menu functions of original applications to development platforms. However, the original applications have accumulated a large amount of business logic and functional modules. However, with the development of technology and changes in business needs, enterprises need to migrate these functions to a more modern, flexible and easy-to-maintain development platform to better support the rapid development and changes of the business.

[0003] However, during the migration process, the original application and the development platform may use different development languages. If the large number of menu functions in the application are migrated to the platform and developed according to the original application functions, it will take a lot of time and manpower. In addition, the knowledge stack of the development platform and the knowledge stack of the original application may be completely different, which will increase the migration threshold and slow down the progress of the migration task.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present application is to provide a window component transcoding method, device, equipment, storage medium and computer program product, aiming to solve the technical problem of low migration efficiency during application migration.

[0006] To achieve the above object, the present application proposes a window component transcoding method, the method comprising:

[0007] Determine the mapping relationship between window components and page components;

[0008] Parsing the window component, identifying syntax elements of the window component, and generating a component tree of the window component based on the syntax elements;

[0009] Serializing the component tree to generate standard information data of the component tree;

[0010] Based on the mapping relationship between the window component and the page component, a conversion operation is performed on the standard information data of the component tree to generate a target page based on the page component.

[0011] In one embodiment, the step of determining the mapping relationship between the window component and the page component includes:

[0012] Determine a window component of an initial window and a first attribute of the window component;

[0013] Determine a page component of a target page and a second attribute of the page component;

[0014] Based on the first attribute of the window component and the second attribute of the page component, a mapping relationship between the window component and the page component is established.

[0015] In one embodiment, the steps of parsing the window component, identifying the syntax elements of the window component, and generating the component tree of the window component based on the syntax elements include:

[0016] Obtaining the initial source code file of the window component;

[0017] Parsing the initial source code file by a syntax parser to obtain syntax elements of the initial source code file;

[0018] The syntax elements of the initial source code file are analyzed and screened to obtain a component tree of the window component.

[0019] In one embodiment, the step of serializing the component tree to generate standard information data of the component tree includes:

[0020] Obtaining a window component in the component tree and a first attribute of the window component;

[0021] Creating an intermediate object based on the window component in the component tree, and configuring an object property of the intermediate object based on a first property of the window component;

[0022] Based on the intermediate objects of the component tree and the object attributes of the intermediate objects, standard information data of the component tree is obtained.

[0023] In one embodiment, the step of converting the standard information data of the component tree based on the mapping relationship between the window component and the page component to generate a target page based on the page component includes:

[0024] Determine the grammatical rules of the domain-specific language of the target page;

[0025] Based on the mapping relationship between the window component and the page component, converting the standard information data into a domain-specific language source code of a target page through the grammar rule;

[0026] Verifying the domain specific language source code by using a syntax parser of the target page;

[0027] When the verification of the domain specific language source code is passed, the domain specific language source code is run on the target platform to obtain the target page.

[0028] In one embodiment, the step of analyzing and screening the syntax elements of the initial source code file to obtain the component tree of the window component includes:

[0029] Performing relationship analysis based on syntax elements of the initial source code file to obtain a syntax tree of the initial source code file;

[0030] According to target requirements, key components of the initial source code file are extracted from the syntax tree, and screening and simplifying operations are performed on the key components to construct a component tree of the window component.

[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a transcoding device for a window component, and the transcoding device for the window component includes:

[0032] A mapping determination module, used to determine the mapping relationship between the window component and the page component;

[0033] A parsing and identifying module, used for parsing the window component, identifying the syntax elements of the window component, and generating a component tree of the window component based on the syntax elements;

[0034] A data sequence module, used for serializing the component tree to generate standard information data of the component tree;

[0035] The page generation module is used to perform a conversion operation on the standard information data of the component tree based on the mapping relationship between the window component and the page component, so as to generate a target page based on the page component.

[0036] In addition, to achieve the above-mentioned purpose, the present application also proposes a transcoding device for a window component, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the transcoding method for the window component as described above.

[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the window component transcoding method described above are implemented.

[0038] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the window component transcoding method described above are implemented.

[0039] One or more technical solutions proposed in this application have at least the following technical effects:

[0040] The embodiment of the present application proposes a transcoding method, device, equipment, storage medium and computer program product for a window component, which determines the mapping relationship between the window component and the page component; parses the window component, identifies the syntax elements of the window component, and generates a component tree of the window component based on the syntax elements; serializes the component tree to generate standard information data of the component tree; based on the mapping relationship between the window component and the page component, converts the standard information data of the component tree to generate a target page based on the page component. The present application transcodes the development of window functions through tooling, which can improve the efficiency of migration during application migration. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0042] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0043] Figure 1 A flowchart diagram of a first embodiment of a method for transcoding a window component of the present application;

[0044] Figure 2 A schematic diagram of the module structure of the transcoding device of the window component of the embodiment of the present application;

[0045] Figure 3 This is a schematic diagram of the device structure of the hardware operating environment involved in the transcoding method of the window component in the embodiment of the present application.

[0046] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0049] The main solution of the embodiment of the present application is: determine the mapping relationship between the window component and the page component; parse the window component, identify the syntax elements of the window component, and generate a component tree of the window component based on the syntax elements; serialize the component tree to generate standard information data of the component tree; based on the mapping relationship between the window component and the page component, convert the standard information data of the component tree to generate a target page based on the page component.

[0050] In this embodiment, for the convenience of description, the following description is made by taking the transcoding device for identifying the window component as the execution subject.

[0051] As software development technology matures, many development platforms are widely promoted and used. Enterprises need to migrate large quantities of menu functions of original applications to development platforms. Original applications have accumulated a large amount of business logic and functional modules. However, with the development of technology and changes in business needs, enterprises need to migrate these functions to more modern, flexible and easy-to-maintain development platforms to better support the rapid development and changes of the business.

[0052] However, during the migration process, the original application and the development platform may use different development languages. If the large number of menu functions in the application are migrated to the platform and developed according to the original application functions, it will take a lot of time and manpower. In addition, the knowledge stack of the development platform and the knowledge stack of the original application may be completely different, which will increase the migration threshold and slow down the progress of the migration task.

[0053] This application provides a solution that can improve the efficiency of migration during application migration by tooling the development and transcoding of window functions.

[0054] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a transcoding device of a window component, etc. The following takes the transcoding device of a window component as an example to illustrate this embodiment and the following embodiments.

[0055] Based on this, the embodiment of the present application provides a method for transcoding a window component, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the transcoding method of the window component of the present application.

[0056] In this embodiment, the window component transcoding method includes steps S10 to S40:

[0057] Step S10, determining the mapping relationship between the window component and the page component.

[0058] It should be noted that the window component refers to a component of the window interface of the application to be migrated, is a basic element constituting the window interface, and is responsible for realizing various functions of the window.

[0059] In addition, it should be noted that the page component refers to the component in the application page after the application to be migrated is migrated to the target platform, which is the basic element of the page and is responsible for implementing various functions of the page. Among them, the target platform refers to the development platform for new development of the original application.

[0060] Specifically, the window component of the initial window and the first attribute of the window component are determined; the page component of the target page and the second attribute of the page component are determined; and based on the first attribute of the window component and the second attribute of the page component, a mapping relationship between the window component and the page component is established.

[0061] Step S20: parse the window component, identify the syntax elements of the window component, and generate a component tree of the window component based on the syntax elements.

[0062] It should be noted that the syntax elements of a window component refer to the basic units in the initial source code file of the window component, and the syntax elements include but are not limited to expressions, statements, declarations, etc.

[0063] Among them, an expression is a sequence of operators, operands (such as variables, constants), function calls, etc., which is used to calculate and return a value; for example, in C#, a+b*c is an expression, where + and * are operators, and a, b, and c are operands. Statements are instructions in the initial source code for performing specific operations; for example, statements can be assignment statements (such as x=5), conditional statements (such as if(a>b)), loop statements (such as for(int i=0; i<10; i++)), etc. Declarations are parts of the initial source code used to define entities such as variables, functions, classes, interfaces, etc.; for example, in C#, int x is a variable declaration, and voidMyFunction() is a function declaration.

[0064] In addition, it should be noted that the component tree refers to ComponentTree, which is a data structure used to represent the hierarchical relationship between components and their subcomponents. In software development, especially in user interface (UI) design and development, ComponentTree is used to organize and manage interface elements. It usually contains information such as the name, properties, subcomponents, etc. of the component, forming a tree structure, so that developers can easily add, delete and modify components. In this application, the component tree is to parse the window components, parse and identify the various grammatical elements in the code, such as expressions, statements, declarations, etc., and organize these elements into a grammatical tree.

[0065] Specifically, an initial source code file of the window component is obtained; the initial source code file is parsed by a syntax parser to obtain syntax elements of the initial source code file; and the syntax elements of the initial source code file are analyzed and screened to obtain a component tree of the window component.

[0066] Step S30, serializing the component tree to generate standard information data of the component tree.

[0067] It should be noted that the standard information data refers to the data obtained by converting the component tree of the ComponentTree data structure into a string in JSON (JavaScript Object Notation) format. JSON is a lightweight data exchange format that is easy for people to read and write, and easy for machines to parse and generate. It is based on a subset of the JavaScript programming language, but it is language independent. Many different programming languages ​​support the generation and parsing of JSON data.

[0068] Specifically, the window component in the component tree and the first attribute of the window component are obtained; an intermediate object is created based on the window component in the component tree, and the object attribute of the intermediate object is configured based on the first attribute of the window component; and standard information data of the component tree is obtained based on the intermediate object of the component tree and the object attribute of the intermediate object.

[0069] Step S40: Based on the mapping relationship between the window component and the page component, convert the standard information data of the component tree to generate a target page based on the page component.

[0070] It should be noted that the target page refers to a running page obtained by converting the initial window of the application to be migrated on the target platform after the application to be migrated is migrated to the target platform for running.

[0071] Specifically, the grammatical rules of the domain-specific language of the target page are determined; based on the mapping relationship between the window component and the page component, the standard information data is converted into the domain-specific language source code of the target page through the grammatical rules; the domain-specific language source code is verified through the grammatical parser of the target page; when the verification of the domain-specific language source code is passed, the domain-specific language source code is run on the target platform to obtain the target page.

[0072] This embodiment uses the above scheme to determine the mapping relationship between the window component and the page component; parse the window component, identify the syntax elements of the window component, and generate the component tree of the window component based on the syntax elements; serialize the component tree to generate standard information data of the component tree; based on the mapping relationship between the window component and the page component, convert the standard information data of the component tree to generate a target page based on the page component. This application uses tooling to develop and transcode window functions, which can improve the efficiency of migration during application migration.

[0073] Based on the above implementation scheme, in a feasible implementation manner, the step of determining the mapping relationship between the window component and the page component includes steps S11 to S13:

[0074] Step S11, determining the window component of the initial window and the first attribute of the window component.

[0075] It should be noted that the initial window refers to the window interface of the application to be migrated, which is used to display and operate the functions of the application.

[0076] In addition, it should be noted that the first attribute of the window component refers to the component attributes of the window component, which describe the characteristics of the window component, such as type (such as text box, button, tab, etc.), name, position, size, visibility, whether to enable, event handler, etc.

[0077] For example, CMBRun2.Controls2.CMBTabControl.CMBTabControl has properties such as the number of tabs, the index of the currently selected tab, etc.; CMBRun2.DeviceControls.FP.FPTextBox has properties such as text content, font, color, etc.

[0078] Specifically, a series of initial windows that need to be migrated for the application to be migrated are determined, the types and properties of all windows are determined, and the components and properties contained in each window are determined.

[0079] Step S12, determining the page component of the target page and the second attribute of the page component.

[0080] It should be noted that the target page refers to the application page after the application to be migrated is migrated to the target platform.

[0081] In addition, it should be noted that the second attribute of the page component refers to the component attributes of the page component, which describe the characteristics of the page component, such as type (such as text box, button, tab, etc.), name, position, size, visibility, whether to enable, event handler, etc.

[0082] For example, the page type has attributes such as page title, page layout, etc.; the tabs type has attributes such as tab list, current active tab, etc.; the input type has attributes such as input value, placeholder text, input type (such as password, number, etc.), etc.

[0083] Specifically, the target page of the target platform is determined based on a series of initial windows in the application to be migrated, the type and attributes of the target page are determined, and the type and attributes of the page component of the target page are determined based on the window component of the initial window. At the same time, basic functions are preset for the target page. Basic functions are a set of predefined general functions or methods to improve code reusability and reduce duplicate code. These functions can perform common operations such as string processing, data validation, mathematical calculations, etc.

[0084] Step S13: establishing a mapping relationship between the window component and the page component based on the first attribute of the window component and the second attribute of the page component.

[0085] Specifically, a correspondence between window components and page components is established based on the window components of the initial window and the first attributes of the window components, as well as the page components of the target page and the second attributes of the page components; the component types of the application to be migrated and the target platform are compared, their properties and behaviors are analyzed, and the mapping relationship is determined; for components that cannot be directly matched, the components are marked, and consideration is given to whether special processing is required.

[0086] In one embodiment of the present application, the application to be migrated is the CMBRUN platform, which is an important system used by China Merchants Bank to process core business data, support banking operations and customer service. It covers many aspects of banking business, including but not limited to account management, transaction processing, risk management, etc. In the CMBRUN platform, two programming languages, Delphi and C#, are used to develop application program interfaces. Delphi is an object-oriented programming language, particularly suitable for developing Windows applications. Delphi provides a rich library of controls and components, allowing developers to quickly build applications with complete functions and beautiful interfaces; in CMBRUN1, Delphi is used to develop various window interfaces, which include various menus, dialog boxes, buttons, etc., for interacting with users. C# is a general object-oriented programming language, which is part of the Microsoft .NET framework. The C# language combines the powerful functions of C++ and the ease of use of Visual Basic, allowing developers to quickly develop efficient and secure applications; in CMBRUN2, C# is used to develop various window interfaces, which also include various menus, dialog boxes, buttons, etc., for interacting with users.

[0087] The target platform is the Kaiyang Service Development Platform, which integrates a variety of development tools, technical resources and services to form an integrated development environment. It provides software developers with services throughout the entire software life cycle, from code writing to testing, debugging, and publishing. Developers can develop projects on this platform without having to worry about the underlying technical details, so that they can focus more on the implementation of business logic. It has core functions such as integrated development environment, cloud services and resources, debugging and debugging tools, and marketing and promotion.

[0088] For example, Run2BaseForm in the window component is mapped to the page type in the page component: it means that the basic window in CMBRUN2 corresponds to a page in the Kaiyang service-oriented development platform;

[0089] CMBRun2.Controls2.CMBTabControl.CMBTabControl in the window component is mapped to the tabs type in the page component: it means that the tab control in CMBRUN2 corresponds to a tab page collection in the Kaiyang service-oriented development platform;

[0090] In the window component, CMBRun2.Controls2.CMBTabControl.CMBTabPage is mapped to the tabpane type in the page component: it means that the tab page in CMBRUN2 corresponds to a specific tab page in the Kaiyang Service Development Platform;

[0091] In the window component, CMBRun2.Controls2.CMBPanel is mapped to p type in the page component: it means that the panel in CMBRUN2 corresponds to a panel in the Kaiyang service-oriented development platform;

[0092] CMBRun2.Controls2.OprControl.CMBOprButton in the window component is mapped to the button type in the page component: it means that a button in CMBRUN2 corresponds to a button in the Kaiyang Service Development Platform;

[0093] In the window component, CMBRun2.DeviceControls.FP.FPTextBox is mapped to the input type in the page component: it represents a text box control in CMBRUN2, which is used to input text. In the Kaiyang service-oriented development platform, it corresponds to the input type, which is used to input text.

[0094] In addition, for some window components in CMBRun2 that have no corresponding types under the current mapping rules, they are marked with "*Ignore*", indicating that these elements may be ignored or require special processing in the subsequent mapping process.

[0095] Based on the above implementation scheme, in a feasible implementation manner, parsing the window component, identifying the syntax elements of the window component, and generating the component tree of the window component based on the syntax elements includes steps S21 to S23:

[0096] Step S21, obtaining the initial source code file of the window component.

[0097] It should be noted that the initial source code file of the window component refers to the source code file of the application to be migrated, and the source code file contains the complete implementation of the application, including user interface design, business logic, data processing, etc.

[0098] Specifically, the initial source code file of the initial window is obtained from the background of the application to be migrated. In one embodiment of the present application, the application to be migrated is the CMBRUN platform, CMBRUN1 is a page developed using Delphi in the CMBRUN platform, CMBRUN2 is a page developed using C# in the CMBRUN platform, and the CMBRUN1 source code file and the CMBRUN2 source code file are obtained as the initial source code files.

[0099] Step S22: parsing the initial source code file by a syntax parser to obtain syntax elements of the initial source code file.

[0100] It should be noted that the syntax parser is used to process the initial source code file, and can perform in-depth analysis on the source code, identify various syntax elements therein, and analyze the relationships between these elements.

[0101] Specifically, the initial source code file is converted into a series of lexical units through a syntax analyzer. These units are the smallest grammatical elements in the source code, such as keywords, identifiers, operators, separators, etc.

[0102] Step S23, analyzing and screening the syntax elements of the initial source code file to obtain a component tree of the window component.

[0103] Specifically, a relationship analysis is performed based on the syntax elements of the initial source code file to obtain a syntax tree of the initial source code file; key components of the initial source code file are extracted from the syntax tree according to target requirements, and the key components are screened and simplified to construct a component tree of the window component.

[0104] Based on the above implementation scheme, in a feasible implementation manner, the analyzing and screening based on the syntax elements of the initial source code file to obtain the component tree of the window component includes steps S231 to S232:

[0105] Step S231 , performing relationship analysis based on syntax elements of the initial source code file to obtain a syntax tree of the initial source code file.

[0106] It should be noted that the syntax tree of the initial source code file is a tree data structure used to represent the relationship between syntax elements in the initial source code file. Each node of the syntax tree represents a syntax element in the source code. These elements can be expressions, statements, declarations, etc.; the type of node depends on the type of syntax element it represents. The edges of the syntax tree represent the parent-child relationship between nodes; in the source code, a syntax element may contain other syntax elements (such as a statement may contain multiple expressions), and this inclusion relationship is represented by edges in the syntax tree. The syntax tree has a hierarchical structure, which reflects the nested relationship of syntax elements in the source code; for example, a method declaration may contain multiple statements, and each statement may contain multiple expressions. These relationships are represented in the syntax tree by the hierarchy of nodes.

[0107] Specifically, according to the grammatical rules of the language, lexical units are organized into a syntax tree; each node in the syntax tree represents a syntax element, such as a variable declaration, expression, statement, etc.; the relationships between elements, such as parent-child relationships, sibling relationships, etc., are analyzed and reflected in the syntax tree.

[0108] Step S232, extracting key components of the initial source code file from the syntax tree according to target requirements, performing screening and simplification operations on the key components, and constructing a component tree of the window component.

[0109] It should be noted that the target requirement refers to the specific requirement based on which the component tree is constructed. For example, when the target requirement is to migrate only the core functions of the application to be migrated to the target platform, only the window components related to the core functions need to be extracted from the initial source code file as key components.

[0110] Specifically, the target requirements are determined, and the window components related to the target requirements are determined according to the target requirements. The key components and their attribute information are extracted from the syntax tree according to the target requirements. Then, the extracted key components and their attribute information are subjected to secondary processing such as filtering, screening, and hierarchical simplification. The component tree is constructed based on the components after secondary processing, and the component tree will be more focused on the core elements and attributes required by the target requirements.

[0111] Based on the above implementation scheme, in a feasible implementation manner, the serializing the component tree to generate standard information data of the component tree includes steps S31 to S33:

[0112] Step S31, obtaining the window component in the component tree and the first attribute of the window component.

[0113] Specifically, the window component and the component properties corresponding to the window component are obtained from the component tree.

[0114] Step S32: creating an intermediate object based on the window component in the component tree, and configuring the object property of the intermediate object based on the first property of the window component.

[0115] It should be noted that the intermediate object refers to a JSON object corresponding to each window component in the process of converting the component tree of the ComponentTree data structure into a string in JSON (JavaScript Object Notation) format, and the JSON object is the intermediate object.

[0116] In addition, it should be noted that the object attributes refer to the attribute information of each JSON object, including but not limited to component type, component style and behavior, component subcomponent array, etc. In one embodiment of the present application, componentName is used to define the component type, such as button, text box, table, etc.; props is used to define the component style and behavior, color, size, font, click event, etc.; children is used to define the subcomponent array of the component, and when the component is nested, the subcomponent array is stored.

[0117] Specifically, a window component in the component tree is obtained, a JSON object is created based on the obtained window component, and an object property of the JSON object is configured based on a first property of the window component.

[0118] Step S33: obtaining standard information data of the component tree based on the intermediate objects of the component tree and the object attributes of the intermediate objects.

[0119] Specifically, the obtained JSON object and the object attributes of the JSON object together constitute the standard information data of the component tree, that is, the JSON format file of the component tree.

[0120] Based on the above implementation scheme, in a feasible implementation manner, based on the mapping relationship between the window component and the page component, converting the standard information data of the component tree to generate a target page based on the page component includes steps S41 to S44:

[0121] Step S41, determining the grammatical rules of the domain specific language of the target page.

[0122] It should be noted that the domain-specific language refers to DSL (Domain-Specific Language), which is a programming language designed for problems in a specific domain.

[0123] Specifically, the grammatical rules of the domain-specific language of the target page of the target platform are sorted out, such as component declaration, property setting, sub-component nesting, etc.

[0124] Step S42: based on the mapping relationship between the window component and the page component, convert the standard information data into a domain-specific language source code of the target page through the grammar rule.

[0125] Specifically, based on the mapping relationship between the window component and the page component, the source code generator converts the standard information data of the initial window into the DSL source code of the target page.

[0126] Step S43: verifying the domain specific language source code through the syntax parser of the target page.

[0127] Specifically, a syntax parser is used to perform syntax checking on the generated DSL source code to verify whether the DSL source code conforms to the syntax rules of the DSL. If the verification fails, the error in the DSL source code is corrected according to the error information provided by the parser; if the verification succeeds, the DSL source code is run.

[0128] Step S44: when the verification of the domain specific language source code is passed, the domain specific language source code is run on the target platform to obtain the target page.

[0129] Specifically, the verified DSL source code is uploaded to the target platform, and the DSL source code is executed on the target platform to generate the target page. In one embodiment of the present application, the DSL source code is copied to the Kaiyang service-oriented development platform for execution to generate a preview target page.

[0130] This application also provides a transcoding device for a window component, please refer to Figure 2 , the transcoding device of the window component includes:

[0131] A mapping determination module 201 is used to determine a mapping relationship between a window component and a page component;

[0132] A parsing and identifying module 202, configured to parse the window component, identify the syntax elements of the window component, and generate a component tree of the window component based on the syntax elements;

[0133] A data sequence module 203, used to serialize the component tree and generate standard information data of the component tree;

[0134] The page generation module 204 is used to perform a conversion operation on the standard information data of the component tree based on the mapping relationship between the window component and the page component, and generate a target page based on the page component.

[0135] The transcoding device of the window component provided by the present application adopts the transcoding method of the window component in the above embodiment, which can solve the technical problem of low migration efficiency during application migration. Compared with the prior art, the beneficial effects of the transcoding device of the window component provided by the present application are the same as the beneficial effects of the transcoding method of the window component provided by the above embodiment, and other technical features in the transcoding device of the window component are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0136] The present application provides a transcoding device for a window component, the transcoding device for the window component comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the transcoding method for the window component in the above-mentioned embodiment 1.

[0137] Reference below Figure 3 , which shows a schematic diagram of the structure of a transcoding device suitable for implementing the window component of the embodiment of the present application. The transcoding device of the window component in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The transcoding device of the window component shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0138] like Figure 3As shown, the transcoding device of the window component may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the transcoding device of the window component are also stored in RAM1004. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the transcoding device of the window component to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a transcoding device of the window component with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.

[0139] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0140] The transcoding device of the window component provided by the present application adopts the transcoding method of the window component in the above embodiment, which can solve the technical problem of low migration efficiency during application migration. Compared with the prior art, the beneficial effects of the transcoding device of the window component provided by the present application are the same as the beneficial effects of the transcoding method of the window component provided by the above embodiment, and other technical features in the transcoding device of the window component are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0141] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0142] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0143] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the window component transcoding method in the above-mentioned embodiment.

[0144] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0145] The computer-readable storage medium may be included in the transcoding device of the window component; or may exist independently without being assembled into the transcoding device of the window component.

[0146] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the transcoding device of the window component, the transcoding device of the window component: determines the mapping relationship between the window component and the page component; parses the window component, identifies the syntax elements of the window component, and generates a component tree of the window component based on the syntax elements; serializes the component tree to generate standard information data of the component tree; based on the mapping relationship between the window component and the page component, converts the standard information data of the component tree to generate a target page based on the page component.

[0147] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0148] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0149] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0150] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned window component transcoding method, and can solve the technical problem of low migration efficiency during application migration. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the window component transcoding method provided by the above-mentioned embodiment, and will not be repeated here.

[0151] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned window component transcoding method when executed by a processor.

[0152] The computer program product provided by the present application can solve the technical problem of low migration efficiency during application migration. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the window component transcoding method provided by the above embodiment, which will not be repeated here.

[0153] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A window component transcoding method, characterized in that: The method comprises: Determine the mapping relationship between window components and page components; Parsing the window component, identifying syntax elements of the window component, and generating a component tree of the window component based on the syntax elements; Serializing the component tree to generate standard information data of the component tree; Based on the mapping relationship between the window component and the page component, a conversion operation is performed on the standard information data of the component tree to generate a target page based on the page component.

2. The method according to claim 1, characterized in that The step of determining the mapping relationship between the window component and the page component comprises: Determine a window component of an initial window and a first attribute of the window component; Determine a page component of a target page and a second attribute of the page component; Based on the first attribute of the window component and the second attribute of the page component, a mapping relationship between the window component and the page component is established.

3. The method according to claim 1, characterized in that The steps of parsing the window component, identifying the syntax elements of the window component, and generating the component tree of the window component based on the syntax elements include: Obtaining the initial source code file of the window component; Parsing the initial source code file by a syntax parser to obtain syntax elements of the initial source code file; The syntax elements of the initial source code file are analyzed and screened to obtain a component tree of the window component.

4. The method according to claim 1, characterized in that The step of serializing the component tree to generate standard information data of the component tree comprises: Obtaining a window component in the component tree and a first attribute of the window component; Creating an intermediate object based on the window component in the component tree, and configuring an object property of the intermediate object based on a first property of the window component; Based on the intermediate objects of the component tree and the object attributes of the intermediate objects, standard information data of the component tree is obtained.

5. The method according to claim 1, characterized in that The step of converting the standard information data of the component tree based on the mapping relationship between the window component and the page component to generate a target page based on the page component includes: Determine the grammatical rules of the domain-specific language of the target page; Based on the mapping relationship between the window component and the page component, converting the standard information data into a domain-specific language source code of a target page through the grammar rule; Verifying the domain specific language source code by using a syntax parser of the target page; When the verification of the domain specific language source code is passed, the domain specific language source code is run on the target platform to obtain the target page.

6. The method according to claim 3, characterized in that The step of analyzing and screening the syntax elements of the initial source code file to obtain the component tree of the window component comprises: Performing relationship analysis based on syntax elements of the initial source code file to obtain a syntax tree of the initial source code file; According to target requirements, key components of the initial source code file are extracted from the syntax tree, and screening and simplifying operations are performed on the key components to construct a component tree of the window component.

7. A transcoding device for a window component, characterized in that: The device comprises: A mapping determination module, used to determine the mapping relationship between the window component and the page component; A parsing and identifying module, used for parsing the window component, identifying the syntax elements of the window component, and generating a component tree of the window component based on the syntax elements; A data sequence module, used for serializing the component tree to generate standard information data of the component tree; The page generation module is used to perform a conversion operation on the standard information data of the component tree based on the mapping relationship between the window component and the page component, so as to generate a target page based on the page component.

8. A transcoding device for a window component, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the window component transcoding method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the window component transcoding method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the window component transcoding method according to any one of claims 1 to 6 are implemented.