Disclosure of Invention
The embodiment of the invention provides a network resource configuration method and device, electronic equipment and a readable storage medium, wherein the process of changing network resources does not need a complex flow, but takes effect directly, saves engineering cost, reduces system change and avoids risks.
The embodiment of the invention provides a network resource allocation method, which comprises the following steps:
s1: establishing a network resource issuing service, wherein the network resource issuing service is used for continuously updating P network resource configuration groups through a system service interface and supporting updating and replacing of the network resource configuration groups;
s2: and configuring the currently used network resources according to the cold start resources and the network resource issuing service, wherein the cold start resources are a preset batch of preset network resources.
According to a network resource allocation method of an embodiment of the present invention, the S2 includes:
s21: acquiring an effective network resource allocation group from the network resource allocation groups in the network resource issuing service; if the acquisition fails, executing S22; if the acquisition is successful, executing S23;
s22: taking the cold start resource as an effective network resource allocation group;
s23: the validated network resource configuration group is saved as a valid network resource configuration group and configured as the currently used network resource.
According to an embodiment of the present invention, the obtaining an effective network resource allocation group from the network resource allocation groups in the network resource issuing service in S21 specifically includes:
s211: verifying one of the P network resource allocation groups, and if verification fails, executing S212; if the verification is successful, executing S214;
s212: verifying any one of the other network resource allocation groups of the P network resource allocation groups; judging whether the verification is successful, if so, executing S213; if the verification is successful, executing S214;
s213: judging whether the verification of the P network resource allocation groups fails, if so, executing S215; if not, returning to the step S212;
s214: acquiring a valid network resource allocation group and determining that the acquisition is successful;
s215, determining acquisition failure.
According to an embodiment of the present invention, one network resource allocation group in S211 is selected from the valid network resource allocation groups obtained in S21 last time.
The network resource allocation method according to one embodiment of the present invention further comprises:
when the system operates, every other time interval T, the network resource issuing service is called, the network resource configuration group is updated once, and the currently used network resource is reconfigured.
The embodiment of the invention provides a network resource configuration device, which comprises a delivery service establishment module and a network optimization module, wherein:
the issuing service establishing module is used for establishing a network resource issuing service, wherein the network resource issuing service is used for continuously updating P network resource configuration groups through a system service interface and supporting updating and replacing of the network resource configuration groups;
the network optimization module is connected with the issuing service establishment module and is used for configuring the network resources currently used according to the cold starting resources and the network resource issuing service, wherein the cold starting resources are a preset batch of preset network resources.
According to the network resource allocation device of the embodiment of the invention, the network optimization module comprises an acquisition unit and a network allocation unit, wherein:
the acquiring unit is configured to acquire a valid network resource allocation group from the network resource allocation group in the cold start resource or the network resource issuing service;
the network configuration unit is connected with the acquisition unit and is used for saving the effective network resource configuration group as an effective network resource configuration group and configuring the effective network resource configuration group as the currently used network resource.
According to the network resource allocation device of the embodiment of the invention, the network optimization module comprises a network updating unit, wherein the network updating unit is used for calling the network resource issuing service every other time interval T when the system is running, updating the network resource allocation group once and reconfiguring the currently used network resource.
The embodiment of the invention provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the steps of the network resource allocation method when executing the program.
Embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the network resource allocation method.
According to the network resource configuration method and device, the electronic equipment and the readable storage medium, a batch of default network resources are preset to serve as cold starting resources, P latest effective network resource configuration groups are continuously updated by subsequent network resources through a system service interface, and currently used network resources are configured according to the cold starting resources and network resource issuing services, so that the network resources are changed in a flow, automation and systemization mode; the process of changing network resources does not need complex flow, but takes effect directly, saves engineering cost and reduces system change. When network resource change is normally needed, the network resource change is issued through system service, no influence is generated on users and systems, no cost is generated, the time and labor cost of several days to several weeks are reduced compared with the current scheme, and risks are avoided.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
A network resource allocation method according to an embodiment of the present invention is described below with reference to fig. 1, including:
the embodiment of the invention provides a network resource allocation method, which comprises the following steps:
s1: establishing a network resource issuing service, wherein the network resource issuing service is used for continuously updating P network resource configuration groups through a system service interface and supporting updating and replacing of the network resource configuration groups;
in the S1, P network resource allocation groups are in practical consideration of network transmission speed and actual requirements, and generally P is 2-200; the subsequent network resource continuously updates the P latest valid network resource configuration groups through the system service interface.
S2: and configuring the currently used network resources according to the cold start resources and the network resource issuing service, wherein the cold start resources are a preset batch of preset network resources.
The preset network resources are generally selected from the best and most dominant lines, the most dominant high-quality domain names and the like as alternative cold start resources. In theory, when the failure probability of each network resource allocation group in the network resource issuing service is d, the probability that at least one network resource allocation group is still effective at the same time is 1-dρ, the failure probability d can approach 1 at maximum theoretically, and if 1 indicates that 100% of resources are failed, any mode cannot be recovered. The fault tolerance of the method can reach d=0.75 about considering network speed and user service guarantee, and even 75% of failures can still be detected. Even if the establishment of the network resource issuing service fails or the acquisition of all the network resource configuration groups in the issuing service fails, the network resources currently used can be continuously configured by adopting the cold start resources, so that the system can normally operate.
In the embodiment of the present disclosure, a batch of default network resources are preset as cold start resources, and P latest valid network resource configuration groups are continuously updated by subsequent network resources through a system service interface, so that currently used network resources are configured according to the cold start resources and network resource issuing services, and the network resources are changed in a flow, automation and systemization manner; the process of changing network resources does not need complex flow, but takes effect directly, saves engineering cost and reduces system change. When the network resource is normally required to be changed, the network resource is issued through the system service, so that no influence is generated on the user and the system, and no cost is generated. Reduces the time and labor cost of several days to several weeks compared with the current proposal, and avoids risks.
Further, the step S2 includes:
s21: acquiring an effective network resource allocation group from the network resource allocation groups in the network resource issuing service; if the acquisition fails, executing S22; if the acquisition is successful, S23 is executed.
In S21, for example, the connectivity service is tested by velocimetry, and it is checked whether or not connectivity is enabled. The acquisition failure refers to failure of the network resource allocation group per se, and is not connected; the successful acquisition means that the network resource allocation group is detected to pass and can be communicated. The test is to call the network resource allocation group by using other system services/mobile phone mobile application/mobile phone mobile terminal webpage application and the like as call parties of issuing services, if no problem exists, the next group is called until the network resource allocation group is called, if the detection fails, the effective network resource allocation group is saved as an effective network resource allocation group and is configured as a currently used network resource, if the P groups fail, the cold start resource is taken as the effective network resource allocation group.
S22: and taking the cold start resource as an effective network resource allocation group.
In S22, if the network resource is severely changed, and all P network resource allocation groups fail, the cold start resource is taken as the effective network resource allocation group.
S23: the validated network resource configuration group is saved as a valid network resource configuration group and configured as the currently used network resource.
In S23, the effective network resource allocation group is selected for updating the network resource allocation group.
More specifically, the step of obtaining an effective network resource allocation group from the network resource allocation groups in the network resource delivery service in S21 specifically includes:
s211: verifying one of the P network resource allocation groups, and if verification fails, executing S212; if the verification is successful, S214 is performed.
In S211, one network resource allocation group selects the effective network resource allocation group obtained in the last time through S21, and the last normal operation test is the last time effective without any problem, and each time S21 is executed, the effective network resource allocation group obtained in the last time through S21 starts, so that the program can be saved, because the effective probability of the effective network resource allocation group obtained in the last time is higher. The last valid set of valid network resource configurations is preferably used, and when failed, the next set of configurations is continued until successful. This effective configuration set is remembered at this time and configured as the currently used configuration set
S212: verifying any one of the other network resource allocation groups of the P network resource allocation groups; judging whether the verification is successful, if so, executing S213; if the verification is successful, S214 is performed.
And in S212, verifying any other network resource configuration group in the P network resource configuration groups, wherein the verification sequence is self-defined, any rule allocation can be adopted, logic writing is completed, in the process of executing S21 once, the network resource configuration groups verified each time, are different, if the verification fails all the time, the next network resource configuration group is selected all the time to continue verification until the verification is successful or the P network resource configuration groups are all verified.
S213: judging whether the verification of the P network resource allocation groups fails, if so, executing S215; if not, returning to the step S212.
In S213, if all of the P network resource allocation groups fail to verify, this indicates that acquisition fails. If there are more network resource allocation groups that are not authenticated, return to S212 to proceed with the next authentication.
S214: and acquiring the effective network resource allocation group and determining that the acquisition is successful.
In S214, if one of the P network resource allocation groups is successfully verified, the network resource allocation group that is successfully verified is taken as the effective network resource allocation group, and the acquisition success is determined, and the S21 circulation process is ended.
S215, determining acquisition failure.
In S215, if none of the P network resource allocation groups is successfully verified, that is, all of the verification fails, it is determined that the acquisition fails.
The network resource allocation method according to one embodiment of the present invention further comprises:
when the system operates, every other time interval T, the network resource issuing service is called, the network resource configuration group is updated once, and the currently used network resource is reconfigured.
According to d less than 1, it is impossible that all P network resource allocation groups fail, even when the network resources are severely changed, so that all P network resource allocation groups fail, according to the configured time interval T, the system automatically resumes normal service operation after the average T/2 and the longest T time.
Specifically, the following various scenes are possible, scene 1: if the network resources are all disabled at the 2/3T position, the network resources at the T position are updated, and the operation of the 1/3T system is recovered in time; scene 2: if the network resources are all disabled at 1/3T, the network resources at T are updated, and the operation of the time-consuming 2/3T system is recovered; scene 3: in the extreme case, at point 0, all network resources fail, at T, network resources are updated, and time-consuming T system operation resumes. When the network resource is abnormally invalid, the normal service operation is automatically restored after the longest T time according to the configuration at the average T/2. And the devil fruits and user losses of the system paralysis are avoided.
As shown in fig. 2, the embodiment of the present invention further provides a network resource configuration device, which includes a service establishment module 10 and a network optimization module 20, where:
the service establishment module 10 is configured to establish a network resource service, where the network resource service is configured to continuously update P network resource configuration groups through a system service interface, and support updating and replacing the network resource configuration groups;
the network optimization module 20 is connected to the service establishment module 10, and is configured to configure a currently used network resource according to a cold start resource and a network resource issuing service, where the cold start resource is a preset batch of preset network resources.
The network optimization module 20 includes an acquisition unit, a network configuration unit, where:
the acquiring unit is configured to acquire a valid network resource allocation group from the network resource allocation group in the cold start resource or the network resource issuing service;
the network configuration unit is connected with the acquisition unit and is used for saving the effective network resource configuration group as an effective network resource configuration group and configuring the effective network resource configuration group as the currently used network resource.
The network optimization module 20 includes a network updating unit, where the network updating unit is configured to invoke the network resource issuing service every other time interval T when the system is running, perform a network resource configuration group update once, and reconfigure the currently used network resources.
The working principle of the network resource allocation device in the embodiment of the present invention is corresponding to the network resource allocation method in the above embodiment, and will not be described in detail here.
Fig. 3 illustrates a physical schematic diagram of an electronic device, which may include: processor 810, communication interface (Communications Interface) 820, memory 830, and communication bus 840, wherein processor 810, communication interface 820, memory 830 accomplish communication with each other through communication bus 840. Processor 810 may invoke logic instructions in memory 830 to perform a network resource configuration method comprising:
s1: presetting a batch of preset network resources as cold start resources;
s2: establishing a network resource issuing service, wherein the network resource issuing service is used for continuously updating P network resource configuration groups through a system service interface and supporting updating and replacing of the network resource configuration groups;
s2: and configuring the currently used network resources according to the cold start resources and the network resource issuing service.
Further, the logic instructions in the memory 830 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present invention further provide a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform a network resource allocation method provided by the above-described method embodiments, the method comprising:
s1: presetting a batch of preset network resources as cold start resources;
s2: establishing a network resource issuing service, wherein the network resource issuing service is used for continuously updating P network resource configuration groups through a system service interface and supporting updating and replacing of the network resource configuration groups;
s2: and configuring the currently used network resources according to the cold start resources and the network resource issuing service.
In yet another aspect, embodiments of the present invention further provide a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor, is implemented to perform a network resource allocation method provided by the above embodiments, the method comprising:
s1: presetting a batch of preset network resources as cold start resources;
s2: establishing a network resource issuing service, wherein the network resource issuing service is used for continuously updating P network resource configuration groups through a system service interface and supporting updating and replacing of the network resource configuration groups;
s2: and configuring the currently used network resources according to the cold start resources and the network resource issuing service.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.