Port adding method, device, equipment, medium and product of form page

By automatically querying and displaying the service port range on the form page, and performing validation and availability checks during input operations, the problem of low port configuration efficiency is solved, and business development efficiency is improved.

CN120469679BActive Publication Date: 2025-10-24INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In business system development, the existing port configuration method is inefficient. Developers need to repeatedly enter the port number and perform multiple verifications. Moreover, port verification is usually performed when the form is submitted, resulting in low development efficiency.

Method used

When the form page is opened, automatically query the range of available service ports and display it on the page to provide developers with a reference for entering port numbers. In response to input operations, perform validation, call the availability query interface to check port availability, and display a prompt message when the port is unavailable.

Benefits of technology

It improves port verification efficiency, reduces the number of times port numbers need to be filled in and adjusted, improves business development efficiency, and ensures that developers are informed of verification results and port availability in a timely manner.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120469679B_ABST
    Figure CN120469679B_ABST
Patent Text Reader

Abstract

The application discloses a form page port adding method and device, electronic equipment, a storage medium and a computer program product, and relates to the technical field of business development. The method comprises the following steps: when a form page for business development is opened, automatically querying available server port ranges, displaying the server port ranges on the form page, and providing port number filling references for developers. During the port form item filling process, in response to a first input operation of the port form item, newly added port data is verified according to extracted port verification rules. When the port addition is completed, a preset availability query interface is called to query the availability state of the newly added port data. When the verification result does not pass or the availability state indicates that the port is unavailable, corresponding prompt information is displayed on the form page. The method can enable developers to learn the verification result and the availability state of the newly added port data in a timely manner, solves the technical problem of low port addition efficiency, and improves the business development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of business development, and particularly relates to a port adding method and device for a form page, an electronic device, a storage medium and a computer program product. BACKGROUND

[0002] In the development process of a business system, service port configuration is a common requirement. In particular, in a micro-service architecture or a distributed system, a developer needs to assign a unique port number to different services to ensure normal communication between services. However, in the traditional port configuration method, the developer needs to input the port number repeatedly for trial and error, and the existing form system only checks the port number when the form is submitted. If the check fails, the developer needs to modify and submit again, resulting in repeated operations and low development efficiency. SUMMARY

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

[0004] The present application provides a port adding method for a form page, and the form page is a business development interface. The method comprises the following steps.

[0005] In response to an opening instruction for a form page of a first service, the available service port range information is queried, and the service port range information is displayed on the form page.

[0006] From a plurality of preset verification rules of the form page, a port verification rule corresponding to a port form item is extracted.

[0007] In response to a first input operation of the port form item from the form page, the newly added port data corresponding to the first input operation is verified according to the port verification rule, and a verification result is obtained.

[0008] In response to a port addition completion instruction from the form page, a preset availability query interface is called to query the availability state of the newly added port data.

[0009] When the verification result indicates that the verification is not passed, or the availability state indicates that the port is not available, corresponding prompt information is displayed on the form page to prompt modification.

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

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

[0012] The rule acquisition module is configured to extract a port check rule corresponding to the port form item from a plurality of check rules preset on the form page.

[0013] The local check module is configured to check newly added port data corresponding to a first input operation of the port form item on the form page according to the port check rule, and obtain a check result.

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

[0015] The result prompt module is configured to display corresponding prompt information on the form page to prompt modification when the check result indicates that the check fails or the availability state indicates that the port is unavailable.

[0016] The application further provides an electronic device, including a memory configured to store a computer program, and a processor configured to execute the computer program to implement steps of any of the port addition methods.

[0017] The application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement steps of any of the port addition methods.

[0018] The application further provides a computer program product, which includes a computer program, and the computer program is executed by a processor to implement steps of any of the port addition methods.

[0019] According to the application, when a form page developed for a service is opened, available service port range information is automatically queried and displayed on the form page to provide a port number filling reference for a developer. During filling of a port form item, newly added port data is checked according to an extracted port check rule in response to a first input operation of the port form item, thereby improving port check efficiency. In addition, when port addition is completed, a preset availability query interface is called to query an availability state of the newly added port data, and corresponding prompt information is displayed on the form page when the check result fails or the availability state indicates that the port is unavailable, thereby enabling the developer to learn the check result and the availability state of the newly added port data in a timely manner, avoiding repeated manual modification and adjustment of the port number after the entire form is submitted, and improving service development efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained without creative labor on the basis of these drawings.

[0021] Figure 1 A schematic diagram of a form system related to the embodiments of the present application;

[0022] Figure 2 A schematic diagram of a form page related to the embodiments of the present application;

[0023] Figure 3 A flowchart of a port adding method related to the embodiments of the present application;

[0024] Figure 4 A form item for displaying prompt information related to the embodiments of the present application;

[0025] Figure 5 A form item for displaying container port duplication related to the embodiments of the present application;

[0026] Figure 6 A form item for displaying service port duplication related to the embodiments of the present application;

[0027] Figure 7 A flowchart of a port batch adding method related to the embodiments of the present application;

[0028] Figure 8 A schematic diagram of a batch adding pop-up box related to the embodiments of the present application;

[0029] Figure 9 A schematic diagram of the interaction logic of each module of a form system related to the embodiments of the present application;

[0030] Figure 10 A structural schematic diagram of a port adding device related to the embodiments of the present application;

[0031] Figure 11 A structural diagram of an electronic device related to the embodiments of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, but not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

[0033] It should be noted that in the description of the present application, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or inherent to such a process, method, article or device. The terms "first", "second" and the like in the present application are used to distinguish similar objects, not to describe a specific order or sequence.

[0034] In order for those skilled in the art to better understand the present application, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.

[0035] In the development process of the business system, the service port in the container is mapped to the service port of the server cluster to realize external access. In the related art, the service port access capability is provided in the form of "container port: service port", and the valid port range is limited to 1-65535. In order to improve security and optimize resource management, the range of open ports is limited for specific development tasks. When filling in the port, the developer can manually query the available port range in the current system or cluster, for example, through a command line tool or by referring to the document. Or try by inputting randomly several times. No matter which way, there is the problem of long time-consuming and low efficiency.

[0036] In addition, the existing form system usually only checks the port value when the form is submitted. If the data filling of a certain form item does not pass the check, it needs to be re-filled and checked, which increases the checking time and reduces the development efficiency. Even if the port format check passes, it may still be unavailable due to port occupation or firewall restriction in actual use.

[0037] To solve the above problems, the present application provides a port adding method. When the form page for business development is opened, the available service port range is automatically queried and displayed on the form page, providing a port number filling reference for the developer. During the filling process of the port form item, in response to the first input operation of the port form item, the newly added port data is checked according to the extracted port checking rule, which improves the port checking efficiency. In addition, when the port addition is completed, a preset availability query interface is called to query the availability state of the newly added port data, and when the checking result does not pass or the availability state indicates that the port is unavailable, the corresponding prompt information is displayed on the form page. The developer can learn the checking result and availability state of the newly added port data in time, avoiding the situation of repeatedly manually modifying and adjusting the port number after the entire form is submitted, and improving the business development efficiency.

[0038] 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.

[0039] 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.

[0040] 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.

[0041] 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.

[0042] Specifically, in response to an opening instruction of a form page of the first service, the service port range information corresponding to the first service is queried according to a preset query interface, and the service port range information is displayed on the form page. The available service port range information can be a port range value opened corresponding to the permission level of the first service, or can be an opened port range value that is not disabled in the server cluster. In some examples, the service port range information displayed on the form page can be displayed as: "the service port range is 30000-31000", and the display position can be above the port form item or other areas, and the display mode can be in the form of static prompt content or pop-up window. The display mode and display position of the available service port range information are not particularly limited, and a person skilled in the art can set them according to actual needs.

[0043] In some specific embodiments, the form configuration component pre-defines 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 a Dom (Document Object Model, Document Object Model) and displayed on the form page.

[0044] By calling the query interface to query the available service port range and displaying it on the form page, the developer can be provided with clear available service port range information, avoiding the need to input the port number multiple times, saving the input time of the port form item, and improving the port addition efficiency.

[0045] Step S302: Extracting the port check rule corresponding to the port form item from the pre-set multiple check rules of the form page.

[0046] The form page includes multiple form items to be filled in, such as a name item for indicating the name of the developed service function, an explanation item, a related parameter setting item, and a port form item for configuring the added port. Compared with other form items of the form page, the port form item needs more rules for checking, in addition to the regular mandatory check and format check, it also needs to check whether the input port number exceeds the upper and lower limits of the fillable range and whether multiple port numbers are duplicated.

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

[0048] Step S303: In response to the first input operation of the port form item of the form page, the newly added port data corresponding to the first input operation is checked according to the port checking rule, and a checking result is obtained.

[0049] In some examples, the first input operation can be any input operation of the input box of the port form item after the form inner page is opened. The form configuration component can listen to the input operation of the port form item through an input event.

[0050] In some embodiments, the port checking rule is used to check whether the newly added port data meets the filling requirements of the port form item. The filling requirements can include a first requirement indicating a mandatory filling, a second requirement indicating a character format, and / or a third requirement indicating an unrepeatable filling. Specifically, the first requirement is used to check whether the port form item with the mandatory filling requirement is empty. If the port form item is empty, the requirement is not met, and the checking fails. The second requirement is used to check whether the input content of the port form item is a number. If the content is not in a numerical format, the checking fails. The third requirement is used to check whether there is a repeated value between the multiple port numbers in the newly added port data. If there is a repetition, the checking fails.

[0051] In some embodiments, the port form item includes a container port item and a service port item, the port checking rule includes a first checking rule for checking the container port item and a second checking rule for checking the service port item, and the newly added port data includes a container port number and a service port number having a mapping relationship.

[0052] Step S302 can include the following steps: checking the container port number according to the first checking rule and checking the service port number according to the second checking rule. That is, the container port number and the service port number are checked by the first checking rule and the second checking rule, respectively.

[0053] In some examples, the first checking rule and the second checking rule can include the first requirement, the second requirement, and / or the third requirement. The first checking rule and the second checking rule can be the same or different.

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

[0055] The port addition completion instruction can be an instruction generated based on a blur event (an interaction mechanism used to listen to the case where an input box loses focus. When the user clicks an area other than the input box, the event is triggered) or an instruction generated based on a click operation of a port confirmation addition control in the form page.

[0056] 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.

[0057] 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.

[0058] 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.

[0059] 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.

[0060] 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.

[0061] 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.

[0062] 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.

[0063] 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.

[0064] 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.

[0065] 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.

[0066] 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.

[0067] Specifically, a listening event can be added to the input box of the service port table item, and when information is input into the input box, the listening event triggers the verification logic of other service port items once to verify whether the input port number of the service port item corresponding to the current input operation is duplicated in the service port numbers of other service port items.

[0068] In some specific examples, when the input port numbers of the service port items are duplicated, corresponding prompt information is displayed in the form page, such as Figure 6 As shown in FIG. 6, a service duplication prompt area 610 is arranged below each service port item in the port form item 203, and the corresponding service duplication prompt area 610 displays information when the service port numbers are duplicated. The prompt information can be located below the container port item with duplicated service port numbers, and a prompt in red color is given, and the content of the prompt can be “duplicated” or “not duplicable”. Specifically, the presentation position, form, and content of the prompt are not particularly limited, and a person skilled in the art can set them according to actual needs.

[0069] In some embodiments, the port adding method can further include the following steps: when the verification result indicates that the verification is passed and the availability result indicates that the port is available, submitting the 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 predetermined format to complete the port addition.

[0070] In some embodiments, the port adding method can further include the following steps:

[0071] 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 satisfying the port number recommendation request, and the recommended port data is fed back to the form page.

[0072] The port number recommendation request can be triggered based on the operation of a specific control in the form page, for example, a button indicating the recommendation of a service port can be arranged beside the input box of the port form item, and when the developer clicks the button by using an input device (for example, a mouse, a touch control, or a keyboard), the form page generates and sends the port number recommendation request. In some specific examples, the control for initiating the port number recommendation request in the form page can include a single recommendation control and also can include a batch recommendation control. Correspondingly, the port number recommendation requests generated based on the two types of controls differ in the number of recommendations. It is easy to understand that the port number recommendation request corresponding to the single recommendation control includes one recommendation, and the port number recommendation request corresponding to the batch recommendation control includes multiple recommendations.

[0073] In some embodiments, the recommended port data is a recommended service port number, the port number recommendation request includes a recommended quantity, a preset recommended port query interface is called to obtain recommended port data meeting the port number recommendation request, which can include the following steps: calling the recommended port query interface, querying available port data that is not occupied in the server cluster, and obtaining one or more recommended service port numbers corresponding to the recommended quantity from the available port data.

[0074] Specifically, in response to a port number recommendation request from a form page, a preset recommended port query interface is called to query available port data that is not occupied in the server cluster, which can be a set of available service port numbers, and one or more recommended service port numbers corresponding to the recommended quantity are obtained therefrom. For example, when the recommended quantity of the port number recommendation request is 1, one service port number is selected from the set of queried service port numbers that are not occupied, 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 way of selecting the service port number can be random selection or preferentially selecting a small-valued port number from the available port data.

[0075] In some examples, obtaining one or more recommended service port numbers corresponding to the recommended quantity from the available port data can also be preferentially selecting a port number similar to the service port number occupied by the current development business from the available port data according to the service port number occupied by the current development business.

[0076] In some examples, the recommended quantity included in the port number recommendation request triggered by the batch recommendation control can be manually input by the developer or automatically generated based on specific interaction logic. For example, after the developer clicks the batch recommendation control of the form page, the form page pops up an input box for filling in the number of ports to be added in batches. Based on the input value of the input box, the specific recommended quantity can be determined. For another example, after the developer clicks the batch recommendation control of the form page, the recommended quantity can be determined based on the number of container port items filled in the current port form item. A plurality of available service port numbers are obtained according to the recommended quantity and are sequentially filled into the input boxes of the service port items.

[0077] By providing a port number recommendation function, in response to a port number recommendation request, the unoccupied service port is automatically queried and automatically filled into the corresponding form item, the automatic addition of the port number is realized, the user input error and the number of attempts are reduced, and the efficiency of port filling is improved.

[0078] In some embodiments, the port addition method further includes a manual batch addition step, as shown in Figure 7 The port addition method can further include steps S701 to S703.

[0079] Step S701: In response to a port batch addition request from the form page, display a batch addition pop-up box on the form page, the batch addition pop-up box including an edit area for filling in a string representing port data;

[0080] Step S702: In response to a batch addition completion instruction, parse the string information in the edit area to obtain batch-added port data.

[0081] Step S703: Verify the batch-added port data.

[0082] Specifically, the batch addition pop-up box can be as shown in Figure 8 The batch addition pop-up box 800 can include an edit area 810 for filling in a string representing port data, and an addition instruction control 820, the batch edit area 810 further including guide information 811 for providing filling guidance, the addition instruction control 820 can include a cancel control and a confirm control.

[0083] The batch addition completion instruction can be generated based on the confirm control in the addition instruction control 820.

[0084] The string information in the edit area can be parsed according to the filling specification, in some examples, the filling specification of the edit area is: “batch addition is separated by line feed as key-value pair separator, key-value pair is separated by space as key-value separator, for example key1 value1 key2 value2”, and in response to the batch addition completion instruction, the batch addition string is parsed, the entire string is divided into multiple independent key-value pair strings according to the line feed, and for each divided key-value pair string, the key and value are obtained according to the space; the key and value are combined 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.

[0085] In some embodiments, the specific steps of verifying the batch-added port data can include the following steps: verifying the batch-added port data according to a port verification rule, calling an availability query interface to query the availability state of the batch-added port data.

[0086] It is easy to understand that when the batch of newly added port data obtained by parsing is verified and the availability state is verified, each set of data is traversed and verified respectively, and the verification method and the availability state query method are similar to the verification method and the availability state query method of the port table item in the above embodiment, and details are not repeated here.

[0087] By providing the port batch adding function based on the edit box, a port adding mode different from filling in multiple port table items is provided, which can match the port adding habits of different developers and improve the use experience of the developers.

[0088] In some embodiments, the port adding method can further include the following steps:

[0089] After extracting the port verification rule corresponding to the port table 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 come from the same port table item of the business.

[0090] When multiple port adding operations are performed for the same business, the newly added port data corresponding to each port adding operation is verified according to the stored port verification rule.

[0091] In some embodiments, the port adding method can further include the following steps:

[0092] In response to a third input operation on the port table item of 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 the port verification rule of the second business has a difference rule item from the port verification rule, the port verification rule is modified according to the difference rule item, and the newly added port data corresponding to the third input operation is verified according to the modified port verification rule.

[0093] The second business is a software development business different from the first business. The verification rules for the added port data of different software development businesses can be the same or different. When an input event occurs on the port table item of the other business different from the first business, the form configuration component extracts the corresponding port verification rule and compares it with the stored verification rule of the first business. If they are the same, the port verification rule of the first business is directly applied to verify the newly added port data this time. If they are different, the difference is replaced and verified, and the modified port verification rule is stored in the form configuration component.

[0094] By storing the verification rule in the form configuration component, the same verification rule for the business can be reused in the development process of different businesses, and code redundancy can be avoided.

[0095] In some embodiments, the port adding method may further include the following steps:

[0096] 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.

[0097] 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.

[0098] 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.

[0099] 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.

[0100] 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.

[0101] 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.

[0102] In some examples, the form configuration component is further configured to define an array variable on the form object form: a key-value pair array variable "formPortParameters" for storing the new port data. Define an array variable: a container port validation rule list "targetPortValueRules" for storing the container port validation rules. And define an array variable: a service port validation rule list "portValueRules" for storing the service port validation rules. The form configuration component is further configured to listen to the input operation of the port form item, or listen to the click event of the corresponding control added by the port form item. When the developer adds new port data based on the port form item, the key-value pair array variable adds a data containing the container port key and the service port value. The container port validation rule list synchronously adds a data with the value of the container port validation rule. The service port validation rule list synchronously adds a data with the value of the service port validation rule.

[0103] In some examples, the form configuration component is configured to render the port form item, specifically, render the input form of the port form item based on the key-value pair array variable. Loop through each data in the key-value pair array variable and use the position index of the current item to set the container port of each data as the container port form item for obtaining and verifying the container port number. Set the service port of each data as the container service port form item for obtaining and verifying the service port number.

[0104] In some embodiments, the form configuration component is configured to bind the corresponding validation rule for each port form item, specifically, set the rules attribute of each container port form item as the current item of the container port validation rule list, that is, "targetPortValueRules[index]", as the verification rule of the current container port form item, and set the props attribute of the form item as "formPortParameters.index.key" to bind the validation rule. Set the rules attribute of each service port form item as the current item of the service port validation rule list, that is, "portValueRules[index]", as the verification rule of the current service port form item, and set the props attribute of the form item as "formPortParameters.index.value" to bind the validation rule.

[0105] In some embodiments, the port adding method can also include a port deleting operation. Specifically, in response to a deletion instruction triggered by a port deleting control, the form configuration component deletes, in the key-value pair array variable "formPortParameters", the current piece of data containing the container port key corresponding to the current index index and the service port value corresponding to the current index index; the container port verification rule list "targetPortValueRules" synchronously deletes the current piece of data corresponding to the current index value. The service port verification rule list "portValueRules" synchronously deletes the current piece of data corresponding to the current index value.

[0106] The form configuration component in the above key-value pair structure can support receiving verification rules, interface data, and defining interactive logic of a form page, and can realize strict verification on newly added port data. Moreover, the form configuration component can be repeatedly used in multiple business modules for filling in key-value pair data, simplifying the code writing work of a developer and improving the development efficiency. In addition, the form configuration component can realize dynamic form generation, support dynamic addition and deletion of key-value pair input boxes, and can flexibly configure form items according to business requirements, thereby improving the flexibility and expandability of the system.

[0107] In some embodiments, the interactive logic between the modules of the form system 100 can be as shown in Figure 9 . Steps S901 to S914 are included. The specific steps are as follows:

[0108] Step S901: The form page 101 calls an interface to query the service port range from the service module 103;

[0109] Step S902: The service module 103 queries the service port range, returns the service port range to the form page 101, and prompts the user on the interface as prompt information.

[0110] Step S903: The developer of the form page 101 triggers a port adding event;

[0111] Step S904: The form configuration component 102 responds to the port adding event and adds one or more pieces of port data in a predefined port array variable, wherein the port data includes a container port number and a service port number;

[0112] Step S905: The form page 101 generates an input event of a port form item;

[0113] Step S906: The form configuration component 102 listens to the port value change in response to the port form item input event, triggers the port check, specifically including listening to the change of the container port number, triggering the local container port check rule, checking whether the container port is repeated, if there is a repeated container port, prompting the user on the interface; listening to the service port number change, triggering the local service port check rule, checking whether the service port is repeated, if there is a repeated service port, prompting the user on the interface;

[0114] Step S907: The port addition of the form page 101 is completed;

[0115] Step S908: In response to the port form item losing focus event or the batch adding port determination event, a request for querying whether the port is available is sent to the service module 103;

[0116] Step S909: The service module 103 returns the port availability state result queried to the form configuration component 102;

[0117] Step S910: The form configuration component 102 verifies whether the newly added service port value is available through the newly added custom check rule, and if not available, displays the current service port number and the unavailable reason;

[0118] Step S911: The form page 101 occurs a recommended port calling event, which can be a single recommended control or a batch recommended control click operation;

[0119] Step S912: The form configuration component 102 calls an interface to query the service port not occupied as a recommended port;

[0120] Step S913: The service module 103 returns the service port not occupied to the form configuration component 102, and the form configuration component 102 fills it into the corresponding port form item;

[0121] Step S914: The service module 103 periodically scans the port usage state, and when the number of available ports in the server cluster is less than the preset threshold, sends an alarm information to prompt the server expansion.

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

[0123] It should be understood that the above-mentioned various steps in the method flowchart are displayed in sequence according to the indication of the arrow, but these steps are not necessarily executed in the order indicated by the arrow, unless it is explicitly stated herein, the execution of these steps does not have strict order restrictions, and these steps can be executed in other orders. Moreover, at least part of the steps of the foregoing embodiments can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or sub-steps or stages of other steps.

[0124] Embodiments of the present application also provide a port adding device, as shown in Figure 10 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 prompting module 1005.

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

[0126] The rule acquisition module 1002 is configured to extract a port verification rule corresponding to a port form item from a plurality of verification rules preset on the form page.

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

[0128] The dynamic verification module 1004 is configured to query an availability state of the newly added port data by calling a preset availability query interface in response to a port addition completion instruction from the form page.

[0129] The result prompting module 1005 is configured to display corresponding prompt information on the form page to prompt for modification when the verification result indicates that the verification is not passed or the availability state indicates that the port is not available.

[0130] 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 having a mapping relationship. The local verification module 1003 includes a container port verification unit and a service port verification unit.

[0131] The container port checking unit is configured to check the container port number according to a first checking rule.

[0132] The service port checking unit is configured to check the service port number according to a second checking rule.

[0133] In some embodiments, the port adding apparatus 1000 further comprises a port recommendation module (not shown in the figure).

[0134] The port recommendation module is configured to, in response to a port number recommendation request from the form page, invoke a preset recommendation port query interface, obtain recommendation port data satisfying the port number recommendation request, and feed back the recommendation port data to the form page.

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

[0136] The available port query unit is configured to invoke the recommendation port query interface to query available port data that is not occupied in the server cluster.

[0137] The recommended port number obtaining unit is configured to obtain one or more recommended service port numbers corresponding to the recommended quantity from the available port data.

[0138] In some embodiments, the port adding apparatus 1000 further comprises a batch adding module (not shown in the figure). The batch adding module comprises a pop-up box unit, an analysis unit and a checking unit.

[0139] The pop-up box unit is configured to, in response to a port batch adding request from the form page, display a batch adding pop-up box on the form page, wherein the batch adding pop-up box comprises an editing area for filling in a string representing port data.

[0140] The analysis unit is configured to, in response to a batch adding completion instruction, analyze the string information in the editing area to obtain batch new port data.

[0141] The checking unit is configured to check the batch new port data.

[0142] In some embodiments, the checking unit is further configured to check the batch new port data according to a port checking rule, and invoke an availability query interface to query an availability state of the batch new port data.

[0143] In some embodiments, the port adding apparatus 1000 further comprises a rule storage module (not shown in the figure).

[0144] The rule storage module is configured to, after extracting a port checking rule corresponding to a port form item, store the port checking rule in a form configuration component.

[0145] The local verification module 1003 is further configured to, in response to a second input operation, verify, according to the port verification rule, newly added port data corresponding to the second input operation, wherein the second input operation and the first input operation are from a port table entry of a same service.

[0146] In some embodiments, the local verification module 1003 is further configured to, in response to a third input operation for a port table entry of a second service, when a port verification rule of the second service is the same as the port verification rule, verify, according to the port verification rule, newly added port data corresponding to the third input operation, and when the port verification rule of the second service has a difference rule item from the port verification rule, modify the port verification rule according to the difference rule item, and verify, according to the modified port verification rule, the newly added port data corresponding to the third input operation. The second service is a software development service different from the first service.

[0147] In some embodiments, the port adding apparatus 1000 further comprises a periodic scanning module (not shown in the figure).

[0148] The periodic scanning module is configured to periodically acquire port usage state information in a server cluster according to a preset scanning frequency, and send an alarm information to prompt server expansion when the number of available ports in the server cluster is less than a preset threshold.

[0149] In some embodiments, the port adding apparatus 1000 further comprises a configuration component reference module (not shown in the figure).

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

[0151] The form configuration component comprises a key-value pair array variable for storing newly added port data and a rule array variable for storing a port verification rule.

[0152] The form configuration component is configured to, after acquiring a port verification rule corresponding to a port table entry, bind the port verification rule with the corresponding port table entry.

[0153] The form configuration component is further configured to configure the form page to implement the steps of the port adding method in any of the embodiments of the first aspect.

[0154] The features of the embodiments of the port adding apparatus can be referred to the related descriptions of the embodiments of the port adding method of the form page, which will not be repeated here.

[0155] The embodiment of the present application further provides an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor is arranged to run the computer program to execute the steps in any of the above-mentioned form page port adding method embodiments.

[0156] In some embodiments, the internal structure of the above-mentioned electronic device can be as shown in the figure. Figure 11 The electronic device comprises a processor, a memory and a communication interface connected through a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device comprises 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 operating system and the computer program in the non-volatile storage medium to run. The communication interface of the electronic device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement the port adding method in any of the embodiments herein.

[0157] Those skilled in the art can understand that, Figure 11 The structure shown in the figure is only a block diagram of part of the structure related to the embodiment of the present disclosure, and does not constitute a limitation on the computer device to which the embodiment of the present disclosure is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0158] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, wherein the computer program is arranged to run to execute the steps in any of the above-mentioned form page port adding method embodiments. Figure 11 The computer readable storage medium can be a non-volatile storage medium in the computer device as shown in the figure.

[0159] In an exemplary embodiment, the above-mentioned computer readable storage medium can include but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic or optical disk, and various media that can store computer programs.

[0160] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the steps in any of the above-mentioned form page port adding method embodiments.

[0161] The embodiment of the present application further provides another computer program product comprising a nonvolatile computer readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above form page port adding method embodiments.

[0162] Those skilled in the art will further appreciate that the units and algorithm steps of the examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, various components have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends on the particular application and design constraints imposed on the overall system. Skilled persons can implement the described functionality in varying ways for each particular application, but such implementation does not depart from the scope of the present application.

[0163] The above describes in detail the form page port adding provided by the present application. The principles and implementation modes of the present application are described by applying specific examples. The above description of the embodiments is only for helping to understand the method of the present application and its core idea. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, some improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the present application.

Claims

1. A port adding method of a form page, characterized by, The form page is a business development interface, and the method comprises: In response to an opening instruction of the form page, a preset form configuration component is introduced into the form page, wherein the form configuration component comprises a key-value pair array variable for storing newly added port data, a rule array variable for storing port verification rules, and is also used for configuring the form page; after obtaining the port verification rules corresponding to the port form item, the port verification rules are bound with the corresponding port form item; In response to an opening instruction of the form page for the first business, the available service port range information is queried and displayed on the form page; From the pre-set multiple verification rules of the form page, the port verification rules corresponding to the port form item are extracted; In response to a first input operation of the port form item from the form page, the newly added port data corresponding to the first input operation is verified according to the port verification rules, and a verification result is obtained; In response to a port addition completion instruction from the form page, a preset availability query interface is called to query the availability state of the newly added port data; When the verification result indicates that the verification is not passed, or the availability state indicates that the port is not available, corresponding prompt information is displayed on the form page to prompt modification; In response to a third input operation of the port form item for the second business, when the port verification rules of the second business are the same as the port verification rules, the newly added port data corresponding to the third input operation is verified according to the port verification rules; When the port verification rules of the second business have different rule items from the port verification rules, the port verification rules are 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 rules; wherein the second business is a software development business different from the first business.

2. The port addition method of claim 1, wherein, The port form item comprises a container port item and a service port item, the port verification rules comprise 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 comprises a container port number and a service port number having a mapping relationship; The verification of the newly added port data corresponding to the first input operation according to the port verification rules comprises: Verifying the container port number according to the first verification rule; Verifying the service port number according to the second verification rule.

3. The port addition method of claim 1, wherein, The port verification rules are used to verify whether the newly added port data meets the filling requirements of the port form item, and the filling requirements comprise a first requirement indicating that it is mandatory, a second requirement indicating character format, and / or a third requirement indicating that it cannot be repeated.

4. The port addition method of claim 1, wherein, The method further comprises: In response to a port number recommendation request from the form page, a preset recommended port query interface is called to obtain recommended port data meeting the port number recommendation request; The recommended port data is fed back to the form page.

5. The port addition method of claim 4, wherein, The recommended port data is a recommended service port number; the port number recommendation request comprises a recommended number. The calling preset recommended port query interface acquires recommended port data satisfying the port number recommendation request, and the recommended port data includes: The recommended port query interface is called to query available port data that is not occupied in the server cluster; From the available port data, one or more recommended service port numbers corresponding to the recommended number are obtained.

6. The port addition method of claim 1, wherein, The method further includes: In response to a port batch addition request from the form page, a batch addition pop-up box is displayed on the form page, and the batch addition pop-up box includes an editing area for filling in a string representing port data; In response to a batch addition completion instruction, the string information in the editing area is parsed to obtain batch-added port data; The batch-added port data is verified.

7. The port addition method of claim 6, wherein, The verification of the batch-added port data includes: The batch-added port data is verified according to the port verification rule; The availability query interface is called to query the availability status of the batch-added port data.

8. The port addition method of claim 1, wherein, The method further includes: After extracting the port verification rule corresponding to the port form item, the port verification rule is stored in the 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, and the second input operation and the first input operation come from the same port form item of the same service.

9. The port adding method of claim 1, wherein, The method further includes: According to a preset scanning frequency, the port usage state information in the server cluster is periodically acquired, and when the number of available ports in the server cluster is less than a preset threshold, an alarm information is sent to prompt server expansion.

10. A port adding apparatus characterized by comprising: It includes: The configuration component reference module is configured to respond to an opening instruction of the form page, and introduce a preset form configuration component into the form page, wherein the form configuration component includes a key-value pair array variable for storing newly-added port data, a rule array variable for storing port verification rules, and is also used for configuring the form page, and after obtaining the port verification rule corresponding to the port form item, the port verification rule is bound to the corresponding port form item; The available range query module is configured to respond to an opening instruction of the form page for a first service, query available service port range information, and display the service port range information on the form page; The rule acquisition module is configured to extract the port verification rule corresponding to the port form item from the multiple preset verification rules of the form page; The local verification module is configured to respond to a first input operation of a port form item from the form page, and verify newly-added port data corresponding to the first input operation according to the port verification rule to obtain a verification result; The dynamic verification module is configured to respond to a port addition completion instruction from the form page, call a preset availability query interface, and query the availability status of the newly-added port data; The result prompt module is configured 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 modification. The local check module is further configured to, in response to a third input operation on a port table entry of a second service, check, when a port check rule of the second service is the same as the port check rule, new port data corresponding to the third input operation according to the port check rule, modify the port check rule according to a difference rule item when the port check rule of the second service is different from the port check rule, and check the new port data corresponding to the third input operation according to the modified port check rule; the second service is a software development service different from the first service.

11. An electronic device, comprising: The application relates to a computer program product, comprising: a memory for storing a computer program; a processor for executing the computer program to implement the steps of the port adding method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer program is stored in the computer readable storage medium, and when the computer program is executed by the processor, the steps of the port adding method according to any one of claims 1 to 9 are implemented.

13. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the port adding method according to any one of claims 1 to 9.

Citation Information

Patent Citations

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

    CN116187290A

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

    CN117827365A