Data reference representation method, data reference analysis method and related products
By assigning unique identifiers and preset reference prefixes to referenced objects in the low-code platform's configuration files, combined with reference mapping items, the problem of lengthy and difficult-to-maintain data references is solved, achieving stability and automated resolution of data reference relationships, and improving the platform's reliability and efficiency.
Patent Information
- Application Number
- CN202511589196.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-01-30
AI Technical Summary
Existing low-code platforms use verbose and difficult-to-maintain path expression languages for data references, resulting in low reliability of reference management. Furthermore, when the project structure is complex, configuration errors can easily occur due to changes in parameter names or adjustments to document hierarchy, affecting the platform's usability and stability.
By assigning unique identifiers to referenced objects in the configuration file and utilizing preset reference prefixes and reference mapping items, the system distinguishes between internal and cross-file data reference relationships, thereby achieving a structured representation and automatic parsing of reference expressions.
It improves the configuration reliability and maintainability of the low-code platform in complex project scenarios, reduces the problem of reference breakage caused by path or name changes, enhances the stability and automation of data reference relationships, and reduces manual maintenance costs.
Smart Images

Figure CN121433710A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of computer, and in particular, to a data reference representation method, a data reference analysis method and related products. BACKGROUND
[0002] In the field of low-code development platforms, developers usually generate application interfaces and business logic through visual configuration and model-driven methods. In order to realize the unified description and automatic generation of elements such as pages, components, and logic flows, the industry generally uses structured data models such as JSON Schema to define these elements. As a data structure description language, JSON Schema can express page layout, attribute parameters, and logic relationships in a hierarchical manner, thereby supporting the automatic parsing and rendering of front-end pages and business processes by low-code platforms.
[0003] The existing low-code platforms usually implement data reference through directly writing fixed paths or matching references by object names in configuration files. For example, the properties of a component may reference the value of another page parameter through a path or bind data through an object name, which essentially relies on path strings or name matching to achieve, so in the scenario where the project structure is complex and there are many dependencies between components, the reliability of reference management is low. Therefore, some technical solutions attempt to use path expression languages such as JSON-Pointer and JSONPath to enhance reference capabilities, so that reference paths can be located and parsed through standard syntax.
[0004] However, path expression languages are often lengthy and difficult to maintain, which is not conducive to intuitive editing in visual configuration interfaces. Secondly, once the parameter name is modified, the component is moved, or the document hierarchy is adjusted, the reference relationship needs to be manually adjusted for all referenced data items, which not only easily causes configuration errors, but also affects the usability and stability of low-code platforms. SUMMARY
[0005] Based on the above problems, embodiments of the present application provide a data reference representation method, a data reference analysis method and related products.
[0006] In a first aspect, embodiments of the present application provide a data reference representation method, comprising:
[0007] obtaining a configuration file for describing a page component, and assigning an identifier to a reference object in the configuration file;
[0008] In the configuration file, a reference expression is obtained by using a preset reference prefix and the identifier to represent the data reference relationship in the configuration file, wherein the preset reference prefix is used to distinguish reference types;
[0009] The configuration file defines reference mapping items; each reference mapping item records corresponding information between the identifier and an external file path.
[0010] In an embodiment, the preset reference prefix is used to represent data reference relationships between internal objects in the configuration file and between the configuration file and external files; the preset reference prefix includes a self-reference prefix used to indicate internal reference relationships in the configuration file and an external reference prefix used to indicate cross-file external reference relationships.
[0011] In an embodiment, the identifier in the reference mapping item remains unchanged as a fixed identifier, and the external file path is updated according to changes in external file resource configurations.
[0012] In an embodiment, the external reference prefix is in the form of an external reference path component with the external reference prefix as a key and a file path as a value; the reference expression variable is in the form of interpolation or a placeholder.
[0013] In a second aspect, the embodiments of the present application further provide a data reference analysis method, which comprises:
[0014] Obtaining a configuration file containing a reference expression;
[0015] Identifying the type of the reference prefix in the reference expression;
[0016] Determining a corresponding analysis strategy according to the type of the reference prefix;
[0017] Analyzing the reference expression into actual data based on the analysis strategy;
[0018] Performing a data replacement operation to replace the reference expression with the analysis result.
[0019] In an embodiment, the configuration file assigns an identifier to a reference object; the preset reference prefix includes a self-reference prefix used to indicate internal reference relationships in the configuration file and an external reference prefix used to indicate cross-file external reference relationships; the configuration file defines reference mapping items; each reference mapping item records corresponding information between the identifier and an external file path.
[0020] The determination of the corresponding analysis strategy according to the type of the reference prefix comprises:
[0021] If the type of the reference prefix is a self-reference prefix, the reference object is located in the current configuration file according to the identifier, and actual data is obtained;
[0022] If the type of the reference prefix is an external reference prefix, an external file path is obtained in a reference mapping item according to the identifier.
[0023] In an embodiment, if the type of the reference prefix is an external reference prefix, obtaining an external file path in a reference mapping item according to the identifier includes:
[0024] Finding a key that is completely matched with the identifier in each reference mapping item;
[0025] Returning an external file path corresponding to the key.
[0026] In a third aspect, the embodiments of the present application further provide a low-code development system, comprising:
[0027] An identifier allocation unit is configured to obtain a configuration file used for describing a page component, and allocate an identifier for a reference object in the configuration file;
[0028] A reference expression generation unit is configured to represent a data reference relationship in the configuration file by using a preset reference prefix and the identifier in the configuration file, to obtain a reference expression; wherein the preset reference prefix is used to distinguish reference types.
[0029] A reference mapping management unit is configured to define reference mapping items in the configuration file; wherein each reference mapping item records corresponding information between the identifier and an external file path.
[0030] In a fourth aspect, the embodiments of the present application further provide a computer device, comprising:
[0031] A central processing unit, a memory, and an input / output interface;
[0032] The memory is a volatile memory or a persistent storage memory;
[0033] The central processing unit is configured to communicate with the memory, and perform instruction operations in the memory to execute the data reference representation method described in the first aspect of the embodiments of the present application or any specific implementation manner of the first aspect, or the data reference analysis method described in the second aspect of the embodiments of the present application or any specific implementation manner of the second aspect.
[0034] In a fifth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to execute the data reference representation method described in the first aspect of the embodiments of the present application or any specific implementation manner of the first aspect, or the data reference analysis method described in the second aspect of the embodiments of the present application or any specific implementation manner of the second aspect.
[0035] From the above technical solution, the embodiments of the present application have the following advantages:
[0036] The data reference representation method of the first aspect of the present application has the following advantages: by assigning a unique identifier to the reference object in the configuration file and using a reference syntax containing a preset reference prefix to represent the data reference relationship, the data reference within the configuration file and across files can be defined in a structured and standardized manner. The reference prefix is used to clearly distinguish the reference type, avoiding the problem of ambiguous reference type and difficult parsing in the traditional path hard coding or name matching method. Further, by defining a reference mapping item in the configuration file, the reference identifier is corresponded to the external file path, so that when the external file path or name is changed, only the mapping item needs to be modified to complete the reference update, without the need for manual adjustment of all reference positions. Therefore, this method can effectively avoid the reference breakage problem caused by path or name changes, realize stable maintenance of the data reference relationship, and improve the configuration reliability and maintainability of the low-code platform in complex project scenarios.
[0037] The data reference analysis method of the second aspect of the present application has the following advantages: by identifying the type of the reference prefix in the reference expression and using the corresponding analysis strategy according to different prefix types, the system can automatically distinguish and correctly analyze the internal reference and cross-document reference of the document. In the analysis process, the actual data or external path is located according to the reference identifier and the reference mapping relationship, and then the data replacement operation is performed to dynamically replace the reference expression with the actual data value or access path that can be directly used. This method not only realizes automatic analysis and runtime update of the reference relationship, but also maintains the correctness of the reference result when the document structure is adjusted, the parameter name is modified, or the external resource path is changed. Therefore, this method can improve the automation and dynamic adaptability of data reference analysis, reduce the manual maintenance cost, and improve the efficiency and system stability of the low-code development platform. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of the provided drawings.
[0039] Figure 1 A data reference representation method flowchart provided for the embodiments of the present application;
[0040] Figure 2 A data reference analysis method flowchart provided for the embodiments of the present application;
[0041] Figure 3 A data reference representation device structure schematic diagram provided for an embodiment of the present application;
[0042] Figure 4 A data reference resolution device structure schematic diagram provided for an embodiment of the present application;
[0043] Figure 5 A computer device structure schematic diagram provided for an embodiment of the present application. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present application.
[0045] The various embodiments of the present application will be described in further detail below with reference to the drawings.
[0046] The embodiments of the present application provide a data reference representation method, as shown in Figure 1 The method comprises steps S101-S103.
[0047] S101: Obtain a configuration file for describing a page component, and assign an identifier to a reference object in the configuration file;
[0048] The configuration file mentioned in the embodiments of the present application refers to a data collection for describing the structure, properties, logical relationships, etc. of a page component in a structured data format (for example, JSON, XML or other data formats supporting nested structures). The configuration file usually contains information of multiple page components, and defines the related properties, parameters and hierarchical relationships of each component in the form of key-value pairs, facilitating subsequent visual rendering or behavior execution control of the page. The page component is a basic unit for building application interface and logical structure in a low-code development platform, and the page component can include but is not limited to functional modules such as buttons, input boxes, links, forms, etc. Different components have different configuration items for defining their styles, behaviors, bound data, etc. The reference object refers to a data item, parameter, component, path or resource referenced by other components or properties in the configuration file.
[0049] The identifier can be a string, a UUID, or other encoding with no repetition, so that once the identifier is assigned, other components in the configuration file can call the referenced object through the identifier without changing its value. Even if the location, name, or attribute of the referenced object changes, as long as the identifier remains unchanged, the reference relationship is not affected, thereby realizing data addressability and structural stability of data reference relationship between components in the configuration file.
[0050] In one possible embodiment, the system first obtains the configuration file of the page component from the design environment of the low-code platform, and in the configuration file, the system assigns identifiers to data items or component elements that can be referenced by other components or logic. Specifically, for a parameter, variable, or sub-component that needs to be referenced, the platform adds an "id" field at its defined position, and the value corresponding to the "id" field is the identifier of the referenced object. The identifier is unique in the entire configuration file and does not change with the changes of component name, parameter name, or level. For example, in a parameter object in the page parameter list, an "id" can be defined as "param_123", and "param_123" is the identifier of the parameter object. Subsequent other components can access the parameter object by referencing the identifier.
[0051] S102: In the configuration file, a preset reference prefix and an identifier are used to represent the data reference relationship in the configuration file, to obtain a reference expression;
[0052] In an embodiment of the present application, the preset reference prefix is a predefined symbol prefix with an identification function, which is used to indicate the reference type of the constructed reference expression. Different types of reference prefixes have different semantics, so that the parser can identify the reference range and parsing strategy when processing the reference expression. The reference expression is a combination of the preset reference prefix and the identifier, which is used to represent the reference relationship between data in the configuration file. The reference expression can be nested in component attribute values or parameter definitions to refer to the target data object.
[0053] S103: Defining a reference mapping item in the configuration file; wherein each reference mapping item records the corresponding information between the identifier and the external file path.
[0054] In the embodiments of the present application, the reference mapping item is one or more data structure units defined in the configuration file for recording data reference relationship, which is used to establish a mapping relationship between the reference identifier used in the configuration file and the actual corresponding external file path. Therefore, each reference mapping item includes at least two field information: one is the identifier, which is used to identify the referenced external object or document; the other is the external file path, which points to the file path or positioning address actually storing the external resource, such as the URL path or local file relative path that can be recognized and accessed by the parser.
[0055] By setting the reference mapping item, when the reference expression is parsed, the external file path associated with the identifier can be quickly found based on the identifier, so that fast and accurate parsing and access of cross-file resources are realized, and the reference invalidation problem caused by path hard coding is avoided.
[0056] In order to solve the problem of high coupling and difficult maintenance of data reference mode in traditional low-code configuration files, in an embodiment, a preset reference prefix is used to represent the data reference relationship between the internal objects of the configuration file and the external files of the configuration file; the preset reference prefix includes a self-reference prefix used to indicate the internal reference relationship of the configuration file, and an external reference prefix used to indicate the external reference relationship across files.
[0057] It can be understood that the preset reference prefix in the embodiments of the present application can be divided into two categories according to the range of the reference target: one is used to represent the data reference relationship within the configuration file, which is called self-reference prefix; the other is used to represent the data reference relationship between the configuration file and the external file, which is called external reference prefix.
[0058] The self-reference prefix usually starts with a specific string, such as “$(self)” and the like, and its semantics points to the structure range within the current configuration file itself, which is used to represent the associated reference between fields, attributes or components within the same document. For example, in the page configuration file, “$(self)parameters.param_id” can represent the reference to the parameter item with the identifier param_id in the current page parameter list.
[0059] The external reference prefix is used to indicate the data reference relationship across files, and is usually identified by a string such as “$(ref)”, which represents that the reference target is not within the current configuration file, but in another configuration file defined outside the configuration file. The external reference prefix can be used in combination with the reference mapping item defined in the current configuration file to realize the positioning and parsing across documents. For example, “$(ref)page2” represents the reference to an external document path named “page2”, and the corresponding path information will be registered in the mapping item of the current document, such as “page2”:“ / page2.sdv”.
[0060] In summary, the embodiments of the present application provide explicit differentiation of data reference relationships by presetting reference prefixes, so that data reference relationships of different ranges can be uniformly managed and accurately parsed, effectively improving the reusability and combination capability between different modules or pages in the low-code platform, and enhancing the robustness and flexibility of the configuration file.
[0061] In an embodiment, the identifier in the reference mapping item remains unchanged as a fixed identifier, and the external file path is updated according to the change of the external file resource configuration.
[0062] In the embodiments of the present application, the identifier in the reference mapping item is actually defined and remains unchanged as a fixed identifier, and the external file path corresponding to the identifier can be dynamically updated according to the configuration change of the external file resource. In this way, the reference expression and the specific external path information can be decoupled, and the unchanged identifier is used as a reference anchor, so that the data reference relationship still has stability and maintainability in the face of external file path changes.
[0063] Specifically, in the configuration file, when a certain external file resource (such as another page, component or logic unit) needs to be referenced, the system defines an identifier for the resource in the reference mapping item, such as "page2", and records the identifier in the reference mapping item, and maps the identifier to the actual corresponding external file path (such as " / page2.sdv") in the reference mapping item. It can be understood that the external file path can be a local path, a network address or an access path dynamically generated by a resource management platform.
[0064] In the above reference mapping item structure, the identifier page2 appears as a fixed reference anchor in the expression statement in the reference expression, such as "$(ref)page2", and the expression is always parsed with "page2" as the target. With the adjustment of the external resource location or structure, for example, the page resource originally located at " / page2.sdv" is restructured to " / modules / sub / page2.json", at this time, only the path value corresponding to "page2" in the reference mapping item needs to be updated to the new file path, without the need to modify all reference expressions in the main configuration file one by one, so that the stability of the data reference logic and the flexibility of the configuration file structure can be guaranteed at the same time.
[0065] Please understand in the use scenario of the low-code platform, the configuration file is often in the visual editing, component dragging, module separation and frequent changes. If the traditional technology is used, the reference object itself is relied on when expressing the data reference relationship, and the name of the reference object needs to be manually modified every time the structure is adjusted, which is easy to cause reference invalidation and maintenance burden. In the embodiment, the abstract encapsulation of the data reference relationship is realized by the strategy of constant identifier and variable path, and the robustness of the reference mechanism is significantly improved under the premise of keeping the semantics of the reference expression unchanged and dynamically adapting to the adjustment of the underlying resource structure.
[0066] For example, if there is a reference mapping item in the configuration file as follows:
[0067]
[0068] But when the external file resource is migrated to other paths, only the structure needs to be updated to:
[0069]
[0070] And the reference expression in the configuration file such as $(ref)page2?id=$(self)parameters.param_id does not need to be changed, and the parsing device can still correctly parse and replace the actual available external file path at runtime, which can have high adaptability to the actual development and running environment, and is helpful to realize the modularization and extensible management of the configuration file.
[0071] In an embodiment, the external reference path component where the external reference prefix is located is in the form of taking the external reference prefix as the key and the file path as the value; the variable interpolation or placeholder form of the reference expression.
[0072] In order to improve the organization clarity and structural consistency of the cross-file reference relationship in the configuration file, in the embodiment of the present application, the external reference path component where the external reference prefix is located is designed in the form of key-value pair, wherein the identifier contained in the external reference prefix is taken as the key, and the corresponding external file path is taken as the value.
[0073] In the embodiment, the external reference path component can be defined in the form of a mapping structure in a specific field of the configuration file, for example, under the references field. In the mapping structure, the key of the key-value pair is an identifier used in the reference expression, for example, page2, and the value is the path of the external file represented by the identifier, such as “ / modules / page2.json” or “ / page2.sdv”. When the system performs the parsing logic, the system will look up the mapping structure according to the identifier in the reference expression to obtain the corresponding path, thereby accurately locating the external resource. Therefore, one significant advantage of the key-value mapping method is that the structure is clear and the parsing is efficient. By decoupling the reference identifier and the path and maintaining the path mapping information in a centralized location, when the path of the external file changes, the path only needs to be updated in this location, and repeated modification at all reference points is not required, thereby greatly improving the maintainability of the system and the reusability of the module.
[0074] Further, in the embodiment of the application, the reference expression itself can be organized in the form of variable interpolation or placeholder. Variable interpolation refers to embedding a specific format expression in the string of the configuration content, and the expression will be replaced by a specific value at runtime. For example, $(ref)page2?id=$(self)parameters.param_id is a typical variable interpolation expression form, which functions to dynamically replace the value corresponding to the identifier in the expression with the actual path and parameter value parsed at runtime. The placeholder is a symbol structure used to identify the replaceable position in the expression, and its essence is also a runtime replacement mechanism, only the form is usually more simplified or abstract.
[0075] The reference expression in the form of variable interpolation or placeholder can realize dynamic parsing and combination of the content of the configuration file, thereby supporting more flexible data transmission and component combination methods. For example, in combination with the mapping structure described above, the following code example is provided:
[0076]
[0077] The reference expression “$(ref)page2?id=$(self)parameters.pid” can be converted to “ / pages / page2.json?id=1” (assuming that the value of parameters.pid is 1) after runtime parsing, thereby realizing accurate path parsing.
[0078] Correspondingly, the application also provides a data reference parsing method for dynamically parsing and replacing the reference expression in the configuration file in a low-code platform to realize stable data transmission between pages, components, and parameters. For details, please refer to Figure 2 The method comprises steps S201-S205.
[0079] S201: Obtain a configuration file containing a reference expression;
[0080] The system first obtains a configuration file containing a reference expression. As described above, the configuration file is a file written in a structured data format (e.g. JSON). The reference expression usually starts with a preset reference prefix, indicating that the value of the field comes from another location rather than static assignment.
[0081] S202: Identify the type of reference prefix in the reference expression;
[0082] The parsing device identifies the type of preset reference prefix used in the reference expression in the configuration file obtained in step S201. For example, “$(self)” is used to identify the data reference relationship within the current configuration file, and “$(ref)” is used to identify the data reference of resources in the external file path.
[0083] S203: Determine the corresponding parsing strategy according to the type of reference prefix;
[0084] The parsing device determines the corresponding parsing strategy according to the identified reference prefix type. If the reference prefix is “$(self)”, it means that the reference target is within the current configuration file, and the system can perform a local data structure search. If the reference prefix is “$(ref)”, the system needs to retrieve the external resource path according to the reference identifier in the reference mapping structure defined in the current configuration file, load the external configuration file content according to the path, and then perform a positioning operation in it.
[0085] S204: Parse the reference expression into actual data based on the parsing strategy;
[0086] The system performs the specific parsing process and parses the value of the reference expression according to the above-mentioned parsing strategy. For internal references, the system extracts the corresponding value from the current configuration file according to the field path corresponding to the identifier in the reference expression. For external references, the system first retrieves the path corresponding to the identifier from the reference mapping item, then loads the corresponding external file, and finally locates the required field value according to the path rule provided by the reference expression.
[0087] S205: Perform data replacement operation to replace the reference expression with the parsed result.
[0088] After parsing, the system performs a data replacement operation on the original reference expression, replacing it with the actual data value obtained in step S204. The replacement can be done at runtime, so that the configuration file presents the final available data in the rendering or execution stage.
[0089] To realize dynamic identification and analysis of data reference relationship, in an embodiment, an identifier is assigned to a reference object in the configuration file; the preset reference prefix includes a self-reference prefix used to indicate internal reference relationship of the configuration file, and an external reference prefix used to indicate external reference relationship across files; a reference mapping item is defined in the configuration file; the corresponding information between the identifier and the external file path is recorded in each reference mapping item; and the step S203 specifically includes: if the type of the reference prefix is the self-reference prefix, the reference object is located in the current configuration file according to the identifier and the actual data is obtained; and if the type of the reference prefix is the external reference prefix, the external file path is obtained in the reference mapping item according to the identifier.
[0090] To realize the distinction of reference types and the distinction of data reference relationship identification in different ranges, in the embodiment, the preset reference prefix is set, including two types of self-reference prefix and external reference prefix. The self-reference prefix is used to indicate that the data involved in the reference relationship is located in the current configuration file, such as “$(self)”; and the external reference prefix is used to indicate that the reference target is located in an external file, such as “$(ref)”. In this way, by distinguishing the reference prefixes of the two reference ranges, the scope of the reference expression can be quickly judged according to the prefix in the preliminary analysis stage, which facilitates data positioning.
[0091] Further, to support reliable analysis of the external reference path, the reference mapping item is defined in the configuration file in the embodiment, which is used to record the corresponding relationship between the reference identifier and the actual external file path. Each reference mapping item is stored in the form of key-value pair, the key is the reference identifier, and the value is the corresponding external file path, such as “page2” mapped to “ / pages / page2.json”, so as to realize centralized management of external file path management, so that when the reference target file structure or path changes, only the external file path of the reference mapping item needs to be modified without modifying all reference expressions one by one, which greatly reduces the maintenance cost.
[0092] In the process of analyzing the reference expression, the system needs to select the appropriate analysis strategy according to the type of the reference prefix. If the type of the identified reference prefix is the self-reference prefix, that is, the data reference relationship in the scenarios such as data transmission and binding between components, parameters and components, the identifier carried in the reference expression is taken as the retrieval basis to locate the object matched with the identifier in the current configuration file, and then the actual data is extracted.
[0093] Accordingly, if the type of the reference prefix is an external reference prefix, the identifier included in the reference expression is used to first retrieve the path of the external file corresponding to the identifier in the reference mapping item. After the path is obtained, the system can load the target file through the path, and further parse the reference relationship or extract the target data in the external file, thereby ensuring the logical consistency and execution efficiency of the reference between cross-file resources.
[0094] For example, if the configuration file includes the following reference expression: "href": "$(ref)page2?id=$(self)parameters.pid", and the defined reference mapping item is: "references": { "page2": " / pages / page2.json"}, the system first identifies $(ref) as an external reference prefix, extracts the identifier page2, and obtains the path / pages / page2.json in the reference mapping item in the parsing process. Then, the $(self)parameters.pid part is processed, and the value corresponding to the parameter item in the current document (e.g., 1) is parsed. Finally, the complete path / pages / page2.json?id=1 is generated by merging, thereby realizing page jumping or data transmission operations.
[0095] In an embodiment, if the type of the reference prefix is an external reference prefix, the external file path is obtained according to the identifier in the reference mapping item, including: searching for a key that completely matches the identifier in each reference mapping item; and returning the external file path corresponding to the key.
[0096] When the system identifies that the type of the reference prefix in the reference expression is an external reference prefix, the parser will start the cross-document path parsing process. In this process, the identifier following the reference prefix in the reference expression is first extracted, for example, page2 in $(ref)page2, as a reference key, and whether there is a key that completely matches the target identifier in the reference mapping item is searched one by one. For example, if the references mapping includes the following configuration:
[0097]
[0098] The system compares page2 with the identifier page2 in the reference expression, confirms the complete match, extracts the value / page2.sdv corresponding to the key as the external file path, and accesses the target resource file through the path. Without relying on the hard-coded path or the complex path expression language, the system can accurately access the target resource file, thereby enhancing the flexibility and maintainability of the reference relationship. The developer only needs to ensure that the identifier has a unique corresponding item in the configuration file, and can realize dynamic positioning and access of cross-document resources, which is suitable for low-code platform environments with frequent changes in document structure or dynamic generation of resource paths.
[0099] The method provided by the present application can be understood in combination with the following examples. In a specific embodiment, a developer constructs an application page based on a low-code platform, and the page configuration file is defined in a structured JSON Schema format. To realize data jump and parameter transmission between pages, the developer defines the data reference relationship between components and across pages in the configuration file by using a data reference representation method, and dynamically analyzes the reference relationship by combining a data analysis method.
[0100] Specifically, the configuration file includes a page node with an identifier "id":"page1", and a parameter object "param_id" in the page, which is an integer type int and has a unique identifier "id": "param_id". In addition, the page also defines a link component "link1", and the jump link configuration is as follows: "href": "$(ref)page2?id=$(self)parameters.param_id".
[0101] Further, the specific code example is as follows:
[0102]
[0103] According to the scheme of the embodiment, "$(ref)page2" represents an external reference, the reference target of which is the reference object with the name "page2" in the "references" item in the current configuration file, and the corresponding external file path is " / page2.sdv". "$(self)parameters.param_id" represents an internal reference in the current configuration file, which refers to the parameter item with the ID "param_id" in the "parameters" array under the "props" node. The parser will first parse the path corresponding to "page2" as " / page2.sdv", and then parse the actual parameter value (such as 1) corresponding to "param_id", and finally construct the page jump path / page2.sdv?id=1. The jump path is used as the attribute of the component link1, and when the user clicks, the page jump with parameters can be realized, and the entire reference process does not depend on the parameter name or the path structure, and the reference relationship can be defined and parsed based on the combination of the identifier and the reference prefix. Even if the name of the parameter is modified from "name":"productid" to "name":"itemid", as long as "id":"param_id" remains unchanged, the data reference relationship between pages remains valid, and the original configuration expression does not need to be modified, ensuring the stability and maintenance efficiency of the system.
[0104] If the same function of the above page jump and parameter passing is implemented by using the prior art, the developer usually needs to directly write the target page path and the parameter name and its value (i.e., the hard coding of the path) in the link component, such as "href":" / page2.sdv?id=productid". The traditional method has the following problems: the reference between data completely depends on the parameter name "productid", and once the user modifies the name (such as to "itemid"), the jump path will be invalid, and needs to be modified to "itemid" from "productid", and when modifying, it may need to judge whether each place really needs to be modified, so when the project structure is complex and the document level is deep, the hard coding of the path is prone to errors due to document migration and reconstruction, and the maintenance cost is high. In addition, each reference must maintain the path information one by one, and it is also easy to be omitted.
[0105] In comparison, the present application encapsulates the data reference relationship into a parseable reference expression, and assists with a reference mapping item and an identifier, so that the data reference relationship in the configuration file is more standardized and stable, and also has the ability to reference across documents. In the visual editing environment of the low-code platform, the technical scheme of the embodiment can significantly reduce the reference invalidation problem caused by component dragging, parameter renaming or structure adjustment, thereby improving the development efficiency and platform usability.
[0106] In order to realize the data reference representation method of the embodiment of the present application, the embodiment of the present application further provides a low-code development system, as shown in the following table: Figure 3 The apparatus comprises:
[0107] An identifier allocation unit 301 is configured to obtain a configuration file for describing a page component, and allocate an identifier for a reference object in the configuration file;
[0108] A reference expression generation unit 302 is configured to represent a data reference relationship in the configuration file by using a preset reference prefix and the identifier, to obtain a reference expression; wherein the preset reference prefix is used to distinguish reference types.
[0109] A reference mapping management unit 303 is configured to define a reference mapping item in the configuration file; wherein each reference mapping item records corresponding information between the identifier and an external file path.
[0110] In an embodiment, the preset reference prefix is used to represent data reference relationships between internal objects of the configuration file and between the configuration file and external files; the preset reference prefix comprises a self-reference prefix used to indicate internal reference relationships of the configuration file, and an external reference prefix used to indicate cross-file external reference relationships.
[0111] In an embodiment, the identifier in the reference mapping item remains unchanged as a fixed identifier, and the external file path is updated according to changes in external file resource configurations.
[0112] In an embodiment, an external reference path component where the external reference prefix is located is in the form of taking the external reference prefix as a key and a file path as a value; and the reference expression is in the form of variable interpolation or a placeholder.
[0113] It should be noted that: the above embodiment provides a data reference representation apparatus, which is only used as an example to illustrate the division of the above program modules, and in actual application, the above processing can be completed by different program modules according to needs, that is, the internal structure of the apparatus is divided into different program modules to complete all or part of the above processing. In addition, the data reference representation apparatus and the data reference representation method embodiment provided by the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0114] In order to realize the data reference representation method of the embodiment of the present application, the embodiment of the present application further provides a data reference analysis apparatus, as shown in the following table: Figure 4 The apparatus comprises:
[0115] The configuration file acquisition unit 401 is configured to acquire a configuration file containing a reference expression;
[0116] The reference prefix identification unit 402 is configured to identify the type of the reference prefix in the reference expression.
[0117] The parsing strategy determination unit 403 is configured to determine a corresponding parsing strategy according to the type of the reference prefix.
[0118] The reference resolution unit 404 is configured to resolve the reference expression into actual data based on the parsing strategy.
[0119] The data replacement unit 405 is configured to perform a data replacement operation to replace the reference expression with the resolution result.
[0120] In an embodiment, the configuration file is assigned with an identifier for a reference object; the preset reference prefix includes a self-reference prefix used to indicate an internal reference relationship of a configuration file, and an external reference prefix used to indicate an external reference relationship across files; the configuration file is defined with reference mapping items; each reference mapping item records corresponding information between the identifier and an external file path.
[0121] The parsing strategy determination unit 403 is specifically configured to:
[0122] If the type of the reference prefix is the self-reference prefix, the reference object is located in the current configuration file according to the identifier, and actual data is acquired.
[0123] If the type of the reference prefix is the external reference prefix, the external file path is acquired in the reference mapping item according to the identifier.
[0124] In an embodiment, the parsing strategy determination unit 403 is specifically configured to:
[0125] A key completely matching the identifier is searched in each reference mapping item.
[0126] An external file path corresponding to the key is returned.
[0127] It should be noted that: the above embodiment provides a data reference resolution device, and only the division of each program module is used as an example for description in the data reference resolution. In actual application, the above processing can be completed by different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the above processing. In addition, the data reference resolution device and the data reference resolution method provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0128] Based on the hardware implementation of the above program modules, and in order to implement the data reference representation method and / or the data reference resolution method provided by the embodiments of the present application, the embodiments of the present application further provide a computer device, such as Figure 5 As shown in the figure, the computer device 500 includes:
[0129] A central processing unit 501, a memory 502, and an input / output interface 503;
[0130] The memory 502 is a transitory storage memory or a persistent storage memory;
[0131] The central processing unit 501 is configured to communicate with the memory 502 and execute the instruction operation in the memory 502 to perform the data reference representation method described in the first aspect of the present application or any specific implementation manner of the first aspect, or the data reference resolution method described in the second aspect of the present application or any specific implementation manner of the second aspect.
[0132] Of course, in actual application, various components in the computer device 500 are coupled together through a bus system 504. It can be understood that the bus system 504 is used to realize the connection and communication between the components. The bus system 504 includes not only a data bus, but also a power bus, a control bus, and a status signal bus. However, in order to clearly illustrate the present application, all kinds of buses are marked as the bus system 504 in the figure. Figure 5
[0133] The memory 502 in the embodiments of the present application is used to store various types of data to support the operation of the computer device 500. Examples of these data include: any computer program used for operation on the computer device 500.
[0134] It can be understood that when the processor in the computer device described above executes the computer program, the functions of each unit in the corresponding device embodiments described above can also be realized, which will not be described here. Exemplarily, the computer program can be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the embodiments of the present application. One or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the computer device. For example, the computer program can be divided into the units in the computer device described above, and each unit can realize the specific functions as described above with respect to the corresponding computer device.
[0135] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and the like. The computer device can include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the processor and the memory are merely examples of the computer device, and do not constitute a limitation on the computer device, and can include more or fewer components, or combine certain components, or different components, for example, the computer device can also include an input / output device, a network access device, a bus, and the like.
[0136] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, and the like. The processor is the control center of the computer device, and connects all parts of the computer device through various interfaces and lines.
[0137] The memory can be used to store computer programs and / or modules, and the processor realizes various functions of the computer device by running or executing the computer programs and / or modules stored in the memory, and calling data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required by a function, and the like; and the data storage area can store data created according to the use of the terminal, and the like. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0138] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to perform the data reference representation method described in the first aspect of the embodiment of the present application or any specific implementation manner of the first aspect, or the data reference analysis method described in the second aspect of the embodiment of the present application or any specific implementation manner of the second aspect.
[0139] The embodiment of the present application further provides a computer program product, which stores a computer program / instruction, and the computer program / instruction is executed by a processor to implement the data reference representation method described in the first aspect of the embodiment of the present application or any specific implementation manner of the first aspect, or the data reference analysis method described in the second aspect of the embodiment of the present application or any specific implementation manner of the second aspect.
[0140] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the system, device and unit described above can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0141] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented by other manners. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interfaces, devices or units, and can be electrical, mechanical or other forms.
[0142] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.
[0143] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0144] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
Claims
1. A data reference representation method, characterized by, The method comprises: obtaining a configuration file used for describing a page component, and assigning an identifier to a reference object in the configuration file; in the configuration file, representing a data reference relationship in the configuration file by using a preset reference prefix and the identifier, to obtain a reference expression; wherein the preset reference prefix is used to distinguish reference types; defining reference mapping items in the configuration file; wherein each reference mapping item records corresponding information between the identifier and an external file path.
2. The method of claim 1, wherein, The preset reference prefix is used to represent the data reference relationship between internal objects of the configuration file and between the configuration file and external files; the preset reference prefix comprises a self-reference prefix used to indicate an internal reference relationship of the configuration file, and an external reference prefix used to indicate an external reference relationship across files.
3. The method of claim 1, wherein, The identifier in the reference mapping item remains unchanged as a fixed identifier, and the external file path is updated according to changes in external file resource configuration.
4. The method of claim 1, wherein, The external reference path component where the external reference prefix is located is in the form of taking the external reference prefix as a key and a file path as a value; and the reference expression is in the form of a variable interpolation or a placeholder.
5. A data reference resolution method, characterized by, The method comprises: obtaining a configuration file containing a reference expression; identifying the type of the reference prefix in the reference expression; determining a corresponding resolution strategy according to the type of the reference prefix; resolving the reference expression into actual data based on the resolution strategy; performing a data replacement operation to replace the reference expression with the resolution result.
6. The method of claim 5, wherein, The configuration file assigns an identifier to a reference object; the preset reference prefix comprises a self-reference prefix used to indicate an internal reference relationship of the configuration file, and an external reference prefix used to indicate an external reference relationship across files; the configuration file defines reference mapping items; each reference mapping item records corresponding information between the identifier and an external file path; The method of determining a corresponding resolution strategy according to the type of the reference prefix comprises: if the type of the reference prefix is a self-reference prefix, locating a reference object in a current configuration file according to the identifier and obtaining actual data; if the type of the reference prefix is an external reference prefix, obtaining an external file path in the reference mapping items according to the identifier.
7. The method of claim 6, wherein, If the type of the reference prefix is an external reference prefix, obtaining an external file path in the reference mapping items according to the identifier, comprises: finding a key that completely matches the identifier in each reference mapping item; returning an external file path corresponding to the key.
8. A low-code development system characterized by, The method comprises: an identifier assignment unit, configured to obtain a configuration file used for describing a page component, and assign an identifier to a reference object in the configuration file; a reference expression generation unit, configured to represent a data reference relationship in the configuration file by using a preset reference prefix and the identifier, to obtain a reference expression; wherein the preset reference prefix is used to distinguish reference types; a reference mapping management unit, configured to define reference mapping items in the configuration file; wherein each reference mapping item records corresponding information between the identifier and an external file path.
9. A computer device, comprising: The method comprises: a central processing unit, a memory, and an input / output interface; the memory is a volatile memory or a persistent memory; the central processing unit is configured to communicate with the memory and execute instructions in the memory to perform the method of any one of claims 1-7.
10. A computer-readable storage medium having stored thereon a computer program, characterized in that, the computer program, when executed by a processor, performs the method of any one of claims 1-7.
