WO2023109074A1 - Method and apparatus for implementing linkage function, device, storage medium, and program - Google Patents

Method and apparatus for implementing linkage function, device, storage medium, and program Download PDF

Info

Publication number
WO2023109074A1
WO2023109074A1 PCT/CN2022/100726 CN2022100726W WO2023109074A1 WO 2023109074 A1 WO2023109074 A1 WO 2023109074A1 CN 2022100726 W CN2022100726 W CN 2022100726W WO 2023109074 A1 WO2023109074 A1 WO 2023109074A1
Authority
WO
WIPO (PCT)
Prior art keywords
linkage
node
component
condition
component node
Prior art date
Application number
PCT/CN2022/100726
Other languages
French (fr)
Chinese (zh)
Inventor
郑荣东
江旻
王大飞
陈秋雁
黎联成
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2023109074A1 publication Critical patent/WO2023109074A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/36Software reuse
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Definitions

  • This application relates to the technical field of cloud computing in financial technology (Fintech), and involves but is not limited to a method, device, electronic device, computer storage medium and computer program product for realizing linkage functions.
  • the present application provides a method, device, electronic equipment, computer storage medium and computer program product for realizing the linkage function, which can solve the problems of limited generalization and high cost in iterative development of Formily linkage development in the related art.
  • the embodiment of the present application provides a method for realizing the linkage function, which is applied to the low-code core class of the Formily framework, and the method includes:
  • the JSON Schema configuration sent from the user page;
  • the JSON Schema configuration is obtained by the user page from the page designer;
  • the JSON Schema configuration includes linkage configuration information for describing multiple component nodes of the user page , and the linkage configuration information of different component nodes corresponds to the same data structure specification;
  • the linkage configuration information of each component node in the plurality of component nodes is obtained; according to the data structure specification, the linkage configuration information of each component node is subjected to linkage analysis processing, and the linkage analysis is obtained.
  • the processed linkage function code is
  • the linkage function code for each component node is realized by using the linkage function code after the linkage analysis and processing.
  • the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result of the component node and linkage conditions; the linkage conditions include condition node paths and Condition component node type;
  • the linkage function code after the linkage analysis and processing is used to perform the following steps:
  • the current linkage configuration information included in the current component node according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes;
  • the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
  • the linkage condition further includes a condition node value and a condition node value type, and the judging whether the found component node satisfies the linkage condition includes:
  • condition value after the type conversion is the same as the condition node value in the linkage condition, determine that the found component node satisfies the linkage condition;
  • condition value after the type conversion is different from the condition node value in the linkage condition, it is determined that the found component node does not satisfy the linkage condition.
  • linkage function code after the linkage analysis and processing to realize the linkage function for each component node includes:
  • the linkage function code is invoked through the linkage function api to realize the linkage function for each component node.
  • the method also includes:
  • the verification function code for each component node is realized by using the verification function code after the verification analysis.
  • the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result of the component node and linkage conditions; the linkage conditions include condition node paths and Condition component node type;
  • the verification function code after the linkage analysis and processing is used to perform the following steps:
  • the current linkage configuration information included in the current component node according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes;
  • the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
  • finding the component node from other component nodes includes:
  • a component node of the same type as the conditional component node in the linkage condition is found from the partial component nodes.
  • said verifying and parsing the processed verifying function code to realize the verifying function of each component node includes:
  • the verification function for each component node is realized by executing the verification function code.
  • the method further includes:
  • the embodiment of the present application also proposes a device for realizing the linkage function, the device includes a receiving module, an obtaining module and a linkage module, wherein,
  • the receiving module is configured to receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes multiple components for describing the user page
  • the linkage configuration information of the node, and the linkage configuration information of different component nodes corresponds to the same data structure specification;
  • Obtaining a module configured to obtain the linkage configuration information of each component node in the plurality of component nodes by traversing the JSON Schema configuration; performing linkage analysis on the linkage configuration information of each component node according to the data structure specification processing to obtain the linkage function code after linkage analysis and processing;
  • the linkage module is configured to realize the linkage function of each component node by using the linkage function code after the linkage analysis and processing.
  • An embodiment of the present application provides an electronic device, the device includes a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements one or more of the aforementioned technologies when executing the program The method provided by the scheme to realize the linkage function.
  • An embodiment of the present application provides a computer storage medium, and the computer storage medium stores a computer program; after the computer program is executed, the method for realizing the linkage function provided by the aforementioned one or more technical solutions can be implemented.
  • the embodiment of the present application also provides a computer program product, including computer readable code, when the computer readable code is run in the electronic device, the processor in the electronic device executes to implement the aforementioned one or more The method for realizing the linkage function provided by the technical solution.
  • the embodiment of the present application proposes a method, device, electronic device, computer storage medium, and computer program product for realizing the linkage function, which are applied to the low-code core class of the Formily framework, and the method includes: receiving the JSON sent from the user page Schema configuration; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes linkage configuration information for describing multiple component nodes of the user page, and the linkage of different component nodes
  • the configuration information corresponds to the same data structure specification; by traversing the JSON Schema configuration, the linkage configuration information of each component node in the plurality of component nodes is obtained; the linkage configuration of each component node according to the data structure specification
  • the information is subjected to linkage analysis and processing to obtain a linkage function code after linkage analysis and processing; using the linkage function code after linkage analysis and processing to realize the linkage function of each component node.
  • each component node included in the JSON Schema configuration corresponds to the same data structure specification
  • you can Based on a generalized data structure specification these component nodes are linked and analyzed.
  • the problem of limited generalization of linked development can be solved; further, when these component nodes are linked and analyzed according to the data structure specification , by combing the rules of each protocol field in the data structure specification, the function code for realizing the linkage function can be automatically generated, so that developers do not need to hand-write code blocks related to complex linkage functions every time, and solve the cost of linkage functions in iterative development high question.
  • FIG. 1A is a schematic flow diagram of a method for realizing a linkage function in an embodiment of the present application
  • Fig. 1B is a schematic flow diagram of executing linkage function codes in the embodiment of the present application.
  • FIG. 1C is a schematic diagram of a data structure specification in the embodiment of the present application.
  • FIG. 2A is a schematic diagram of a scenario for implementing a linkage verification function according to an embodiment of the present application
  • FIG. 2B is a schematic flow diagram of performing linkage analysis processing and verification analysis processing according to an embodiment of the present application
  • FIG. 2C is another schematic flow diagram of linkage analysis processing according to the embodiment of the present application.
  • FIG. 2D is another schematic flowchart of verification and analysis processing according to the embodiment of the present application.
  • Fig. 3 is a schematic diagram of the composition and structure of the device for realizing the linkage function according to the embodiment of the present application;
  • FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion, so that a method or device comprising a series of elements not only includes the explicitly stated elements, but also include other elements not explicitly listed, or also include elements inherent in implementing the method or apparatus.
  • an element defined by the phrase “comprising a" does not exclude the presence of additional related elements (such as steps in the method or A unit in an apparatus, for example, a unit may be part of a circuit, part of a processor, part of a program or software, etc.).
  • the method for realizing the linkage function provided by the embodiment of the present application includes a series of steps, but the method for realizing the linkage function provided by the embodiment of the present application is not limited to the steps described.
  • the method for realizing the linkage function provided by the embodiment of the present application The functional device includes a series of modules, but the device for realizing the linkage function provided by the embodiment of the application is not limited to include the modules explicitly recorded, and may also include the required settings for obtaining relevant task data or processing based on task data module.
  • the embodiments of the present application can be applied to a computer system composed of servers, and can operate together with many other general-purpose or special-purpose computing system environments or configurations.
  • the server may be a distributed cloud computing technology environment including a small computer system, a large computer system, and so on.
  • program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types.
  • the computer system/server can be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network.
  • program modules may be located in both local and remote computing system storage media including storage devices.
  • Formily has three ways of using Markup Schema, JSON Schema, and JSX; the embodiment of this application can be aimed at the way of using JSON Schema.
  • the JSON Schema protocol data type used by Formily is not rich enough.
  • the JSON Schema used by Formily is a JSON string, which is generated by the page designer.
  • the value corresponding to the JSON string is mostly entered manually by the user through the input box, the obtained value is a string type.
  • Formily's schema type (type) only supports string, object, array, number, boolean, void, date and datetime. Therefore, when encountering basic types such as Boolean values (true, false), the input box of string type cannot correctly convert the string type value into a Boolean type value.
  • Formily's schema type cannot be converted correctly through string type values.
  • Formily's linkage development has limitations in generalization and high cost in iterative development.
  • the method for realizing the linkage function can be implemented by using a processor in a device for realizing the linkage function, and the above-mentioned processor can be an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor ( Digital Signal Processor, DSP), Digital Signal Processing Device (Digital Signal Processing Device, DSPD), Programmable Logic Device (Programmable Logic Device, PLD), Field Programmable Logic Gate Array (Field Programmable Gate Array, FPGA), CPU At least one of (Central Processing Unit, CPU), controller, microcontroller, microprocessor.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processing Device
  • PLD Programmable Logic Device
  • FPGA Field Programmable Logic Gate Array
  • CPU At least one of (Central Processing Unit, CPU), controller, microcontroller, microprocessor.
  • Fig. 1A is a schematic flowchart of a method for realizing linkage function in the embodiment of the present application. As shown in Fig. 1A, the method includes the following steps:
  • Step 100 Receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes linkage configuration information for describing multiple component nodes of the user page, and different component nodes
  • the linkage configuration information corresponds to the same data structure specification.
  • the method for realizing the linkage function can be applied to the low-code core class of the Formily framework;
  • the Formily framework includes not only the low-code core class, but also a user page and a page designer; wherein, the user page can be the World Wide Web ( The WEB interface corresponding to the World Wide Web (WEB) application can also be other human-computer interaction interfaces; the page designer is a page design platform developed by low-code, which can finally output a JSON data conforming to the JSON Schema protocol.
  • the low-code core class receives the JSON Schema configuration sent from the user page; as an example, the implementation process can be as follows, when the user page is opened, a data request for obtaining the JSON Schema configuration is sent to the page designer through the user page , when the page designer receives the data request, it returns the JSON Schema configuration to the user page, and sends the JSON Schema configuration to the low-code core class. At this time, the low-code core class receives the JSON Schema configuration sent from the user page .
  • the JSON Schema configuration can be represented by a tree data structure in JSON format, where the tree data structure is composed of multiple component nodes describing the user page; here, the component node representation is used to describe the user page
  • the node corresponding to the data information of the component.
  • the component node can be an abstract data type of view plus interactive logic, and can include hypertext markup language (hypertext markup language, html) templates, cascading style sheets (cascading style sheets, css) styles and js (javascript) Logical code snippets.
  • Step 101 By traversing the JSON Schema configuration, obtain the linkage configuration information of each component node among multiple component nodes; perform linkage analysis processing on the linkage configuration information of each component node according to the data structure specification, and obtain the linkage function after linkage analysis processing code.
  • the linkage configuration array saves the linkage configuration information from all component nodes in the JSON Schema configuration; here, the linkage configuration array is located in the cache of the low-code core class.
  • the linkage configuration information can be saved according to the format [ ⁇ "key", “data structure specification” ⁇ ]; here "key” represents the component node identity number (identity document, id).
  • key represents the component node identity number (identity document, id).
  • the linkage analysis processing is equivalent to declaring the code blocks corresponding to each protocol field in the linkage configuration information.
  • the linkage analysis processing it can be automated. Generate subsequent function codes required to realize the linkage function of each component node. It can be seen that in this process, there is no need for developers to write code blocks related to linkage functions by hand, so the problem of high cost in iterative development of linkage functions can be solved.
  • Step 102 Realize the linkage function for each component node by using the linkage function code after linkage analysis and processing.
  • a component node may include multiple pieces of linkage configuration information, wherein each piece of linkage configuration information in the multiple pieces of linkage configuration information may include the final setting result of the component node and linkage conditions; wherein, the linkage conditions may include condition node paths and Condition component node type.
  • the linkage function code after linkage analysis and processing is used to perform the following steps:
  • Step 1021 In the current linkage configuration information included in the current component node, according to the condition node path and the condition component node type in the linkage condition, find out the component node from other component nodes;
  • Step 1022 Determine whether the found component nodes meet the linkage condition
  • Step 1023 When it is determined that the found component node satisfies the linkage condition, determine that the current linkage configuration information satisfies the linkage condition, and set the final setting result in the current linkage configuration information to the result of the current component node.
  • the current component node represents a component node among the multiple component nodes that needs to be analyzed and processed currently; the rest of the component nodes represent component nodes among the multiple component nodes except the current component node.
  • finding the component node from the remaining component nodes may include: determining the part corresponding to the condition node path in the linkage condition from the remaining component nodes Component nodes; find component nodes of the same type as the conditional component nodes in the linkage condition from some component nodes.
  • the linkage condition of the current component node first, according to the condition node path in the linkage condition of the current component node, find out some component nodes under the condition node path from the remaining component nodes; Traverse each component node in some component nodes to find out the component node with the same type as the conditional component node in the linkage condition.
  • the found component node satisfies the linkage condition
  • the final setting result in the current linkage configuration information can be set to the result of the current component node
  • next linkage configuration information included in the component node check whether the found component node satisfies the linkage condition until the linkage configuration information matching the current component node is found; If the linkage configuration information matching the current component node is found, it means that the current component node does not need to trigger linkage.
  • the linkage condition may also include a condition node value and a condition node value type, and judging whether the found component node satisfies the linkage condition may include: pairing the searched component node according to the condition node value type in the linkage condition Convert the condition node value to get the condition value after type conversion; if the condition value after type conversion is the same as the condition node value in the linkage condition, it is determined that the found component node meets the linkage condition; after the type conversion If the condition value is not the same as the condition node value in the linkage condition, it is determined that the found component node does not satisfy the linkage condition.
  • the found component node if it is determined that the found component node meets the linkage condition, it means that the current linkage configuration information contained in the current component node meets the linkage condition; otherwise, if it is determined that the found component node does not meet the linkage condition, it means that the current component node includes The current linkage configuration information for does not meet the linkage conditions.
  • the linkage configuration information of each component node in the JSON Schema configuration corresponds to the same data structure specification; here, the data structure specification is a generalized protocol specification newly defined in this application; FIG. A schematic diagram of a data structure specification, as shown in Figure 1C, the data structure specification "includeAttributeValues" can be expressed in the form of ⁇ values, condition ⁇ key, values, formType, valueType ⁇ , errorMsg ⁇ ; below, the data structure Each attribute (that is, the protocol field) in the specification is described.
  • the values attribute represents the final setting result of the component node that needs to be analyzed and processed in conjunction; it should be noted that for different types of component nodes, the types of corresponding values can be different.
  • the component node is an Input component
  • values The value represents the type of linkage condition
  • the component node is a Select component
  • the values value represents the range of options
  • the condition attribute defines the conditions required for the linkage judgment of the component node, and the purpose of setting the judgment conditions in the condition attribute is to facilitate
  • the code core class performs code analysis for linkage condition judgment.
  • condition.key (the key in the condition attribute) represents the path of the condition node that needs to be observed, specifically how to observe the implementation of the linkage function code obtained by subsequent analysis.
  • condition.values (values in the condition attribute) represents the condition node value, which defines the specific value of the judgment condition.
  • condition.formType (formType in the condition attribute) represents the condition component node type, and each component node encapsulates its own linkage analysis method.
  • condition.valueType (valueType in the condition attribute) defines the data type of the condition node; here, condition.values and condition.valueType appear in pairs; errorMsg represents the error message.
  • the component node corresponding to condition.formType will first perform type conversion according to condition.valueType, and then judge the condition node value of the component node corresponding to condition.formType to determine Whether the current component node that requires linkage parsing and processing meets the linkage conditions.
  • the various attributes included in the data structure specification are sorted out through actual business, and they describe the key data information related to the linkage of component nodes.
  • Corresponding linkage parsing and processing of linkage configuration information can solve the problem that linkage development is limited in generalization.
  • the found component node in the process of judging whether the found component node satisfies the linkage condition according to the current linkage configuration information included in the current component node, it may be traversed according to the component node id of each component node in the found component node , judge one by one whether the value of the condition node after the type conversion of each component node is the same as the value of the condition node in the linkage condition of the current component node.
  • the linkage configuration information satisfies the linkage condition.
  • the final setting result in the current linkage configuration information can be set to the result of the current component node.
  • the found component node does not meet the linkage condition, that is, the current linkage configuration information does not meet the linkage condition.
  • the linkage configuration information matching the current component node is found; if the linkage configuration information matching the current component node cannot be found among the multiple linkage configuration information included in the current component node, it means that the current component node does not need to trigger linkage.
  • the linkage configuration information matching the current component node can be found from the multiple pieces of linkage configuration information included in the current component node, and the linkage configuration information can be used for subsequent implementation of the current component node. linkage.
  • using the linkage function code after linkage analysis and processing to realize the linkage function to each component node may include: registering the linkage function code after linkage analysis and processing into the linkage function api of the Formily framework; When the user page triggers linkage for each component node, the linkage function code is called through the linkage function api to realize the linkage function for each component node.
  • the corresponding linkage function code can be obtained, and the linkage function code can be registered in the Formily framework
  • the linkage function api is located in the user interface; later, when the user triggers linkage to the current component node through the user page, the corresponding linkage function code can be called according to the linkage function api, and by executing the linkage function code, you can Realize the linkage function of the current component node.
  • the embodiment of the present application proposes a method, device, electronic device, computer storage medium, and computer program product for realizing the linkage function, which are applied to the low-code core class of the Formily framework, and the method includes: receiving the JSON Schema configuration sent from the user page ;JSON Schema configuration is obtained by the user page from the page designer; JSON Schema configuration includes the linkage configuration information used to describe multiple component nodes of the user page, and the linkage configuration information of different component nodes corresponds to the same data structure specification; Traverse the JSON Schema configuration to obtain the linkage configuration information of each component node among multiple component nodes; perform linkage analysis and processing on the linkage configuration information of each component node according to the data structure specification, and obtain the linkage function code after linkage analysis and processing; use linkage Parse the processed linkage function code to realize the linkage function of each component node.
  • the above method may further include: performing verification and analysis processing on the linkage configuration information of each component node according to the data structure specification to obtain the verification function code after the verification and analysis processing;
  • the verification function code realizes the verification function of each component node.
  • the data structure specification for performing verification analysis processing is the same as the above-mentioned data structure specification for performing linkage analysis processing, and will not be repeated here.
  • the linkage configuration information of each component node is verified and analyzed according to the same data structure specification as the linkage analysis process, which can improve the accuracy of the verification result of the component node.
  • the verification function code after linkage analysis and processing is used to perform the following steps: in the current linkage configuration information included in the current component node, according to the condition node path and condition component node type in the linkage condition, Find the component nodes from the rest of the component nodes; the current component node represents the component node that needs to be analyzed and processed currently among the multiple component nodes, and the remaining component nodes represent the component nodes other than the current component node among the multiple component nodes; judge the found one Whether the component node meets the linkage condition;
  • the found component node satisfies the linkage condition, continue to judge whether the current component node passes the verification; here, passing the verification shows that the result of the current component node is consistent with the final The setting results are the same; if the verification fails, it means that the result of the current component node is different from the final setting result in the current linkage configuration information.
  • the verification function code of each component node is realized by using the verification function code after the verification analysis processing, which may include: registering the verification function code after the linkage analysis processing to the submission of the low-code core class In function; when the data recovery or submission operation is determined on the user page, the verification function of each component node is realized by executing the verification function code.
  • the above method may further include: performing type conversion on the output data of the verification function code according to the condition node data type in the linkage condition of the current component node.
  • the output data of the verification function code related to the current component node can be type-converted according to the condition node data type in the linkage condition of the current component node to obtain the verification function code final output.
  • the JSON Schema protocol data type can be enriched, and the problem that some data types cannot be correctly converted through the string type in related technologies can be solved.
  • Fig. 2A is a schematic diagram of a scenario for realizing the linkage verification function according to an embodiment of the present application. As shown in Fig. 2A, the figure includes: a user page, a low code core class (LowcodeCore) and a page designer; the specific implementation process can be as follows :
  • the user page sends a data request to the page designer to obtain the JSON Schema configuration; when the page designer receives the data request, it returns the JSON Schema configuration to the user page; after receiving the JSON Schema configuration, the user page sends the JSON Schema configuration Configuration is sent to low-code core classes.
  • the low-code core class finds out the linkage configuration information of each component node under each level of node tree by traversing the tree data structure configured by JSON Schema and saves it in the linkage configuration array; the low-code core class performs linkage configuration according to the data structure specification
  • the linkage configuration information of each component node in the configuration array is analyzed for linkage and verification, and the linkage function code and verification function code are automatically generated.
  • Fig. 2B is a schematic flow diagram of a linkage analysis process and verification analysis process according to an embodiment of the present application. As shown in Fig. 2B, the process includes the following steps:
  • Step A1 Obtain the linkage configuration array.
  • the low-code core class obtains a linkage configuration array from its own cache, and the linkage configuration array includes linkage configuration information of all component nodes in the JSON Schema configuration.
  • Step A2 Determine the work type as linkage type.
  • the work type includes two types: linkage type and verification type.
  • Step A3 Carry out linkage parsing and processing according to the data structure specification.
  • the low-code core class after determining that the current work type is a linkage type, performs linkage analysis and processing on multiple pieces of linkage configuration information in the linkage configuration array corresponding to the current component node according to the data structure specification.
  • Step A4 Find the linkage configuration information that meets the linkage conditions by traversing the linkage configuration array.
  • Step A5 Set the values in the linkage configuration information to the current component node.
  • the values value corresponds to the final setting result in the above-mentioned current linkage configuration information; after traversing the linkage configuration array to determine that all component nodes in the current linkage configuration information meet the linkage conditions, the current linkage configuration information
  • the values (final setting result) in are set to the current component node; at this time, the linkage analysis processing for the current component node is completed, and the linkage function code after the linkage analysis processing is obtained.
  • Step A2' Determine the work type as the verification type.
  • Step A3' Perform verification and parsing processing according to the data structure specification.
  • the low-code core class determines that the current work type is the verification type, it performs verification analysis processing on multiple pieces of linkage configuration information in the linkage configuration array corresponding to the current component node according to the data structure specification.
  • Step A4' find the linkage configuration information satisfying the linkage condition by traversing the linkage configuration array.
  • Step A5' Judging whether it is equal to the result of the current component node.
  • the linkage configuration information that satisfies the linkage condition, it is judged whether the values (final setting result) in the linkage configuration information is equal to the result of the current component node; if yes, it means that the verification function of the current component node is passed. , the verification is successful; otherwise, it indicates that the verification function of the current component node has failed, and at this time, the verification failure is returned.
  • FIG. 2C is another schematic flow diagram of the linkage analysis process according to the embodiment of the present application. As shown in FIG. 2C, the process includes the following steps :
  • Step B1 Obtain the linkage configuration array.
  • Step B2 Obtain the current linkage configuration information of the current component node.
  • the current piece of linkage configuration information of the current component node can be acquired from the linkage configuration array in a traversal manner.
  • the current component node represents the JSON description of one of the user interface (User Interface, UI) components in the JSON Schema tree configuration describing the current user page.
  • Step B3 Determine whether the current component node has changed.
  • Step B4 Determine some component nodes according to the conditional node path in the linkage condition.
  • some component nodes are determined according to the path of the conditional node in the linkage condition.
  • Step B5 Obtain the ComponentSchema component instance of the found component node according to the conditional component node type in the linkage condition.
  • Step B6 Pass the condition node value type and condition node value in the linkage condition to the ComponentSchema component instance of the found component node.
  • the ComponentSchema component instance after passing the condition node value type and condition node value in the linkage condition to the ComponentSchema component instance of the found component node, the ComponentSchema component instance will match the found component node according to the condition node value type in the linkage condition Perform type conversion on the condition node value of each component node in , and obtain the condition value after type conversion; judge the condition value after type conversion and the condition node value in the linkage condition, and determine whether the found component nodes satisfy the linkage condition .
  • Step B7 Judging whether the linkage condition is met. If yes, execute step B8, otherwise, execute step B4 for determining whether the next piece of linkage configuration information included in the current component node satisfies the linkage condition.
  • the found component node satisfies the linkage condition, and when it is determined that the type-converted condition value corresponding to the found component node is the same as the condition node value in the linkage condition, it is determined that the found component node satisfies The linkage condition, that is, the current linkage configuration information satisfies the linkage condition; otherwise, it is determined that the current linkage configuration information does not meet the linkage condition.
  • Step B8 Obtain the ComponentSchema component instance of the current component node, and transfer the values in the current linkage configuration information to the ComponentSchema component instance of the current component node for setting.
  • the ComponentSchema component instance of the current component node when it is determined that the current linkage configuration information satisfies the linkage condition, the ComponentSchema component instance of the current component node can be obtained, and the values in the current linkage configuration information can be transferred to the ComponentSchema component instance of the current component node for further processing.
  • the setting of the linkage result that is, setting the values (final setting result) in the current linkage configuration information to the ComponentSchema component instance of the current component node.
  • the linkage configuration array relationConfigArr including the linkage configuration information of all component nodes is taken out from the low-code core class.
  • the current component node in the linkage configuration array can represent For: '[ ⁇ "key”:"detail.identity”,”includeAttributeValues”:[ ⁇ "values":[ ⁇ "regex”:" ⁇ S”,”errorRemind”:”” ⁇ ],”condition”: [ ⁇ "key”:”detail.identityType”,”values":[ ⁇ "label”:"ID card”,”value":"0" ⁇ ],”formType”:”select”,”valueType”:” 2" ⁇ ] ⁇ ] ⁇ ]'; relationConfigArr.*.key represents the current component node id, and relationConfigArr.*.includeAttributeValues represents the linkage configuration information of the current component node.
  • the linkage configuration information relationConfig of the current component node is as follows: ( ⁇ "includeAttributeValues":[ ⁇ "values":[ ⁇ "regex”:" ⁇ S","errorRemind”:”” ⁇ ],”condition”:[ ⁇ "key”:”detail.
  • identityType "values":[ ⁇ "label”:"ID card”,”value":"0" ⁇ ]
  • formType "select”
  • Formily's data source ⁇ detail: ⁇ identity,identityType ⁇
  • condition node of relationConfig configures the condition node of relationConfig as the linkage judgment condition, use the value of condition.key as "detail.identityType" as the dependency path, and then call Formily's API onFieldValueChange with the condition.key path as detail.
  • the data of identityType monitors and registers a callback function. In the callback function, when the detail.identityType changes, get the result of detail.identityType from the formal parameter of the callback function. Then obtain the corresponding ComponentSchema component instance according to the condition.formType component type, pass the range values of the detail.identityType and condition.values judgment conditions to the ComponentSchema component instance and call validate for verification.
  • condition condition check passes, it means that the linkage condition of the current component is satisfied, otherwise it is not satisfied. Then use Array.some to traverse, verify and analyze the component nodes in the linkage configuration array. If there is a condition condition in the linkage configuration array that passes the verification of the ComponentSchema component instance, set the linkage result includeAttributeValues.*.values to the configuration relationConfig. On the component corresponding to key, the component corresponding to relationConfig.key will call Formily API setFieldState according to the current component rules to set the linkage result includeAttributeValues.*.values to the correct attribute.
  • Fig. 2D is another schematic flow diagram of verification analysis processing according to the embodiment of the present application. As shown in Fig. 2D, the flow includes the following steps:
  • Step C1 Obtain the linkage configuration array.
  • Step C2 Obtain the linkage configuration information of the component nodes that need to be parsed and processed in linkage.
  • linkage configuration information of all component nodes requiring linkage parsing and processing may be acquired from the linkage configuration array in a traversal manner.
  • Step C3 Verify according to the linkage configuration information of the current component node.
  • the current component node is a component node among all component nodes that need to be linked and parsed.
  • Step C4 Judging whether all checks are passed.
  • step C12 and step C13 in sequence If yes, execute step C12 and step C13 in sequence, otherwise, execute step C5.
  • Step C5 Obtain the ComponentSchema component instance of the found component node according to the conditional component node type in the linkage condition.
  • Step C6 Pass the condition node value type and condition node value in the linkage condition of the current component node to the ComponentSchema component instance of the found component node.
  • steps C5 to C6 are implemented in the same way as the above steps B5 to B6, and will not be repeated here.
  • Step C7 Judging whether the linkage condition is met. If yes, execute step C8, otherwise, execute step C4 to determine whether all the component nodes that require linkage analysis and processing pass the verification, if not, follow the steps below to continue the linkage verification of the next component node of the current component node ; At this point, the default current component node check is passed.
  • Step C8 Get the ComponentSchema component instance of the current component node.
  • the ComponentSchema component instance of the current component node can be obtained
  • Step C9 Transfer the values in the current linkage configuration information to the ComponentSchema component instance of the current component node for verification.
  • Step C10 Judging whether the verification is passed.
  • Step C11 Return verification failure.
  • Step C12 Perform type conversion processing on the output data.
  • the output data of the verification function code related to the current component node can be type-converted to obtain the final output result.
  • Step C13 Return verification success.
  • the linkage configuration array relationConfigArr including the linkage configuration information of all component nodes is taken out from the low-code core class.
  • the current component node in the linkage configuration array can represent For: '[ ⁇ "key”:"detail.identity”,”includeAttributeValues”:[ ⁇ "values":[ ⁇ "regex”:" ⁇ S”,”errorRemind”:”” ⁇ ],”condition”: [ ⁇ "key”:”detail.identityType”,”values":[ ⁇ "label”:"ID card”,”value":"0" ⁇ ],”formType”:”select”,”valueType”:” 2" ⁇ ] ⁇ ] ⁇ ]'.
  • relationConfigArr.*.key represents the current component node id
  • relationConfigArr.*.includeAttributeValues represents the linkage configuration information of the current component node.
  • the linkage configuration information relationConfig of the current component node is as follows: ( ⁇ "includeAttributeValues":[ ⁇ "values":[ ⁇ "regex”:" ⁇ S","errorRemind”:”” ⁇ ],”condition”:[ ⁇ "key”:"detail.
  • identityType "values":[ ⁇ "label”:"ID card”,”value":"0" ⁇ ]
  • formType "select”
  • the result data source of the submitted operation ⁇ detail: ⁇ identity,identityType ⁇
  • condition node of relationConfig is used as the linkage judgment condition
  • value of condition.key "detail.identityType” is used as the dependency path to extract the value of detail.identityType from the data source, and then obtain it according to the condition.formType component type Go to the corresponding ComponentSchema component instance, pass the range values of the detail.identityType and condition.values judgment conditions to the ComponentSchema component instance and call validate for verification. If the match is successful, it means that the linkage condition node has passed, otherwise continue to traverse the next linkage configuration. If none of the conditional nodes match successfully, it can pass the verification on behalf of the current node relationConfig.key.
  • relationConfig.key node id.
  • relationConfig.key by configuring relationConfig.key to "detail.identity" as the value path, take out the verification value from the data source, and pass the verification value and includeAttributeValues.*.values matching result range to the ComponentSchema component instance for verification. Only when the verification value conforms to the result range of includeAttributeValues.*.values can the verification pass, otherwise the node verification of relationConfig.key returns failure. Then use Array.every to traverse and analyze the verification configuration array relationConfigArr of all nodes.
  • the verification function of the verification function code is confirmed to pass, otherwise return fail. After the verification function is passed, it is necessary to perform type conversion of the output data to obtain the final data data.
  • the process of conversion such as ComponentSchema component instance, has config attribute to represent configuration information, and config.valueType represents output data type. For example, when the valueType is a number type, the output data of the current node needs to be processed as a number type. For example, 1 in a string will be updated to 1 in a number type.
  • the final verification function code is successful, output the verification result and output data such as ⁇ status: true, data: ⁇ a1, a2, a3 ⁇ .
  • Fig. 3 is a schematic diagram of the composition and structure of the device for realizing the linkage function according to the embodiment of the present application.
  • the device includes a receiving module 300, an obtaining module 301 and a linkage module 302, wherein,
  • the receiving module 300 is configured to receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes multiple The linkage configuration information of component nodes, and the linkage configuration information of different component nodes corresponds to the same data structure specification;
  • the obtaining module 301 is configured to obtain the linkage configuration information of each component node in the plurality of component nodes by traversing the JSON Schema configuration; perform linkage to the linkage configuration information of each component node according to the data structure specification Analyzing and processing to obtain the linkage function code after linkage analysis and processing;
  • the linkage module 302 is configured to use the linkage function code after the linkage analysis and processing to realize the linkage function for each component node.
  • the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result of the component node and a linkage condition; the linkage condition includes a condition node path and condition component node types;
  • the linkage function code after the linkage analysis and processing is used to perform the following steps:
  • the current linkage configuration information included in the current component node according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes;
  • the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
  • the linkage condition further includes a condition node value and a condition node value type
  • the linkage module 302 is configured to determine whether the found component node satisfies the linkage condition, including:
  • condition value after the type conversion is the same as the condition node value in the linkage condition, determine that the found component node satisfies the linkage condition;
  • condition value after the type conversion is different from the condition node value in the linkage condition, it is determined that the found component node does not satisfy the linkage condition.
  • the linkage module 302 is configured to use the linkage function code after the linkage analysis and processing to realize the linkage function for each component node, including:
  • the linkage function code is invoked through the linkage function api to realize the linkage function for each component node.
  • the device further includes a verification module, and the verification module is configured to:
  • the verification function code for each component node is realized by using the verification function code after the verification analysis.
  • the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result of the component node and a linkage condition; the linkage condition includes a condition node path and condition component node types;
  • the verification function code after the linkage analysis and processing is used to perform the following steps:
  • the current linkage configuration information included in the current component node according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes;
  • the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
  • the checking module is configured to find out component nodes from other component nodes according to the condition node path and condition component node type in the linkage condition, including:
  • a component node of the same type as the conditional component node in the linkage condition is found from the partial component nodes.
  • the verification module is configured to implement the verification function of each component node by using the verification function code after the parsing and processing of the verification, including:
  • the verification function for each component node is realized by executing the verification function code.
  • the verification module is further configured to:
  • the above-mentioned receiving module 300, obtaining module 301, linkage module 302 and verification module can all be realized by a processor located in the electronic device, and the processor can be ASIC, DSP, DSPD, PLD, FPGA, CPU, At least one of controller, microcontroller, microprocessor.
  • each functional module in this embodiment may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software function modules.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or The contribution made by related technologies or all or part of the technical solution can be embodied in the form of software products, the computer software products are stored in a storage medium, and include several instructions to make a computer device (which can be a personal computer) , server, or network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment.
  • aforementioned storage medium comprises: various mediums that can store program codes such as U disk, mobile hard disk, read-only memory (Read Only Memory, ROM), RAM, magnetic disk or optical disk.
  • the computer program instructions corresponding to a method for realizing the linkage function in this embodiment can be stored on a storage medium such as an optical disc, a hard disk, or a USB flash drive.
  • a storage medium such as an optical disc, a hard disk, or a USB flash drive.
  • FIG. 4 shows an electronic device 400 provided by an embodiment of the present application, which may include: a memory 401 and a processor 402; wherein,
  • memory 401 configured to store computer programs and data
  • the processor 402 is configured to execute the computer program stored in the memory, so as to implement any one of the methods for realizing the linkage function in the foregoing embodiments.
  • the above-mentioned memory 401 can be a volatile memory (volatile memory), such as RAM; or a non-volatile memory (non-volatile memory), such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor 402.
  • volatile memory such as RAM
  • non-volatile memory such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor 402.
  • the aforementioned processor 402 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It can be understood that, for different devices implementing linkage functions, the electronic device used to implement the above processor function may also be other, which is not specifically limited in this embodiment of the present application.
  • the embodiment of the present application also provides a computer program product, the computer program product carries a program code, and the instructions included in the program code can be used to execute the load balancing method described in the above method embodiment, for details, please refer to the above method embodiment , which will not be repeated here.
  • the above-mentioned computer program product may be specifically implemented by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
  • a software development kit Software Development Kit, SDK
  • the functions or modules included in the device provided by the embodiments of the present application can be used to execute the methods described in the above method embodiments, and its specific implementation can refer to the descriptions of the above method embodiments. For brevity, here No longer.
  • the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) having computer-usable program code embodied therein.
  • a computer-usable storage media including but not limited to disk storage, optical storage, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Embodiments of the present application provide a method and apparatus for implementing a linkage function, an electronic device, a computer storage medium, and a computer program product, applied to a low-code core class of a Formily framework. The method comprises: receiving JSON Schema configuration sent from a user page, the JSON Schema configuration being obtained by the user page from a page designer, the JSON Schema configuration comprising linkage configuration information for describing a plurality of component nodes of the user page, and the linkage configuration information of different component nodes corresponding to the same data structure specification; traversing the JSON Schema configuration to obtain the linkage configuration information of each of the plurality of component nodes; performing linkage parsing on the linkage configuration information of each component node according to the data structure specification to obtain a linkage function code after the linkage parsing; and implementing a linkage function of each component node by using the linkage function code after the linkage parsing.

Description

一种实现联动功能的方法、装置、设备、存储介质和程序A method, device, equipment, storage medium and program for realizing linkage function
相关申请的交叉引用Cross References to Related Applications
本申请基于申请号为202111552350.5、申请日为2021年12月17日的中国专利申请提出,申请人为深圳前海微众银行股份有限公司,申请名称为“一种实现联动功能的方法、装置、设备和存储介质”的技术方案,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on a Chinese patent application with application number 202111552350.5 and an application date of December 17, 2021. The applicant is Shenzhen Qianhai WeBank Co., Ltd., and the application name is "A Method, Device, and Equipment for Realizing Linkage Functions" and storage medium” and claim the priority of this Chinese patent application, the entire content of this Chinese patent application is hereby incorporated into this application as a reference.
技术领域technical field
本申请涉及金融科技(Fintech)的云计算技术领域,涉及但不限于一种实现联动功能的方法、装置、电子设备、计算机存储介质和计算机程序产品。This application relates to the technical field of cloud computing in financial technology (Fintech), and involves but is not limited to a method, device, electronic device, computer storage medium and computer program product for realizing linkage functions.
背景技术Background technique
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技转变,但由于金融行业的安全性、实时性要求,也对技术提出了更高的要求。With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually transforming into financial technology. However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.
相关技术中,高性能表单解决方案Formily的联动开发在通用化上具有限制性和在迭代开发中成本高的问题。例如在Schema上写联动功能时使用表达式字符串,而表达式字符串内的变量在别的地方执行会因缺少正确的执行上下文而报错。再者,例如使用函数方式在Formily的effect应用程序接口(application programming interface,api)上开发复杂联动功能时,每一次都需要手写与复杂联动功能相关的代码块;进而,影响Formily的联动开发处理能力。Among related technologies, the linked development of Formily, a high-performance form solution, has limitations in generalization and high cost in iterative development. For example, an expression string is used when writing a linkage function on the Schema, and an error will be reported due to the lack of a correct execution context when the variables in the expression string are executed elsewhere. Furthermore, for example, when using the function method to develop complex linkage functions on Formily's effect application programming interface (application programming interface, api), it is necessary to hand-write code blocks related to complex linkage functions every time; further, it affects Formily's linkage development process ability.
发明内容Contents of the invention
本申请提供一种实现联动功能的方法、装置、电子设备、计算机存储介质和计算机程序产品,可以解决相关技术中Formily的联动开发在通用化上具有限制性和在迭代开发中成本高的问题。The present application provides a method, device, electronic equipment, computer storage medium and computer program product for realizing the linkage function, which can solve the problems of limited generalization and high cost in iterative development of Formily linkage development in the related art.
本申请的技术方案是这样实现的:The technical scheme of the present application is realized like this:
本申请实施例提供了一种实现联动功能的方法,应用于Formily框架的低代码核心类中,所述方法包括:The embodiment of the present application provides a method for realizing the linkage function, which is applied to the low-code core class of the Formily framework, and the method includes:
接收从用户页面发送的JSON Schema配置;所述JSON Schema配置是所述用户页面从页面设计器中获取的;所述JSON Schema配置包括用于描述所述用户页面的多个组件节点的联动配置信息,且不同组件节点的联动配置信息对应相同的数据结构规范;Receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes linkage configuration information for describing multiple component nodes of the user page , and the linkage configuration information of different component nodes corresponds to the same data structure specification;
通过遍历所述JSON Schema配置,得到所述多个组件节点中每个组件节点的联动配置信息;按照所述数据结构规范对所述每个组件节点的联动配置信息进行联动解析处理,得到联动解析处理后的联动功能代码;By traversing the JSON Schema configuration, the linkage configuration information of each component node in the plurality of component nodes is obtained; according to the data structure specification, the linkage configuration information of each component node is subjected to linkage analysis processing, and the linkage analysis is obtained. The processed linkage function code;
利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能。The linkage function code for each component node is realized by using the linkage function code after the linkage analysis and processing.
示例性地,所述组件节点包括多份联动配置信息,所述多份联动配置信息中的每份联动配置信息包括:组件节点的最终设置结果和联动条件;所述联动条件包括条件节点路径和条件组件节点类型;Exemplarily, the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result of the component node and linkage conditions; the linkage conditions include condition node paths and Condition component node type;
所述联动解析处理后的联动功能代码,用于执行以下步骤:The linkage function code after the linkage analysis and processing is used to perform the following steps:
在当前组件节点包括的当前一份联动配置信息中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点;所述当前组件节点表示所述 多个组件节点中当前需要联动解析处理的组件节点,所述其余组件节点表示所述多个组件节点中除所述当前组件节点以外的组件节点;In the current linkage configuration information included in the current component node, according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes; the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
判断查找出的组件节点是否满足联动条件;Determine whether the found component nodes meet the linkage conditions;
在确定所述查找出的组件节点满足联动条件时,确定所述当前一份联动配置信息满足所述联动条件,将所述当前一份联动配置信息中的最终设置结果设置到所述当前组件节点的结果上。When it is determined that the found component node satisfies the linkage condition, it is determined that the current piece of linkage configuration information satisfies the linkage condition, and the final setting result in the current piece of linkage configuration information is set to the current component node on the results.
示例性地,所述联动条件还包括条件节点值和条件节点值类型,所述判断查找出的组件节点是否满足联动条件,包括:Exemplarily, the linkage condition further includes a condition node value and a condition node value type, and the judging whether the found component node satisfies the linkage condition includes:
按照所述联动条件中的条件节点值类型对所述查找出的组件节点的条件节点值进行类型转换,得到类型转换后的条件值;performing type conversion on the condition node value of the found component node according to the condition node value type in the linkage condition, to obtain a type-converted condition value;
在所述类型转换后的条件值与所述联动条件中的条件节点值相同的情况下,确定所述查找出的组件节点满足联动条件;When the condition value after the type conversion is the same as the condition node value in the linkage condition, determine that the found component node satisfies the linkage condition;
在所述类型转换后的条件值与所述联动条件中的条件节点值不相同的情况下,确定所述查找出的组件节点不满足联动条件。If the condition value after the type conversion is different from the condition node value in the linkage condition, it is determined that the found component node does not satisfy the linkage condition.
示例性地,所述利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能,包括:Exemplarily, using the linkage function code after the linkage analysis and processing to realize the linkage function for each component node includes:
将所述联动解析处理后的联动功能代码注册到所述Formily框架的联动功能应用程序接口api中;Registering the linkage function code after the linkage analysis and processing in the linkage function application programming interface api of the Formily framework;
在确定所述用户页面对所述每个组件节点触发联动时,通过所述联动功能api调用所述联动功能代码,实现对所述每个组件节点的联动功能。When it is determined that the user page triggers linkage for each component node, the linkage function code is invoked through the linkage function api to realize the linkage function for each component node.
示例性地,所述方法还包括:Exemplarily, the method also includes:
按照所述数据结构规范对所述每个组件节点的联动配置信息进行校验解析处理,得到校验解析处理后的校验功能代码;Perform verification and analysis processing on the linkage configuration information of each component node according to the data structure specification, and obtain the verification function code after the verification and analysis processing;
利用所述校验解析处理后的校验功能代码,实现对所述每个组件节点的校验功能。The verification function code for each component node is realized by using the verification function code after the verification analysis.
示例性地,所述组件节点包括多份联动配置信息,所述多份联动配置信息中的每份联动配置信息包括:组件节点的最终设置结果和联动条件;所述联动条件包括条件节点路径和条件组件节点类型;Exemplarily, the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result of the component node and linkage conditions; the linkage conditions include condition node paths and Condition component node type;
所述联动解析处理后的校验功能代码,用于执行以下步骤:The verification function code after the linkage analysis and processing is used to perform the following steps:
在当前组件节点包括的当前一份联动配置信息中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点;所述当前组件节点表示所述多个组件节点中当前需要联动解析处理的组件节点,所述其余组件节点表示所述多个组件节点中除所述当前组件节点以外的组件节点;In the current linkage configuration information included in the current component node, according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes; the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
判断查找出的组件节点是否满足联动条件;Determine whether the found component nodes meet the linkage conditions;
在确定所述查找出的组件节点满足联动条件时,确定所述当前一份联动配置信息满足所述联动条件,继续判断所述当前组件节点的结果是否通过校验,得到校验结果;在根据所述校验结果确定所述当前组件节点通过校验后,继续判断所述当前组件节点的下一组件节点是否通过校验,直至需要联动解析处理的组件节点全部判断完成;或者,When determining that the found component node satisfies the linkage condition, determine that the current linkage configuration information satisfies the linkage condition, continue to judge whether the result of the current component node passes the verification, and obtain the verification result; After the verification result determines that the current component node has passed the verification, continue to judge whether the next component node of the current component node has passed the verification until all the component nodes that need linkage analysis and processing are judged; or,
在确定所述查找出的组件节点不满足联动条件时,确定所述当前组件节点通过校验;继续判断所述当前组件节点的下一组件节点是否通过校验,直至需要联动解析处理的组件节点全部判断完成。When it is determined that the found component node does not meet the linkage condition, determine that the current component node has passed the verification; continue to judge whether the next component node of the current component node has passed the verification, until the component node that needs linkage analysis processing All judgments are complete.
示例性地,所述按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点,包括:Exemplarily, according to the condition node path and condition component node type in the linkage condition, finding the component node from other component nodes includes:
从所述其余组件节点中确定与所述联动条件中的条件节点路径对应的部分组件节点;determining a part of component nodes corresponding to the condition node path in the linkage condition from the remaining component nodes;
从所述部分组件节点中查找出与所述联动条件中的条件组件节点类型相同的组件节点。A component node of the same type as the conditional component node in the linkage condition is found from the partial component nodes.
示例性地,所述利用所述校验解析处理后的校验功能代码,实现对所述每个组件节点的校验功能,包括:Exemplarily, said verifying and parsing the processed verifying function code to realize the verifying function of each component node includes:
将所述联动解析处理后的校验功能代码注册到所述低代码核心类的提交功能中;Register the verification function code after the linkage analysis and processing into the submission function of the low-code core class;
在确定所述用户页面进行数据恢复或提交操作时,通过执行所述校验功能代码,实现对所述每个组件节点的校验功能。When it is determined that the user page is performing a data recovery or submission operation, the verification function for each component node is realized by executing the verification function code.
示例性地,在执行所述校验功能代码后,所述方法还包括:Exemplarily, after executing the verification function code, the method further includes:
根据所述当前组件节点的联动条件中的条件节点数据类型,对所述校验功能代码的输出数据进行类型转换。Perform type conversion on the output data of the verification function code according to the data type of the condition node in the linkage condition of the current component node.
本申请实施例还提出了一种实现联动功能的装置,所述装置包括接收模块、得到模块和联动模块,其中,The embodiment of the present application also proposes a device for realizing the linkage function, the device includes a receiving module, an obtaining module and a linkage module, wherein,
接收模块,配置为接收从用户页面发送的JSON Schema配置;所述JSON Schema配置是所述用户页面从页面设计器中获取的;所述JSON Schema配置包括用于描述所述用户页面的多个组件节点的联动配置信息,且不同组件节点的联动配置信息对应相同的数据结构规范;The receiving module is configured to receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes multiple components for describing the user page The linkage configuration information of the node, and the linkage configuration information of different component nodes corresponds to the same data structure specification;
得到模块,配置为通过遍历所述JSON Schema配置,得到所述多个组件节点中每个组件节点的联动配置信息;按照所述数据结构规范对所述每个组件节点的联动配置信息进行联动解析处理,得到联动解析处理后的联动功能代码;Obtaining a module configured to obtain the linkage configuration information of each component node in the plurality of component nodes by traversing the JSON Schema configuration; performing linkage analysis on the linkage configuration information of each component node according to the data structure specification processing to obtain the linkage function code after linkage analysis and processing;
联动模块,配置为利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能。The linkage module is configured to realize the linkage function of each component node by using the linkage function code after the linkage analysis and processing.
本申请实施例提供一种电子设备,所述设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现前述一个或多个技术方案提供的实现联动功能的方法。An embodiment of the present application provides an electronic device, the device includes a memory, a processor, and a computer program stored on the memory and operable on the processor, and the processor implements one or more of the aforementioned technologies when executing the program The method provided by the scheme to realize the linkage function.
本申请实施例提供一种计算机存储介质,所述计算机存储介质存储有计算机程序;所述计算机程序被执行后能够实现前述一个或多个技术方案提供的实现联动功能的方法。An embodiment of the present application provides a computer storage medium, and the computer storage medium stores a computer program; after the computer program is executed, the method for realizing the linkage function provided by the aforementioned one or more technical solutions can be implemented.
本申请实施例还提供了一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现前述一个或多个技术方案提供的实现联动功能的方法。The embodiment of the present application also provides a computer program product, including computer readable code, when the computer readable code is run in the electronic device, the processor in the electronic device executes to implement the aforementioned one or more The method for realizing the linkage function provided by the technical solution.
本申请实施例提出了一种实现联动功能的方法、装置、电子设备、计算机存储介质和计算机程序产品,应用于Formily框架的低代码核心类中,所述方法包括:接收从用户页面发送的JSON Schema配置;所述JSON Schema配置是所述用户页面从页面设计器中获取的;所述JSON Schema配置包括用于描述所述用户页面的多个组件节点的联动配置信息,且不同组件节点的联动配置信息对应相同的数据结构规范;通过遍历所述JSON Schema配置,得到所述多个组件节点中每个组件节点的联动配置信息;按照所述数据结构规范对所述每个组件节点的联动配置信息进行联动解析处理,得到联动解析处理后的联动功能代码;利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能。The embodiment of the present application proposes a method, device, electronic device, computer storage medium, and computer program product for realizing the linkage function, which are applied to the low-code core class of the Formily framework, and the method includes: receiving the JSON sent from the user page Schema configuration; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes linkage configuration information for describing multiple component nodes of the user page, and the linkage of different component nodes The configuration information corresponds to the same data structure specification; by traversing the JSON Schema configuration, the linkage configuration information of each component node in the plurality of component nodes is obtained; the linkage configuration of each component node according to the data structure specification The information is subjected to linkage analysis and processing to obtain a linkage function code after linkage analysis and processing; using the linkage function code after linkage analysis and processing to realize the linkage function of each component node.
可以看出,在本申请实施例中,由于JSON Schema配置中包括的每个组件节点均对应相同的数据结构规范,因而在需要对JSON Schema配置中包括的每个组件节点进行联动开发时,可以基于一个通用化的数据结构规范对这些组件节点进行联动解析处理,这样,可以解决联动开发在通用化上具有限制性的问题;进一步地,在按照数据结构规范对这些组件节点进行联动解析处理时,通过梳理数据结构规范中各个协议字段的规则, 可以自动化生成用于实现联动功能的功能代码,如此,无需开发人员每次手写与复杂联动功能相关的代码块,解决联动功能在迭代开发中成本高的问题。It can be seen that in the embodiment of this application, since each component node included in the JSON Schema configuration corresponds to the same data structure specification, when it is necessary to perform linkage development on each component node included in the JSON Schema configuration, you can Based on a generalized data structure specification, these component nodes are linked and analyzed. In this way, the problem of limited generalization of linked development can be solved; further, when these component nodes are linked and analyzed according to the data structure specification , by combing the rules of each protocol field in the data structure specification, the function code for realizing the linkage function can be automatically generated, so that developers do not need to hand-write code blocks related to complex linkage functions every time, and solve the cost of linkage functions in iterative development high question.
附图说明Description of drawings
图1A是本申请实施例中的一种实现联动功能的方法的流程示意图;FIG. 1A is a schematic flow diagram of a method for realizing a linkage function in an embodiment of the present application;
图1B是本申请实施例中的一种执行联动功能代码的流程示意图;Fig. 1B is a schematic flow diagram of executing linkage function codes in the embodiment of the present application;
图1C是本申请实施例中的一种数据结构规范的示意图;FIG. 1C is a schematic diagram of a data structure specification in the embodiment of the present application;
图2A是本申请实施例的一种实现联动校验功能的场景示意图;FIG. 2A is a schematic diagram of a scenario for implementing a linkage verification function according to an embodiment of the present application;
图2B是本申请实施例的一种进行联动解析处理和校验解析处理的流程示意图;FIG. 2B is a schematic flow diagram of performing linkage analysis processing and verification analysis processing according to an embodiment of the present application;
图2C是本申请实施例的另一种进行联动解析处理的流程示意图;FIG. 2C is another schematic flow diagram of linkage analysis processing according to the embodiment of the present application;
图2D是本申请实施例的另一种进行校验解析处理的流程示意图;FIG. 2D is another schematic flowchart of verification and analysis processing according to the embodiment of the present application;
图3是本申请实施例的实现联动功能的装置的组成结构示意图;Fig. 3 is a schematic diagram of the composition and structure of the device for realizing the linkage function according to the embodiment of the present application;
图4是本申请实施例提供的电子设备的结构示意图。FIG. 4 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所提供的实施例仅仅用以解释本申请,并不用于限定本申请。另外,以下所提供的实施例是用于实施本申请的部分实施例,而非提供实施本申请的全部实施例,在不冲突的情况下,本申请实施例记载的技术方案可以任意组合的方式实施。The present application will be described in further detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments provided here are only used to explain the present application, and are not intended to limit the present application. In addition, the embodiments provided below are some embodiments for implementing the application, rather than providing all the embodiments for implementing the application. In the case of no conflict, the technical solutions described in the embodiments of the application can be combined in any manner implement.
需要说明的是,在本申请实施例中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性的包含,从而使得包括一系列要素的方法或者装置不仅包括所明确记载的要素,而且还包括没有明确列出的其它要素,或者是还包括为实施方法或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括该要素的方法或者装置中还存在另外的相关要素(例如方法中的步骤或者装置中的单元,例如的单元可以是部分电路、部分处理器、部分程序或软件等等)。It should be noted that, in the embodiments of the present application, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion, so that a method or device comprising a series of elements not only includes the explicitly stated elements, but also include other elements not explicitly listed, or also include elements inherent in implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of additional related elements (such as steps in the method or A unit in an apparatus, for example, a unit may be part of a circuit, part of a processor, part of a program or software, etc.).
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,I和/或J,可以表示:单独存在I,同时存在I和J,单独存在J这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括I、J、R中的至少一种,可以表示包括从I、J和R构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three kinds of relationships, for example, I and/or J, which can mean: I exists alone, I and J exist at the same time, and I exist alone J these three situations. In addition, the term "at least one" herein means any one of a variety or any combination of at least two of the more, for example, including at least one of I, J, R, may mean including from I, Any one or more elements selected from the set formed by J and R.
例如,本申请实施例提供的实现联动功能的方法包含了一系列的步骤,但是本申请实施例提供的实现联动功能的方法不限于所记载的步骤,同样地,本申请实施例提供的实现联动功能的装置包括了一系列模块,但是本申请实施例提供的实现联动功能的装置不限于包括所明确记载的模块,还可以包括为获取相关任务数据、或基于任务数据进行处理时所需要设置的模块。For example, the method for realizing the linkage function provided by the embodiment of the present application includes a series of steps, but the method for realizing the linkage function provided by the embodiment of the present application is not limited to the steps described. Similarly, the method for realizing the linkage function provided by the embodiment of the present application The functional device includes a series of modules, but the device for realizing the linkage function provided by the embodiment of the application is not limited to include the modules explicitly recorded, and may also include the required settings for obtaining relevant task data or processing based on task data module.
本申请实施例可以应用于服务端组成的计算机系统中,并可以与众多其它通用或专用计算系统环境或配置一起操作。这里,服务端可以是包括小型计算机系统﹑大型计算机系统的分布式云计算技术环境,等等。The embodiments of the present application can be applied to a computer system composed of servers, and can operate together with many other general-purpose or special-purpose computing system environments or configurations. Here, the server may be a distributed cloud computing technology environment including a small computer system, a large computer system, and so on.
服务端等电子设备可以通过程序模块的执行实现相应的功能。通常,程序模块可以包括例程、程序、目标程序、组件、逻辑、数据结构等等,它们执行特定的任务或者实现特定的抽象数据类型。计算机系统/服务端可以在分布式云计算环境中实施,分布式云计算环境中,任务是由通过通信网络链接的远程处理设备执行的。在分布式云计算环境中,程序模块可以位于包括存储设备的本地或远程计算系统存储介质上。Electronic devices such as the server can realize corresponding functions through the execution of program modules. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types. The computer system/server can be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including storage devices.
目前,Formily有Markup Schema、JSON Schema、JSX 3种使用方式;本申请实施 例可以针对JSON Schema这种使用方式。At present, Formily has three ways of using Markup Schema, JSON Schema, and JSX; the embodiment of this application can be aimed at the way of using JSON Schema.
Formily使用的JSON Schema协议数据类型不够丰富。Formily使用的JSON Schema是JSON字符串,它由页面设计器生成的。在页面设计器中,因为JSON字符串对应的值大多是用户通过输入框手动录入的,所以得到的值是字符串类型。又因为Formily的schema类型(type)只支持string、object、array、number、boolean、void、date和datetime。所以当遇到基础类型如布尔值(true,false)时,字符串类型的输入框无法正确将字符串类型值转换成布尔类型值。并且,当遇到复杂类型如职业类型结构:{jobcode:1234}时,Formily的schema type也无法通过字符串类型值进行正确转换。此外,Formily的联动开发在通用化上具有限制性和在迭代开发中成本高的问题。The JSON Schema protocol data type used by Formily is not rich enough. The JSON Schema used by Formily is a JSON string, which is generated by the page designer. In the page designer, because the value corresponding to the JSON string is mostly entered manually by the user through the input box, the obtained value is a string type. And because Formily's schema type (type) only supports string, object, array, number, boolean, void, date and datetime. Therefore, when encountering basic types such as Boolean values (true, false), the input box of string type cannot correctly convert the string type value into a Boolean type value. Moreover, when encountering complex types such as the occupation type structure: {jobcode:1234}, Formily's schema type cannot be converted correctly through string type values. In addition, Formily's linkage development has limitations in generalization and high cost in iterative development.
针对上述技术问题,提出以下各实施例。In view of the above technical problems, the following embodiments are proposed.
在本申请的一些实施例中,实现联动功能的方法可以利用实现联动功能的装置中的处理器实现,上述处理器可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(Programmable Logic Device,PLD)、现场可编程逻辑门阵列(Field Programmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。In some embodiments of the present application, the method for realizing the linkage function can be implemented by using a processor in a device for realizing the linkage function, and the above-mentioned processor can be an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor ( Digital Signal Processor, DSP), Digital Signal Processing Device (Digital Signal Processing Device, DSPD), Programmable Logic Device (Programmable Logic Device, PLD), Field Programmable Logic Gate Array (Field Programmable Gate Array, FPGA), CPU At least one of (Central Processing Unit, CPU), controller, microcontroller, microprocessor.
图1A是本申请实施例中的一种实现联动功能的方法的流程示意图,如图1A所示,该方法包括如下步骤:Fig. 1A is a schematic flowchart of a method for realizing linkage function in the embodiment of the present application. As shown in Fig. 1A, the method includes the following steps:
步骤100:接收从用户页面发送的JSON Schema配置;JSON Schema配置是用户页面从页面设计器中获取的;JSON Schema配置包括用于描述用户页面的多个组件节点的联动配置信息,且不同组件节点的联动配置信息对应相同的数据结构规范。Step 100: Receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes linkage configuration information for describing multiple component nodes of the user page, and different component nodes The linkage configuration information corresponds to the same data structure specification.
示例性地,实现联动功能的方法可以应用于Formily框架的低代码核心类中;这里,Formily框架除了包括低代码核心类外,还包括用户页面以及页面设计器;其中,用户页面可以是万维网(World Wide Web,WEB)应用对应的WEB界面,也可以是其他人机交互界面;页面设计器是一个由低代码开发的页面设计平台,它最终可以输出一份符合JSON Schema协议的JSON数据。Exemplarily, the method for realizing the linkage function can be applied to the low-code core class of the Formily framework; here, the Formily framework includes not only the low-code core class, but also a user page and a page designer; wherein, the user page can be the World Wide Web ( The WEB interface corresponding to the World Wide Web (WEB) application can also be other human-computer interaction interfaces; the page designer is a page design platform developed by low-code, which can finally output a JSON data conforming to the JSON Schema protocol.
本申请实施例中,低代码核心类接收从用户页面发送的JSON Schema配置;示例性地,实现过程可以如下,当用户页面打开后,通过用户页面向页面设计器发送获取JSON Schema配置的数据请求,当页面设计器接收到该数据请求后,向用户页面返回JSON Schema配置,并将该JSON Schema配置发送给低代码核心类,此时,低代码核心类接收到从用户页面发送的JSON Schema配置。In the embodiment of this application, the low-code core class receives the JSON Schema configuration sent from the user page; as an example, the implementation process can be as follows, when the user page is opened, a data request for obtaining the JSON Schema configuration is sent to the page designer through the user page , when the page designer receives the data request, it returns the JSON Schema configuration to the user page, and sends the JSON Schema configuration to the low-code core class. At this time, the low-code core class receives the JSON Schema configuration sent from the user page .
示例性地,JSON Schema配置可以通过一个JSON格式的树形数据结构进行表示,其中,树形数据结构是由描述用户页面的多个组件节点构成的;这里,组件节点表示用于描述用户页面内对应组件的数据信息的节点。示例性地,组件节点可以是一种视图加交互逻辑的抽象数据类型,可以包含超文本标记语言(hypertext markup language,html)模板、层叠样式表(cascading style sheets,css)样式和js(javascript)逻辑代码片段。Exemplarily, the JSON Schema configuration can be represented by a tree data structure in JSON format, where the tree data structure is composed of multiple component nodes describing the user page; here, the component node representation is used to describe the user page The node corresponding to the data information of the component. Exemplarily, the component node can be an abstract data type of view plus interactive logic, and can include hypertext markup language (hypertext markup language, html) templates, cascading style sheets (cascading style sheets, css) styles and js (javascript) Logical code snippets.
步骤101:通过遍历JSON Schema配置,得到多个组件节点中每个组件节点的联动配置信息;按照数据结构规范对每个组件节点的联动配置信息进行联动解析处理,得到联动解析处理后的联动功能代码。Step 101: By traversing the JSON Schema configuration, obtain the linkage configuration information of each component node among multiple component nodes; perform linkage analysis processing on the linkage configuration information of each component node according to the data structure specification, and obtain the linkage function after linkage analysis processing code.
示例性地,在低代码核心类接收到从用户页面发送的JSON Schema配置后,首先,通过遍历JSON Schema配置得到每个组件节点的联动配置信息;然后,将每个组件节点的联动配置信息统一保存至联动配置数组中;这样,联动配置数组中保存了来源于JSON Schema配置中的所有组件节点的联动配置信息;这里,联动配置数组位于低代码核心类的缓存中。Exemplarily, after the low-code core class receives the JSON Schema configuration sent from the user page, first, obtain the linkage configuration information of each component node by traversing the JSON Schema configuration; then, unify the linkage configuration information of each component node Save to the linkage configuration array; in this way, the linkage configuration array saves the linkage configuration information from all component nodes in the JSON Schema configuration; here, the linkage configuration array is located in the cache of the low-code core class.
示例性地,在将每个组件节点的联动配置信息保存至联动配置数组的过程中,可以按照[{"key","数据结构规范"}]这种格式对联动配置信息进行保存;这里的"key"代表组件节点身份标识号码(identity document,id),通过将组件节点id保存至联动配置数组,便于后续在联动解析处理时对各个组件节点的查找。Exemplarily, in the process of saving the linkage configuration information of each component node to the linkage configuration array, the linkage configuration information can be saved according to the format [{"key", "data structure specification"}]; here "key" represents the component node identity number (identity document, id). By saving the component node id to the linkage configuration array, it is convenient to search for each component node in the linkage analysis process.
这里,在低代码核心类需要对每个组件节点的联动配置信息进行联动解析处理之前,首先获取联动配置数组,再从联动配置数组中获取每个组件节点的联动配置信息,再按照图1C所示的数据结构规范对每个组件节点的联动配置信息进行联动解析处理;这里,联动解析处理相当于对联动配置信息中各个协议字段对应的代码块进行声明,在进行联动解析处理后,可以自动化生成后续用于实现每个组件节点的联动功能所需要的功能代码。可见,在此过程中,无需开发人员手写与联动功能相关的代码块,因而,可以解决联动功能在迭代开发中成本高的问题。Here, before the low-code core class needs to analyze and process the linkage configuration information of each component node, first obtain the linkage configuration array, and then obtain the linkage configuration information of each component node from the linkage configuration array, and then follow the steps shown in Figure 1C The data structure specification shown in the following table performs linkage analysis processing on the linkage configuration information of each component node; here, the linkage analysis processing is equivalent to declaring the code blocks corresponding to each protocol field in the linkage configuration information. After the linkage analysis processing, it can be automated. Generate subsequent function codes required to realize the linkage function of each component node. It can be seen that in this process, there is no need for developers to write code blocks related to linkage functions by hand, so the problem of high cost in iterative development of linkage functions can be solved.
步骤102:利用联动解析处理后的联动功能代码,实现对每个组件节点的联动功能。Step 102: Realize the linkage function for each component node by using the linkage function code after linkage analysis and processing.
示例性地,组件节点可以包括多份联动配置信息,其中,多份联动配置信息中的每份联动配置信息可以包括组件节点的最终设置结果和联动条件;其中,联动条件可以包括条件节点路径和条件组件节点类型。Exemplarily, a component node may include multiple pieces of linkage configuration information, wherein each piece of linkage configuration information in the multiple pieces of linkage configuration information may include the final setting result of the component node and linkage conditions; wherein, the linkage conditions may include condition node paths and Condition component node type.
在一些实施例中,参照图1B,联动解析处理后的联动功能代码,用于执行以下步骤:In some embodiments, referring to FIG. 1B , the linkage function code after linkage analysis and processing is used to perform the following steps:
步骤1021:在当前组件节点包括的当前一份联动配置信息中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点;Step 1021: In the current linkage configuration information included in the current component node, according to the condition node path and the condition component node type in the linkage condition, find out the component node from other component nodes;
步骤1022:判断查找出的组件节点是否满足联动条件;Step 1022: Determine whether the found component nodes meet the linkage condition;
步骤1023:在确定查找出的组件节点满足联动条件时,确定当前一份联动配置信息满足联动条件,将当前一份联动配置信息中的最终设置结果设置到当前组件节点的结果上。Step 1023: When it is determined that the found component node satisfies the linkage condition, determine that the current linkage configuration information satisfies the linkage condition, and set the final setting result in the current linkage configuration information to the result of the current component node.
这里,当前组件节点表示多个组件节点中当前需要联动解析处理的组件节点;其余组件节点表示多个组件节点中除当前组件节点以外的组件节点。Here, the current component node represents a component node among the multiple component nodes that needs to be analyzed and processed currently; the rest of the component nodes represent component nodes among the multiple component nodes except the current component node.
在一些实施例中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点,可以包括:从其余组件节点中确定与联动条件中的条件节点路径对应的部分组件节点;从部分组件节点中查找出与联动条件中的条件组件节点类型相同的组件节点。In some embodiments, according to the condition node path and the condition component node type in the linkage condition, finding the component node from the remaining component nodes may include: determining the part corresponding to the condition node path in the linkage condition from the remaining component nodes Component nodes; find component nodes of the same type as the conditional component nodes in the linkage condition from some component nodes.
示例性地,在确定当前组件节点的联动条件的情况下,首先根据当前组件节点的联动条件中的条件节点路径,从其余组件节点中查找出在该条件节点路径下的部分组件节点;接着通过对部分组件节点中每个组件节点进行遍历,查找出与联动条件中的条件组件节点类型相同的组件节点。Exemplarily, in the case of determining the linkage condition of the current component node, first, according to the condition node path in the linkage condition of the current component node, find out some component nodes under the condition node path from the remaining component nodes; Traverse each component node in some component nodes to find out the component node with the same type as the conditional component node in the linkage condition.
本申请实施例中,在当前组件节点包括的当前一份联动配置信息中,若按照联动条件中的条件节点路径和条件组件节点类型,查找到组件节点后,需要进一步判断查找出的组件节点是否满足联动条件。In the embodiment of this application, in the current linkage configuration information included in the current component node, if the component node is found according to the condition node path and condition component node type in the linkage condition, it is necessary to further judge whether the found component node is Linkage conditions are met.
示例性地,若确定查找出的组件节点满足联动条件,则说明当前一份联动配置信息满足联动条件,此时,可以将当前一份联动配置信息中的最终设置结果设置到当前组件节点的结果上;反之,若确定查找出的组件节点不满足联动条件,则说明当前一份联动配置信息不满足联动条件,即当前组件节点与这一份联动配置信息不匹配,此时,继续确定在当前组件节点包括的下一份联动配置信息中,查找出的组件节点是否满足联动条件,直至找到与当前组件节点匹配的联动配置信息;如果在当前组件节点包括的多份联动配置信息中,查找不到与当前组件节点匹配的联动配置信息,则说明当前组件节点不需要触发联动。Exemplarily, if it is determined that the found component node satisfies the linkage condition, it means that the current linkage configuration information satisfies the linkage condition. At this time, the final setting result in the current linkage configuration information can be set to the result of the current component node On the contrary, if it is determined that the found component node does not meet the linkage condition, it means that the current linkage configuration information does not meet the linkage condition, that is, the current component node does not match this linkage configuration information. In the next linkage configuration information included in the component node, check whether the found component node satisfies the linkage condition until the linkage configuration information matching the current component node is found; If the linkage configuration information matching the current component node is found, it means that the current component node does not need to trigger linkage.
在一些实施例中,联动条件还可以包括条件节点值和条件节点值类型,判断查找出的组件节点是否满足联动条件,可以包括:按照联动条件中的条件节点值类型对查找出的组件节点的条件节点值进行类型转换,得到类型转换后的条件值;在类型转换后的条件值与联动条件中的条件节点值相同的情况下,确定查找出的组件节点满足联动条件;在类型转换后的条件值与联动条件中的条件节点值不相同的情况下,确定查找出的组件节点不满足联动条件。In some embodiments, the linkage condition may also include a condition node value and a condition node value type, and judging whether the found component node satisfies the linkage condition may include: pairing the searched component node according to the condition node value type in the linkage condition Convert the condition node value to get the condition value after type conversion; if the condition value after type conversion is the same as the condition node value in the linkage condition, it is determined that the found component node meets the linkage condition; after the type conversion If the condition value is not the same as the condition node value in the linkage condition, it is determined that the found component node does not satisfy the linkage condition.
这里,若确定查找出的组件节点满足联动条件,则说明当前组件节点包括的当前一份联动配置信息满足联动条件;反之,若确定查找出的组件节点不满足联动条件,则说明当前组件节点包括的当前一份联动配置信息不满足联动条件。Here, if it is determined that the found component node meets the linkage condition, it means that the current linkage configuration information contained in the current component node meets the linkage condition; otherwise, if it is determined that the found component node does not meet the linkage condition, it means that the current component node includes The current linkage configuration information for does not meet the linkage conditions.
示例性地,JSON Schema配置中各个组件节点的联动配置信息对应相同的数据结构规范;这里,数据结构规范是本申请新定义的一个的通用化协议规范;图1C是本申请实施例中的一种数据结构规范的示意图,如图1C所示,可通过{values,condition{key,values,formType,valueType},errorMsg}这种形式对数据结构规范"includeAttributeValues"进行表示;下面,对该数据结构规范中的各个属性(即协议字段)进行说明。Exemplarily, the linkage configuration information of each component node in the JSON Schema configuration corresponds to the same data structure specification; here, the data structure specification is a generalized protocol specification newly defined in this application; FIG. A schematic diagram of a data structure specification, as shown in Figure 1C, the data structure specification "includeAttributeValues" can be expressed in the form of {values, condition{key, values, formType, valueType}, errorMsg}; below, the data structure Each attribute (that is, the protocol field) in the specification is described.
这里,values属性代表需要联动解析处理的组件节点的最终设置结果;需要说明的是,对于不同类型的组件节点,其对应的values值的种类可以不同,例如,在组件节点为Input组件时,values值代表联动的条件种类;在组件节点为Select组件时,values值代表选项范围;condition属性定义了对组件节点进行联动判断时所需的条件,设置condition属性中各项判断条件的目的是便于低代码核心类进行联动条件判断的代码解析。Here, the values attribute represents the final setting result of the component node that needs to be analyzed and processed in conjunction; it should be noted that for different types of component nodes, the types of corresponding values can be different. For example, when the component node is an Input component, values The value represents the type of linkage condition; when the component node is a Select component, the values value represents the range of options; the condition attribute defines the conditions required for the linkage judgment of the component node, and the purpose of setting the judgment conditions in the condition attribute is to facilitate The code core class performs code analysis for linkage condition judgment.
进一步地,condition.key(condition属性中的key)代表需要被观察的条件节点路径,具体如何观察由后续解析得到的联动功能代码实现。condition.values(condition属性中的values)代表条件节点值,定义了判断条件的具体值。condition.formType(condition属性中的formType)代表条件组件节点类型,每种组件节点都封装了各自的联动解析方法。condition.valueType(condition属性中的valueType)定义了条件节点数据类型;这里,condition.values和condition.valueType是成对出现的;errorMsg代表错误信息。最终,在进行联动条件判断的过程中,condition.formType所对应的组件节点会根据condition.valueType先进行类型转换,之后,再对condition.formType所对应的组件节点进行条件节点值的判断,以确定需要联动解析处理的当前组件节点是否满足联动条件。Furthermore, condition.key (the key in the condition attribute) represents the path of the condition node that needs to be observed, specifically how to observe the implementation of the linkage function code obtained by subsequent analysis. condition.values (values in the condition attribute) represents the condition node value, which defines the specific value of the judgment condition. condition.formType (formType in the condition attribute) represents the condition component node type, and each component node encapsulates its own linkage analysis method. condition.valueType (valueType in the condition attribute) defines the data type of the condition node; here, condition.values and condition.valueType appear in pairs; errorMsg represents the error message. Finally, in the process of judging the linkage condition, the component node corresponding to condition.formType will first perform type conversion according to condition.valueType, and then judge the condition node value of the component node corresponding to condition.formType to determine Whether the current component node that requires linkage parsing and processing meets the linkage conditions.
示例性地,数据结构规范包括的各项属性是经过实际业务梳理出来的,它们描述了与组件节点联动相关的关键数据信息,本申请实施例可以利用这同一种数据结构规范对各个组件节点的联动配置信息进行相应的联动解析处理,可以解决联动开发在通用化上具有限制性的问题。Exemplarily, the various attributes included in the data structure specification are sorted out through actual business, and they describe the key data information related to the linkage of component nodes. Corresponding linkage parsing and processing of linkage configuration information can solve the problem that linkage development is limited in generalization.
示例性地,在根据当前组件节点包括的当前一份联动配置信息,判断查找出的组件节点是否满足联动条件的过程中,可以根据查找出的组件节点中每个组件节点的组件节点id进行遍历,逐一判断每个组件节点进行类型转换后的条件节点值与当前组件节点的联动条件中的条件节点值是否相同,如果确定相同,则说明查找出的组件节点满足联动条件,即,当前一份联动配置信息满足联动条件,此时,可以将当前一份联动配置信息中的最终设置结果设置到当前组件节点的结果上。反之,如果确定不相同,则说明查找出的组件节点不满足联动条件,即,当前一份联动配置信息不满足联动条件,此时,继续判断当前组件节点包括的下一份联动配置信息是否满足联动条件,直至找到与当前组件节点匹配的联动配置信息;如果在当前组件节点包括的多份联动配置信息中,查找不到与当前组件节点匹配的联动配置信息,则说明当前组件节点不需要触发联动。Exemplarily, in the process of judging whether the found component node satisfies the linkage condition according to the current linkage configuration information included in the current component node, it may be traversed according to the component node id of each component node in the found component node , judge one by one whether the value of the condition node after the type conversion of each component node is the same as the value of the condition node in the linkage condition of the current component node. The linkage configuration information satisfies the linkage condition. At this time, the final setting result in the current linkage configuration information can be set to the result of the current component node. On the contrary, if it is determined that they are not the same, it means that the found component node does not meet the linkage condition, that is, the current linkage configuration information does not meet the linkage condition. At this time, continue to judge whether the next linkage configuration information included in the current component node satisfies the linkage condition Linkage conditions until the linkage configuration information matching the current component node is found; if the linkage configuration information matching the current component node cannot be found among the multiple linkage configuration information included in the current component node, it means that the current component node does not need to trigger linkage.
可以看出,在本申请实施例中,可以从当前组件节点包括的多份联动配置信息,找到与当前组件节点匹配的联动配置信息,而该联动配置信息可以用于后续实现对当前组件节点的联动。It can be seen that in the embodiment of the present application, the linkage configuration information matching the current component node can be found from the multiple pieces of linkage configuration information included in the current component node, and the linkage configuration information can be used for subsequent implementation of the current component node. linkage.
在一些实施例中,利用联动解析处理后的联动功能代码,实现对每个组件节点的联动功能,可以包括:将联动解析处理后的联动功能代码注册到Formily框架的联动功能api中;在确定用户页面对每个组件节点触发联动时,通过联动功能api调用联动功能代码,实现对每个组件节点的联动功能。In some embodiments, using the linkage function code after linkage analysis and processing to realize the linkage function to each component node may include: registering the linkage function code after linkage analysis and processing into the linkage function api of the Formily framework; When the user page triggers linkage for each component node, the linkage function code is called through the linkage function api to realize the linkage function for each component node.
示例性地,以当前组件节点为例,在低代码核心类根据上述步骤确定与当前组件节点实现联动的各个组件节点后,可以得到对应的联动功能代码,将该联动功能代码注册到Formily框架的联动功能api中,这里,联动功能api位于用户界面中;后续,当用户通过用户页面对当前组件节点触发联动时,可以根据联动功能api调用对应的联动功能代码,通过执行该联动功能代码,可以实现对当前组件节点的联动功能。Exemplarily, taking the current component node as an example, after the low-code core class determines each component node that realizes linkage with the current component node according to the above steps, the corresponding linkage function code can be obtained, and the linkage function code can be registered in the Formily framework In the linkage function api, here, the linkage function api is located in the user interface; later, when the user triggers linkage to the current component node through the user page, the corresponding linkage function code can be called according to the linkage function api, and by executing the linkage function code, you can Realize the linkage function of the current component node.
可以看出,本申请实施例中,通过将联动功能代码注册到Formily框架的联动功能api,可以方便后续触发组件节点联动时,快速执行与该组件节点相关的联动功能代码,确保执行联动操作的有效性。It can be seen that in the embodiment of the present application, by registering the linkage function code to the linkage function api of the Formily framework, it is convenient to quickly execute the linkage function code related to the component node when the linkage of the component node is triggered later, so as to ensure the execution of the linkage operation. effectiveness.
本申请实施例提出了一种实现联动功能的方法、装置、电子设备、计算机存储介质和计算机程序产品,应用于Formily框架的低代码核心类中,方法包括:接收从用户页面发送的JSON Schema配置;JSON Schema配置是用户页面从页面设计器中获取的;JSON Schema配置包括用于描述用户页面的多个组件节点的联动配置信息,且不同组件节点的联动配置信息对应相同的数据结构规范;通过遍历JSON Schema配置,得到多个组件节点中每个组件节点的联动配置信息;按照数据结构规范对每个组件节点的联动配置信息进行联动解析处理,得到联动解析处理后的联动功能代码;利用联动解析处理后的联动功能代码,实现对每个组件节点的联动功能。可以看出,在本申请实施例中,由于JSON Schema配置中包括的每个组件节点均对应相同的数据结构规范,因而在需要对JSON Schema配置中包括的每个组件节点进行联动开发时,可以基于一个通用化的数据结构规范对这些组件节点进行联动解析处理,这样,可以解决联动开发在通用化上具有限制性的问题;进一步地,在按照数据结构规范对这些组件节点进行联动解析处理时,通过梳理数据结构规范中各个协议字段的规则,可以自动化生成用于实现联动功能的功能代码,如此,无需开发人员每次手写与复杂联动功能相关的代码块,解决联动功能在迭代开发中成本高的问题。The embodiment of the present application proposes a method, device, electronic device, computer storage medium, and computer program product for realizing the linkage function, which are applied to the low-code core class of the Formily framework, and the method includes: receiving the JSON Schema configuration sent from the user page ;JSON Schema configuration is obtained by the user page from the page designer; JSON Schema configuration includes the linkage configuration information used to describe multiple component nodes of the user page, and the linkage configuration information of different component nodes corresponds to the same data structure specification; Traverse the JSON Schema configuration to obtain the linkage configuration information of each component node among multiple component nodes; perform linkage analysis and processing on the linkage configuration information of each component node according to the data structure specification, and obtain the linkage function code after linkage analysis and processing; use linkage Parse the processed linkage function code to realize the linkage function of each component node. It can be seen that in the embodiment of this application, since each component node included in the JSON Schema configuration corresponds to the same data structure specification, when it is necessary to perform linkage development on each component node included in the JSON Schema configuration, you can Based on a generalized data structure specification, these component nodes are linked and analyzed. In this way, the problem of limited generalization of linked development can be solved; further, when these component nodes are linked and analyzed according to the data structure specification , by combing the rules of each protocol field in the data structure specification, the function code for realizing the linkage function can be automatically generated. In this way, developers do not need to manually write code blocks related to complex linkage functions every time, and solve the cost of linkage functions in iterative development. high question.
在一些实施例中,上述方法还可以包括:按照数据结构规范对每个组件节点的联动配置信息进行校验解析处理,得到校验解析处理后的校验功能代码;利用校验解析处理后的校验功能代码,实现对每个组件节点的校验功能。In some embodiments, the above method may further include: performing verification and analysis processing on the linkage configuration information of each component node according to the data structure specification to obtain the verification function code after the verification and analysis processing; The verification function code realizes the verification function of each component node.
这里,进行校验解析处理的数据结构规范与上述进行联动解析处理的数据结构规范相同,此处不再赘述。Here, the data structure specification for performing verification analysis processing is the same as the above-mentioned data structure specification for performing linkage analysis processing, and will not be repeated here.
示例性地,按照与联动解析处理相同的数据结构规范对每个组件节点的联动配置信息进行校验解析处理,可以提高组件节点校验结果的准确性。Exemplarily, the linkage configuration information of each component node is verified and analyzed according to the same data structure specification as the linkage analysis process, which can improve the accuracy of the verification result of the component node.
在一些实施例中,联动解析处理后的校验功能代码,用于执行以下步骤:在当前组件节点包括的当前一份联动配置信息中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点;当前组件节点表示多个组件节点中当前需要联动解析处理的组件节点,其余组件节点表示多个组件节点中除当前组件节点以外的组件节点;判断查找出的组件节点是否满足联动条件;In some embodiments, the verification function code after linkage analysis and processing is used to perform the following steps: in the current linkage configuration information included in the current component node, according to the condition node path and condition component node type in the linkage condition, Find the component nodes from the rest of the component nodes; the current component node represents the component node that needs to be analyzed and processed currently among the multiple component nodes, and the remaining component nodes represent the component nodes other than the current component node among the multiple component nodes; judge the found one Whether the component node meets the linkage condition;
在确定查找出的组件节点满足联动条件时,确定当前一份联动配置信息满足联动条件,继续判断当前组件节点的结果是否通过校验,得到校验结果;在根据校验结果确定 当前组件节点通过校验后,继续判断当前组件节点的下一组件节点是否通过校验,直至需要联动解析处理的组件节点全部判断完成;或者,在确定查找出的组件节点不满足联动条件时,确定当前组件节点通过校验;继续判断当前组件节点的下一组件节点是否通过校验,直至需要联动解析处理的组件节点全部判断完成。When it is determined that the found component node meets the linkage condition, determine that the current linkage configuration information meets the linkage condition, continue to judge whether the result of the current component node passes the verification, and obtain the verification result; after determining that the current component node passes the verification result After the verification, continue to judge whether the next component node of the current component node passes the verification until all the component nodes that need linkage analysis and processing are judged; or, when it is determined that the found component nodes do not meet the linkage conditions, determine the current component node Pass the verification; continue to judge whether the next component node of the current component node passes the verification until all the component nodes that need linkage analysis and processing are judged.
示例性地,确定查找出的组件节点是否满足联动条件的实现方式已在上述实施例进行说明,此处不再赘述。Exemplarily, the implementation manner of determining whether the found component node satisfies the linkage condition has been described in the above embodiment, and will not be repeated here.
在一种实施方式中,如果确定查找出的组件节点满足联动条件,则继续判断当前组件节点是否通过校验;这里,通过校验说明当前组件节点的结果与当前一份联动配置信息中的最终设置结果相同;未通过校验则说明当前组件节点的结果与当前一份联动配置信息中的最终设置结果不相同。In one embodiment, if it is determined that the found component node satisfies the linkage condition, continue to judge whether the current component node passes the verification; here, passing the verification shows that the result of the current component node is consistent with the final The setting results are the same; if the verification fails, it means that the result of the current component node is different from the final setting result in the current linkage configuration information.
示例性地,如果确定当前组件节点通过校验,继续判断当前组件节点的下一组件节点是否通过校验,直至完成对需要联动解析处理的所有组件节点的判断。Exemplarily, if it is determined that the current component node passes the verification, continue to judge whether the next component node of the current component node passes the verification, until the judgment of all the component nodes requiring linkage analysis processing is completed.
在另一种实施方式中,如果确定当前组件节点不满足联动条件,则无需进行校验判断,而是直接默认当前组件节点通过校验;接着,继续判断当前组件节点的下一组件节点是否满足联动条件,如果满足,则继续进行校验判断;如果不满足,则直接默认通过校验。In another implementation, if it is determined that the current component node does not meet the linkage conditions, no verification judgment is required, but the current component node is directly defaulted to pass the verification; then, continue to judge whether the next component node of the current component node satisfies the Linkage conditions, if satisfied, continue to verify and judge; if not satisfied, directly pass the verification by default.
这里,在当前组件节点包括的当前一份联动配置信息中,只有当查找出的组件节点均通过校验时,才说明当前组件节点的校验功能通过;反之,则说明当前组件节点的校验功能失败。Here, in the current linkage configuration information included in the current component node, only when the found component nodes pass the verification, it means that the verification function of the current component node has passed; otherwise, it means that the verification function of the current component node is passed. Function failed.
可以看出,在确定出需要与当前组件节点联动的各个组件节点后,通过对这些组件节点进行进一步校验,可以确保实现组件节点联动功能的可靠性。It can be seen that after each component node that needs to be linked with the current component node is determined, further verification of these component nodes can ensure the reliability of the component node linkage function.
在一些实施例中,利用校验解析处理后的校验功能代码,实现对每个组件节点的校验功能,可以包括:将联动解析处理后的校验功能代码注册到低代码核心类的提交功能中;在确定用户页面进行数据恢复或提交操作时,通过执行校验功能代码,实现对每个组件节点的校验功能。In some embodiments, the verification function code of each component node is realized by using the verification function code after the verification analysis processing, which may include: registering the verification function code after the linkage analysis processing to the submission of the low-code core class In function; when the data recovery or submission operation is determined on the user page, the verification function of each component node is realized by executing the verification function code.
本申请实施中,以当前组件节点为例,在得到当前组件节点的校验功能代码后,将该校验功能代码注册到低代码核心类的提交功能中;之后,在用户通过用户页面进行数据恢复或提交操作时,通过执行该校验功能代码,可以实现对当前组件节点的校验功能。In the implementation of this application, taking the current component node as an example, after obtaining the verification function code of the current component node, register the verification function code in the submission function of the low-code core class; When restoring or submitting an operation, by executing the verification function code, the verification function of the current component node can be realized.
可以看出,本申请实施例中,通过校验功能代码注册到低代码核心类的提交功能中,可以方便后续进行数据恢复或提交操作时,快速执行与该组件节点相关的校验功能代码,确保执行校验操作的有效性。It can be seen that in the embodiment of this application, by registering the verification function code in the submission function of the low-code core class, it is convenient to quickly execute the verification function code related to the component node during subsequent data recovery or submission operations. Ensure the validity of the performed check operation.
在一些实施例中,在执行校验功能代码后,上述方法还可以包括:根据当前组件节点的联动条件中的条件节点数据类型,对校验功能代码的输出数据进行类型转换。In some embodiments, after the verification function code is executed, the above method may further include: performing type conversion on the output data of the verification function code according to the condition node data type in the linkage condition of the current component node.
示例性地,在执行校验功能代码后,可以根据当前组件节点的联动条件中的条件节点数据类型,对当前组件节点相关的校验功能代码的输出数据进行类型转换,得到校验功能代码的最终输出结果。Exemplarily, after the verification function code is executed, the output data of the verification function code related to the current component node can be type-converted according to the condition node data type in the linkage condition of the current component node to obtain the verification function code final output.
可以看出,通过对条件节点数据类型对输出数据进行转换,可以丰富JSON Schema协议数据类型,解决相关技术中有些数据类型无法正确通过字符串类型转换的问题。It can be seen that by converting the output data of the conditional node data type, the JSON Schema protocol data type can be enriched, and the problem that some data types cannot be correctly converted through the string type in related technologies can be solved.
为了能够更加体现本申请的目的,在本申请上述实施例的基础上,进行进一步的说明。In order to better reflect the purpose of the present application, further description will be made on the basis of the above-mentioned embodiments of the present application.
图2A是本申请实施例的一种实现联动校验功能的场景示意图,如图2A所示,该图中包括:用户页面、低代码核心类(LowcodeCore)和页面设计器;具体实现过程可以如下:Fig. 2A is a schematic diagram of a scenario for realizing the linkage verification function according to an embodiment of the present application. As shown in Fig. 2A, the figure includes: a user page, a low code core class (LowcodeCore) and a page designer; the specific implementation process can be as follows :
首先,用户页面向页面设计器发送获取JSON Schema配置的数据请求;当页面设 计器接收到该数据请求后,向用户页面返回JSON Schema配置;用户页面在接收到JSON Schema配置后,将该JSON Schema配置发送给低代码核心类。First, the user page sends a data request to the page designer to obtain the JSON Schema configuration; when the page designer receives the data request, it returns the JSON Schema configuration to the user page; after receiving the JSON Schema configuration, the user page sends the JSON Schema configuration Configuration is sent to low-code core classes.
然后,低代码核心类通过遍历JSON Schema配置的树形数据结构,找出每一级节点树下各个组件节点的联动配置信息并保存到联动配置数组中;低代码核心类按照数据结构规范对联动配置数组中每个组件节点的联动配置信息进行联动和校验解析处理,自动化生成联动功能代码和校验功能代码。Then, the low-code core class finds out the linkage configuration information of each component node under each level of node tree by traversing the tree data structure configured by JSON Schema and saves it in the linkage configuration array; the low-code core class performs linkage configuration according to the data structure specification The linkage configuration information of each component node in the configuration array is analyzed for linkage and verification, and the linkage function code and verification function code are automatically generated.
最后,将联动功能代码注册到Formily框架的联动功能api中进行使用,并将校验功能代码注册到低代码核心类的提交(submit)功能中,当页面进行数据恢复或提交时会被执行。Finally, register the linkage function code to the linkage function api of the Formily framework for use, and register the verification function code to the submit function of the low-code core class, which will be executed when the page performs data recovery or submission.
图2B是本申请实施例的一种进行联动解析处理和校验解析处理的流程示意图,如图2B所示,该流程包括以下步骤:Fig. 2B is a schematic flow diagram of a linkage analysis process and verification analysis process according to an embodiment of the present application. As shown in Fig. 2B, the process includes the following steps:
步骤A1:获取联动配置数组。Step A1: Obtain the linkage configuration array.
示例性地,低代码核心类从自身缓存中获取联动配置数组,该联动配置数组中包括JSON Schema配置中所有组件节点的联动配置信息。Exemplarily, the low-code core class obtains a linkage configuration array from its own cache, and the linkage configuration array includes linkage configuration information of all component nodes in the JSON Schema configuration.
步骤A2:确定工作类型为联动类型。Step A2: Determine the work type as linkage type.
示例性地,在低代码核心类获取联动配置数组后,会判断当前的工作类型;这里,工作类型包括联动类型和校验类型这两种。Exemplarily, after the low-code core class obtains the linkage configuration array, it will judge the current work type; here, the work type includes two types: linkage type and verification type.
步骤A3:根据数据结构规范进行联动解析处理。Step A3: Carry out linkage parsing and processing according to the data structure specification.
示例性地,低代码核心类在确定当前的工作类型为联动类型后,根据数据结构规范对当前组件节点对应的联动配置数组中的多份联动配置信息进行联动解析处理。Exemplarily, after determining that the current work type is a linkage type, the low-code core class performs linkage analysis and processing on multiple pieces of linkage configuration information in the linkage configuration array corresponding to the current component node according to the data structure specification.
步骤A4:通过遍历联动配置数组找到满足联动条件的联动配置信息。Step A4: Find the linkage configuration information that meets the linkage conditions by traversing the linkage configuration array.
示例性地,若通过遍历当前组件节点对应的联动配置数组中的每份联动配置信息,确定当前组件节点包括的当前一份联动配置信息满足联动条件,则说明根据当前一份联动配置信息查找出的组件节点中均满足联动条件;具体实现方式已在上述实施例进行说明,此处不再赘述。Exemplarily, if it is determined that the current piece of linkage configuration information contained in the current component node meets the linkage condition by traversing each piece of linkage configuration information in the linkage configuration array corresponding to the current component node, it means that the current piece of linkage configuration information is found out The component nodes of all meet the linkage conditions; the specific implementation has been described in the above-mentioned embodiments, and will not be repeated here.
步骤A5:将联动配置信息中的values值设置到当前组件节点上。Step A5: Set the values in the linkage configuration information to the current component node.
示例性地,values值对应上述当前一份联动配置信息中的最终设置结果;在通过遍历联动配置数组确定当前一份联动配置信息中的所有组件节点满足联动条件后,将当前这份联动配置信息中的values值(最终设置结果)设置到当前组件节点上;此时,针对当前组件节点的联动解析处理完成,得到联动解析处理后的联动功能代码。Exemplarily, the values value corresponds to the final setting result in the above-mentioned current linkage configuration information; after traversing the linkage configuration array to determine that all component nodes in the current linkage configuration information meet the linkage conditions, the current linkage configuration information The values (final setting result) in are set to the current component node; at this time, the linkage analysis processing for the current component node is completed, and the linkage function code after the linkage analysis processing is obtained.
步骤A2':确定工作类型为校验类型。Step A2': Determine the work type as the verification type.
步骤A3':根据数据结构规范进行校验解析处理。Step A3': Perform verification and parsing processing according to the data structure specification.
示例性地,低代码核心类在确定当前的工作类型为校验类型后,根据数据结构规范对当前组件节点对应的联动配置数组中的多份联动配置信息进行校验解析处理。Exemplarily, after the low-code core class determines that the current work type is the verification type, it performs verification analysis processing on multiple pieces of linkage configuration information in the linkage configuration array corresponding to the current component node according to the data structure specification.
步骤A4':通过遍历联动配置数组找到满足联动条件的联动配置信息。Step A4': find the linkage configuration information satisfying the linkage condition by traversing the linkage configuration array.
示例性地,具体实现方式已在上述实施例进行说明,此处不再赘述。Exemplarily, specific implementation manners have been described in the foregoing embodiments, and details are not repeated here.
步骤A5':判断是否等于当前组件节点的结果。Step A5': Judging whether it is equal to the result of the current component node.
示例性地,在满足联动条件的联动配置信息中,判断联动配置信息中的values值(最终设置结果)是否等于当前组件节点的结果;如果是,说明当前组件节点的校验功能通过,此时,返回校验成功;反之,说明当前组件节点的校验功能失败,此时,返回校验失败。Exemplarily, in the linkage configuration information that satisfies the linkage condition, it is judged whether the values (final setting result) in the linkage configuration information is equal to the result of the current component node; if yes, it means that the verification function of the current component node is passed. , the verification is successful; otherwise, it indicates that the verification function of the current component node has failed, and at this time, the verification failure is returned.
下面,结合具体的流程图对上述联动解析过程和校验解析过程进行说明;图2C是本申请实施例的另一种进行联动解析处理的流程示意图,如图2C所示,该流程包括以下步骤:Below, the above-mentioned linkage analysis process and verification analysis process will be described in conjunction with a specific flow chart; FIG. 2C is another schematic flow diagram of the linkage analysis process according to the embodiment of the present application. As shown in FIG. 2C, the process includes the following steps :
步骤B1:获取联动配置数组。Step B1: Obtain the linkage configuration array.
步骤B2:获取当前组件节点的当前一份联动配置信息。Step B2: Obtain the current linkage configuration information of the current component node.
示例性地,可以通过遍历方式,从联动配置数组中获取当前组件节点的当前一份联动配置信息。这里,当前组件节点表示描述当前用户页面的JSON Schema树形配置中,其中一个用户页面(User Interface,UI)组件的JSON描述。Exemplarily, the current piece of linkage configuration information of the current component node can be acquired from the linkage configuration array in a traversal manner. Here, the current component node represents the JSON description of one of the user interface (User Interface, UI) components in the JSON Schema tree configuration describing the current user page.
步骤B3:判断当前组件节点是否发生变化。Step B3: Determine whether the current component node has changed.
示例性地,判断当前组件节点的当前一份联动配置信息是否发生变化;如果是,则继续执行以下步骤,此时,需要重新确定与当前组件节点联动的其他组件节点,如果否,则说明当前组件节点不需要重新联动。Exemplarily, it is judged whether the current linkage configuration information of the current component node has changed; if yes, proceed to the following steps. Component nodes do not need to be relinked.
步骤B4:按照联动条件中的条件节点路径确定部分组件节点。Step B4: Determine some component nodes according to the conditional node path in the linkage condition.
示例性地,在当前组件节点的当前一份联动配置信息中,按照联动条件中的条件节点路径确定部分组件节点。Exemplarily, in the current piece of linkage configuration information of the current component node, some component nodes are determined according to the path of the conditional node in the linkage condition.
步骤B5:根据联动条件中的条件组件节点类型,获取查找到的组件节点的ComponentSchema组件实例。Step B5: Obtain the ComponentSchema component instance of the found component node according to the conditional component node type in the linkage condition.
示例性地,在确定部分组件节点后,根据联动条件中的条件组件节点类型,继续从部分组件节点中查找出与联动条件中的条件组件节点类型相同的组件节点;获取查找到的组件节点的ComponentSchema组件实例。Exemplarily, after part of the component nodes are determined, according to the type of the conditional component node in the linkage condition, continue to find out from the part of the component nodes the component node of the same type as the conditional component node in the linkage condition; obtain the found component node ComponentSchema component instance.
步骤B6:将联动条件中的条件节点值类型和条件节点值传入查找到的组件节点的ComponentSchema组件实例。Step B6: Pass the condition node value type and condition node value in the linkage condition to the ComponentSchema component instance of the found component node.
示例性地,在将联动条件中的条件节点值类型和条件节点值传入查找到的组件节点的ComponentSchema组件实例后,ComponentSchema组件实例会按照联动条件中的条件节点值类型对查找到的组件节点中每个组件节点的条件节点值进行类型转换,得到类型转换后的条件值;对类型转换后的条件值与联动条件中的条件节点值进行判断,确定查找到的组件节点是否均满足联动条件。Exemplarily, after passing the condition node value type and condition node value in the linkage condition to the ComponentSchema component instance of the found component node, the ComponentSchema component instance will match the found component node according to the condition node value type in the linkage condition Perform type conversion on the condition node value of each component node in , and obtain the condition value after type conversion; judge the condition value after type conversion and the condition node value in the linkage condition, and determine whether the found component nodes satisfy the linkage condition .
步骤B7:判断是否满足联动条件。如果是,执行步骤B8,反之,执行步骤B4,用于确定当前组件节点包括的下一份联动配置信息是否满足联动条件。Step B7: Judging whether the linkage condition is met. If yes, execute step B8, otherwise, execute step B4 for determining whether the next piece of linkage configuration information included in the current component node satisfies the linkage condition.
示例性地,判断查找到的组件节点是否满足联动条件,在确定查找到的组件节点对应的类型转换后的条件值与联动条件中的条件节点值相同的情况下,确定查找到的组件节点满足联动条件,即,当前一份联动配置信息满足联动条件;反之,则确定当前一份联动配置信息不满足联动条件。Exemplarily, it is judged whether the found component node satisfies the linkage condition, and when it is determined that the type-converted condition value corresponding to the found component node is the same as the condition node value in the linkage condition, it is determined that the found component node satisfies The linkage condition, that is, the current linkage configuration information satisfies the linkage condition; otherwise, it is determined that the current linkage configuration information does not meet the linkage condition.
步骤B8:获取当前组件节点的ComponentSchema组件实例,将当前一份联动配置信息中的values值传入当前组件节点的ComponentSchema组件实例进行设置。Step B8: Obtain the ComponentSchema component instance of the current component node, and transfer the values in the current linkage configuration information to the ComponentSchema component instance of the current component node for setting.
示例性地,在确定当前一份联动配置信息满足联动条件的情况下,可以获取当前组件节点的ComponentSchema组件实例,将当前一份联动配置信息中的values值传入当前组件节点的ComponentSchema组件实例进行联动结果的设置,即,将当前一份联动配置信息中的values值(最终设置结果)设置到当前组件节点的ComponentSchema组件实例上。Exemplarily, when it is determined that the current linkage configuration information satisfies the linkage condition, the ComponentSchema component instance of the current component node can be obtained, and the values in the current linkage configuration information can be transferred to the ComponentSchema component instance of the current component node for further processing. The setting of the linkage result, that is, setting the values (final setting result) in the current linkage configuration information to the ComponentSchema component instance of the current component node.
示例性地,在开始执行生成的联动功能代码时,先从低代码核心类中取出包括所有组件节点的联动配置信息的联动配置数组relationConfigArr,示例性地,联动配置数组中的当前组件节点可以表示为:'[{"key":"detail.identity","includeAttributeValues":[{"values":[{"regex":"\\S","errorRemind":""}],"condition":[{"key":"detail.identityType","values":[{"label":"身份证","value":"0"}],"formType":"select","valueType":"2"}]}]}]';relationConfigArr.*.key代表当前组件节点id,而relationConfigArr.*.includeAttributeValues代表当前组件节点的联动配置信息。Exemplarily, when starting to execute the generated linkage function code, the linkage configuration array relationConfigArr including the linkage configuration information of all component nodes is taken out from the low-code core class. Exemplarily, the current component node in the linkage configuration array can represent For: '[{"key":"detail.identity","includeAttributeValues":[{"values":[{"regex":"\\S","errorRemind":""}],"condition": [{"key":"detail.identityType","values":[{"label":"ID card","value":"0"}],"formType":"select","valueType":" 2"}]}]}]'; relationConfigArr.*.key represents the current component node id, and relationConfigArr.*.includeAttributeValues represents the linkage configuration information of the current component node.
然后遍历联动配置数组relationConfigArr;对relationConfigArr每一个组件节点按照数据结构规范进行联动解析处理。其中,当前组件节点的联动配置信息relationConfig如下:({"includeAttributeValues":[{"values":[{"regex":"\\S","errorRemind":""}],"condition":[{"key":"detail.identityType","values":[{"label":"身份证","value":"0"}],"formType":"select","valueType":"2"}]}]})和Formily的数据源({detail:{identity,identityType}})进行解析说明。Then traverse the linkage configuration array relationConfigArr; perform linkage analysis processing for each component node of relationConfigArr according to the data structure specification. Among them, the linkage configuration information relationConfig of the current component node is as follows: ({"includeAttributeValues":[{"values":[{"regex":"\\S","errorRemind":""}],"condition":[ {"key":"detail.identityType","values":[{"label":"ID card","value":"0"}],"formType":"select","valueType":"2 "}]}]}) and Formily's data source ({detail:{identity,identityType}}) for parsing instructions.
在联动解析过程中,以配置relationConfig的条件(condition)节点作为联动判断条件,使用condition.key的值为"detail.identityType"作为依赖路径,然后调用Formily的API onFieldValueChange对condition.key路径为detail.identityType的数据监听并注册回调函数。在回调函数中,当detail.identityType发生变化时,从回调函数的形参中取出detail.identityType的结果。接着根据condition.formType组件类型获取到对应的ComponentSchema组件实例,将detail.identityType和condition.values判断条件的范围值传到ComponentSchema组件实例中并调用validate进行校验。如果condition条件校验通过,代表当前组件联动条件满足,否则不满足。接着使用Array.some对联动配置数组中的组件节点进行遍历校验解析,如果联动配置数组中有一项条件condition通过ComponentSchema组件实例的校验,就将联动结果includeAttributeValues.*.values设置到配置relationConfig.key这个对应组件上,relationConfig.key对应的组件内部会按照当前组件规则调用Formily API setFieldState将联动结果includeAttributeValues.*.values设置到正确的属性上。In the linkage analysis process, configure the condition node of relationConfig as the linkage judgment condition, use the value of condition.key as "detail.identityType" as the dependency path, and then call Formily's API onFieldValueChange with the condition.key path as detail. The data of identityType monitors and registers a callback function. In the callback function, when the detail.identityType changes, get the result of detail.identityType from the formal parameter of the callback function. Then obtain the corresponding ComponentSchema component instance according to the condition.formType component type, pass the range values of the detail.identityType and condition.values judgment conditions to the ComponentSchema component instance and call validate for verification. If the condition condition check passes, it means that the linkage condition of the current component is satisfied, otherwise it is not satisfied. Then use Array.some to traverse, verify and analyze the component nodes in the linkage configuration array. If there is a condition condition in the linkage configuration array that passes the verification of the ComponentSchema component instance, set the linkage result includeAttributeValues.*.values to the configuration relationConfig. On the component corresponding to key, the component corresponding to relationConfig.key will call Formily API setFieldState according to the current component rules to set the linkage result includeAttributeValues.*.values to the correct attribute.
图2D是本申请实施例的另一种进行校验解析处理的流程示意图,如图2D所示,该流程包括以下步骤:Fig. 2D is another schematic flow diagram of verification analysis processing according to the embodiment of the present application. As shown in Fig. 2D, the flow includes the following steps:
步骤C1:获取联动配置数组。Step C1: Obtain the linkage configuration array.
步骤C2:获取需要联动解析处理的组件节点的联动配置信息。Step C2: Obtain the linkage configuration information of the component nodes that need to be parsed and processed in linkage.
示例性地,可以通过遍历方式,从联动配置数组中获取需要联动解析处理的所有组件节点的联动配置信息。Exemplarily, linkage configuration information of all component nodes requiring linkage parsing and processing may be acquired from the linkage configuration array in a traversal manner.
步骤C3:根据当前组件节点的联动配置信息进行校验。Step C3: Verify according to the linkage configuration information of the current component node.
这里,当前组件节点为需要联动解析处理的所有组件节点中的一个组件节点。Here, the current component node is a component node among all component nodes that need to be linked and parsed.
步骤C4:判断是否全部校验通过。Step C4: Judging whether all checks are passed.
示例性地,判断需要联动解析处理的所有组件节点是否全部校验通过。如果是,依次执行步骤C12、步骤C13,反之,执行步骤C5。Exemplarily, it is judged whether all the component nodes that need to be linked and parsed pass the verification. If yes, execute step C12 and step C13 in sequence, otherwise, execute step C5.
步骤C5:根据联动条件中的条件组件节点类型,获取查找到的组件节点的ComponentSchema组件实例。Step C5: Obtain the ComponentSchema component instance of the found component node according to the conditional component node type in the linkage condition.
步骤C6:将当前组件节点的联动条件中的条件节点值类型和条件节点值传入查找到的组件节点的ComponentSchema组件实例。Step C6: Pass the condition node value type and condition node value in the linkage condition of the current component node to the ComponentSchema component instance of the found component node.
示例性地,步骤C5至步骤C6与上述步骤B5至步骤B6的实现方式相同,此处不再赘述。Exemplarily, steps C5 to C6 are implemented in the same way as the above steps B5 to B6, and will not be repeated here.
步骤C7:判断是否满足联动条件。如果是,执行步骤C8,反之,执行步骤C4,用于确定需要联动解析处理的组件节点是否全部校验通过,如果否,会按照下列步骤继续对当前组件节点的下一组件节点进行联动校验;此时,默认当前组件节点校验通过。Step C7: Judging whether the linkage condition is met. If yes, execute step C8, otherwise, execute step C4 to determine whether all the component nodes that require linkage analysis and processing pass the verification, if not, follow the steps below to continue the linkage verification of the next component node of the current component node ; At this point, the default current component node check is passed.
步骤C8:获取当前组件节点的ComponentSchema组件实例。Step C8: Get the ComponentSchema component instance of the current component node.
示例性地,在确定当前一份联动配置信息满足联动条件的情况下,可以获取当前组件节点的ComponentSchema组件实例,Exemplarily, when it is determined that the current linkage configuration information satisfies the linkage condition, the ComponentSchema component instance of the current component node can be obtained,
步骤C9:将当前一份联动配置信息中的values值传入当前组件节点的 ComponentSchema组件实例进行校验。Step C9: Transfer the values in the current linkage configuration information to the ComponentSchema component instance of the current component node for verification.
示例性地,将当前组件节点包括的当前一份联动配置信息中的values值传入当前组件节点的ComponentSchema组件实例后,通过比较当前组件节点的ComponentSchema组件实例的实际结果与当前一份联动配置信息中的values值进行校验。Exemplarily, after passing the values in the current linkage configuration information included in the current component node to the ComponentSchema component instance of the current component node, by comparing the actual result of the ComponentSchema component instance of the current component node with the current linkage configuration information The values in the value are verified.
步骤C10:判断校验是否通过。Step C10: Judging whether the verification is passed.
示例性地,根据当前组件节点的ComponentSchema组件实例与当前一份联动配置信息中的values值的比较结果,判断当前组件节点的校验功能是否通过;如果是,执行步骤C4,反之执行步骤C11。Exemplarily, according to the comparison result of the ComponentSchema component instance of the current component node and the values in the current linkage configuration information, it is judged whether the verification function of the current component node is passed; if yes, execute step C4, otherwise execute step C11.
步骤C11:返回校验失败。Step C11: Return verification failure.
示例性地,在确定当前组件节点的校验功能未通过后,确定校验失败。Exemplarily, after it is determined that the verification function of the current component node fails, it is determined that the verification fails.
步骤C12:对输出数据进行类型转换处理。Step C12: Perform type conversion processing on the output data.
示例性地,可以根据当前组件节点的联动条件中的条件节点数据类型,对当前组件节点相关的校验功能代码的输出数据进行类型转换,得到最终输出结果。Exemplarily, according to the data type of the condition node in the linkage condition of the current component node, the output data of the verification function code related to the current component node can be type-converted to obtain the final output result.
步骤C13:返回校验成功。Step C13: Return verification success.
示例性地,在得到最终输出结果后,确定校验成功。Exemplarily, after the final output result is obtained, it is determined that the verification is successful.
示例性地,在开始执行生成校验功能代码时,先从低代码核心类中取出包括所有组件节点的联动配置信息的联动配置数组relationConfigArr,示例性地,联动配置数组中的当前组件节点可以表示为:'[{"key":"detail.identity","includeAttributeValues":[{"values":[{"regex":"\\S","errorRemind":""}],"condition":[{"key":"detail.identityType","values":[{"label":"身份证","value":"0"}],"formType":"select","valueType":"2"}]}]}]'。relationConfigArr.*.key代表当前组件节点id,而relationConfigArr.*.includeAttributeValues代表当前组件节点的联动配置信息。Exemplarily, when starting to execute the generation verification function code, the linkage configuration array relationConfigArr including the linkage configuration information of all component nodes is taken out from the low-code core class. Exemplarily, the current component node in the linkage configuration array can represent For: '[{"key":"detail.identity","includeAttributeValues":[{"values":[{"regex":"\\S","errorRemind":""}],"condition": [{"key":"detail.identityType","values":[{"label":"ID card","value":"0"}],"formType":"select","valueType":" 2"}]}]}]'. relationConfigArr.*.key represents the current component node id, and relationConfigArr.*.includeAttributeValues represents the linkage configuration information of the current component node.
然后遍历联动配置数组relationConfigArr;对relationConfigArr每一个组件节点按照数据结构规范进行联动解析处理。其中,当前组件节点的联动配置信息relationConfig如下:({"includeAttributeValues":[{"values":[{"regex":"\\S","errorRemind":""}],"condition":[{"key":"detail.identityType","values":[{"label":"身份证","value":"0"}],"formType":"select","valueType":"2"}]}]})和进行提交操作的结果数据源({detail:{identity,identityType}})进行解析说明。Then traverse the linkage configuration array relationConfigArr; perform linkage analysis processing for each component node of relationConfigArr according to the data structure specification. Among them, the linkage configuration information relationConfig of the current component node is as follows: ({"includeAttributeValues":[{"values":[{"regex":"\\S","errorRemind":""}],"condition":[ {"key":"detail.identityType","values":[{"label":"ID card","value":"0"}],"formType":"select","valueType":"2 "}]}]}) and the result data source of the submitted operation ({detail:{identity,identityType}}) for parsing instructions.
在联动解析过程中,以配置relationConfig的condition节点作为联动判断条件,使用condition.key的值"detail.identityType"作为依赖路径从数据源中取出detail.identityType的值,接着根据condition.formType组件类型获取到对应的ComponentSchema组件实例,将detail.identityType和condition.values判断条件的范围值传到ComponentSchema组件实例中并调用validate进行校验。如果匹配成功则代表联动条件节点通过,否则继续遍历下一个联动配置。如果所有condition条件节点都没匹配成功,可以代表当前节点relationConfig.key通过校验。如果有条件节点匹配成功,根据relationConfig.key节点id获取到对应的ComponentSchema组件实例。接着通过配置relationConfig.key为"detail.identity"作为取值路径从数据源中取出校验值,将校验值和includeAttributeValues.*.values匹配结果范围传到ComponentSchema组件实例中进行校验,当校验值符合includeAttributeValues.*.values的结果范围才能校验通过,否则relationConfig.key的节点校验返回失败。接着使用Array.every对所有节点的校验配置数组relationConfigArr进行遍历校验解析,只有当所有节点都能通过上述联动配置includeAttributeValues的校验流程,校验功能代码的校验功能才确定通过,否则返回失败。校验功能通过后,接着需要进行输出数据的类型转换来得到最终数据data。转换的 流程例如ComponentSchema组件实例有config属性代表配置信息,config.valueType代表输出数据类型。例如valueType为number类型时,需要将当前节点的输出数据进行number类型处理例如字符串的1会被更新成number类型的1。最终校验功能代码成功时,输出校验结果和输出数据如{status:true,data:{a1,a2,a3}}。In the linkage analysis process, the condition node of relationConfig is used as the linkage judgment condition, and the value of condition.key "detail.identityType" is used as the dependency path to extract the value of detail.identityType from the data source, and then obtain it according to the condition.formType component type Go to the corresponding ComponentSchema component instance, pass the range values of the detail.identityType and condition.values judgment conditions to the ComponentSchema component instance and call validate for verification. If the match is successful, it means that the linkage condition node has passed, otherwise continue to traverse the next linkage configuration. If none of the conditional nodes match successfully, it can pass the verification on behalf of the current node relationConfig.key. If the conditional node matches successfully, the corresponding ComponentSchema component instance is obtained according to the relationConfig.key node id. Then, by configuring relationConfig.key to "detail.identity" as the value path, take out the verification value from the data source, and pass the verification value and includeAttributeValues.*.values matching result range to the ComponentSchema component instance for verification. Only when the verification value conforms to the result range of includeAttributeValues.*.values can the verification pass, otherwise the node verification of relationConfig.key returns failure. Then use Array.every to traverse and analyze the verification configuration array relationConfigArr of all nodes. Only when all nodes can pass the verification process of the above-mentioned linkage configuration includeAttributeValues, the verification function of the verification function code is confirmed to pass, otherwise return fail. After the verification function is passed, it is necessary to perform type conversion of the output data to obtain the final data data. The process of conversion, such as ComponentSchema component instance, has config attribute to represent configuration information, and config.valueType represents output data type. For example, when the valueType is a number type, the output data of the current node needs to be processed as a number type. For example, 1 in a string will be updated to 1 in a number type. When the final verification function code is successful, output the verification result and output data such as {status: true, data: {a1, a2, a3}}.
图3是本申请实施例的实现联动功能的装置的组成结构示意图,如图3所示,该装置包括接收模块300、得到模块301和联动模块302,其中,Fig. 3 is a schematic diagram of the composition and structure of the device for realizing the linkage function according to the embodiment of the present application. As shown in Fig. 3, the device includes a receiving module 300, an obtaining module 301 and a linkage module 302, wherein,
接收模块300,配置为接收从用户页面发送的JSON Schema配置;所述JSON Schema配置是所述用户页面从页面设计器中获取的;所述JSON Schema配置包括用于描述所述用户页面的多个组件节点的联动配置信息,且不同组件节点的联动配置信息对应相同的数据结构规范;The receiving module 300 is configured to receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes multiple The linkage configuration information of component nodes, and the linkage configuration information of different component nodes corresponds to the same data structure specification;
得到模块301,配置为通过遍历所述JSON Schema配置,得到所述多个组件节点中每个组件节点的联动配置信息;按照所述数据结构规范对所述每个组件节点的联动配置信息进行联动解析处理,得到联动解析处理后的联动功能代码;The obtaining module 301 is configured to obtain the linkage configuration information of each component node in the plurality of component nodes by traversing the JSON Schema configuration; perform linkage to the linkage configuration information of each component node according to the data structure specification Analyzing and processing to obtain the linkage function code after linkage analysis and processing;
联动模块302,配置为利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能。The linkage module 302 is configured to use the linkage function code after the linkage analysis and processing to realize the linkage function for each component node.
在一些实施例中,所述组件节点包括多份联动配置信息,所述多份联动配置信息中的每份联动配置信息包括:组件节点的最终设置结果和联动条件;所述联动条件包括条件节点路径和条件组件节点类型;In some embodiments, the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result of the component node and a linkage condition; the linkage condition includes a condition node path and condition component node types;
所述联动解析处理后的联动功能代码,用于执行以下步骤:The linkage function code after the linkage analysis and processing is used to perform the following steps:
在当前组件节点包括的当前一份联动配置信息中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点;所述当前组件节点表示所述多个组件节点中当前需要联动解析处理的组件节点,所述其余组件节点表示所述多个组件节点中除所述当前组件节点以外的组件节点;In the current linkage configuration information included in the current component node, according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes; the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
判断查找出的组件节点是否满足联动条件;Determine whether the found component nodes meet the linkage conditions;
在确定所述查找出的组件节点满足联动条件时,确定所述当前一份联动配置信息满足所述联动条件,将所述当前一份联动配置信息中的最终设置结果设置到所述当前组件节点的结果上。When it is determined that the found component node satisfies the linkage condition, it is determined that the current piece of linkage configuration information satisfies the linkage condition, and the final setting result in the current piece of linkage configuration information is set to the current component node on the results.
在一些实施例中,所述联动条件还包括条件节点值和条件节点值类型,所述联动模块302,配置为判断查找出的组件节点是否满足联动条件,包括:In some embodiments, the linkage condition further includes a condition node value and a condition node value type, and the linkage module 302 is configured to determine whether the found component node satisfies the linkage condition, including:
按照所述联动条件中的条件节点值类型对所述查找出的组件节点的条件节点值进行类型转换,得到类型转换后的条件值;performing type conversion on the condition node value of the found component node according to the condition node value type in the linkage condition, to obtain a type-converted condition value;
在所述类型转换后的条件值与所述联动条件中的条件节点值相同的情况下,确定所述查找出的组件节点满足联动条件;When the condition value after the type conversion is the same as the condition node value in the linkage condition, determine that the found component node satisfies the linkage condition;
在所述类型转换后的条件值与所述联动条件中的条件节点值不相同的情况下,确定所述查找出的组件节点不满足联动条件。If the condition value after the type conversion is different from the condition node value in the linkage condition, it is determined that the found component node does not satisfy the linkage condition.
在一些实施例中,所述联动模块302,配置为利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能,包括:In some embodiments, the linkage module 302 is configured to use the linkage function code after the linkage analysis and processing to realize the linkage function for each component node, including:
将所述联动解析处理后的联动功能代码注册到所述Formily框架的联动功能应用程序接口api中;Registering the linkage function code after the linkage analysis and processing in the linkage function application programming interface api of the Formily framework;
在确定所述用户页面对所述每个组件节点触发联动时,通过所述联动功能api调用所述联动功能代码,实现对所述每个组件节点的联动功能。When it is determined that the user page triggers linkage for each component node, the linkage function code is invoked through the linkage function api to realize the linkage function for each component node.
在一些实施例中,所述装置还包括校验模块,所述校验模块,配置为:In some embodiments, the device further includes a verification module, and the verification module is configured to:
按照所述数据结构规范对所述每个组件节点的联动配置信息进行校验解析处理,得到校验解析处理后的校验功能代码;Perform verification and analysis processing on the linkage configuration information of each component node according to the data structure specification, and obtain the verification function code after the verification and analysis processing;
利用所述校验解析处理后的校验功能代码,实现对所述每个组件节点的校验功能。The verification function code for each component node is realized by using the verification function code after the verification analysis.
在一些实施例中,所述组件节点包括多份联动配置信息,所述多份联动配置信息中的每份联动配置信息包括:组件节点的最终设置结果和联动条件;所述联动条件包括条件节点路径和条件组件节点类型;In some embodiments, the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result of the component node and a linkage condition; the linkage condition includes a condition node path and condition component node types;
所述联动解析处理后的校验功能代码,用于执行以下步骤:The verification function code after the linkage analysis and processing is used to perform the following steps:
在当前组件节点包括的当前一份联动配置信息中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点;所述当前组件节点表示所述多个组件节点中当前需要联动解析处理的组件节点,所述其余组件节点表示所述多个组件节点中除所述当前组件节点以外的组件节点;In the current linkage configuration information included in the current component node, according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes; the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
判断查找出的组件节点是否满足联动条件;Determine whether the found component nodes meet the linkage conditions;
在确定所述查找出的组件节点满足联动条件时,确定所述当前一份联动配置信息满足所述联动条件,继续判断所述当前组件节点的结果是否通过校验,得到校验结果;在根据所述校验结果确定所述当前组件节点通过校验后,继续判断所述当前组件节点的下一组件节点是否通过校验,直至需要联动解析处理的组件节点全部判断完成;或者,When determining that the found component node satisfies the linkage condition, determine that the current linkage configuration information satisfies the linkage condition, continue to judge whether the result of the current component node passes the verification, and obtain the verification result; After the verification result determines that the current component node has passed the verification, continue to judge whether the next component node of the current component node has passed the verification until all the component nodes that need linkage analysis and processing are judged; or,
在确定所述查找出的组件节点不满足联动条件时,确定所述当前组件节点通过校验;继续判断所当前组件节点的下一组件节点是否通过校验,直至需要联动解析处理的组件节点全部判断完成。When it is determined that the found component node does not meet the linkage condition, determine that the current component node has passed the verification; continue to judge whether the next component node of the current component node has passed the verification, until all the component nodes that need to be analyzed and processed by linkage Judgment complete.
在一些实施例中,所述校验模块,配置为按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点,包括:In some embodiments, the checking module is configured to find out component nodes from other component nodes according to the condition node path and condition component node type in the linkage condition, including:
从所述其余组件节点中确定与所述联动条件中的条件节点路径对应的部分组件节点;determining a part of component nodes corresponding to the condition node path in the linkage condition from the remaining component nodes;
从所述部分组件节点中查找出与所述联动条件中的条件组件节点类型相同的组件节点。A component node of the same type as the conditional component node in the linkage condition is found from the partial component nodes.
在一些实施例中,所述校验模块,配置为利用所述校验解析处理后的校验功能代码,实现对所述每个组件节点的校验功能,包括:In some embodiments, the verification module is configured to implement the verification function of each component node by using the verification function code after the parsing and processing of the verification, including:
将所述联动解析处理后的校验功能代码注册到所述低代码核心类的提交功能中;Register the verification function code after the linkage analysis and processing into the submission function of the low-code core class;
在确定所述用户页面进行数据恢复或提交操作时,通过执行所述校验功能代码,实现对所述每个组件节点的校验功能。When it is determined that the user page is performing a data recovery or submission operation, the verification function for each component node is realized by executing the verification function code.
在一些实施例中,在执行所述校验功能代码后,所述校验模块,还用于:In some embodiments, after executing the verification function code, the verification module is further configured to:
根据所述当前组件节点的联动条件中的条件节点数据类型,对所述校验功能代码的输出数据进行类型转换。Perform type conversion on the output data of the verification function code according to the data type of the condition node in the linkage condition of the current component node.
在实际应用中,上述接收模块300、得到模块301、联动模块302和校验模块均可以由位于电子设备中的处理器实现,该处理器可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。In practical applications, the above-mentioned receiving module 300, obtaining module 301, linkage module 302 and verification module can all be realized by a processor located in the electronic device, and the processor can be ASIC, DSP, DSPD, PLD, FPGA, CPU, At least one of controller, microcontroller, microprocessor.
另外,在本实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in this embodiment may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software function modules.
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、RAM、磁碟或者光盘等各种可以存储程序代码 的介质。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or The contribution made by related technologies or all or part of the technical solution can be embodied in the form of software products, the computer software products are stored in a storage medium, and include several instructions to make a computer device (which can be a personal computer) , server, or network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment. And aforementioned storage medium comprises: various mediums that can store program codes such as U disk, mobile hard disk, read-only memory (Read Only Memory, ROM), RAM, magnetic disk or optical disk.
具体来讲,本实施例中的一种实现联动功能的方法对应的计算机程序指令可以被存储在光盘、硬盘、U盘等存储介质上,当存储介质中的与一种实现联动功能的方法对应的计算机程序指令被一电子设备读取或被执行时,实现前述实施例的任意一种实现联动功能的方法。Specifically, the computer program instructions corresponding to a method for realizing the linkage function in this embodiment can be stored on a storage medium such as an optical disc, a hard disk, or a USB flash drive. When the instructions in the storage medium correspond to a method for realizing the linkage function When the computer program instructions are read or executed by an electronic device, any one of the methods for realizing the linkage function in the foregoing embodiments is implemented.
基于前述实施例相同的技术构思,参见图4,其示出了本申请实施例提供的电子设备400,可以包括:存储器401和处理器402;其中,Based on the same technical concept as the foregoing embodiments, see FIG. 4 , which shows an electronic device 400 provided by an embodiment of the present application, which may include: a memory 401 and a processor 402; wherein,
存储器401,配置为存储计算机程序和数据; memory 401 configured to store computer programs and data;
处理器402,配置为执行存储器中存储的计算机程序,以实现前述实施例的任意一种实现联动功能的方法。The processor 402 is configured to execute the computer program stored in the memory, so as to implement any one of the methods for realizing the linkage function in the foregoing embodiments.
在实际应用中,上述存储器401可以是易失性存储器(volatile memory),例如RAM;或者非易失性存储器(non-volatile memory),例如ROM、快闪存储器(flash memory)、硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器402提供指令和数据。In practical applications, the above-mentioned memory 401 can be a volatile memory (volatile memory), such as RAM; or a non-volatile memory (non-volatile memory), such as ROM, flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and provide instructions and data to the processor 402.
上述处理器402可以为ASIC、DSP、DSPD、PLD、FPGA、CPU、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的实现联动功能的设备,用于实现上述处理器功能的电子器件还可以为其它,本申请实施例不作具体限定。本申请实施例还提供一种计算机程序产品,该计算机程序产品承载有程序代码,所述程序代码包括的指令可用于执行上述方法实施例中所述的负载均衡方法,具体可参见上述方法实施例,在此不再赘述。The aforementioned processor 402 may be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor. It can be understood that, for different devices implementing linkage functions, the electronic device used to implement the above processor function may also be other, which is not specifically limited in this embodiment of the present application. The embodiment of the present application also provides a computer program product, the computer program product carries a program code, and the instructions included in the program code can be used to execute the load balancing method described in the above method embodiment, for details, please refer to the above method embodiment , which will not be repeated here.
其中,上述计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。Wherein, the above-mentioned computer program product may be specifically implemented by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) etc. wait.
在一些实施例中,本申请实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the device provided by the embodiments of the present application can be used to execute the methods described in the above method embodiments, and its specific implementation can refer to the descriptions of the above method embodiments. For brevity, here No longer.
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本文不再赘述。The above descriptions of the various embodiments tend to emphasize the differences between the various embodiments, the same or similar points can be referred to each other, and for the sake of brevity, details are not repeated herein.
本申请所提供的各方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the various method embodiments provided in this application can be combined arbitrarily without conflict to obtain new method embodiments.
本申请所提供的各产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in the various product embodiments provided in this application can be combined arbitrarily without conflict to obtain new product embodiments.
本申请所提供的各方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in each method or device embodiment provided in this application can be combined arbitrarily without conflict to obtain a new method embodiment or device embodiment.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) having computer-usable program code embodied therein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理 器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
以上,仅为本申请的较佳实施例而已,并非用于限定本申请的保护范围。The above are only preferred embodiments of the present application, and are not intended to limit the protection scope of the present application.

Claims (13)

  1. 一种实现联动功能的方法,应用于Formily框架的低代码核心类中,所述方法包括:A method for implementing linkage functions, applied to the low-code core classes of the Formily framework, the method includes:
    接收从用户页面发送的JSON Schema配置;所述JSON Schema配置是所述用户页面从页面设计器中获取的;所述JSON Schema配置包括用于描述所述用户页面的多个组件节点的联动配置信息,且不同组件节点的联动配置信息对应相同的数据结构规范;Receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes linkage configuration information for describing multiple component nodes of the user page , and the linkage configuration information of different component nodes corresponds to the same data structure specification;
    通过遍历所述JSON Schema配置,得到所述多个组件节点中每个组件节点的联动配置信息;按照所述数据结构规范对所述每个组件节点的联动配置信息进行联动解析处理,得到联动解析处理后的联动功能代码;By traversing the JSON Schema configuration, the linkage configuration information of each component node in the plurality of component nodes is obtained; according to the data structure specification, the linkage configuration information of each component node is subjected to linkage analysis processing, and the linkage analysis is obtained. The processed linkage function code;
    利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能。The linkage function code for each component node is realized by using the linkage function code after the linkage analysis and processing.
  2. 根据权利要求1所述的方法,其中,所述组件节点包括多份联动配置信息,所述多份联动配置信息中的每份联动配置信息包括:组件节点的最终设置结果和联动条件;所述联动条件包括条件节点路径和条件组件节点类型;The method according to claim 1, wherein the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result and linkage conditions of the component node; Linkage conditions include condition node path and condition component node type;
    所述联动解析处理后的联动功能代码,用于执行以下步骤:The linkage function code after the linkage analysis and processing is used to perform the following steps:
    在当前组件节点包括的当前一份联动配置信息中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点;所述当前组件节点表示所述多个组件节点中当前需要联动解析处理的组件节点,所述其余组件节点表示所述多个组件节点中除所述当前组件节点以外的组件节点;In the current linkage configuration information included in the current component node, according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes; the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
    判断查找出的组件节点中是否满足联动条件;Determine whether the linkage condition is satisfied in the found component nodes;
    在确定所述查找出的组件节点满足联动条件时,确定所述当前一份联动配置信息满足所述联动条件,将所述当前一份联动配置信息中的最终设置结果设置到所述当前组件节点的结果上。When it is determined that the found component node satisfies the linkage condition, it is determined that the current piece of linkage configuration information satisfies the linkage condition, and the final setting result in the current piece of linkage configuration information is set to the current component node on the results.
  3. 根据权利要求2所述的方法,其中,所述联动条件还包括条件节点值和条件节点值类型,所述判断查找出的组件节点是否满足联动条件,包括:The method according to claim 2, wherein the linkage condition further includes a condition node value and a condition node value type, and the judging whether the found component node satisfies the linkage condition comprises:
    按照所述联动条件中的条件节点值类型对所述查找出的组件节点的条件节点值进行类型转换,得到类型转换后的条件值;performing type conversion on the condition node value of the found component node according to the condition node value type in the linkage condition, to obtain a type-converted condition value;
    在所述类型转换后的条件值与所述联动条件中的条件节点值相同的情况下,确定所述查找出的组件节点满足联动条件;When the condition value after the type conversion is the same as the condition node value in the linkage condition, determine that the found component node satisfies the linkage condition;
    在所述类型转换后的条件值与所述联动条件中的条件节点值不相同的情况下,确定所述查找出的组件节点不满足联动条件。If the condition value after the type conversion is different from the condition node value in the linkage condition, it is determined that the found component node does not satisfy the linkage condition.
  4. 根据权利要求1所述的方法,其中,所述利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能,包括:The method according to claim 1, wherein said utilizing the linkage function code after said linkage analysis and processing to realize the linkage function of each component node includes:
    将所述联动解析处理后的联动功能代码注册到所述Formily框架的联动功能应用程序接口api中;Registering the linkage function code after the linkage analysis and processing in the linkage function application programming interface api of the Formily framework;
    在确定所述用户页面对所述每个组件节点触发联动时,通过所述联动功能api调用所述联动功能代码,实现对所述每个组件节点的联动功能。When it is determined that the user page triggers linkage for each component node, the linkage function code is invoked through the linkage function api to realize the linkage function for each component node.
  5. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    按照所述数据结构规范对所述每个组件节点的联动配置信息进行校验解析处理,得到校验解析处理后的校验功能代码;Perform verification and analysis processing on the linkage configuration information of each component node according to the data structure specification, and obtain the verification function code after the verification and analysis processing;
    利用所述校验解析处理后的校验功能代码,实现对所述每个组件节点的校验功能。The verification function code for each component node is realized by using the verification function code after the verification analysis.
  6. 根据权利要求5所述的方法,其中,所述组件节点包括多份联动配置信息,所述多份联动配置信息中的每份联动配置信息包括:组件节点的最终设置结果和联动条件;所述联动条件包括条件节点路径和条件组件节点类型;The method according to claim 5, wherein the component node includes multiple pieces of linkage configuration information, and each piece of linkage configuration information in the multiple pieces of linkage configuration information includes: the final setting result and linkage conditions of the component node; Linkage conditions include condition node path and condition component node type;
    所述联动解析处理后的校验功能代码,用于执行以下步骤:The verification function code after the linkage analysis and processing is used to perform the following steps:
    在当前组件节点包括的当前一份联动配置信息中,按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点;所述当前组件节点表示所述多个组件节点中当前需要联动解析处理的组件节点,所述其余组件节点表示所述多个组件节点中除所述当前组件节点以外的组件节点;In the current linkage configuration information included in the current component node, according to the condition node path and the condition component node type in the linkage condition, find out the component nodes from the remaining component nodes; the current component node represents the plurality of component nodes Among the component nodes that currently need linkage analysis and processing, the remaining component nodes represent component nodes in the plurality of component nodes except the current component node;
    判断查找出的组件节点是否满足联动条件;Determine whether the found component nodes meet the linkage conditions;
    在确定所述查找出的组件节点满足联动条件时,确定所述当前一份联动配置信息满足所述联动条件,继续判断所述当前组件节点的结果是否通过校验,得到校验结果;在根据所述校验结果确定所述当前组件节点通过校验后,继续判断所述当前组件节点的下一组件节点是否通过校验,直至需要联动解析处理的组件节点全部判断完成;或者,When determining that the found component node satisfies the linkage condition, determine that the current linkage configuration information satisfies the linkage condition, continue to judge whether the result of the current component node passes the verification, and obtain the verification result; After the verification result determines that the current component node has passed the verification, continue to judge whether the next component node of the current component node has passed the verification until all the component nodes that need linkage analysis and processing are judged; or,
    在确定所述查找出的组件节点不满足联动条件时,确定所述当前组件节点通过校验;继续判断所述当前组件节点的下一组件节点是否通过校验,直至需要联动解析处理的组件节点全部判断完成。When it is determined that the found component node does not meet the linkage condition, determine that the current component node has passed the verification; continue to judge whether the next component node of the current component node has passed the verification, until the component node that needs linkage analysis processing All judgments are complete.
  7. 根据权利要求2或6所述的方法,其中,所述按照联动条件中的条件节点路径和条件组件节点类型,从其余组件节点中查找出组件节点,包括:The method according to claim 2 or 6, wherein, according to the condition node path and the condition component node type in the linkage condition, finding the component node from the remaining component nodes includes:
    从所述其余组件节点中确定与所述联动条件中的条件节点路径对应的部分组件节点;determining a part of component nodes corresponding to the condition node path in the linkage condition from the remaining component nodes;
    从所述部分组件节点中查找出与所述联动条件中的条件组件节点类型相同的组件节点。A component node of the same type as the conditional component node in the linkage condition is found from the partial component nodes.
  8. 根据权利要求5所述的方法,其中,所述利用所述校验解析处理后的校验功能代码,实现对所述每个组件节点的校验功能,包括:The method according to claim 5, wherein said using the verification function code after the verification analysis processing to realize the verification function of each component node includes:
    将所述联动解析处理后的校验功能代码注册到所述低代码核心类的提交功能中;Register the verification function code after the linkage analysis and processing into the submission function of the low-code core class;
    在确定所述用户页面进行数据恢复或提交操作时,通过执行所述校验功能代码,实现对所述每个组件节点的校验功能。When it is determined that the user page is performing a data recovery or submission operation, the verification function for each component node is realized by executing the verification function code.
  9. 根据权利要求8所述的方法,其中,在执行所述校验功能代码后,所述方法还包括:The method according to claim 8, wherein, after executing the verification function code, the method further comprises:
    根据所述当前组件节点的联动条件中的条件节点数据类型,对所述校验功能代码的输出数据进行类型转换。Perform type conversion on the output data of the verification function code according to the data type of the condition node in the linkage condition of the current component node.
  10. 一种实现联动功能的装置,应用于Formily框架的低代码核心类中,所述装置包括:A device for realizing the linkage function, which is applied to the low-code core class of the Formily framework, and the device includes:
    接收模块,用于接收从用户页面发送的JSON Schema配置;所述JSON Schema配置是所述用户页面从页面设计器中获取的;所述JSON Schema配置包括用于描述所述用户页面的多个组件节点的联动配置信息,且不同组件节点的联动配置信息对应相同的数据结构规范;The receiving module is used to receive the JSON Schema configuration sent from the user page; the JSON Schema configuration is obtained by the user page from the page designer; the JSON Schema configuration includes multiple components used to describe the user page The linkage configuration information of the node, and the linkage configuration information of different component nodes corresponds to the same data structure specification;
    得到模块,用于通过遍历所述JSON Schema配置,得到所述多个组件节点中每个组件节点的联动配置信息;按照所述数据结构规范对所述每个组件节点的联动配置信息进行联动解析处理,得到联动解析处理后的联动功能代码;Obtaining a module for obtaining the linkage configuration information of each component node in the plurality of component nodes by traversing the JSON Schema configuration; performing linkage analysis on the linkage configuration information of each component node according to the data structure specification processing to obtain the linkage function code after linkage analysis and processing;
    联动模块,用于利用所述联动解析处理后的联动功能代码,实现对所述每个组件节点的联动功能。The linkage module is configured to realize the linkage function of each component node by using the linkage function code after the linkage analysis and processing.
  11. 一种电子设备,所述设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1至9任一项所述的方法。An electronic device, the device comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor implementing the program according to any one of claims 1 to 9 method.
  12. 一种计算机存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现权利要求1至9任一项所述的方法。A computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is realized.
  13. 一种计算机程序产品,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行权利要求1至9任一项所述的方法。A computer program product comprising computer readable codes, when the computer readable codes are run in an electronic device, a processor in the electronic device executes the method according to any one of claims 1 to 9.
PCT/CN2022/100726 2021-12-17 2022-06-23 Method and apparatus for implementing linkage function, device, storage medium, and program WO2023109074A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111552350.5 2021-12-17
CN202111552350.5A CN114385148A (en) 2021-12-17 2021-12-17 Method, device, equipment and storage medium for realizing linkage function

Publications (1)

Publication Number Publication Date
WO2023109074A1 true WO2023109074A1 (en) 2023-06-22

Family

ID=81197507

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/100726 WO2023109074A1 (en) 2021-12-17 2022-06-23 Method and apparatus for implementing linkage function, device, storage medium, and program

Country Status (2)

Country Link
CN (1) CN114385148A (en)
WO (1) WO2023109074A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472372A (en) * 2023-10-27 2024-01-30 北京真内控科技有限公司 Responsive form construction method and system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114385148A (en) * 2021-12-17 2022-04-22 深圳前海微众银行股份有限公司 Method, device, equipment and storage medium for realizing linkage function

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200097268A1 (en) * 2018-09-21 2020-03-26 Salesforce.Com, Inc. Application builder with connected components
CN112487112A (en) * 2020-12-17 2021-03-12 江苏苏宁云计算有限公司 Method and device for linkage configuration of components, computer equipment and storage medium
CN113094561A (en) * 2021-05-08 2021-07-09 中国工商银行股份有限公司 Webpage generation method, webpage generation device, electronic equipment and storage medium
CN114385148A (en) * 2021-12-17 2022-04-22 深圳前海微众银行股份有限公司 Method, device, equipment and storage medium for realizing linkage function

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200097268A1 (en) * 2018-09-21 2020-03-26 Salesforce.Com, Inc. Application builder with connected components
CN112487112A (en) * 2020-12-17 2021-03-12 江苏苏宁云计算有限公司 Method and device for linkage configuration of components, computer equipment and storage medium
CN113094561A (en) * 2021-05-08 2021-07-09 中国工商银行股份有限公司 Webpage generation method, webpage generation device, electronic equipment and storage medium
CN114385148A (en) * 2021-12-17 2022-04-22 深圳前海微众银行股份有限公司 Method, device, equipment and storage medium for realizing linkage function

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472372A (en) * 2023-10-27 2024-01-30 北京真内控科技有限公司 Responsive form construction method and system
CN117472372B (en) * 2023-10-27 2024-04-09 北京真内控科技有限公司 Responsive form construction method and system

Also Published As

Publication number Publication date
CN114385148A (en) 2022-04-22

Similar Documents

Publication Publication Date Title
Gao et al. Checking smart contracts with structural code embedding
US10540270B1 (en) Representation-based automated software testing
US10177996B2 (en) System and method for validating documentation of representational state transfer (REST) services
US9483387B1 (en) Tree comparison functionality for services
US10901961B2 (en) Systems and methods for generating schemas that represent multiple data sources
WO2023109074A1 (en) Method and apparatus for implementing linkage function, device, storage medium, and program
US10452407B2 (en) Adapter configuration
KR101755365B1 (en) Managing record format information
US10824636B2 (en) Mechanisms for querying disparate data storage systems
Martin-Lopez et al. Specification and automated analysis of inter-parameter dependencies in web APIs
US10642863B2 (en) Management of structured, non-structured, and semi-structured data in a multi-tenant environment
US20170364386A1 (en) Event-Driven Multi-Tenant Computer-Management Platform
Felício et al. Rapitest: Continuous black-box testing of restful web apis
US20230040635A1 (en) Graph-based impact analysis of misconfigured or compromised cloud resources
WO2024000955A1 (en) Page hot update method and apparatus, device, and storage medium
CN117493158A (en) Test method and device, electronic equipment and storage medium
CN113703739B (en) Cross-language fusion calculation method, system and terminal based on omiga engine
CN116088846A (en) Processing method, related device and equipment for continuous integrated code format
CN117632710A (en) Method, device, equipment and storage medium for generating test code
US10719424B1 (en) Compositional string analysis
US20230072988A1 (en) System and a method for automatic generation of smart contracts across blockchain platforms
CN116346609A (en) Method for realizing route configuration and parameter binding based on go language
WO2021022702A1 (en) Log insertion method and apparatus, computer apparatus and storage medium
WO2022111209A1 (en) Data acquisition method and apparatus, data acquisition device and readable storage medium
Halfond Identifying inter-component control flow in web applications

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22905840

Country of ref document: EP

Kind code of ref document: A1