Page constraint verification method and device, computer equipment and storage medium
By preconfiguring the correspondence between the constraint dimensions of the controls and attribute constraint rules on the backend device, the problem of low efficiency of front-end page development is solved, and efficient page development and dynamic configuration management are achieved.
Patent Information
- Application Number
- CN202411686994.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-11
AI Technical Summary
During the front-end page development process, pages with complex logic and a large number of development tasks lead to low page development efficiency.
By preconfiguring the correspondence between the constraint dimensions of the control and the attribute constraint rules on the backend device, the operation information sent by the front-end device is obtained, and the target attribute constraint rules are determined based on the information to perform constraint verification processing, and the verification result is generated and sent to the front-end device.
It improves the development efficiency of front-end pages, transfers the logical development of front-end pages to back-end devices, and implements dynamic configuration management, avoiding frequent changes in front-end code.
Smart Images

Figure CN119806697A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of page development, and in particular to a method, device, computer equipment and storage medium for checking page constraints. Background Art
[0002] In the process of front-end page development, for some pages with complex logic, such as linkage between controls in the page, it is necessary to configure the properties of the corresponding controls; when the number of pages is large, this will bring a large number of development tasks, resulting in low page development efficiency. Summary of the invention
[0003] In view of this, the present invention provides a method, apparatus, computer device and storage medium for checking page constraints to solve the problem of low page development efficiency.
[0004] In a first aspect, the present invention provides a method for checking page constraints, which is applied to a backend device and includes:
[0005] Pre-configure the corresponding relationship between the constraint dimension and the attribute constraint rule for the controls required by the page; the constraint dimension includes the effective range of the business object identifier;
[0006] Acquire operation information sent by the front-end device; the operation information is generated when operating a target control in a page of a target business object, and the operation information includes a business object identifier of the target business object, a control identifier of the target control, and related attribute information;
[0007] According to the corresponding relationship configured for the target control, the target attribute constraint rule hit by the operation information is determined; the business object identifier of the target business object belongs to the effective range corresponding to the target attribute constraint rule;
[0008] Perform constraint verification processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint verification result;
[0009] The constraint checking result is sent to the front-end device, instructing the front-end device to render the page according to the constraint checking result.
[0010] In some optional implementations, the constraint dimension further includes: acceptance action;
[0011] The determining, according to the corresponding relationship configured for the target control, the target attribute constraint rule hit by the operation information includes:
[0012] Determining an acceptance action for the operation information according to the attribute information;
[0013] Determine whether the acceptance action of the operation information matches the acceptance action corresponding to the attribute constraint rule, and whether the business object identifier of the target business object belongs to the effective range corresponding to the attribute constraint rule;
[0014] When the acceptance action matches and the business object identifier belongs to the corresponding effective range, the attribute constraint rule corresponding to the business object identifier that matches the acceptance action of the operation information and whose effective range includes the target business object is used as the target attribute constraint rule.
[0015] In some optional embodiments, the method further comprises:
[0016] Obtaining an extension instruction; the extension instruction includes a new constraint dimension and / or a new enumeration value under an existing constraint dimension;
[0017] In combination with the new constraint dimension and / or the new enumeration value, a new corresponding relationship between the configuration and the attribute constraint rule is configured.
[0018] In some optional implementations, the pre-configuring the corresponding relationship between the constraint dimension and the attribute constraint rule for the control required for the page includes:
[0019] Pre-build multiple attribute constraint rules and assign unique rule identifiers;
[0020] Bind the control identifier, the identifier and / or range corresponding to the constraint dimension, and the rule identifier of the attribute constraint rule to generate a corresponding correspondence relationship;
[0021] The determining, according to the corresponding relationship configured for the target control, the target attribute constraint rule hit by the operation information includes:
[0022] According to the corresponding relationship configured for the target control, a target rule identifier bound to the control identifier of the target control and the business object identifier of the target business object is determined, and a target attribute constraint rule corresponding to the target rule identifier is used as a target attribute constraint rule.
[0023] In some optional implementations, the attribute constraint rule includes a plurality of attribute constraint sub-rules divided according to the acceptance life cycle of the business object; the attribute constraint sub-rule includes: at least one of a page verification constraint rule, a page submission constraint rule, and a business generation constraint rule;
[0024] The correspondence between the constraint dimensions and the attribute constraint rules configured in advance for the controls required for the page includes:
[0025] Determine the acceptance life cycle corresponding to the controls required by the page;
[0026] According to the corresponding acceptance life cycle, configure the corresponding relationship between the constraint dimension and the corresponding attribute constraint sub-rule for the controls required by the page.
[0027] In some optional implementations, performing constraint verification processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint verification result includes:
[0028] According to the constraint dimension corresponding to the operation information, a corresponding constraint checker is loaded; the constraint checker is pre-configured for each constraint dimension, and the constraint checker supports dynamic plug-in and pull-out;
[0029] The loaded constraint checker is used to perform constraint checking processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint checking result.
[0030] In some optional embodiments, the method further comprises:
[0031] Preload the corresponding relationships configured for each control.
[0032] In a second aspect, the present invention provides a device for checking page constraints, which is applied to a backend device and includes:
[0033] A pre-configuration module, used to pre-configure the corresponding relationship between the constraint dimension and the attribute constraint rule for the controls required by the page; the constraint dimension includes the effective range of the business object identifier;
[0034] An information acquisition module, used to acquire operation information sent by the front-end device; the operation information is generated when operating a target control in a page of a target business object, and the operation information includes a business object identifier of the target business object, a control identifier of the target control, and related attribute information;
[0035] A matching module, used to determine the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control; the business object identifier of the target business object belongs to the effective range corresponding to the target attribute constraint rule;
[0036] A processing module, used to perform constraint verification processing on the attribute information according to the target attribute constraint rule, and generate a corresponding constraint verification result;
[0037] The sending module is used to send the constraint checking result to the front-end device, and instruct the front-end device to render the page according to the constraint checking result.
[0038] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the page constraint checking method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0039] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the page constraint checking method of the first aspect or any corresponding embodiment thereof.
[0040] In a fifth aspect, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the page constraint checking method of the first aspect or any corresponding embodiment thereof.
[0041] The present invention pre-configures attribute constraint rules for each control under a certain constraint dimension on the back-end device side. When receiving the operation information currently fed back by the front-end device, the back-end device can process it based on the hit attribute constraint rules, and return the processing result to the front-end device for the front-end device to render the page, thereby transferring the logic development of the front-end page to the back-end device. This not only improves the development efficiency of the front-end page, but also when the page logic needs to be changed, it can be achieved by updating the attribute constraint rules without changing the front-end code, thereby realizing dynamic configuration management of the page. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] Figure 1 is a flow chart of a method for checking page constraints according to an embodiment of the present invention;
[0044] Figure 2 is a simplified schematic diagram of a cloud computer ordering page according to an embodiment of the present invention;
[0045] Figure 3 is a flow chart of another method for checking page constraints according to an embodiment of the present invention;
[0046] Figure 4 is a schematic diagram of a configuration constraint checker according to an embodiment of the present invention;
[0047] Figure 5is a schematic diagram of a process for performing constraint checking on page interaction according to an embodiment of the present invention;
[0048] Figure 6 is a structural block diagram of a device for checking page constraints according to an embodiment of the present invention;
[0049] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0051] When developing pages related to cloud products, since cloud products include cloud hosts, cloud computers, cloud software, etc., and each cloud product can be further subdivided, for each cloud product, when users order or renew cloud products, it is necessary to use the cloud product page to provide relevant attribute information, such as the model and specifications of the cloud product ordered by the user. However, some users may have limited cloud products to order, or different cloud products have different specifications, so it is necessary to configure the corresponding logic in the cloud product page to support users to accurately order cloud products.
[0052] In order to develop pages with complex logic, one way to achieve this is to preset tracking points. However, after configuring the tracking point, the function of the tracking point is fixed. When the tracking point is triggered, it will respond to the fixed processing logic. If the control logic changes, for example, the size of the hard disk supported by multiple cloud computers changes, the tracking points in each cloud computer page need to be reconfigured, and the development efficiency is still low.
[0053] The page constraint verification method provided by the embodiment of the present invention transfers the logic development of the front-end page to the back-end device, and uses the back-end device to configure the attribute constraint rules of the corresponding page controls. The front-end page can be processed by configuring the attribute constraint rules, which has high development efficiency and is conducive to realizing dynamic configuration management.
[0054] According to an embodiment of the present invention, a method embodiment of page constraint checking is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0055] In this embodiment, a method for checking page constraints is provided, which can be applied to backend devices, such as backend servers. Figure 1 is a flow chart of a method for checking page constraints according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps.
[0056] Step S101, pre-configure the corresponding relationship between the constraint dimension and the attribute constraint rule for the control required by the page; the constraint dimension includes the effective range of the business object identifier.
[0057] In this embodiment, in a business scenario, multiple business objects are involved, and the business objects are objects for which related pages need to be developed, for example, the business objects are cloud products, etc. In addition, a unique identifier, namely, a business object identifier, is provided for each business object; for example, the business object identifier may be an ID of the business object, a product model, etc.
[0058] For each business object (such as a cloud product), a corresponding page needs to be developed to meet business needs such as ordering and unsubscribing, and corresponding controls need to be set in the page, such as a text box, a selection box, a button, etc.
[0059] In this embodiment, the pages of different business objects may have the same controls, or different pages of a business object may have different controls. For the controls required by the page of the business object, a corresponding constraint dimension is set for the control, and the constraint dimension can represent the page of at least one business object. The constraint rule includes a scope for indicating which business objects are effective, which is specifically the effective scope of the business object identifier; the effective scope can be a specific business object, multiple business scopes within a certain range, or all business objects, depending on the actual business needs.
[0060] In addition, the required attribute constraint rules are pre-configured for the corresponding constraint dimensions of the control, so as to construct the corresponding relationship between the constraint dimensions of the control and the attribute constraint rules. The attribute constraint rules are rules for constraining and verifying the corresponding controls, and the user's operation on the control, or the information returned to the user, needs to comply with the attribute constraint rules.
[0061] Among them, for a certain control, since it can be applied to multiple pages, you can configure multiple constraint dimensions with different values for the control, and set appropriate attribute constraint rules for each. That is, the constraint dimension or attribute constraint rule can have a one-to-many relationship with the page of the business object.
[0062] Figure 2 A simple schematic diagram of the cloud computer ordering page is shown. Figure 2As shown, the page includes multiple controls such as "resource pool", "product name", "specifications", and "operating system". Users can submit relevant information about the cloud computer they need by operating these controls. Among them, some controls are applicable to multiple pages. For example, the ordering page and renewal page of cloud products such as cloud computers and cloud hosts all include controls such as "specifications" and "operating system". For a certain control, attribute constraint rules can be configured in advance.
[0063] Each control is also provided with a unique identifier, namely, a control identifier, and corresponding property constraint rules can be configured based on the control identifier. The following table 1 exemplifies the property constraint rules of some controls.
[0064] Table 1
[0065]
[0066] As shown in Table 1, configure the corresponding constraint dimension for each control, and set the attribute constraint rules as needed; wherein, the constraint dimension is used to indicate the conditions for triggering the corresponding attribute constraint rules, which may include multiple dimensions. As shown in Table 1, in addition to the effective scope of the business object identifier, the constraint dimension may also include other dimensions such as acceptance actions. The acceptance actions may specifically include ordering, unsubscribing, renewing, upgrading, changing, downgrading, freezing, and destroying. If the attribute constraint rules corresponding to multiple acceptance actions are the same, you can configure the attribute constraint rules for each acceptance action separately, or you can regard these multiple acceptance actions as a whole and configure the attribute constraint rules for the whole.
[0067] Among them, if the business object is cloud computer a1, if its ordering page has a "resource pool" control, when the user operates the resource pool control in the ordering page of cloud computer a1, it is necessary to verify whether the information selected or entered by the user is complete, then the corresponding attribute constraint rule "verify whether the information is complete" can be configured on the back-end device side. The configuration process of the attribute constraint rule is similar to this, and will not be repeated here.
[0068] Since the controls in different pages (for example, pages of different business objects, etc.) can be configured with appropriate attribute constraint rules according to the constraint dimensions, there is no need to repeatedly configure the controls for each page, thereby improving the development efficiency of the front-end pages; and when the business rules change, it is sufficient to uniformly adjust the corresponding attribute constraint rules without changing the front-end code, and the efficiency of unified adjustment is also high, which is conducive to dynamic configuration management.
[0069] Step S102, obtaining operation information sent by the front-end device; the operation information is generated when operating a target control in a page of a target business object, and the operation information includes a business object identifier of the target business object, a control identifier of the target control, and related attribute information.
[0070] In this embodiment, when a user accesses a page of a business object based on a front-end device, the user can operate the controls therein. The front-end device is, for example, a front-end client, a browser, etc. For ease of description, the business object accessed by the user is referred to as a target business object, and the control operated is referred to as a target control. When the user operates the target control, corresponding attribute information can be generated. In this embodiment, the front-end device forms the attribute information and related identifiers into the operation information required by the back-end, and sends it to the back-end device.
[0071] As mentioned above, business objects and controls have unique identifiers. When a user operates a target control, the control identifier of the target control can be determined, and the business object identifier of the corresponding target business object can also be determined. The relevant business object identifier, control identifier and attribute information are combined to form the operation information provided to the back-end device.
[0072] For example, you can configure a corresponding tracking point in the target control. When the user operates the target control, the tracking point can be triggered and relevant information, that is, attribute information, can be collected. Figure 2 The "operating system" shown in the figure may specifically include the name of the operating system selected by the user; or, if the target control is Figure 2 "Submit Order" is shown, the attribute information may include all the information provided by the user in the ordering page.
[0073] Step S103, determining the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control; the business object identifier of the target business object belongs to the effective range corresponding to the target attribute constraint rule.
[0074] In this embodiment, after the back-end device receives the operation information sent by the front-end device, it can determine the corresponding relationship related to the target control based on the pre-configured corresponding relationship, and then determine the attribute constraint rule hit by the operation information based on the business object identifier and other content related to the constraint dimension in the operation information, that is, the target attribute constraint rule.
[0075] Specifically, based on the control identifier of the target control in the operation information, the pre-configured corresponding relationship for the target control can be determined, and then the business object identifier of the target business object is determined to be within the effective range of which corresponding relationship, so that the attribute constraint rule corresponding to the effective range can be used as the target attribute constraint rule. If the operation information does not match any constraint dimension, for example, the business object identifier of the target business object does not belong to any effective range, it can be determined that no relevant attribute constraint rules have been pre-configured, that is, no subsequent constraint verification processing is required.
[0076] It can be understood that when determining the target attribute constraint rules hit by the operation information, the control identifier can be matched first, and then the constraint dimensions such as the business object identifier can be matched, or the business object identifier can be matched first, and then the control identifier can be matched. This embodiment does not limit this order.
[0077] Step S104: performing constraint verification processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint verification result.
[0078] In this embodiment, if the current operation information hits the pre-configured target attribute constraint rule, it is necessary to perform constraint verification processing on the attribute information therein according to the target attribute constraint rule. Among them, constraint verification processing can be specifically divided into constraint processing and verification processing. The constraint processing is used to process based on the specifications specified in the attribute constraint rules to generate corresponding processing results; for example, the constraint processing can indicate which fields need to generate data, or which other controls and pages need to be linked, etc. The verification processing is used to verify the attribute information provided by the front end or the generated processing results to determine whether these data meet the preset rules, and finally generate constraint verification results that comply with the attribute constraint rules; for example, it can verify whether the format of these data meets the requirements and whether it meets the business requirements.
[0079] Step S105, sending the constraint check result to the front-end device, instructing the front-end device to render the page according to the constraint check result.
[0080] In this embodiment, after the back-end device generates the corresponding constraint verification result, it can return the constraint verification result to the front-end device. The constraint verification result can indicate which operations the front-end device needs to trigger and which responses to execute. The front-end device can render the page according to the constraint verification result, and finally realize the constraint configuration of the target control on the back-end.
[0081] For example, when a user orders a cloud product, if the user selects a cloud product of a certain specification, the backend device can constrain the operating systems supported by the cloud product of that specification based on the relevant attribute constraint rules, and verify whether the user has the authority to order the cloud product of that specification, or whether the resources of a cloud product of a certain specification are sufficient, etc. If the verification is successful, the relevant constraint verification results can be fed back to the frontend for the user to continue to select the required operating system; if the verification fails, for example, if the user does not have the authority to order, the frontend device can be instructed to pop up a message indicating that there is no authority to order, to remind the user to change to other specifications.
[0082] The page constraint verification method provided in this embodiment pre-configures the attribute constraint rules of each control under a certain constraint dimension on the back-end device side. When receiving the operation information currently fed back by the front-end device, the back-end device can process it based on the hit attribute constraint rules, and return the processing result to the front-end device for the front-end device to render the page, thereby transferring the logic development of the front-end page to the back-end device. This not only improves the development efficiency of the front-end page, but also when the page logic needs to be changed, it can be achieved by updating the attribute constraint rules without changing the front-end code, thereby realizing dynamic configuration management of the page.
[0083] In this embodiment, a method for checking page constraints is provided, which can be applied to backend devices, such as backend servers. Figure 3 is a flow chart of a method for checking page constraints according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps.
[0084] Step S301, pre-configure the corresponding relationship between the constraint dimension and the attribute constraint rule for the control required by the page; the constraint dimension includes the effective range of the business object identifier.
[0085] In this embodiment, as shown in Table 1 above, the constraint dimension may include, in addition to the effective scope, an acceptance action; the acceptance action is an action included in the acceptance business object. For example, the acceptance action may include: ordering, unsubscribing, renewing, upgrading, changing, downgrading, freezing, destroying, etc.
[0086] Optionally, the backend device supports the extension of constraint dimensions, that is, the triggering conditions of the attribute constraint rules can be extended. Specifically, the method may further include steps A1 to A2.
[0087] Step A1, obtaining an extension instruction; the extension instruction includes a new constraint dimension and / or a new enumeration value under an existing constraint dimension.
[0088] Step A2: combining the new constraint dimension and / or the new enumeration value, configuring a new correspondence between the attribute constraint rule and the attribute constraint rule.
[0089] In this embodiment, developers can freely expand the required constraint dimensions or enumeration values under a constraint dimension based on actual business needs. For example, if the current business requires two constraint dimensions, namely, effective scope and acceptance action, a third constraint dimension can be added; or, if a new acceptance action is required, an enumeration value representing the new action can be added to the constraint dimension of acceptance action.
[0090] When configuring the correspondence between constraint dimensions and attribute constraint rules later, these new constraint dimensions or enumeration values can be combined for configuration. It is understandable that the configured correspondence can also be updated in combination with new constraint dimensions or enumeration values, which is not limited in this embodiment.
[0091] Optionally, the attribute constraint rule includes a plurality of attribute constraint sub-rules divided according to the acceptance life cycle of the business object; the attribute constraint sub-rule includes: at least one of a page verification constraint rule, a page submission constraint rule, and a business generation constraint rule.
[0092] Furthermore, the above step S301 of "pre-configuring the correspondence between constraint dimensions and attribute constraint rules for controls required by the page" includes steps B1 to B2.
[0093] Step B1, determine the acceptance life cycle corresponding to the controls required by the page.
[0094] Step B2: According to the corresponding acceptance life cycle, the corresponding relationship between the constraint dimension and the corresponding attribute constraint sub-rule is configured for the control required by the page.
[0095] Business objects can generally correspond to multiple acceptance life cycles. This embodiment subdivides the attribute constraint rules from the life cycle dimension. Specifically, the acceptance life cycle of a business object can at least include a page interaction verification cycle, a page submission cycle, and a business generation cycle; for example, for a certain cloud product, it is necessary to first go through a page verification to determine whether the information submitted by the user is appropriate, and then go through a page submission to trigger acceptance actions such as ordering and unsubscribing, and finally generate a corresponding business order.
[0096] Accordingly, corresponding attribute constraint rules, namely attribute constraint sub-rules, may be set. The attribute constraint sub-rules may specifically include: page verification constraint rules, page submission constraint rules, business generation constraint rules, and the like.
[0097] Among them, the page verification constraint rule is used to identify the action of each interaction accepted by the page and verify whether these interactions meet the expected business rules or format requirements. The page submission constraint rule is used to identify that the collection of acceptance page information is completed, and the page acceptance information containing information such as acceptance actions can be submitted and the page acceptance information can be verified. The business generation constraint rule is used to identify that the decomposition of page acceptance information is completed and the system generates the action of a formal order, which can specifically include rules such as status change and exception handling.
[0098] When pre-configuring the corresponding relationship of controls, you can set corresponding attribute constraint sub-rules for them based on the business life cycle corresponding to the constraint dimension of the control. For example, if the constraint dimension of a control corresponds to page validation, you can configure a certain page validation constraint rule for it, and the specific content of the page validation constraint rule can be determined based on actual needs.
[0099] In this embodiment, the constraint dimension can be expanded to configure the triggering conditions of each attribute constraint rule more flexibly. In addition, the attribute constraint rules are formulated according to the acceptance life cycle of the business object, which facilitates the definition of common attribute constraint rules for each life cycle and simplifies the configuration process.
[0100] Step S302, obtaining operation information sent by the front-end device; the operation information is generated when operating a target control in a page of a target business object, and the operation information includes a business object identifier of the target business object, a control identifier of the target control, and related attribute information.
[0101] For details, please see Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0102] Optionally, before the above step S302, the method may further include: preloading the corresponding relationship configured for each control.
[0103] In this embodiment, for the pre-configured correspondences, when it is necessary to implement page logic control based on these correspondences, these correspondences can be preloaded to increase the speed of subsequent matching of the correspondences, maximize the system response speed, and optimize user perception.
[0104] For example, these corresponding relationships can be preconfigured into a relational database. When the program is initialized, the corresponding database can be preloaded through the distributed cache to achieve preloading of attribute constraint rules.
[0105] Step S303, determining the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control; the business object identifier of the target business object belongs to the effective range corresponding to the target attribute constraint rule.
[0106] Specifically, the above step S303 "determining the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control" may include steps S3031 to S3033.
[0107] Step S3031, determining the acceptance action of the operation information according to the attribute information.
[0108] In this embodiment, the attribute information of the operation information may include fields related to the acceptance action. For example, the attribute information may include a page identifier or information related to the function of a control, based on which the acceptance action corresponding to the page can be determined. For example, if the page currently operated by the user is an ordering page, the corresponding acceptance action can be determined to be ordering.
[0109] Step S3032: determine whether the acceptance action of the operation information matches the acceptance action corresponding to the attribute constraint rule, and whether the business object identifier of the target business object belongs to the effective range corresponding to the attribute constraint rule.
[0110] Step S3033, when the acceptance action matches and the business object identifier belongs to the corresponding effective range, the attribute constraint rule corresponding to the business object identifier that matches the acceptance action of the operation information and whose effective range includes the target business object is used as the target attribute constraint rule.
[0111] In this embodiment, when the constraint dimension of acceptance action is configured, in addition to determining whether the business object identifier of the target business object belongs to the effective range corresponding to the attribute constraint rule, it is also necessary to determine whether the acceptance action of the operation information matches the acceptance action corresponding to the attribute constraint rule. If the acceptance action matches and falls within the corresponding effective range, the target attribute constraint rule corresponding to the operation information can be determined.
[0112] For example, taking Table 1 above as an example, if the attribute constraint rule for configuring the operating system control for all cloud computers is "prohibit downgrade", the corresponding acceptance action is "downgrade"; if the user downgrades the cloud computer again, if the operating system is downgraded, the attribute constraint rule "prohibit downgrade" will be triggered, thereby prohibiting the user from downgrading. For example, a prompt message such as downgrade failure or downgrade prohibition can be returned.
[0113] In some optional implementations, the above step 301 "pre-configure the correspondence between constraint dimensions and attribute constraint rules for controls required for the page" may include: pre-building multiple attribute constraint rules and assigning unique rule identifiers; binding the control identifier, the identifier and / or range corresponding to the constraint dimension, and the rule identifier of the attribute constraint rule to generate a corresponding correspondence.
[0114] In addition, the above-mentioned step S303 "determine the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control" specifically includes: determining the target rule identifier bound to the control identifier of the target control and the business object identifier of the target business object according to the corresponding relationship configured for the target control, and using the target attribute constraint rule corresponding to the target rule identifier as the target attribute constraint rule.
[0115] In this embodiment, a corresponding rule identifier can be set for the attribute constraint rule. When establishing a corresponding relationship, based on the binding of the constraint dimension and the attribute constraint rule, the control identifier, the identifier and / or range corresponding to the constraint dimension, and the rule identifier of the attribute constraint rule are bound, so that a corresponding corresponding relationship can be generated. Among them, the identifier and / or range corresponding to the constraint dimension can specifically be the identifier of the accepted action and / or the effective range of the business object identifier.
[0116] When subsequently matching the attribute constraint rules, the required target attribute constraint rules can be located based on the matched target rule identifier.
[0117] In this embodiment, the binding of attribute constraint rules is realized by using various identifiers, which is simple to realize, and the rule identifier of the same attribute constraint rule can also be bound to different controls or different constraint dimensions, which can conveniently realize the reuse of attribute constraint rules. In addition, this binding method is simple and is also conducive to realizing preloading.
[0118] In scenarios such as acceptance and activation of cloud products, due to various factors (such as insufficient resources, mismatch of attribute specifications, etc.), resource attributes need to be verified during activation. If they are not verified in advance, it may lead to problems such as the inability to accept and activate resources. In this embodiment, different cloud product attribute constraints and business acceptance tracking points are uniformly configured and managed, and the constraint configuration and tracking point configuration are pre-loaded through the distributed cache. Through the product dimension and the acceptance action dimension, unified pre-verification is performed during acceptance, which can realize fast and convenient configuration of attribute constraints, enable fast response, maximize reuse capabilities, and flexibly and efficiently realize unified verification of cloud products during acceptance, thereby improving cloud product acceptance efficiency and user experience.
[0119] Step S304: perform constraint verification processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint verification result.
[0120] For details, please see Figure 1 Step S104 of the illustrated embodiment will not be described in detail here.
[0121] Optionally, the above step S304 "perform constraint verification processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint verification result" may include steps C1 to C2.
[0122] Step C1, loading the corresponding constraint checker according to the constraint dimension corresponding to the operation information; the constraint checker is pre-configured for each constraint dimension, and the constraint checker supports dynamic plug-in and pull-out.
[0123] Step C2, using the loaded constraint checker, performs constraint check processing on the attribute information according to the target attribute constraint rule, and generates a corresponding constraint check result.
[0124] In this embodiment, a unified pre-verification interceptor can be set to intercept the constraint request of the front end, thereby extracting the operation information in the constraint request. In addition, a corresponding constraint checker is configured for each constraint dimension, and the constraint checker can be, for example, a controller class responsible for constraint verification logic. Figure 4 A schematic diagram of configuring a constraint checker is shown, and the number of the constraint checkers is multiple. For example, corresponding constraint checkers can be set for different enumeration values of constraint dimensions; for example, constraint checkers can be set for ordering, renewal, etc. under acceptance actions.
[0125] For the constraint dimension corresponding to the operation information, the constraint verifier applicable to the constraint dimension can be determined and loaded, and then the loaded constraint verifier can be used to perform constraint verification processing, that is, constraint verification processing is performed on the attribute information according to the target attribute constraint rules, and finally the corresponding constraint verification result is generated.
[0126] The constraint checker supports dynamic plug-in and pull-out, for example, dynamic plug-in and pull-out of the constraint checker can be achieved through configuration or annotation. When the attribute constraint rules in the database change, for example, when the attribute constraint rules under a certain constraint dimension no longer need to be configured, the constraint checker can be directly configured to be invalid, which can achieve fast dynamic control without restarting.
[0127] Step S305, sending the constraint check result to the front-end device, instructing the front-end device to render the page according to the constraint check result.
[0128] For details, please see Figure 1 Step S105 of the illustrated embodiment will not be described in detail here.
[0129] Figure 5 A schematic diagram of a process for checking constraints on page interactions is shown. Figure 5 As shown, the attribute constraint rules are predefined; since the front-end page control is provided with a tracking point, the binding relationship between the attribute constraint rules, tracking points, pages, etc. can be preconfigured. After the configuration is completed, the cache and controller are initialized, that is, the binding relationship is preloaded, and the pre-verification interceptor and each constraint verifier are initialized.
[0130] When a page request is initiated by the front end, it can be intercepted by the pre-verification interceptor to obtain the operation information and determine whether constraint verification is required, that is, whether a certain attribute constraint rule is hit; if constraint verification is required, constraint verification processing can be performed based on the corresponding constraint verifier. If constraint verification is not required, this round of process ends, and then the new page request initiated by the front end is received, and this is repeated.
[0131] The page constraint verification method provided in this embodiment transfers the logic development of the front-end page to the back-end device, and the processing of the front-end page can be realized by configuring the attribute constraint rules. The development efficiency is high and it is conducive to the realization of dynamic configuration management. Through batch configuration of different dimensions of business objects, the scope can also be adjusted quickly and dynamically, which reduces the skill requirements of personnel, greatly improves the efficiency of development work, and brings lower labor costs to the enterprise. The front-end page can set a general embedding point without repeatedly defining the configuration; preloading the correspondence between the constraint dimension and the attribute constraint rule in advance can improve the system response speed and optimize user perception.
[0132] In this embodiment, a device for page constraint checking is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" may be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation in hardware, or a combination of software and hardware, is also possible and conceivable.
[0133] This embodiment provides a device for checking page constraints, which is applied to a backend device, such as Figure 6 As shown, including:
[0134] Pre-configuration module 601, used to pre-configure the corresponding relationship between constraint dimensions and attribute constraint rules for the controls required by the page; the constraint dimensions include the effective range of the business object identifier;
[0135] The information acquisition module 602 is used to acquire the operation information sent by the front-end device; the operation information is generated when operating the target control in the page of the target business object, and the operation information includes the business object identifier of the target business object, the control identifier of the target control and related attribute information;
[0136] A matching module 603 is used to determine the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control; the business object identifier of the target business object belongs to the effective range corresponding to the target attribute constraint rule;
[0137] The processing module 604 is used to perform constraint verification processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint verification result;
[0138] The sending module 605 is used to send the constraint checking result to the front-end device, and instruct the front-end device to render the page according to the constraint checking result.
[0139] In some optional implementations, the constraint dimension further includes: acceptance action;
[0140] The matching module 603 determines the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control, including:
[0141] Determining an acceptance action for the operation information according to the attribute information;
[0142] Determine whether the acceptance action of the operation information matches the acceptance action corresponding to the attribute constraint rule, and whether the business object identifier of the target business object belongs to the effective range corresponding to the attribute constraint rule;
[0143] When the acceptance action matches and the business object identifier belongs to the corresponding effective range, the attribute constraint rule corresponding to the business object identifier that matches the acceptance action of the operation information and whose effective range includes the target business object is used as the target attribute constraint rule.
[0144] In some optional implementations, the preconfiguration module 601 is further used to:
[0145] Obtaining an extension instruction; the extension instruction includes a new constraint dimension and / or a new enumeration value under an existing constraint dimension;
[0146] In combination with the new constraint dimension and / or the new enumeration value, a new corresponding relationship between the configuration and the attribute constraint rule is configured.
[0147] In some optional implementations, the pre-configuration module 601 pre-configures the corresponding relationship between the constraint dimension and the attribute constraint rule for the control required by the page, including:
[0148] Pre-build multiple attribute constraint rules and assign unique rule identifiers;
[0149] Bind the control identifier, the identifier and / or range corresponding to the constraint dimension, and the rule identifier of the attribute constraint rule to generate a corresponding correspondence relationship;
[0150] The matching module 603 determines the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control, including:
[0151] According to the corresponding relationship configured for the target control, a target rule identifier bound to the control identifier of the target control and the business object identifier of the target business object is determined, and a target attribute constraint rule corresponding to the target rule identifier is used as a target attribute constraint rule.
[0152] In some optional implementations, the attribute constraint rule includes a plurality of attribute constraint sub-rules divided according to the acceptance life cycle of the business object; the attribute constraint sub-rule includes: at least one of a page verification constraint rule, a page submission constraint rule, and a business generation constraint rule;
[0153] The pre-configuration module 601 pre-configures the corresponding relationship between the constraint dimension and the attribute constraint rule for the control required by the page, including:
[0154] Determine the acceptance life cycle corresponding to the controls required by the page;
[0155] According to the corresponding acceptance life cycle, configure the corresponding relationship between the constraint dimension and the corresponding attribute constraint sub-rule for the controls required by the page.
[0156] In some optional implementations, the processing module 604 performs constraint verification processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint verification result, including:
[0157] According to the constraint dimension corresponding to the operation information, a corresponding constraint checker is loaded; the constraint checker is pre-configured for each constraint dimension, and the constraint checker supports dynamic plug-in and pull-out;
[0158] The loaded constraint checker is used to perform constraint checking processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint checking result.
[0159] In some optional implementations, the preconfiguration module 601 is further used to:
[0160] Preload the corresponding relationships configured for each control.
[0161] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0162] The page constraint checking device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, including a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0163] The embodiment of the present invention also provides a computer device having the above Figure 6 The page shown is a means of constraint checking.
[0164] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0165] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0166] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0167] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0168] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0169] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0170] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0171] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0172] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations should all be included in the protection scope of the present invention.
Claims
1. A method for checking page constraints, characterized in that: Applied to a backend device, the method includes: Pre-configure the corresponding relationship between the constraint dimension and the attribute constraint rule for the controls required by the page; the constraint dimension includes the effective range of the business object identifier; Acquire operation information sent by the front-end device; the operation information is generated when operating a target control in a page of a target business object, and the operation information includes a business object identifier of the target business object, a control identifier of the target control, and related attribute information; According to the corresponding relationship configured for the target control, the target attribute constraint rule hit by the operation information is determined; the business object identifier of the target business object belongs to the effective range corresponding to the target attribute constraint rule; Perform constraint verification processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint verification result; The constraint checking result is sent to the front-end device, instructing the front-end device to render the page according to the constraint checking result.
2. The method according to claim 1, characterized in that: The constraint dimension also includes: acceptance action; The determining, according to the corresponding relationship configured for the target control, the target attribute constraint rule hit by the operation information includes: Determining an acceptance action for the operation information according to the attribute information; Determine whether the acceptance action of the operation information matches the acceptance action corresponding to the attribute constraint rule, and whether the business object identifier of the target business object belongs to the effective range corresponding to the attribute constraint rule; When the acceptance action matches and the business object identifier belongs to the corresponding effective range, the attribute constraint rule corresponding to the business object identifier that matches the acceptance action of the operation information and whose effective range includes the target business object is used as the target attribute constraint rule.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Obtaining an extension instruction; the extension instruction includes a new constraint dimension and / or a new enumeration value under an existing constraint dimension; In combination with the new constraint dimension and / or the new enumeration value, a new corresponding relationship between the configuration and the attribute constraint rule is configured.
4. The method according to claim 1, characterized in that: The correspondence between the constraint dimensions and the attribute constraint rules configured in advance for the controls required for the page includes: Pre-build multiple attribute constraint rules and assign unique rule identifiers; Bind the control identifier, the identifier and / or range corresponding to the constraint dimension, and the rule identifier of the attribute constraint rule to generate a corresponding correspondence relationship; The determining, according to the corresponding relationship configured for the target control, the target attribute constraint rule hit by the operation information includes: According to the corresponding relationship configured for the target control, a target rule identifier bound to the control identifier of the target control and the business object identifier of the target business object is determined, and a target attribute constraint rule corresponding to the target rule identifier is used as a target attribute constraint rule.
5. The method according to claim 1, characterized in that The attribute constraint rules include multiple attribute constraint sub-rules divided according to the acceptance life cycle of the business object; the attribute constraint sub-rules include: at least one of page verification constraint rules, page submission constraint rules, and business generation constraint rules; The correspondence between the constraint dimensions and the attribute constraint rules configured in advance for the controls required for the page includes: Determine the acceptance life cycle corresponding to the controls required by the page; According to the corresponding acceptance life cycle, configure the corresponding relationship between the constraint dimension and the corresponding attribute constraint sub-rule for the control required by the page.
6. The method according to claim 1, characterized in that The performing constraint checking processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint checking result includes: According to the constraint dimension corresponding to the operation information, a corresponding constraint checker is loaded; the constraint checker is pre-configured for each constraint dimension, and the constraint checker supports dynamic plug-in and pull-out; The loaded constraint checker is used to perform constraint checking processing on the attribute information according to the target attribute constraint rule to generate a corresponding constraint checking result.
7. The method according to claim 1, characterized in that The method further comprises: Preload the corresponding relationships configured for each control.
8. A device for checking page constraints, characterized in that: Applied to back-end equipment, the device comprises: A pre-configuration module, used to pre-configure the corresponding relationship between the constraint dimension and the attribute constraint rule for the controls required by the page; the constraint dimension includes the effective range of the business object identifier; An information acquisition module, used to acquire operation information sent by the front-end device; the operation information is generated when operating a target control in a page of a target business object, and the operation information includes a business object identifier of the target business object, a control identifier of the target control, and related attribute information; A matching module, used to determine the target attribute constraint rule hit by the operation information according to the corresponding relationship configured for the target control; the business object identifier of the target business object belongs to the effective range corresponding to the target attribute constraint rule; A processing module, used to perform constraint verification processing on the attribute information according to the target attribute constraint rule, and generate a corresponding constraint verification result; The sending module is used to send the constraint checking result to the front-end device, and instruct the front-end device to render the page according to the constraint checking result.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for checking page constraints as described in any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the page constraint checking method according to any one of claims 1 to 7.