Form page port adding method and device, equipment, medium and product

By automatically querying and verifying the service port range on the form page, the problem of low port configuration efficiency is solved, efficient and timely verification of port configuration is achieved, and business development efficiency is improved.

CN120469679AActive Publication Date: 2025-08-12INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510955724.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-11
Publication Date
2025-08-12
Estimated Expiration
2045-07-11

AI Technical Summary

Technical Problem

In business system development, port configuration efficiency is low. The existing technology requires developers to enter the port number multiple times and verify it only when the form is submitted, resulting in low development efficiency.

Method used

When the form page opens, the available service port range is automatically queried and displayed on the page. In response to the input operation, the port verification is performed, the availability query interface is called to check port availability, and a prompt message is displayed when it is not available.

Benefits of technology

Improve port verification efficiency, reduce duplicate operations of port configuration, improve business development efficiency, and ensure that developers promptly understand the verification results and availability status of port data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120469679A_ABST
    Figure CN120469679A_ABST
Patent Text Reader

Abstract

The invention discloses a port adding method and device for a form page, electronic equipment, a storage medium and a computer program product, and relates to the technical field of business development, and the method comprises the steps: when the form page for business development is opened, automatically querying an available service port range, and displaying the available service port range on the form page. And providing a port number filling reference for a developer, in a port form item filling process, in response to a first input operation of the port form item, checking the newly-added port data according to the extracted port checking rule, and when port addition is completed, calling a preset availability query interface to query the availability state of the newly-added port data, and when the verification result is not passed or the availability state shows that the port is unavailable, the corresponding prompt information is displayed on the form page, so that a developer can timely know the verification result and the availability state of the newly added port data, the technical problem of low port adding efficiency is solved, and the service development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of business development technology, and in particular to a method, device, electronic device, storage medium, and computer program product for adding a port to a form page. Background Art

[0002] Service port configuration is a common requirement during business system development, especially in microservice architectures or distributed systems. Developers need to assign unique port numbers to different services to ensure proper communication between them. However, traditional port configuration methods often require developers to repeatedly enter the port number, and existing form systems only verify the port number when the form is submitted. If the verification fails, developers must modify and submit the form again, resulting in repeated operations and low development efficiency. Summary of the Invention

[0003] The present application provides a method, device, electronic device, storage medium and computer program product for adding a port to a form page, so as to at least solve the problem of low development efficiency in related technologies.

[0004] This application provides a method for adding a port to a form page. The form page is a business development interface. The method includes: In response to an opening instruction for a form page of the first service, querying available service port range information, and displaying the service port range information on the form page; Extracting the port verification rule corresponding to the port form item from the plurality of verification rules pre-set on the form page; In response to a first input operation of a port form item from the form page, verifying the newly added port data corresponding to the first input operation according to the port verification rule to obtain a verification result; In response to a port addition completion instruction from the form page, calling a preset availability query interface to query the availability status of the newly added port data; When the verification result indicates that the verification fails, or the availability status indicates that the port is unavailable, corresponding prompt information is displayed on the form page to prompt the user to make a modification.

[0005] The present application also provides a port adding device, which includes: an available range query module, a rule acquisition module, a local verification module, a dynamic verification module and a result prompt module.

[0006] The available range query module is configured to query available service port range information in response to an opening instruction of a form page for the first service, and display the service port range information on the form page.

[0007] The rule acquisition module is used to extract the port verification rule corresponding to the port form item from the multiple verification rules pre-set on the form page.

[0008] The local verification module responds to a first input operation of the port form item from the form page, and is configured to verify the newly added port data corresponding to the first input operation according to the port verification rule to obtain a verification result.

[0009] The dynamic verification module is used to call a preset availability query interface in response to a port addition completion instruction from the form page to query the availability status of the newly added port data.

[0010] The result prompt module is used to display corresponding prompt information on the form page to prompt modification when the verification result indicates that the verification fails or the availability status indicates that the port is unavailable.

[0011] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned port adding methods when executing the computer program.

[0012] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned port adding methods are implemented.

[0013] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above-mentioned port adding methods when executed by a processor.

[0014] Through this application, when the form page for business development is opened, the available service port range is automatically queried and displayed on the form page, providing developers with a reference for filling in the port number. During the process of filling in the port form item, in response to the first input operation of the port form item, the newly added port data is verified according to the extracted port verification rules, thereby improving the port verification efficiency. In addition, when the port is added, the preset availability query interface is called to query the availability status of the newly added port data, and when the verification result fails or the availability status indicates that the port is unavailable, the corresponding prompt information is displayed on the form page, which enables developers to promptly know the verification result and availability status of the newly added port data, avoiding the situation of repeatedly manually modifying and adjusting the port number after the entire form is submitted, thereby improving business development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0016] Figure 1 A schematic diagram of a form system involved in an embodiment of the present application; Figure 2 A schematic diagram of a form page involved in an embodiment of the present application; Figure 3 This is a flow chart of a port adding method involved in an embodiment of the present application; Figure 4 This is a schematic diagram of a form item for displaying prompt information involved in an embodiment of the present application; Figure 5 This is a schematic diagram of a form item showing repeated container ports according to an embodiment of the present application; Figure 6 This is a schematic diagram of a form item showing duplicate service ports involved in an embodiment of the present application; Figure 7 This is a flow chart of a method for adding ports in batches according to an embodiment of the present application; Figure 8 This is a schematic diagram of adding pop-up boxes in batches according to an embodiment of the present application; Figure 9 A schematic diagram of the interaction logic of various modules of a form system involved in an embodiment of the present application; Figure 10 This is a structural diagram of a port adding device involved in an embodiment of the present application; Figure 11 This is a structural diagram of an electronic device involved in an embodiment of the present application. DETAILED DESCRIPTION

[0017] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0018] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0019] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0020] During the business system development process, external access is achieved by mapping the service port in the container to the service port of the server cluster. In related technologies, service port access is provided in the form of "container port: service port", and the valid port range is limited to 1 to 65535. Usually, in order to improve security and optimize resource management, the open port range is restricted for specific development tasks. When filling in the port, developers can manually query the available port range in the current system or cluster, such as through command line tools or by consulting documentation. Or they can try multiple random inputs. Either method is time-consuming and inefficient.

[0021] Furthermore, existing form systems typically only validate port values when a form is submitted. If a form entry fails validation, it must be re-entered, increasing validation time and reducing development efficiency. Even if the port format validation passes, it may still be unavailable during actual use due to port usage or firewall restrictions.

[0022] In response to the above problems, an embodiment of the present application provides a port adding method. When a form page for business development is opened, the available service port range is automatically queried and displayed on the form page to provide developers with a reference for filling in the port number. During the process of filling in the port form item, in response to the first input operation of the port form item, the newly added port data is verified according to the extracted port verification rules, thereby improving the port verification efficiency. In addition, when the port is added, the preset availability query interface is called to query the availability status of the newly added port data, and when the verification result fails or the availability status indicates that the port is unavailable, the corresponding prompt information is displayed on the form page, which enables developers to promptly know the verification result and availability status of the newly added port data, avoiding the situation of repeatedly manually modifying and adjusting the port number after the entire form is submitted, thereby improving business development efficiency.

[0023] The embodiment of the present application provides a method for adding a port to a form page. For example, Figure 1 The form system 100 used in the embodiment of the present application includes a form page 101, a form configuration component 102, and a service module 103. The form page 101 is a business development interface for developers to develop business. In some examples, the form page 101 can be as follows: Figure 2 As shown, the form page 101 may include a name form item 201, a type form item 202, a port form item 203, and an operation control 204. The port form item 203 includes a container port item and a service port item, and the operation control 204 may include an add control, a delete control, a recommendation control, and the like. By entering data into each form item, relevant parameters for business development can be set. The form configuration component 102 may be a common component of the front-end, used to display corresponding controls or prompt information on the form page 101 based on predefined configuration information and port interaction logic, thereby implementing port addition operations based on the form page 101. The service module 103 is used to provide an application programming interface (API) for querying the available range of service ports in the server cluster, the availability status of service ports, and recommended service ports. This may include an available range query interface, an availability query interface, and a recommended port query interface.

[0024] Use the port addition method on the form page to apply Figure 1 In some embodiments, the form system 100 is described. Figure 3 As shown, the port adding method of the form page may include steps S301 to S305, and each step is described below.

[0025] Step S301: In response to an opening instruction for a form page of a first service, query available service port range information, and display the service port range information on the form page.

[0026] Different business developments correspond to different form pages. The response to the opening instruction for the form page of the first business can be automatically issued based on the opening operation of the form page of the first business. All ports in the server cluster can be divided into open ports and disabled ports according to their open status. Among them, open ports refer to ports that explicitly allow external or internal access, and disabled ports refer to ports that are actively denied access through the firewall. In some cases, from the perspective of business security, different permission levels can be set for different businesses, and different port ranges can be opened for businesses with different permission levels.

[0027] Specifically, in response to the opening instruction of the form page of the first business, the service port range information corresponding to the first business is queried according to the preset query interface, and the service port range information is displayed on the form page. Among them, the available service port range information can be the port range value opened corresponding to the permission level of the first business, and can also be the open port range value that is not disabled in the server cluster. In some examples, the service port range information is displayed on the form page, and can be displayed as: "The service port range is 30000-31000", and the display position can be in the area above the port form item or other areas. The display method can be presented in the form of static prompt content or in the form of a pop-up window. There is no special restriction on the display method and display position of the available service port range information, and those skilled in the art can set it according to actual needs.

[0028] In some specific implementations, the form configuration component predefines a prompt variable for storing port range prompt information. After calling the query interface to query the available service port range information, the service port range information returned by the query interface is saved in the prompt variable, and then the port range prompt information is bound to the Dom (Document Object Model) and displayed on the form page.

[0029] By calling the query interface to query the available service port range and displaying it on the form page, developers can be provided with clear information about the available service port range, avoiding multiple attempts to enter the port number, saving time in entering port form items, and improving port adding efficiency.

[0030] Step S302: extracting the port verification rule corresponding to the port form item from the multiple verification rules pre-set on the form page.

[0031] The form page includes multiple fields to be filled out, such as a name field for the business function being developed, an explanation field, related parameter settings, and a port field for configuring and adding ports. Port fields require more extensive validation than other fields on the form page. In addition to the standard mandatory field and format validation, they also require verification of whether the entered port number exceeds the upper and lower limits of the valid range and whether there are duplicate port numbers.

[0032] Specifically, the port verification rule corresponding to the port form item is extracted from the pre-set multiple verification rules. In some specific examples, the multiple verification rules pre-set on the form page are presented in code form. The port verification rule corresponding to the port form item can be extracted from the pre-set multiple verification rules by identifying key fields in the code. The identification information corresponding to the port form item can also be identified for extraction.

[0033] Step S303: In response to the first input operation of the port form item on the form page, the newly added port data corresponding to the first input operation is verified according to the port verification rule to obtain a verification result.

[0034] In some examples, the first input operation can be any input operation that occurs in the input box of the port form item after the page in the form is opened. The form configuration component can monitor the input operation of the port form item through the input event.

[0035] In some embodiments, the port verification rule is used to verify whether the newly added port data meets the filling requirements of the port form item. The filling requirements may include a first requirement indicating that it is required, a second requirement indicating the character format and / or a third requirement indicating that it is non-repeatable. Specifically, the first requirement is used to verify whether the port form item with the required requirements is empty. When the port form item is empty, the requirement is not met and the verification fails. The second requirement is used to verify whether the input content of the port form item is a number. If it is non-numeric format content, the verification fails. The third requirement is used to verify whether there are duplicate values between multiple port numbers in the newly added port data. If there are duplicates, the verification fails.

[0036] In some embodiments, the port form item includes a container port item and a service port item, the port verification rule includes a first verification rule for verifying the container port item and a second verification rule for verifying the service port item, and the newly added port data includes a container port number and a service port number with a mapping relationship.

[0037] Step S302 may include the following steps: verifying the container port number according to a first verification rule and verifying the service port number according to a second verification rule. That is, verifying the container port number and the service port number using the first verification rule and the second verification rule respectively.

[0038] In some examples, the first verification rule and the second verification rule may include the first requirement, the second requirement, and / or the third requirement, and the first verification rule and the second verification rule may be the same or different.

[0039] Step S304: In response to the port adding completion instruction from the form page, a preset availability query interface is called to query the availability status of the newly added port data.

[0040] Among them, the port addition completion instruction can be an instruction triggered by a blur event (an interactive mechanism used to monitor the situation where the input box loses focus. This event is triggered when the user clicks an area outside the input box), or an instruction triggered by a click operation of a port confirmation addition control in a form page.

[0041] Specifically, in response to the port adding completion instruction from the form page, a preset availability query interface is called to query the availability status of the service port number in the newly added port data.

[0042] In some examples, before querying the availability status of the newly added port data, the port adding method may also include the following steps: verifying whether the service port number in the newly added port data meets the port specifications; if the port specifications are met, calling a preset availability query interface to query the availability status of the newly added port data.

[0043] In some examples, when the availability status of a newly added service port number is queried and the port is available, the availability query interface returns an empty string.

[0044] Step S305: When the verification result indicates that the verification fails, or the availability status indicates that the port is unavailable, a corresponding prompt message is displayed on the form page to prompt modification.

[0045] Specifically, when the verification result indicates that the verification fails, a failure prompt message is displayed on the form page; when the availability status indicates that the port is unavailable, the unavailable port number and the reason for unavailability are displayed on the form page to prompt modification.

[0046] In some specific implementations, a custom rule can be added to the service port validation rule list in the form configuration component. This custom rule provides a callback function for notifying the user of the validation result. If the queried availability status indicates that the port is unavailable, the callback function is invoked and passed an Error object (new Error ("error message")) containing the current service port number and the reason for the unavailability. If the queried availability status indicates that the port is available, the callback function is invoked without parameters, indicating that validation has passed.

[0047] In some specific examples, when the availability status indicates that the port is unavailable, the port form item on the form page can be as follows: Figure 4 The port form item 203 includes a container port item 401 and a service port item 402, and a prompt information area 403. When the service port item 402 includes an unavailable port number, the unavailable port number and the reason for unavailability will be displayed in the prompt information area 403.

[0048] When the form page for business development is opened, the available service port range is automatically queried and displayed on the form page to provide developers with a reference for filling in the port number. During the process of filling in the port form item, in response to the first input operation of the port form item, the newly added port data is verified according to the extracted port verification rules, thereby improving the port verification efficiency. In addition, when the port is added, the preset availability query interface is called to query the availability status of the newly added port data, and when the verification result fails or the availability status indicates that the port is unavailable, the corresponding prompt information is displayed on the form page, which enables developers to promptly know the verification result and availability status of the newly added port data, avoiding the situation of repeatedly manually modifying and adjusting the port number after the entire form is submitted, thereby improving business development efficiency.

[0049] In some embodiments, the port form item includes multiple groups of container port items and service port items with mapping relationships. The port adding method may also include the following steps: in response to an input operation of any container port item, verify whether the input port number of the container port item corresponding to the current input operation is repeated with the container port number in other container port items.

[0050] Specifically, a listening event can be added to the input box of the container port form item. When the input box is listened to, the verification logic of other container port items is triggered to verify whether the input port number of the container port item corresponding to the current input operation is repeated with the container port number in other container port items. In some specific examples, when the input port number of the container port item is repeated with the container port number in other container port items, the form page displays a corresponding prompt message, such as Figure 5 As shown, a container duplicate prompt area 510 is provided below each container port item in the port form item 203. When there are duplicate container port numbers, the corresponding container duplicate prompt area 510 displays information. The prompt information can be located below the duplicate container port item and displayed in a red prompt. The prompt content can be: "Duplicate" or "Not Duplicate". Specifically, there is no particular limitation on the presentation position, form, and content of the prompt, and those skilled in the art can set it according to actual needs.

[0051] In some embodiments, the port adding method may further include the following steps: in response to an input operation of any service port item, verifying whether the input port number of the service port item corresponding to the current input operation is repeated with the service port numbers in other service port items.

[0052] Specifically, a listening event can be added to the input box of the service port form item. When information input is detected in the input box, the verification logic of other service port items is triggered to verify whether the input port number of the service port item corresponding to the current input operation is repeated with the service port numbers in other service port items.

[0053] In some specific examples, when the input port number of the service port item is repeated, the form page displays a corresponding prompt message, such as Figure 6 As shown, a service duplication prompt area 610 is provided below each service port item in the port form item 203. When there are duplicate service port numbers, the corresponding service duplication prompt area 610 displays information. The prompt information can be located below the container port item where there is a duplicate, and is prompted with a red prompt. The content of the prompt can be: "There is a duplicate" or "Not repeatable". Specifically, there is no special restriction on the presentation position, form and content of the prompt, and those skilled in the art can set it according to actual needs.

[0054] In some embodiments, the port adding method may further include the following steps: when the verification result indicates that the verification has passed and the availability result indicates that the port is available, submitting the newly added port information to complete the port addition. Specifically, the content of the form object form of the form page is submitted to the service module in a specified format to complete the port addition.

[0055] In some embodiments, the port adding method may further include the following steps: In response to the port number recommendation request from the form page, a preset recommended port query interface is called to obtain recommended port data that meets the port number recommendation request, and the recommended port data is fed back to the form page.

[0056] Among them, the port number recommendation request can be triggered based on a specific control operation in the form page. For example, a button representing the recommended service port can be set on the side of the input box of the port form item. When the developer clicks the button through an input device (such as a mouse, touch, or keyboard), the form page generates and issues a port number recommendation request. In some specific examples, the controls set in the form page for initiating a port number recommendation request can include a single recommendation control and a batch recommendation control. Correspondingly, there is a difference in the number of requested recommendations in the port number recommendation requests generated based on the two different types of controls. It is easy to understand that the port number recommendation request corresponding to a single recommendation control includes 1 recommendation number, and the port number recommendation request corresponding to a batch recommendation control includes multiple recommendations.

[0057] In some specific embodiments, the recommended port data is a recommended service port number, the port number recommendation request includes a recommended quantity, and calling a preset recommended port query interface to obtain recommended port data that meets the port number recommendation request may include the following steps: calling the recommended port query interface to query the unoccupied available port data in the server cluster, and obtaining one or more recommended service port numbers corresponding to the recommended quantity from the available port data.

[0058] Specifically, in response to a port number recommendation request from a form page, a preset recommended port query interface is called to query the unoccupied available port data in the server cluster, which can be a set of available service port numbers, and obtain one or more recommended service port numbers corresponding to the recommended quantity. For example, when the recommended quantity of the port number recommendation request is 1, a service port number is selected from the unoccupied service port number set that is queried, and the service port number is fed back to the form page. In some examples, the selected service port number can be directly filled into the input box of the corresponding port form item. The service port number can be selected by random selection or by preferentially selecting a port number with a smaller value from the available port data.

[0059] In some examples, obtaining one or more recommended service port numbers corresponding to the recommended quantity from the available port data can also be based on the service port numbers occupied by the currently developed business, and preferentially selecting port numbers close to the service port numbers occupied by the current business from the available port data.

[0060] In some examples, the recommended quantity included in the port number recommendation request triggered by the batch recommendation control can be determined by manual input by the developer, or it can be automatically generated based on specific interactive logic. For example, after the developer clicks the batch recommendation control on the form page, an input box for filling in the number of ports to be added in batches will pop up on the form page. The specific recommended quantity can be determined based on the input value of the input box. For another example, after the developer clicks the batch recommendation control on the form page, the recommended quantity can be determined based on the number of container port items already filled in the current port form item. Multiple available service port numbers are obtained based on the recommended quantity and filled in the input box of the service port item in sequence.

[0061] By providing a port number recommendation function, in response to a port number recommendation request, it automatically queries unoccupied service ports and automatically fills them into the corresponding form items, thereby realizing automatic addition of port numbers, reducing user input errors and attempts, and improving the efficiency of port filling.

[0062] In some embodiments, the port adding method further includes a step of manually adding in batches, such as Figure 7 As shown, the port adding method may further include steps S701 to S703.

[0063] Step S701: In response to a port batch addition request from a form page, a batch addition pop-up window is displayed on the form page, the batch addition pop-up window including an editing area for filling in a character string representing port data; Step S702: In response to the batch adding completion instruction, the character string information in the editing area is parsed to obtain the batch newly added port data; Step S703: verifying the batch of newly added port data.

[0064] Specifically, batch adding pop-up boxes can be done as follows Figure 8 As shown, the batch adding pop-up box 800 may include an editing area 810 for filling in a character string representing port data, and an adding indication control 820. The batch editing area 810 also includes guidance information 811 for providing filling instructions. The adding indication control 820 may include a cancel control and a confirmation control.

[0065] The batch adding completion instruction may be generated based on the confirmation control in the adding instruction control 820 .

[0066] Parse the string information in the edit area according to the filling specification. In some examples, the filling specification of the edit area is: "Batch add with line break as the delimiter between key-value pairs, key-value pairs with space as the key-value delimiter, the example is as follows key1 value1 key2 value2", correspondingly, in response to the batch add completion instruction, parse the batch add string, split the entire string into multiple independent key-value pair strings according to the line break, and for each split key-value pair string, split it again according to the space to obtain the key and value; combine the key and value into an array, for example: [{key: "key1", value: "value1"}, {key: "key2", value: "value2"}], each key-value pair array represents a container port number and a service port number with a mapping relationship.

[0067] In some embodiments, the specific steps of verifying the batch of newly added port data may include the following steps: verifying the batch of newly added port data according to the port verification rule, calling the availability query interface, and querying the availability status of the batch of newly added port data.

[0068] It is easy to understand that when checking and verifying the availability status of the batch of newly added port data obtained by parsing, each group of data is traversed and checked separately. The verification method and availability status query method are similar to the verification method and availability status query method for the port form items in the above embodiment, and will not be repeated here.

[0069] By providing a port batch addition function based on an edit box, a port addition method different from filling in multiple port form items is provided, which can match the port adding habits of different developers and improve the developer's usage experience.

[0070] In some embodiments, the port adding method may further include the following steps: After extracting the port verification rule corresponding to the port form item, the port verification rule is stored in the form configuration component, and in response to a second input operation, the newly added port data corresponding to the second input operation is verified according to the port verification rule. The second input operation and the first input operation are from the port form item of the same business.

[0071] When multiple port adding operations are performed on the same service, the newly added port data corresponding to each port adding operation is verified according to the stored port verification rules.

[0072] In some embodiments, the port adding method may further include the following steps: In response to the third input operation of the port form item for the second business, when the port verification rule of the second business is the same as the port verification rule, the newly added port data corresponding to the third input operation is verified according to the port verification rule; when there are different rule items between the port verification rule of the second business and the port verification rule, the port verification rule is modified according to the different rule items, and the newly added port data corresponding to the third input operation is verified according to the modified port verification rule.

[0073] The second business is a software development business that is different from the first business. Different software development businesses may have the same or different validation rules for added port data. When an input event occurs for a port form item of a business different from the first business, the form configuration component extracts the corresponding port validation rule and compares it with the stored validation rule of the first business. If they are the same, the port validation rule of the first business is directly applied to validate the newly added port data. If they are different, the difference item is replaced and then validated, and the modified port validation rule is stored in the form configuration component.

[0074] By storing validation rules in the form configuration component, it is possible to reuse rule codes for businesses with the same validation rules during different business development processes, thus avoiding code redundancy.

[0075] In some embodiments, the port adding method may further include the following steps: According to the preset scanning frequency, the port usage status information in the server cluster is periodically obtained. When the number of available ports in the server cluster is less than the preset threshold, an alarm message is sent to prompt the server to expand capacity.

[0076] In some specific examples, the preset threshold can be set to a value corresponding to a specific percentage of the total number of available ports, or it can be a threshold set by developers based on business needs and the total amount of system resources. The specific value is not limited here.

[0077] By periodically scanning the port usage status, an alarm is issued when the remaining available ports in the service port range exceeds the threshold, helping developers to understand the port resource status in a timely manner, facilitating resource management and capacity expansion applications.

[0078] In some embodiments, the port adding method may further include the following steps: in response to an opening instruction of a form page, introducing a preset form configuration component into the form page.

[0079] The form configuration component includes a key-value pair array variable for storing newly added port data and a rule array variable for storing port verification rules. The form configuration component is used to bind the port verification rules with the corresponding port form items after obtaining the port verification rules corresponding to the port form items. The form configuration component is also used to configure the form page to implement the steps of the port adding method involved in any of the above embodiments.

[0080] Specifically, the specific steps of introducing a preset form configuration component into a form page may include: passing the container port verification rules, service port verification rules, availability query interface, and recommended port query interface pre-defined in the form page to the form configuration component, and the form configuration component receiving the container port verification rules, service port verification rules, availability query interface, and recommended port query interface from the form page.

[0081] In some examples, the form configuration component is also used to define an array variable on the form object form: a key-value array variable "formPortParameters", which is used to store the newly added port data. An array variable is defined: a container port verification rule list "targetPortValueRules", which is used to store the container port verification rules. And an array variable is defined: a service port verification rule list "portValueRules", which is used to store the service port verification rules. The form configuration component is also used to listen to the input operation of the port form item, or listen to the corresponding control click event of the port form item. When the developer adds new port data based on the port form item, a new piece of data is added to the key-value array variable, including the container port key and the service port value; a new piece of data is added to the container port verification rule list synchronously, and the value is the container port verification rule. A new piece of data is added to the service port verification rule list synchronously, and the value is the service port verification rule.

[0082] In some examples, the form configuration component is used to render a port form item. Specifically, it renders an input form for the port form item based on a key-value array variable. Each data item in the key-value array variable is looped through and indexed using the current item's position. The container port of each data item is set to the container port form item to obtain and verify the container port number. The service port of each data item is set to the container service port form item to obtain and verify the service port number.

[0083] In some embodiments, the form configuration component is used to bind a corresponding validation rule to each port form item. Specifically, for each container port form item, the rules attribute (rule attribute) is set to the current item in the container port validation rule list, that is, "targetPortValueRules[index]" as the validation rule for the current container port form item, and the props (Properties, a mechanism for communication between components) attribute of the form item is set to "formPortParameters.index.key" to bind the validation rule. For each service port form item, the rules attribute is set to the current item in the service port validation rule list, that is, "portValueRules[index]" as the validation rule for the current service port form item, and the props attribute of the form item is set to "formPortParameters.index.value" to bind the validation rule.

[0084] In some embodiments, the port adding method may further include a port deletion operation. Specifically, in response to a deletion instruction triggered by a port deletion control, the form configuration component deletes the current piece of data in the key-value pair array variable "formPortParameters," which includes the container port key corresponding to the current index and the service port value corresponding to the current index. The container port validation rule list "targetPortValueRules" also deletes the piece of data corresponding to the current index. The service port validation rule list "portValueRules" also deletes the piece of data corresponding to the current index.

[0085] The form configuration component, with its key-value structure, supports receiving validation rules, interface data, and defining the interaction logic for form pages, enabling strict validation of newly added port data. It can also be reused across multiple business modules that fill in key-value data, simplifying code development for developers and improving development efficiency. Furthermore, the form configuration component enables dynamic form generation, supporting the dynamic addition and removal of key-value input boxes. This allows for flexible configuration of form items based on business needs, enhancing system flexibility and scalability.

[0086] In some embodiments, the interaction logic between the modules of the form system 100 can be as follows: Figure 9 As shown. It includes steps S901 to S914. The specific steps are as follows: Step S901: the form page 101 calls an interface to query the service module 103 for a service port range; Step S902: the service module 103 searches for the service port range, returns the service port range to the form page 101, and displays it as prompt information to the user on the interface.

[0087] Step S903: the developer of the form page 101 triggers a port adding event; Step S904: the form configuration component 102 adds one or more port data to the predefined port array variable in response to the port adding event, wherein the port data includes the container port number and the service port number; Step S905: the form page 101 generates an input event of a port form item; Step S906: In response to the port form item input event, the form configuration component 102 monitors changes in the port value and triggers port verification. Specifically, the form configuration component 102 monitors changes in the container port number and triggers local container port verification rules to verify whether the container port is duplicated. If there are duplicate container ports, the user is prompted on the interface. The form configuration component 102 monitors changes in the service port number and triggers local service port verification rules to verify whether the service port is duplicated. If there are duplicate service ports, the user is prompted on the interface. Step S907: The port of the form page 101 is added; Step S908: In response to the port form item losing focus event or the batch adding port confirmation event, a request to query whether the port is available is sent to the service module 103; Step S909: the service module 103 returns the queried port availability status result to the form configuration component 102; Step S910: the form configuration component 102 verifies through the newly added custom validation rule and prompts whether the newly added service port value is available. If it is unavailable, the current service port number and the reason for unavailability are displayed; Step S911: a recommendation port call event occurs on the form page 101, which may be a click operation on a single recommendation control or batch recommendation controls; Step S912: the form configuration component 102 calls an interface to query an unoccupied service port as a recommended port; Step S913: the service module 103 returns the unoccupied service port value found out to the form configuration component 102, and the form configuration component 102 fills it into the corresponding port form item; Step S914: the service module 103 periodically scans the port usage status, and when the number of available ports in the server cluster is less than a preset threshold, sends an alarm message to prompt the server to be expanded.

[0088] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0089] It should be understood that the steps in the above-mentioned method flow charts are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned embodiments may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0090] The embodiment of the present application also provides a port adding device, such as Figure 10 As shown, the port adding device 1000 includes an available range query module 1001 , a rule acquisition module 1002 , a local verification module 1003 , a dynamic verification module 1004 and a result prompt module 1005 .

[0091] The available range query module 1001 is configured to query available service port range information in response to an opening instruction of a form page for the first service, and display the service port range information on the form page.

[0092] The rule acquisition module 1002 is used to extract the port verification rule corresponding to the port form item from the multiple verification rules pre-set on the form page.

[0093] The local verification module 1003 is configured to respond to a first input operation of a port form item from a form page, and to verify the newly added port data corresponding to the first input operation according to a port verification rule to obtain a verification result.

[0094] The dynamic verification module 1004 is used to call a preset availability query interface in response to the port addition completion instruction from the form page to query the availability status of the newly added port data.

[0095] The result prompt module 1005 is used to display corresponding prompt information on the form page when the verification result indicates that the verification fails, or the availability status indicates that the port is unavailable, to prompt the user to make changes.

[0096] In some embodiments, the port form item includes a container port item and a service port item, the port verification rule includes a first verification rule for verifying the container port item and a second verification rule for verifying the service port item, and the newly added port data includes a container port number and a service port number with a mapping relationship. The local verification module 1003 includes a container port verification unit and a service port verification unit.

[0097] The container port verification unit is used to verify the container port number according to a first verification rule.

[0098] The service port verification unit is used to verify the service port number according to a second verification rule.

[0099] In some embodiments, the port adding device 1000 further includes: a port recommendation module (not shown in the figure).

[0100] The port recommendation module is used to respond to the port number recommendation request from the form page, call the preset recommended port query interface, obtain the recommended port data that meets the port number recommendation request, and feed the recommended port data back to the form page.

[0101] In some embodiments, the recommended port data is a recommended service port number; the port number recommendation request includes a recommended quantity, and the port recommendation module includes an available port query unit and a recommended port number acquisition unit.

[0102] The available port query unit is used to call the recommended port query interface to query the data of available ports that are not occupied in the server cluster.

[0103] The recommended port number acquisition unit is used to acquire one or more recommended service port numbers corresponding to the recommended quantity from the available port data.

[0104] In some embodiments, the port adding device 1000 further includes a batch adding module (not shown in the figure). The batch adding module includes a pop-up unit, a parsing unit, and a verification unit.

[0105] The pop-up box unit is used to respond to a port batch adding request from a form page and display a batch adding pop-up box on the form page, wherein the batch adding pop-up box includes an editing area for filling in a character string representing port data.

[0106] The parsing unit is used to respond to the batch adding completion instruction, parse the character string information in the editing area, and obtain the batch newly added port data.

[0107] The verification unit is used to verify the batch of newly added port data.

[0108] In some embodiments, the verification unit is further configured to verify the batch of newly added port data according to a port verification rule, and call an availability query interface to query the availability status of the batch of newly added port data.

[0109] In some embodiments, the port adding device 1000 further includes: a rule storage module (not shown in the figure).

[0110] The rule storage module is used to store the port verification rule into the form configuration component after extracting the port verification rule corresponding to the port form item.

[0111] The local verification module 1003 is further configured to respond to a second input operation and verify the newly added port data corresponding to the second input operation according to a port verification rule, wherein the second input operation and the first input operation are from a port form item of the same business.

[0112] In some embodiments, the local verification module 1003 is further configured to respond to a third input operation for a port form item of a second business, and when the port verification rule of the second business is the same as the port verification rule, verify the newly added port data corresponding to the third input operation according to the port verification rule; when there is a difference between the port verification rule of the second business and the port verification rule, modify the port verification rule according to the difference, and verify the newly added port data corresponding to the third input operation according to the modified port verification rule. The second business is a software development business different from the first business.

[0113] In some embodiments, the port adding device 1000 further includes: a periodic scanning module (not shown in the figure).

[0114] The periodic scanning module is used to periodically obtain port usage status information in the server cluster according to a preset scanning frequency. When the number of available ports in the server cluster is less than a preset threshold, an alarm message is sent to prompt server expansion.

[0115] In some embodiments, the port adding device 1000 further includes: a configuration component reference module (not shown in the figure).

[0116] The configuration component reference module is used to introduce a preset form configuration component into the form page in response to an opening instruction of the form page.

[0117] Among them, the form configuration component includes a key-value array variable for storing newly added port data and a rule array variable for storing port verification rules; The form configuration component is used to bind the port verification rule to the corresponding port form item after obtaining the port verification rule corresponding to the port form item; The form configuration component is also used to configure the form page to implement the steps of the port adding method in any embodiment of the first aspect.

[0118] For the description of the features in the embodiment corresponding to the port adding device, please refer to the relevant description of the embodiment corresponding to the port adding method of a form page, which will not be repeated here.

[0119] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned embodiments of the method for adding a port to a form page.

[0120] In some embodiments, the internal structure diagram of the electronic device can be as follows: Figure 11 As shown. The electronic device includes a processor, a memory, and a communication interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements the port adding method in any embodiment of this document.

[0121] Those skilled in the art will understand that Figure 11 The structure shown in the figure is merely a block diagram of a portion of the structure related to the embodiment scheme of the present disclosure, and does not constitute a limitation on the computer device to which the embodiment scheme of the present disclosure is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0122] The embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned embodiments of the method for adding a port to a form page when running. The computer-readable storage medium may be Figure 11 Non-volatile storage media in the computer device shown.

[0123] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0124] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned embodiments of the method for adding a port to a form page are implemented.

[0125] An embodiment of the present application also provides another computer program product, including a non-volatile computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps in any of the above-mentioned embodiments of the method for adding a port to a form page.

[0126] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0127] The above is a detailed introduction to the port addition of a form page provided by this application. This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the scope of protection of this application.

Claims

1. A method for adding a port to a form page, characterized in that: The form page is a business development interface, and the method includes: In response to an opening instruction for a form page of the first service, querying available service port range information, and displaying the service port range information on the form page; Extracting the port verification rule corresponding to the port form item from the plurality of verification rules pre-set on the form page; In response to a first input operation of a port form item from the form page, verifying the newly added port data corresponding to the first input operation according to the port verification rule to obtain a verification result; In response to a port addition completion instruction from the form page, calling a preset availability query interface to query the availability status of the newly added port data; When the verification result indicates that the verification fails, or the availability status indicates that the port is unavailable, corresponding prompt information is displayed on the form page to prompt the user to make a modification.

2. The port adding method according to claim 1, characterized in that: The port form item includes a container port item and a service port item, the port verification rule includes a first verification rule for verifying the container port item and a second verification rule for verifying the service port item, and the newly added port data includes a container port number and a service port number with a mapping relationship; The verifying the newly added port data corresponding to the first input operation according to the port verification rule includes: Verifying the container port number according to the first verification rule; The service port number is verified according to the second verification rule.

3. The port adding method according to claim 1, characterized in that: The port verification rule is used to verify whether the newly added port data meets the filling requirements of the port form item, and the filling requirements include a first requirement indicating mandatory, a second requirement indicating character format, and / or a third requirement indicating non-repeatable.

4. The port adding method according to claim 1, characterized in that: The method further comprises: In response to the port number recommendation request from the form page, calling a preset recommended port query interface to obtain recommended port data that meets the port number recommendation request; Feedback the recommended port data to the form page.

5. The port adding method according to claim 4, characterized in that: The recommended port data is a recommended service port number; the port number recommendation request includes a recommended quantity; The calling of a preset recommended port query interface to obtain recommended port data that meets the port number recommendation request includes: Calling the recommended port query interface to query the unoccupied available port data in the server cluster; One or more recommended service port numbers corresponding to the recommended quantity are obtained from the available port data.

6. The port adding method according to claim 1, characterized in that: The method further comprises: In response to a port batch addition request from the form page, displaying a batch addition pop-up window on the form page, the batch addition pop-up window including an editing area for filling in a character string representing port data; In response to the batch adding completion instruction, parsing the character string information in the editing area to obtain the batch newly added port data; The batch of newly added port data is verified.

7. The port adding method according to claim 6, characterized in that: The verifying of the batch newly added port data includes: Verifying the batch of newly added port data according to the port verification rule; The availability query interface is called to query the availability status of the batch of newly added port data.

8. The port adding method according to claim 1, characterized in that: The method further comprises: After extracting the port verification rule corresponding to the port form item, storing the port verification rule in a form configuration component; In response to a second input operation, the newly added port data corresponding to the second input operation is verified according to the port verification rule, where the second input operation and the first input operation are from a port form item of the same business.

9. The port adding method according to claim 1, characterized in that: The method further comprises: In response to a third input operation on a port form item of a second service, when a port verification rule of the second service is the same as the port verification rule, verifying the newly added port data corresponding to the third input operation according to the port verification rule; When there is a difference between the port verification rule of the second service and the port verification rule, modify the port verification rule according to the difference, and verify the newly added port data corresponding to the third input operation according to the modified port verification rule; The second business is a software development business that is different from the first business.

10. The port adding method according to claim 1, characterized in that: The method further comprises: According to a preset scanning frequency, the port usage status information in the server cluster is periodically obtained. When the number of available ports in the server cluster is less than a preset threshold, an alarm message is sent to prompt the server to be expanded.

11. The port adding method according to claim 1, characterized in that: The method further comprises: In response to an instruction to open the form page, a preset form configuration component is introduced into the form page, wherein the form configuration component includes a key-value array variable for storing the newly added port data and a rule array variable for storing port verification rules; The form configuration component is used to bind the port verification rule to the corresponding port form item after obtaining the port verification rule corresponding to the port form item; The form configuration component is further used to configure the form page to implement the steps of the port adding method according to any one of claims 1 to 10.

12. A port adding device, characterized in that: include: an available range query module, configured to query available service port range information in response to an opening instruction of a form page for a first service, and display the service port range information on the form page; A rule acquisition module, configured to extract a port verification rule corresponding to a port form item from a plurality of verification rules pre-set on the form page; a local verification module, responsive to a first input operation of a port form item from the form page, for verifying the newly added port data corresponding to the first input operation according to the port verification rule to obtain a verification result; A dynamic verification module is configured to, in response to a port addition completion instruction from the form page, call a preset availability query interface to query the availability status of the newly added port data; The result prompt module is used to display corresponding prompt information on the form page when the verification result indicates that the verification fails, or the availability status indicates that the port is unavailable, so as to prompt the user to make changes.

13. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the port adding method according to any one of claims 1 to 11 when executing the computer program.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the port adding method according to any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the port adding method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Batch port configuration method and device based on Kubernetes cluster, and equipment

    CN112769621A

  • Mobile terminal webpage form configuration and verification method and device, equipment and storage medium

    CN112800751A

  • Method and device for automatically checking form, equipment and storage medium

    CN116187290A

  • Verification method and device and storage medium

    CN117592931A

  • Port distribution method and device of application container, equipment, medium and product

    CN117827365A