Component processing method and device, computer readable medium and electronic equipment
By automatically obtaining and parsing component generation information, generating target components and verifying it, the problems of low component development efficiency and waste of resources are solved, and efficient and automated component development and verification are achieved.
Patent Information
- Application Number
- CN202310691890.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2024-12-13
AI Technical Summary
There are problems of inefficiency and waste of resources during component development, mainly due to the need for a lot of manual operations and repeated development of the same type of components.
By obtaining component generation information, determining component type and data storage path, obtaining component object data and parsing it to generate target components, realizing the automatic development of components, reducing manual operations, and automatically verifying component input data through verification rules.
Improve component development efficiency, avoid duplicate development of the same type of components, and enhance the verification efficiency and accuracy of component data.
Smart Images

Figure CN119127164A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to a component processing method, device, computer-readable medium, and electronic device. Background Art
[0002] A component is a functional unit that can realize a specific function and is often used in the software development process. Currently, to generate a component during the development process, developers usually need to manually develop and compile it. When modifying or adding a component, developers also need to locate the module where the component is located and then manually modify or add it. It can be seen that the component development process involves a lot of manual operations, resulting in low component development efficiency. In addition, it is possible to repeatedly develop components with similar content, which in turn causes a waste of system resources. Summary of the invention
[0003] The purpose of the present application is to provide a component processing method, device, computer-readable medium and electronic device to optimize the technical problem of low component development efficiency in related technologies.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a component processing method is provided, including:
[0006] Acquire component generation information, where the component generation information includes a target component type corresponding to the target component to be generated;
[0007] Determine the data storage path of the target component according to the mapping relationship between the component type and the component data storage path, and the target component type included in the component generation information;
[0008] Acquire component object data of the target component according to the data storage path of the target component;
[0009] The component object data is parsed, and the target component is generated according to the parsing result.
[0010] According to one aspect of an embodiment of the present application, a processing device for a component is provided, including:
[0011] A component information acquisition module, used to acquire component generation information, wherein the component generation information includes a target component type corresponding to a target component to be generated;
[0012] A component path determination module, used to determine the data storage path of the target component according to the mapping relationship between the component type and the component data storage path, and the target component type included in the component generation information;
[0013] A component object data acquisition module, used for acquiring the component object data of the target component according to the data storage path of the target component;
[0014] The component generation module is used to parse the component object data and generate the target component according to the parsing result.
[0015] In one embodiment of the present application, the component generation module includes:
[0016] A field path acquisition unit, used to acquire a component field path contained in the component object data from the component object data; the component field path is used to describe the structure of the target component;
[0017] A field path parsing unit, used to parse the component field path to obtain a target component structure;
[0018] The parsing result generating unit is used to use the target component structure and the target component data obtained through the target component type as the parsing result.
[0019] In one embodiment of the present application, the component field path includes a container array for describing component content; the field path parsing unit is specifically used to:
[0020] Parsing the container array contained in the component field path to obtain a secondary array contained in the container array, wherein the secondary array is used to describe the component content of the next level structure corresponding to the container array;
[0021] Parsing the secondary array to obtain array elements contained in the secondary array; the array elements are used to describe the minimum data unit or minimum data unit set in the target component structure;
[0022] The array elements contained in the secondary array are parsed, and the target component structure is constructed according to the parsing results of the array elements contained in the secondary array.
[0023] In one embodiment of the present application, the field path parsing unit is further used to:
[0024] Obtaining content data contained in the array elements from the array elements contained in the secondary array;
[0025] If the content data contained in the array element is target attribute data pointing to the smallest data unit, the target attribute data is used as the parsing result of the level where the array element is located;
[0026] If the content data contained in the array element is array type data pointing to a minimum data unit set, the array element is further parsed as a secondary array;
[0027] The parsing results of the array elements included in the secondary array are generated according to the parsing results of each level.
[0028] In one embodiment of the present application, the on-the-job further includes:
[0029] A target verification component generation module, used to generate a target verification component corresponding to the target component according to the target component type and the mapping relationship between the component type and the verification rule;
[0030] The association module is used to associate the target component with the target verification component so as to verify the data content input into the target component through the target verification component.
[0031] In one embodiment of the present application, the target verification component generation module includes:
[0032] A first verification rule acquisition unit, configured to acquire a first verification rule corresponding to the target component according to the target component type and a mapping relationship between the component type and the verification rule;
[0033] A second verification rule acquisition unit, configured to acquire a second verification rule corresponding to the target component according to the component identifier of the target component; the verification range of the first verification rule is greater than the verification range of the second verification rule;
[0034] A target verification component generating unit is used to generate a target verification component corresponding to the target component according to the first verification rule and the second verification rule.
[0035] In one embodiment of the present application, the target verification component generation unit is specifically used to:
[0036] Merging the first verification rule and the second verification rule to obtain a target verification rule corresponding to the target component;
[0037] The target verification rule is parsed to generate the target verification component.
[0038] In one embodiment of the present application, the target verification component generation unit is further used to:
[0039] Converting a first rule field in the target verification rule into a second rule field in a preset format, wherein the second rule field includes a logical operator;
[0040] Obtaining mathematical verification operation rules and text description information corresponding to the logical operator;
[0041] The target verification component is generated according to the second rule field, the mathematical verification operation rule and the text description information.
[0042] In one embodiment of the present application, the target verification component is specifically used for:
[0043] Detecting data content inputted into the target component;
[0044] Calling a target verification component associated with the target component to verify the input data content;
[0045] Output the verification result prompt information according to the verification result.
[0046] In one embodiment of the present application, the target verification component includes a target verification rule and text description information corresponding to the target verification rule; the target verification component is also used to:
[0047] When verification of the input data content fails, determining a target verification rule that causes the verification failure;
[0048] The text description information corresponding to the target verification rule causing the verification failure is used as the verification result prompt information.
[0049] In one embodiment of the present application, the device further includes:
[0050] The data saving module is used to obtain the output data generated by the target component based on the input data content when the input data content is successfully verified; and save the output data.
[0051] In one embodiment of the present application, the output data is nested data; and the data storage module is specifically used to:
[0052] Generate a nested field path corresponding to the nested data according to the nested relationship of the data contained in the nested data;
[0053] A parameter object is generated according to the nested field path and the value of the output data, and the parameter object is saved.
[0054] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processing method of the component in the above technical solution is implemented.
[0055] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor executes the executable instructions so that the electronic device executes a processing method of a component in the above technical solution.
[0056] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the processing method of the component in the above technical solution.
[0057] In the technical solution provided in the embodiment of the present application, the target component type is obtained from the component generation information, and then the data storage path of the target component is determined according to the mapping relationship between the component type and the component data storage path, and the target component type, and then the component object data is obtained based on the data storage path, and finally the component object data is parsed to generate the target component, thereby realizing the function of automatically generating the required target component according to the component type, reducing manual operations in the component development process, and thus improving the component development efficiency; at the same time, components of the same type can be reused, avoiding repeated development of components of the same type in the component development process, and can further improve the component development efficiency.
[0058] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0060] Figure 1 The exemplary system architecture block diagram applying the technical solution of the present application is schematically shown.
[0061] Figure 2 A flowchart of a component processing method provided by an embodiment of the present application is schematically shown.
[0062] Figure 3 A timing diagram schematically illustrates a component field path parsing process provided by an embodiment of the present application.
[0063] Figure 4 A flowchart of a component processing method provided by an embodiment of the present application is schematically shown.
[0064] Figure 5 A timing diagram schematically illustrates a verification process of component input data provided by an embodiment of the present application.
[0065] Figure 6 A timing diagram schematically illustrates a processing method of a component provided in an embodiment of the present application.
[0066] Figure 7 A timing diagram schematically illustrates a processing method of a component provided in an embodiment of the present application.
[0067] Figure 8 The flowchart schematically shows the application process of the technical solution of the present application in an application scenario.
[0068] Fig. 9 The flowchart schematically shows the application process of the technical solution of the present application in another application scenario.
[0069] Fig.10 A flowchart schematically shows the application process of the technical solution of the present application in another application scenario.
[0070] Fig.11 The structural block diagram of the processing device of the component provided in the embodiment of the present application is schematically shown.
[0071] Fig.12 The structure block diagram of a computer system suitable for implementing an electronic device of an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0072] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0073] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0074] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0075] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0076] Figure 1 The exemplary system architecture block diagram applying the technical solution of the present application is schematically shown.
[0077] like Figure 1 As shown, the system architecture 100 may include a terminal device 110, a network 120, and a server 130. The terminal device 110 may include a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The server 130 may be an independent physical server, or a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in this application. The network 120 may be a communication medium of various connection types that can provide a communication link between the terminal device 110 and the server 130, such as a wired communication link or a wireless communication link.
[0078] According to the implementation requirements, the system architecture in the embodiment of the present application can have any number of terminal devices, networks and servers. For example, the server 130 can be a server group composed of multiple server devices. In addition, the technical solution provided in the embodiment of the present application can be applied to the terminal device 110, can also be applied to the server 130, or can be implemented by the terminal device 110 and the server 130 together, and the present application does not make any special restrictions on this.
[0079] For example, the technical solution of the present application is implemented by the server 130. First, the server 130 obtains component generation information, and the component generation information includes the target component type corresponding to the target component to be generated. For example, the component generation information can be "generate a text box type component", then the target component type is a text box type. Then, the server 130 determines the data storage path of the target component according to the mapping relationship between the component type and the component data storage path, and the target component type contained in the component generation information. For example, a preset component corresponding to a plurality of component types is developed in advance and the component data of the preset component is saved, and then a mapping relationship is established between the component data storage path and the component type. When generating the target component, the mapping relationship is queried according to the target component type to obtain the data storage path corresponding to the target component. Next, the server 130 obtains the component object data of the target component according to the data storage path of the target component. The component object data is the instance data of the implementation component, and the data is stored in the storage location indicated by the data storage path. Finally, the server 130 parses the component object data and generates the target component according to the parsing result. Parsing the component object is equivalent to identifying the component framework structure described by the component object data, and then generating the target component. It can be seen that the technical solution of the present application can automatically generate the required target components according to the component type, reducing manual operations in the component development process, thereby improving the component development efficiency; at the same time, components of the same type can be reused, avoiding repeated development in the component development process, and can further improve the component development efficiency.
[0080] In the embodiment of the present application, the technical solution of the present application can be implemented through cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing, and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool, which is used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites. With the high development and application of the Internet industry, each item may have its own identification mark in the future, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately, and all kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0081] In one embodiment of the present application, the technical solution of the present application is applied to a private cloud technology scenario. A private cloud is a cloud infrastructure and software and hardware resources created within a firewall so that departments within an organization or enterprise can share resources within a data center. In addition to hardware resources, creating a private cloud generally also requires cloud equipment (IaaS, Infrastructure as a Service) software.
[0082] Private cloud computing also includes three levels: cloud hardware, cloud platform, and cloud service. The difference is that cloud hardware is the user's own personal computer or server, not the cloud computing vendor's data center. The purpose of cloud computing vendors to build data centers is to provide public cloud services to millions of users, so they need to have tens of millions of servers. Private cloud computing only serves friends and relatives for individuals, and only serves employees, customers, and suppliers for enterprises. Therefore, an individual or enterprise's own personal computer or server is sufficient to provide cloud services.
[0083] In one embodiment of the present application, the technical solution of the present application can be applied to software development in a private cloud scenario. For example, on an e-commerce platform in a private cloud scenario, it is necessary to design a product information management system that needs to receive information such as product name, price, inventory, etc., and output information such as product list and detail page. Developers can automatically build corresponding components by providing component generation information. In this example, the component generation information may include the input data type and structure requirements of the component, such as: string type name, floating point type price, integer type inventory, etc. Based on the component generation information, the target component type is identified to include text box type and number box type, and then the corresponding text box component and number box component are generated.
[0084] In one embodiment of the present application, the technical solution of the present application can be applied to education and training in a private cloud scenario. For example, a user needs to design components of different types and levels to display teaching content. In this case, the component generation information provided by the user may include component types and levels. For example, component types include text boxes, selection boxes, single-choice questions, multiple-choice questions, etc., and the levels may include single-choice questions and multiple-choice questions in the selection box; then the corresponding components are automatically generated, such as text box components, selection box components, single-choice question components, multiple-choice question components, etc.
[0085] The processing method of the components provided in this application is described in detail below in conjunction with specific implementation methods.
[0086] Figure 2A flowchart of a component processing method provided by an embodiment of the present application is schematically shown. The component processing method provided by the embodiment of the present application can be implemented by a component processing device. The component processing method will be explained below with the component processing device as the execution subject. Figure 2 As shown, the component processing method provided in the embodiment of the present application includes steps 210 to 240, which are specifically as follows:
[0087] Step 210: Obtain component generation information, where the component generation information includes a target component type corresponding to the target component to be generated.
[0088] Specifically, component generation information refers to information provided when generating a required target component, and the component generation information includes a target component type for generating the required target component, and the target component type may include one or more component types. The target component type may be determined based on a specific value corresponding to a component type field in the component generation information. For example, if the component generation information has a field called "component type" and the specific value of the field is "text box", then the target component type is a text box type, which may also be referred to as a text box.
[0089] In one embodiment of the present application, the target component type can also be determined by querying the corresponding mapping relationship based on the data field associated with the component type in the component generation information. Specifically, a mapping relationship is established between the component application scenario and the component type in advance. For example, the component type corresponding to the teaching scenario may include a text box, a number box, a selection box, etc. When the component generation information includes the teaching scenario, the corresponding target component type is determined to include a text box, a number box, a selection box, etc. based on the pre-established mapping relationship.
[0090] Step 220: Determine the data storage path of the target component according to the mapping relationship between the component type and the component data storage path, and the target component type included in the component generation information.
[0091] Specifically, the component data storage path is the storage path for the data required to generate the component itself. Different component types correspond to different components, which naturally correspond to component data, and then correspond to different component data storage paths. A mapping relationship is established between the component type and the component data storage path in advance. When generating the target component, the mapping relationship is searched according to the target component type to obtain the data storage path corresponding to the target component. For example, the mapping relationship between the component type and the component data storage path is embodied in the form of a component dictionary mapping table. When generating the target component, the component type that is the same as the target component type is searched in the component dictionary mapping table, and then the component data storage path corresponding to the same component type is used as the data storage path of the target component.
[0092] Step 230: Acquire component object data of the target component according to the data storage path of the target component.
[0093] Specifically, after determining the data storage path of the target component, the corresponding data storage location can be located according to the data storage path, and then the component object data of the target component can be obtained. In one embodiment of the present application, the component data storage path and the component object data can be stored in a key and value manner, that is, the component data storage path is used as the key, and the component object data is used as the value corresponding to the key. When obtaining the component object data of the target component, the value corresponding to the key of the data storage path of the target component is obtained by key-value method, that is, the component object data of the target component is obtained.
[0094] An object is an entity used to describe objective things in an application system. It is a basic operating unit with specific properties and behaviors (or methods). An object is an instance of a class in a special state, which can be an entity, a noun, or any other object. Component object data is the data corresponding to the object that generates the component. The content of the component object data can be based on certain programming language rules to describe the specific content and structure of the component. Specifically, the component object data includes a set of ordered key-value pair data. In the key-value pairs contained in the component object data, the key usually represents the field required to generate the component, and the value can be a simple value or an object and an array. Exemplarily, the component object data is a JSON (JavaScript Object Notation) object, and the content of the component object data is as follows:
[0095]
[0096] Among them, fieldPath and type are the keys in the component object data, and aliableCount and Integer are the values in the component object data.
[0097] Step 240: parse the component object data and generate a target component according to the parsing result.
[0098] Specifically, parsing the component object data is to identify the specific content contained in the component object data, determine the structure of the target component, and then generate the target component. The components contained in the target component are called basic components. The target component can be a simple component composed of a single basic component, in which case the target component can also be called a basic component; the target component can also be a complex component composed of multiple basic components according to certain arrangement rules.
[0099] In the technical solution provided in the embodiment of the present application, the target component type is obtained from the component generation information, and then the data storage path of the target component is determined according to the mapping relationship between the component type and the component data storage path, and the target component type, and then the component object data is obtained based on the data storage path, and finally the component object data is parsed to generate the target component, thereby realizing the function of automatically generating the required target component according to the component type, reducing manual operations in the component development process, and thus improving the component development efficiency; at the same time, components of the same type can be reused, avoiding repeated development of components of the same type in the component development process, and can further improve the component development efficiency.
[0100] In one embodiment of the present application, the component object data includes at least the target component type and the field path of the target component. The field path of the target component is used to describe the structure of the target component. The structure of the target component is also called the hierarchical structure of the target component. When the target component is a basic component, the target component is the basic component itself, and its hierarchical structure can be considered as a primary structure; when the target component is a complex component, its hierarchical structure is a multi-level structure.
[0101] In one embodiment of the present application, the parsing process of component object data includes: obtaining the component field path contained in the component object data from the component object data; parsing the component field path to obtain the target component structure; and using the target component structure and the target component data obtained through the target component type as the parsing results.
[0102] Specifically, in the process of parsing the data object data, the component field path can be first obtained from the component object data, and then the component field path can be parsed and identified to determine the hierarchical structure of the target component, that is, the target component structure. When generating the target component, the basic components contained in the target component are arranged according to the hierarchical structure of the target component. For example, for a target component that displays province, city, and district information, it includes a provincial information display component, a municipal information display component, and a district information display component. The component types of these three components may all be text box types, and in the hierarchical structure of these three components, the provincial information display component should be the first-level display component, the municipal information display component is the next-level component of the provincial information display component, recorded as the second-level display component, and the district information display component is the next-level component of the municipal information display component, recorded as the third-level display component. When generating the target component, it is necessary to arrange the components according to the hierarchical structure of the target component to generate a target component with a "province-city-district" structure.
[0103] In one embodiment of the present application, when the target component is a complex component, the corresponding component field path is a multi-level structure. This multi-level structure can usually be reflected in the form of an array. Therefore, the component field path contains a container array for describing the component content. Then the parsing process of the component field path includes: parsing the container array contained in the component field path to obtain the secondary array contained in the container array, and the secondary array is used to describe the component content of the next level structure corresponding to the container array; parsing the secondary array to obtain the array elements contained in the secondary array; the array elements are used to describe the minimum data unit or minimum data unit set in the target component structure; parsing the array elements contained in the secondary array, and constructing the target component structure according to the parsing results of the array elements contained in the secondary array.
[0104] Specifically, the component field path of a complex component includes multiple nested arrays, the container array is the top-level array, the array elements contained in the container array are the secondary arrays, the secondary arrays are the next-level structures corresponding to the container arrays, and the array elements contained in the secondary arrays are the next-level structures corresponding to the secondary arrays. The array elements contained in the secondary arrays can be the last level in the component field path, that is, the array elements contained in the secondary arrays no longer have the corresponding next-level structures, and at this time the array elements contained in the secondary arrays point to the smallest data units in the target component structure. The array elements contained in the secondary arrays can also have the corresponding next-level structures, and at this time the array elements contained in the secondary arrays point to the smallest data unit set. Exemplarily, as in the aforementioned target component with a "province-city-district" structure, the "province" corresponds to the container array, the "city" corresponds to the secondary array, and the "district" corresponds to the array elements contained in the secondary array, and is also the smallest data unit in the target component structure.
[0105] In the technical solution of the present application, the smallest data unit in the target component structure is defined by the last level in the component field path. The smallest data unit refers to the smallest level in the target component, and does not mean that the smallest data unit cannot be subdivided. For example, the smallest level in the above "province-city-district" example is "district", so "district" is the smallest data unit, but in other embodiments, "district" can also be subdivided into "street", "community", etc.
[0106] In one embodiment of the present application, the parsing process of the array elements contained in the secondary array includes: obtaining the content data contained in the array elements from the array elements contained in the secondary array; if the content data contained in the array elements is target attribute data pointing to the smallest data unit, then the target attribute data is used as the parsing result of the level where the array element is located; if the content data contained in the array elements is array-type data pointing to a set of smallest data units, then the array elements are continued to be parsed as a secondary array; and the parsing result of the array elements is generated according to the parsing results of each level.
[0107] Specifically, there are two situations for the content data contained in the array element, one is that the content data is the target attribute data pointing to the minimum data unit, and the other is that the content data is array-type data pointing to a minimum data unit set. When the content data contained in the array element is the target attribute data pointing to the minimum data unit, it means that the level where the array element is located is already the minimum level in the target component structure, and the corresponding target attribute data is the parsing result of the level. When the content data contained in the array element is array-type data pointing to a minimum data unit set, it means that the array element contained in the secondary array is still an array, and it is necessary to continue parsing to determine the structural level corresponding to the minimum data unit in the target component structure, so the array element is parsed as a secondary array. Finally, when all array elements in the component field path are parsed, the parsing results of each level are obtained.
[0108] For example, assume that the component object data is as follows:
[0109]
[0110] Among them, fieldPath represents the component field path, and type represents the target component type. The "?" in annotations.container[? ].sub.target[? ].ig.tad represents the number of corresponding arrays. In practical applications, "?" can be replaced by a specific number. It can be seen that the component field path includes multiple levels of arrays, that is, the component field path is a nested structure. When parsing the component field path, you can define a nested parsing function, which parses the component field path and outputs the parsing result.
[0111] Exemplarily, the nested parsing algorithm used by the nested parsing function parse(data) is as follows:
[0112] $annotations.container[? ].sub.target[? ].ig.tad=annotations.container[i].sub.t arget[j].ig.tad$
[0113] Assume that in the above component object data, there are n container arrays, that is, annotations.container[? ] is annotations.container[n]; there are m sub-arrays, that is, sub.target[? ] is sub.target[m].
[0114] During the parsing process, the container array annotations.container is parsed first. Then, for each container array annotations.container, the sub-array sub.target[m] corresponding to the container array can be parsed. For each sub-array sub.target, when the content data in the array element it contains is the target attribute data ig.tad attribute, the ig.tad attribute is used as the parsing result of the current level. When the content data in the array element it contains is an array type data sub.target, the array element continues to be parsed, that is, the nested parsing function parse is recursively called to parse the array element.
[0115] For example, Figure 3 A timing diagram schematically shows a component field path parsing process provided by an embodiment of the present application, such as Figure 3 As shown, the parsing process includes:
[0116] S1. The data provider transmits a JSON object to the data parsing layer. The JSON object is the component object data, including the component field path.
[0117] S2. Parse annotations.container[i]. Parse n container arrays one by one.
[0118] S3. Parse sub.target[i]. For each container data annotations.container, the corresponding m sub-arrays sub.target need to be parsed.
[0119] S4. If the ig.tad attribute exists in sub.target[i], the ig.tad attribute value is added to the parsed object. That is, when the array element of the secondary array includes the target attribute data, the parsing result of the level where the array element is located is obtained according to the target attribute data.
[0120] S5. If the sub.target array exists in sub.target[i], the parse function is recursively called to parse the elements therein. If the ig.tad attribute does not exist in sub.target[i] and the sub.target array exists, it means that the array elements in the secondary array are array type data and need to be parsed further.
[0121] S6. Returns the parsed object of the container array annotations.container[i], that is, returns the parsed result of the current container array.
[0122] S7. Continue parsing annotations.container[i_next], that is, continue parsing the next container array.
[0123] S8. When all container arrays are parsed, the parsed object is returned, that is, the parsed result of the component field path is returned.
[0124] The implementation process of the nested parsing function parse can be expressed as:
[0125]
[0126]
[0127] In one embodiment of the present application, when the target component is a base component, for example, the component object data is as follows:
[0128]
[0129] It can be seen that the component field path is not a nested structure, so the basic component of type "Integer" can be directly obtained and the basic component can be used as the target component.
[0130] Figure 4 A flowchart of a component processing method provided by an embodiment of the present application is schematically shown. This embodiment is a further refinement of the above embodiment. Figure 4 As shown, the method includes steps 410 to 460, which are specifically as follows:
[0131] Step 410: Obtain component generation information, where the component generation information includes a target component type corresponding to the target component to be generated.
[0132] Step 420: Determine the data storage path of the target component according to the mapping relationship between the component type and the component data storage path, and the target component type included in the component generation information.
[0133] Step 430: Acquire component object data of the target component according to the data storage path of the target component.
[0134] Step 440: parse the component object data and generate a target component according to the parsing result.
[0135] Among them, step 410 to step 440 are the same as step 210 to step 240 in the aforementioned embodiment. The specific implementation details can be referred to the relevant description in the aforementioned embodiment, which will not be repeated here.
[0136] Step 450: Generate a target verification component corresponding to the target component according to the target component type and the mapping relationship between the component type and the verification rule.
[0137] Specifically, the target verification component includes verification rules for verifying the target component. Different types of components correspond to different verification rules. For example, the input data of the text box component cannot be numbers, and the input data of the number box component cannot be strings. In this embodiment, verification rules for various types of components are pre-constructed, and a mapping relationship is established between the verification rules and the component types. When obtaining the target verification component corresponding to the target component, the mapping relationship is searched according to the target component type, and the corresponding verification rules are obtained to generate the target verification component.
[0138] In one embodiment of the present application, when constructing a mapping relationship between a verification rule and a component type, the component type can be used as a key and the verification rule can be used as a value to construct a verification rule mapping relationship table in the form of a key-value pair. When searching for a mapping relationship according to a target component type, the corresponding verification rule can be obtained in a key-value manner, that is, searching for the same key as the target component type in the verification rule mapping relationship table, and then using the value corresponding to the same key as the verification rule corresponding to the target component type.
[0139] In one embodiment of the present application, the verification rule that forms a mapping relationship with the component type is a first verification rule, and the first verification rule includes a larger verification range, or in other words, the first verification rule includes a general verification range. In actual applications, the verification range is usually adjusted more finely, that is, a second verification rule with a verification range smaller than that of a verification rule is obtained. Therefore, the generation process of the target verification component includes: obtaining the first verification rule corresponding to the target component according to the target component type and the mapping relationship between the component type and the verification rule; obtaining the second verification rule corresponding to the target component according to the component identifier of the target component; the verification range of the first verification rule is larger than the verification range of the second verification rule; and generating the target verification component corresponding to the target component according to the first verification rule and the second verification rule.
[0140] Specifically, the first verification rule is a verification rule obtained by searching the verification rule mapping relationship according to the target component type, and can also be called a basic verification rule or a general verification rule. The second verification rule is a more detailed verification rule obtained for the generated target component, and its verification range is smaller than the first verification rule. For example, the first verification rule corresponding to the number box component may be that a string cannot be entered, that is, any number can be entered, but a string cannot be entered; the second verification rule may be that the entered number must be between 0 and 1000. The second verification rule is obtained based on the component identifier of the target component. The component identifier can be the name of the target component, the component path field, and other identification information that can represent the target component.
[0141] In one embodiment of the present application, when generating a target component, a component identifier is generated according to the component field path of the target component, and the second verification rule has an identifier. When the component identifier of the target component matches the identifier in the second verification rule, the second verification rule is the second verification rule corresponding to the target component. Exemplarily, the component identifier generated according to the component field path of the target component is the component name, denoted as name, and the second verification rule also has a name identifier. When the name identifier in the second verification rule and the name representation of the target component are the same, the required second verification rule is obtained.
[0142] For example, an example of a second validation rule is as follows:
[0143]
[0144] When obtaining the second validation rule, matching and acquisition can be performed based on the contents of fields such as type, validator, description, name, and default.
[0145] After obtaining the first verification rule and the second verification rule, the two verification rules are combined to obtain a target verification component corresponding to the target component.
[0146] In one embodiment of the present application, the process of combining the first verification rule and the second verification rule includes: fusing the first verification rule and the second verification rule to obtain a target verification rule corresponding to a target component; parsing the target verification rule to generate a target verification component.
[0147] Specifically, the first verification rule and the second verification rule are first merged to obtain the target verification rule. For example, the rule field in the first verification rule and the rule field in the second verification rule are spliced together to form the target verification rule. Then, the target verification rule is parsed to generate a target verification component. The purpose of parsing the target verification rule is to identify the content contained in the target verification rule, convert the content into executable object data, and generate a target verification component.
[0148] In one embodiment of the present application, the specific process of parsing the target verification rules includes: converting the first rule field in the target verification rules into a second rule field in a preset format, wherein the second rule field includes a logical operator; obtaining the mathematical verification operation rules and text description information corresponding to the logical operator; and generating a target verification component based on the second rule field, the mathematical verification operation rules and the text description information.
[0149] Specifically, the format of the first rule field in the target verification rule is a format that is easy for verification rule developers to understand, and it needs to be converted into a second rule field in a preset format that can be understood by the verification rule implementation subject. In the embodiment of the present application, a regular expression can be used to convert the format of the target verification rule, and the expression of the converted second rule field is: op1(v1){∧∨}(o[2(v2)){∧∨}…{∧∨}(op n (v n )), where op i represents the i-th regular operation operator, v i Indicates the i-th rule operation value, and {∧∨} indicates the logical operator between rules (abbreviated as logical operator). For example, the target verification rule is ">0&<=1000", ">" is the first rule operation operator, "0" is the first rule operation value, "<=" is the second rule operation operator, "1000" is the second rule operation value, and "&" is the logical operator between rules.
[0150] The parsing process of the target verification rule also includes the parsing of logical operators. The parsing of logical operators is actually the conversion of logical operators into mathematical verification operation rules. For example, “>0&<
[0151] =1000" indicates that two conditions are met at the same time. The corresponding mathematical verification operation rule can be expressed as The mathematical verification operation rules are implemented in the target verification component through the compare method, that is, when the target verification component is run, the compare method is run, that is, the above mathematical verification operation rules are executed.
[0152] The parsing process of the target verification rule also includes obtaining the text description information of the logical operator, which refers to the interpretation of the logical operator in text form. The language used in the text form is the voice of the application environment of the technical solution of this application. The text description information is also called international display information. For example, the logical operator "&" has the corresponding text description information "and" in the Chinese environment; in the English environment, the corresponding text description information is "and".
[0153] After the above three aspects of analysis are performed, a verification rule object is generated according to the second rule field, the mathematical verification operation rule and the text description information. The verification rule is the target verification component.
[0154] Step 460: Associating the target component with the target verification component so as to verify the data content input into the target component through the target verification component.
[0155] Specifically, after the target verification component is generated, the target component and the target verification component are associated, and when the target component is subsequently used, the data input into the target component can be verified through the target verification component.
[0156] The technical solution provided in the embodiment of the present application can not only automatically generate the corresponding target verification component according to the component type, avoiding the tedious process of manually developing the verification component and improving the development efficiency; it can also associate the target component with the target verification component so that the data input into the target component can be automatically verified later, thereby improving the verification efficiency of the component data and ensuring the accuracy of the input data of the target component.
[0157] In one embodiment of the present application, the verification process of the target verification component on the input data of the target component includes: detecting the data content input in the target component; calling the target verification component associated with the target component to verify the input data content; and outputting the verification result prompt information according to the verification result. That is, when it is detected that there is input data content in the target component, the target verification component associated with the target component is called to verify the input data content, and the prompt information is output according to the verification result.
[0158] In one embodiment of the present application, the verification result includes two situations, one is verification success and the other is verification failure. When the verification is successful, the output prompt information can be empty, which is equivalent to not outputting the prompt information. When the verification fails, the output prompt information can be the reason for the verification failure.
[0159] In one embodiment of the present application, the target verification component includes a target verification rule, and the target verification rule has corresponding text description information, which is composed of the verification rule and the text description information corresponding to the logical operator in the verification rule. For example, if the target verification rule is ">0&<=1000", the corresponding text description information may be "the input data should be >0 and <=1000". When the verification of the input data content fails, the target verification rule that caused the verification failure is determined; then the text description information corresponding to the target verification rule that caused the verification failure is used as the verification result prompt information, and the user can determine the cause of the verification failure through the verification prompt information.
[0160] In one embodiment of the present application, when the input data content is successfully verified, the output data generated by the target component based on the input data content is obtained; and the output data is saved. Specifically, when the verification is successful, it means that the input data of the target component is correct, and the output data obtained is more likely to be correct. The output data is saved, and the output data can be queried and called later.
[0161] In one embodiment of the present application, when the target component is a complex component, the corresponding output data is nested data, that is, the output data has a complex structure with multiple levels, for example, the output data is a province, a city, or a district. When saving the output data, the output data of the nested structure can be flattened first to make it appear in the form of a field path again, that is, the nested field path is used to reflect the data nesting relationship in the output data; then the nested field path and the specific value of the output data form a parameter object, and finally the parameter object is saved. The parameter object includes a FieldPath attribute and a Value attribute, the FieldPath attribute represents the nested field path, and the Value attribute represents the value corresponding to the nested data. This saving method makes the output data save format unified, facilitates subsequent queries and calls, and also facilitates the conversion of data formats.
[0162] In one embodiment of the present application, the convertFieldPaths method is called to flatten the nested data. convertFieldPaths can convert an object (startObject) into a set of parameters (ParameterInput) for use when sending an API request. When flattening the nested data, the data display form of the nested data, the data to be retained, the data to be deleted, the data to be replaced, etc. can also be modified. For example, convertFieldPaths can provide some options to specify how to handle nested attributes, such as converting the values in the array to strings. After flattening the object attributes, the method returns a set of parameter objects, each of which contains a FieldPath attribute and a Value attribute. The FieldPath attribute represents the path of the attribute in the object, and the Value attribute represents the value of the attribute. If a parameter array (parameters) is provided, the method will also use the FieldPath attributes of these parameter objects to determine which attributes need to be retained, and add the values of these attributes to the returned parameter object (which data can be indicated in the fieldpath attribute to be retained or removed). Alternatively, some options can also be used to specify whether to merge the returned parameters into the input parameter array and whether to replace the field path with numbers with a new field path.
[0163] For example, Figure 5 The timing diagram of the verification process of component input data provided by one embodiment of the present application is schematically shown, as shown in FIG. Figure 5 As shown, the verification process includes:
[0164] S1. The verification layer constructs a verification rule mapping relationship table, which includes a mapping relationship between component types and verification rules.
[0165] S2. The verification layer obtains the current component type from the data layer. The current component type is the target component type of the target component currently being built. The verification layer can obtain data from the data layer through an API.
[0166] S3. The verification layer obtains a value from the verification rule mapping table according to the current component type, that is, obtains the first verification rule by key-based value acquisition.
[0167] S4. The validation layer obtains the validation schema from the data layer by creating a new object. The validation schema is the second validation rule. The validation layer can obtain data from the data layer through the API.
[0168] S5. parse the schema to generate an object, that is, merge the first verification rule and the second verification rule to generate a target verification component.
[0169] S6. Apply the verification rule object, that is, apply the target verification component to the target component, and establish an association relationship between the target component and the target verification component.
[0170] S7. When the target component triggers the data flow, the associated target verification component is called to verify the input data content. The target component triggering the data flow means that the data content is input to the target component.
[0171] S8. When the verification succeeds, the data flow is completed.
[0172] S9. When the verification fails, the internationalized verification information is displayed, that is, the text description information corresponding to the verification rule that caused the verification failure is displayed as the internationalized verification information.
[0173] It should be noted that calling the target verification component to verify the data content input by the target component is performed when the target component is configured to verify the input data. If the target component is configured not to verify the input data, there is no need to call the target verification component to verify the data content input by the target component.
[0174] Figure 6 A timing diagram schematically shows a processing method of a component provided by an embodiment of the present application, such as Figure 6 As shown, the method includes:
[0175] S1. The component layer obtains the target component type from the data layer through the API. Next, the component layer generates the target component according to the target component type.
[0176] S2. For basic components, the component layer obtains the corresponding components through key-value method, that is, queries the component dictionary mapping table (referred to as component mapping table) according to the target component type to obtain the corresponding basic component as the target component.
[0177] S3. The component layer obtains the corresponding target verification component from the verification layer, and associates the target component with the target verification component to facilitate subsequent verification.
[0178] S4. The component layer provides users with basic components and associated target verification components.
[0179] S5. For complex components, a nested parsing algorithm is called to parse the component field path in the component object data to determine the target component structure. During the parsing process, when multiple arrays are nested, the nested parsing algorithm can be recursively called to parse the array elements.
[0180] S6. The component layer provides complex components to users. Before providing the complex components, the complex components can also be associated with corresponding verification components as needed.
[0181] Figure 7 A timing diagram schematically shows a processing method of a component provided by an embodiment of the present application, such as Figure 7 As shown, the method includes:
[0182] S1. The data layer provides the rule schema and component type to the verification layer, that is, sends the preset verification rules and component types to the verification layer so that the verification layer can build a verification rule mapping relationship table.
[0183] S2. The data layer provides the component layer with component types and nested data, where the nested data is component object data. The component layer receives and stores the component object data, and establishes a component dictionary mapping table based on the storage address of the component object data and the component type.
[0184] S3. The verification layer constructs a verification rule mapping relationship table.
[0185] S4. The verification layer obtains the current component type from the data layer, compares the verification rule mapping relationship table according to the current component type, and obtains the corresponding verification rule, which is the first verification rule.
[0186] S5. The verification layer obtains the verification schema required by the current component type from the data layer. This verification schema is the second verification rule.
[0187] S6. parse the schema to generate a verification rule object. In this process, the first verification rule and the second verification rule are first merged to obtain the target verification rule, and then the verification rule object is generated according to the parsing result of the target verification rule. The verification rule object is the target verification component.
[0188] S7. The validation rule object is applied to the associated component. When the component triggers the data flow, the validation rule object uses the compare method to perform logical operations and generate internationalized display information, that is, to verify the data content input by the component.
[0189] S8. The component layer builds a component dictionary mapping table based on the data received from the data layer.
[0190] S9. The component layer obtains the component type currently required to be used, that is, the target component type, from the data layer.
[0191] S10. If it is a basic component, the component layer obtains the corresponding basic component from the component dictionary mapping table by key value.
[0192] S11. If it is a complex component, the component layer calls a nested parsing algorithm to parse the component field path. During the parsing process, the array elements in the JSON object are recursively parsed and their values are stored in the parsed object.
[0193] Figure 8 The flowchart schematically shows the application process of the technical solution of the present application in an application scenario, which is software development in a private cloud scenario. Figure 8 As shown, the application process includes:
[0194] The user provides component generation information, including data type and structure requirements (for example: string name, floating point price, integer inventory, etc.), and the corresponding components (for example: text box component, number box component, etc.) can be automatically built, and the corresponding verification rules (for example: the name length cannot exceed 32 characters, the price cannot be a negative number, etc.) can be automatically matched. At the same time, in this scenario, data of different types and structures can also be automatically converted (for example: converting JSON format to YAML format), and unified, standardized and visualized data can be output (for example: displaying product information in a table or web page). This can greatly improve software development efficiency and quality, and reduce maintenance costs.
[0195] Fig. 9 The flowchart schematically shows the application process of the technical solution of the present application in another application scenario, which is data analysis in a private cloud scenario. Fig. 9 As shown, the application process includes:
[0196] When users input data sources of different formats (e.g. CSV files, XML files, database tables, etc.), they can automatically match the corresponding components (e.g. CSV parser components, XML parser components, database connector components, etc.) and automatically convert the data format (e.g. converting CSV files to JSON objects, converting XML files to dictionary objects, converting database tables to DataFrame objects, etc.). At the same time, in this scenario, unified, standardized and visualized data can also be output (e.g. displaying data on charts or reports). This can greatly improve the efficiency and quality of data analysis, and enhance data analysis capabilities and flexibility.
[0197] Fig.10 The flowchart schematically shows the application process of the technical solution of the present application in another application scenario, which is education and training in a private cloud scenario. Fig.10 As shown, the application process includes:
[0198] When the user inputs the component type and level (e.g. text box, selection box, single-choice question, multiple-choice question, etc.), the corresponding components (e.g. text box component, selection box component, single-choice question component, multiple-choice question component, etc.) will be automatically generated, and the components and their verification rules will be automatically displayed (e.g. text box length cannot exceed 32 characters, selection box must select one option, single-choice question can only select one answer, multiple-choice question can select multiple answers, etc.). At the same time, in this scenario, teaching and demonstration content can also be output (e.g. displaying components on slides or web pages). This can greatly improve the efficiency and quality of education and training, and enhance the attractiveness and interactivity of education and training.
[0199] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0200] The following introduces an apparatus embodiment of the present application, which can be used to execute the processing method of the components in the above-mentioned embodiments of the present application. Fig.11 The structural block diagram of the processing device of the component provided in the embodiment of the present application is schematically shown. Fig.11 As shown, the processing device of the component includes:
[0201] The component information acquisition module 1110 is used to acquire component generation information, wherein the component generation information includes a target component type corresponding to a target component to be generated;
[0202] A component path determination module 1120, configured to determine a data storage path of a target component according to a mapping relationship between a component type and a component data storage path, and a target component type included in the component generation information;
[0203] A component object data acquisition module 1130, configured to acquire the component object data of the target component according to the data storage path of the target component;
[0204] The component generation module 1140 is used to parse the component object data and generate the target component according to the parsing result.
[0205] In one embodiment of the present application, the component generation module 1140 includes:
[0206] A field path acquisition unit, used to acquire a component field path contained in the component object data from the component object data; the component field path is used to describe the structure of the target component;
[0207] A field path parsing unit, used to parse the component field path to obtain a target component structure;
[0208] The parsing result generating unit is used to use the target component structure and the target component data obtained through the target component type as the parsing result.
[0209] In one embodiment of the present application, the component field path includes a container array for describing component content; the field path parsing unit is specifically used to:
[0210] Parsing the container array contained in the component field path to obtain a secondary array contained in the container array, wherein the secondary array is used to describe the component content of the next level structure corresponding to the container array;
[0211] Parsing the secondary array to obtain array elements contained in the secondary array; the array elements are used to describe the minimum data unit or minimum data unit set in the target component structure;
[0212] The array elements contained in the secondary array are parsed, and the target component structure is constructed according to the parsing results of the array elements contained in the secondary array.
[0213] In one embodiment of the present application, the field path parsing unit is further used to:
[0214] Obtaining content data contained in the array elements from the array elements contained in the secondary array;
[0215] If the content data contained in the array element is target attribute data pointing to the smallest data unit, the target attribute data is used as the parsing result of the level where the array element is located;
[0216] If the content data contained in the array element is array type data pointing to a minimum data unit set, the array element is further parsed as a secondary array;
[0217] The parsing results of the array elements included in the secondary array are generated according to the parsing results of each level.
[0218] In one embodiment of the present application, the on-the-job further includes:
[0219] A target verification component generation module 1140 is used to generate a target verification component corresponding to the target component according to the target component type and the mapping relationship between the component type and the verification rule;
[0220] The association module is used to associate the target component with the target verification component so as to verify the data content input into the target component through the target verification component.
[0221] In one embodiment of the present application, the target verification component generation module 1140 includes:
[0222] A first verification rule acquisition unit, configured to acquire a first verification rule corresponding to the target component according to the target component type and a mapping relationship between the component type and the verification rule;
[0223] A second verification rule acquisition unit, configured to acquire a second verification rule corresponding to the target component according to the component identifier of the target component; the verification range of the first verification rule is greater than the verification range of the second verification rule;
[0224] A target verification component generating unit is used to generate a target verification component corresponding to the target component according to the first verification rule and the second verification rule.
[0225] In one embodiment of the present application, the target verification component generation unit is specifically used to:
[0226] Merging the first verification rule and the second verification rule to obtain a target verification rule corresponding to the target component;
[0227] The target verification rule is parsed to generate the target verification component.
[0228] In one embodiment of the present application, the target verification component generation unit is further used to:
[0229] Converting a first rule field in the target verification rule into a second rule field in a preset format, wherein the second rule field includes a logical operator;
[0230] Obtaining mathematical verification operation rules and text description information corresponding to the logical operator;
[0231] The target verification component is generated according to the second rule field, the mathematical verification operation rule and the text description information.
[0232] In one embodiment of the present application, the target verification component is specifically used for:
[0233] Detecting data content inputted into the target component;
[0234] Calling a target verification component associated with the target component to verify the input data content;
[0235] Output the verification result prompt information according to the verification result.
[0236] In one embodiment of the present application, the target verification component includes a target verification rule and text description information corresponding to the target verification rule; the target verification component is also used to:
[0237] When verification of the input data content fails, determining a target verification rule that causes the verification failure;
[0238] The text description information corresponding to the target verification rule causing the verification failure is used as the verification result prompt information.
[0239] In one embodiment of the present application, the device further comprises:
[0240] The data saving module is used to obtain the output data generated by the target component based on the input data content when the input data content is successfully verified; and save the output data.
[0241] In one embodiment of the present application, the output data is nested data; and the data storage module is specifically used to:
[0242] Generate a nested field path corresponding to the nested data according to the nested relationship of the data contained in the nested data;
[0243] A parameter object is generated according to the nested field path and the value of the output data, and the parameter object is saved.
[0244] The specific details of the processing device of the components provided in each embodiment of the present application have been described in detail in the corresponding method embodiments and will not be repeated here.
[0245] Fig.12 The structure block diagram of a computer system for implementing an electronic device according to an embodiment of the present application is schematically shown.
[0246] It should be noted that Fig.12 The computer system 1200 of the electronic device 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.
[0247] like Fig.12 As shown, the computer system 1200 includes a central processing unit 1201 (CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1202 (ROM) or the program loaded from the storage part 1208 to the random access memory 1203 (RAM). Various programs and data required for system operation are also stored in the random access memory 1203. The central processing unit 1201, the read-only memory 1202 and the random access memory 1203 are connected to each other through a bus 1204. The input / output interface 1205 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1204.
[0248] The following components are connected to the input / output interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the input / output interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0249] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1209, and / or installed from the removable medium 1211. When the computer program is executed by the central processor 1201, various functions defined in the system of the present application are executed.
[0250] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, 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), a 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 the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0251] 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 box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a 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 box can also occur in a different order from the order marked in the accompanying drawings. For example, two 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 box in the block diagram or flow chart, and the combination of the boxes in the block diagram 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.
[0252] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0253] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0254] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0255] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A component processing method, characterized in that: include: Acquire component generation information, where the component generation information includes a target component type corresponding to the target component to be generated; Determine the data storage path of the target component according to the mapping relationship between the component type and the component data storage path, and the target component type included in the component generation information; Acquire component object data of the target component according to the data storage path of the target component; The component object data is parsed, and the target component is generated according to the parsing result.
2. The component processing method according to claim 1, characterized in that: Parsing the component object data includes: Acquire a component field path contained in the component object data from the component object data; the component field path is used to describe the structure of the target component; Parsing the component field path to obtain a target component structure; The target component structure and the target component data obtained through the target component type are used as the parsing results.
3. The component processing method according to claim 2, characterized in that: The component field path includes a container array for describing component content; the component field path is parsed to obtain a target component structure, including: Parsing the container array contained in the component field path to obtain a secondary array contained in the container array, wherein the secondary array is used to describe the component content of the next level structure corresponding to the container array; Parsing the secondary array to obtain array elements contained in the secondary array; the array elements are used to describe the minimum data unit or minimum data unit set in the target component structure; The array elements contained in the secondary array are parsed, and the target component structure is constructed according to the parsing results of the array elements contained in the secondary array.
4. The component processing method according to claim 3, characterized in that: Parsing the array elements contained in the secondary array, including: Obtaining content data contained in the array elements from the array elements contained in the secondary array; If the content data contained in the array element is target attribute data pointing to the smallest data unit, the target attribute data is used as the parsing result of the level where the array element is located; If the content data contained in the array element is array type data pointing to a minimum data unit set, the array element is further parsed as a secondary array; The parsing results of the array elements included in the secondary array are generated according to the parsing results of each level.
5. The component processing method according to claim 1, characterized in that: The method further comprises: Generate a target verification component corresponding to the target component according to the target component type and the mapping relationship between the component type and the verification rule; The target component is associated with the target verification component so as to verify the data content input into the target component through the target verification component.
6. The component processing method according to claim 5, characterized in that: According to the target component type and the mapping relationship between the component type and the verification rule, a target verification component corresponding to the target component is generated, including: According to the target component type and the mapping relationship between the component type and the verification rule, obtaining a first verification rule corresponding to the target component; Acquire a second verification rule corresponding to the target component according to the component identifier of the target component; the verification range of the first verification rule is greater than the verification range of the second verification rule; A target verification component corresponding to the target component is generated according to the first verification rule and the second verification rule.
7. The component processing method according to claim 6, characterized in that: Generating a target verification component corresponding to the target component according to the first verification rule and the second verification rule includes: Merging the first verification rule and the second verification rule to obtain a target verification rule corresponding to the target component; The target verification rule is parsed to generate the target verification component.
8. The component processing method according to claim 7, characterized in that: Parsing the target verification rule to generate the target verification component includes: Converting a first rule field in the target verification rule into a second rule field in a preset format, wherein the second rule field includes a logical operator; Obtaining mathematical verification operation rules and text description information corresponding to the logical operator; The target verification component is generated according to the second rule field, the mathematical verification operation rule and the text description information.
9. The component processing method according to claim 5, characterized in that: Verifying the data content input into the target component by the target verification component includes: Detecting data content inputted into the target component; Calling a target verification component associated with the target component to verify the input data content; Output the verification result prompt information according to the verification result.
10. The component processing method according to claim 9, characterized in that: The target verification component includes a target verification rule and text description information corresponding to the target verification rule; Output the verification result prompt information according to the verification result, including: When verification of the input data content fails, determining a target verification rule that causes the verification failure; The text description information corresponding to the target verification rule causing the verification failure is used as the verification result prompt information.
11. The component processing method according to claim 9, characterized in that: After outputting verification result prompt information according to the verification result, the method further includes: When the input data content is successfully verified, obtaining output data generated by the target component based on the input data content; The output data is saved.
12. The component processing method according to claim 11, characterized in that: The output data is nested data; Saving the output data includes: Generate a nested field path corresponding to the nested data according to the nested relationship of the data contained in the nested data; A parameter object is generated according to the nested field path and the value of the output data, and the parameter object is saved.
13. A component processing device, characterized in that: include: A component information acquisition module, used to acquire component generation information, wherein the component generation information includes a target component type corresponding to a target component to be generated; A component path determination module, used to determine the data storage path of the target component according to the mapping relationship between the component type and the component data storage path, and the target component type included in the component generation information; A component object data acquisition module, used for acquiring the component object data of the target component according to the data storage path of the target component; The component generation module is used to parse the component object data and generate the target component according to the parsing result.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the processing method of the component described in any one of claims 1 to 12 is implemented.
15. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor executes the executable instructions so that the electronic device executes the processing method of the component described in any one of claims 1 to 12.
