WO2020259533A1 - 网关配置更新方法、装置和电子设备 - Google Patents

网关配置更新方法、装置和电子设备 Download PDF

Info

Publication number
WO2020259533A1
WO2020259533A1 PCT/CN2020/097912 CN2020097912W WO2020259533A1 WO 2020259533 A1 WO2020259533 A1 WO 2020259533A1 CN 2020097912 W CN2020097912 W CN 2020097912W WO 2020259533 A1 WO2020259533 A1 WO 2020259533A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration
service
configuration data
updated
file
Prior art date
Application number
PCT/CN2020/097912
Other languages
English (en)
French (fr)
Inventor
李澍桐
Original Assignee
北京金山云网络技术有限公司
北京金山云科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京金山云网络技术有限公司, 北京金山云科技有限公司 filed Critical 北京金山云网络技术有限公司
Publication of WO2020259533A1 publication Critical patent/WO2020259533A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality

Definitions

  • This application relates to the field of information technology, in particular to a gateway configuration update method, device and electronic equipment.
  • the gateway When cloud computing users deploy services, they need to update the gateway configuration in the cloud network architecture through the cloud computing management terminal.
  • Most of the related technologies use full configuration files to update the gateway configuration. Specifically, after the gateway receives the full configuration file, it analyzes the full configuration file, checks the validity, and compares it with the original configuration file in the gateway, and then updates the gateway configuration. Due to the large amount of data in the full configuration file, and in most cases, only part of the data in the full configuration file is different from the original configuration file, the amount of data redundancy is large, and the gateway configuration update consumes too much time.
  • the purpose of this application is to provide a gateway configuration update method, device and electronic equipment, so as to shorten the time consumption of the gateway configuration update, and thereby improve the update efficiency of the gateway configuration.
  • the present application provides a gateway configuration update method, the method includes: obtaining an update configuration file; wherein the update configuration file contains service configuration data; and comparing the update configuration file with the pre-stored original configuration File to obtain the comparison result; determine the service configuration data that needs to be updated according to the comparison result; generate the configuration items to be updated according to the service configuration data that needs to be updated; update the configuration parameters of the gateway according to the configuration items to be updated.
  • this application provides a gateway configuration update device, the device includes: an acquisition module configured to obtain an updated configuration file; wherein the updated configuration file contains service configuration data; a comparison module configured to compare the updated configuration file with Store the original configuration file to obtain the comparison result; determine the module, set to determine the business configuration data that needs to be updated based on the comparison result; generate the module, set to update the business configuration data that needs to be updated, generate the configuration items to be updated; update the module, set To update the configuration parameters of the gateway according to the configuration items to be updated.
  • the present application provides an electronic device including a processor and a memory.
  • the memory stores machine-executable instructions that can be executed by the processor.
  • the processor executes the machine-executable instructions to implement the first aspect and the first aspect. Any one of the gateway configuration update methods.
  • the present application provides a machine-readable storage medium that stores machine-executable instructions.
  • the machine-executable instructions When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor.
  • the first aspect and the gateway configuration update method described in any one of the first aspect are implemented.
  • the gateway configuration update method, device and electronic device provided in this application after obtaining the updated configuration file, first compare the updated configuration file with the pre-stored original configuration file to obtain a comparison result; determine the service configuration data that needs to be updated according to the comparison result ; Based on the service configuration data that needs to be updated, the configuration items to be updated are generated; finally, the configuration parameters of the gateway are updated according to the configuration items to be updated.
  • This method obtains the service configuration data that needs to be updated by comparing the updated configuration file with the original configuration file. Therefore, the service data that does not need to be updated is removed from the updated configuration file, and the subsequent gateway configuration update process is performed based only on the service configuration data that needs to be updated. This process reduces the data redundancy in the gateway configuration process, thereby shortening the time-consuming update of the gateway configuration, thereby improving the update efficiency of the gateway configuration.
  • FIG. 1 is a schematic diagram of a cloud network architecture provided by an embodiment of this application.
  • FIG. 2 is a flowchart of a method for updating a gateway configuration provided by an embodiment of the application
  • FIG. 3 is a flowchart of another gateway configuration update method provided by an embodiment of the application.
  • FIG. 4 is a schematic diagram of a specific implementation process of determining service configuration data that needs to be updated according to an embodiment of the application
  • FIG. 5 is a flowchart of another gateway configuration update method provided by an embodiment of the application.
  • FIG. 6 is a flowchart of another gateway configuration update method provided by an embodiment of the application.
  • FIG. 7 is a schematic diagram of a process of generating an incremental configuration file provided by an embodiment of the application.
  • FIG. 8 is a schematic structural diagram of a gateway configuration updating apparatus provided by an embodiment of the application.
  • FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the application.
  • cloud computing vendors In the current development of cloud computing technology, large cloud computing vendors rely on distributed gateway clusters to build cloud network architectures based on data centers; this cloud network architecture can provide internal or external services such as elastic computing, virtualization, traffic engineering, network security, Services such as network monitoring.
  • Cloud computing vendors use high-performance servers to deploy self-developed network function software, which is deployed in clusters on various gateway devices in the data center, such as Load Balancing (LB) gateways, Network Address Translation, NAT) gateway, Serving Gateway (SGW), dedicated line gateway and other gateway devices; among them, the serving gateway can be used for traffic rate limiting, traffic accounting, etc.; the working behavior of these gateway devices completely depends on configuration.
  • LB Load Balancing
  • NAT Network Address Translation
  • SGW Serving Gateway
  • the serving gateway can be used for traffic rate limiting, traffic accounting, etc.; the working behavior of these gateway devices completely depends on configuration.
  • the cloud computing management terminal uses the full configuration file to issue configuration changes. The entire configuration update process needs to parse, check,
  • the network architecture includes a management server, which is usually connected to multiple gateway devices; the management server is installed with a management terminal; and a gateway
  • the gateway client and gateway software are installed on the device.
  • the gateway client is used to manage the configuration in the gateway software; the gateway software is a program that performs the gateway function.
  • the process of gateway configuration update is the process of updating related parameters in the gateway software.
  • the management terminal of the management server communicates with the gateway client in the gateway device, and the gateway client communicates with the gateway software in the same gateway device. That is, the gateway client and gateway software in each gateway device have a one-to-one correspondence.
  • the gateway client in the gateway device needs to update the gateway software configuration.
  • the update process includes: parsing the configuration file format, checking the legitimacy of the parsed configuration file, reading the parsed configuration file into the memory and comparing it with the original configuration file saved in the memory to obtain two configurations File differences, and then calculate the configuration items based on the differences.
  • the configuration items usually include the configuration items that need to be added, the configuration items that need to be deleted, and the configuration items that need to be modified. Then the parameters in the gateway software are updated according to the configuration items. .
  • the above configuration file includes the configuration data of all the services involved in the gateway, and the amount of data itself is relatively large.
  • the configuration data of all services in the configuration file is formatted (ie full analysis), the configuration data of all services in the configuration file is checked for legality (ie full check), and the configuration data of all services in the configuration file is stored in the memory
  • the configuration data of all services in the saved original configuration file is compared (that is, full comparison) to calculate the configuration items and complete the gateway configuration update. It can be seen that, in the process of parsing, checking, and comparing in the existing method, the entire configuration file is performed, and the configuration file itself has a large amount of data, which causes the entire gateway configuration update process to consume too much time.
  • the embodiments of the present application first provide a gateway configuration update method, device, and electronic device.
  • This technology can be applied to the gateway management process of various networks, especially cloud computing, gateway device management and configuration update in cloud network architectures. in.
  • the method can be applied to a gateway device; the method includes:
  • Step S202 Obtain an update configuration file; wherein, the update configuration file contains service configuration data.
  • the update configuration file may be issued by the management server; the update configuration file may contain multiple service configuration data, and each service configuration data corresponds to one service.
  • the management server of the cloud network When the cloud network where the gateway device is located needs to update services, the management server of the cloud network generates the aforementioned update configuration file according to the actual business requirements of the user or tenant, and then delivers the update configuration file to the relevant gateway device.
  • the updated configuration file usually contains configuration data of all services related to the gateway device, and these service configuration data can be divided based on service types.
  • the service type can be load balancing service, Elastic Internet Protocol (EIP) service, firewall isolation service, virtual network interworking service, etc.
  • EIP Elastic Internet Protocol
  • Step S204 Compare the updated configuration file with the pre-stored original configuration file to obtain a comparison result.
  • Step S206 Determine the service configuration data that needs to be updated according to the comparison result.
  • the foregoing pre-stored original configuration file can be understood as the configuration file after the previous gateway configuration update is completed, that is, the configuration file being executed by the gateway.
  • the original configuration file may be stored in the gateway device, for example, stored in the memory of the gateway client in the gateway device.
  • the updated configuration file can be compared with the original configuration file through a preset comparison algorithm or file comparison algorithm, etc., so as to obtain different content between the two, and the different content is the service configuration data that needs to be updated.
  • the updated configuration file received by the gateway device is usually a full configuration file, that is, the updated configuration file contains all configuration data related to the gateway device; however, the difference from related technologies is
  • the gateway device After the gateway device receives the updated configuration file, it will compare the updated configuration file with the original configuration file to obtain the service configuration data that needs to be updated, and then perform the subsequent configuration update process based on the service configuration data that needs to be updated.
  • the updated configuration file only participates in the comparison process with the original configuration file, and the service configuration data that needs to be updated participates in the process of generating configuration items and updating the gateway configuration in the subsequent steps. This process can reduce the time-consuming process of a large number of redundant data and more parameters.
  • Step S208 Generate configuration items to be updated according to the service configuration data to be updated.
  • the service configuration data is usually divided based on the type of service, and the service configuration data contains configuration data that can realize various services.
  • the configuration items in this step are usually related to the functions of the gateway itself, and the configuration items are closer to the underlying functions of the gateway.
  • the configuration items usually include a subnet mask, domain name, address, device name, etc.
  • a fixed conversion rule is usually set between business configuration data and configuration items. Based on the conversion rule, the configuration items to be updated can be generated according to the business configuration data that needs to be updated.
  • Step S210 Update the configuration parameters of the gateway according to the configuration items to be updated.
  • the gateway client in the gateway device can push the above configuration items to be updated to the gateway software.
  • the gateway software updates the configuration parameters in the gateway software based on the configuration items to be updated to complete the gateway configuration. Update process. After the gateway software update is completed, the update result can be sent to the gateway client, and the gateway client can also feed back the update result to the management terminal in the management server.
  • a gateway configuration update method provided by an embodiment of the present application, after obtaining an updated configuration file, first compare the updated configuration file with a pre-stored original configuration file to obtain a comparison result; determine the service configuration data that needs to be updated according to the comparison result; Based on the service configuration data that needs to be updated, the configuration items to be updated are generated; finally, the configuration parameters of the gateway are updated according to the configuration items to be updated.
  • This method obtains the service configuration data that needs to be updated by comparing the updated configuration file with the original configuration file. Therefore, the service data that does not need to be updated is removed from the updated configuration file, and the subsequent gateway configuration update process is performed based only on the service configuration data that needs to be updated. This process reduces the data redundancy in the gateway configuration process, thereby shortening the time-consuming update of the gateway configuration, thereby improving the update efficiency of the gateway configuration.
  • the embodiment of the present application also provides another gateway configuration update method, which is implemented on the basis of the method described in the above embodiment; the method focuses on comparing the updated configuration file with the pre-stored original configuration file, and it is determined according to the comparison result that it needs to be updated
  • Step S302 Receive an update configuration file issued by the management server; wherein, the update configuration file contains service configuration data.
  • Step S304 Compare the service identifier of the service configuration data contained in the updated configuration file and the original configuration file to obtain the operation identifier of each service configuration data; where the operation identifier is used to mark whether the service configuration data is the service configuration data that needs to be updated .
  • the updated configuration file usually contains the service configuration data of all services related to the gateway device. These service configuration data can be divided based on the type of service; the service configuration data in the original configuration file can also be performed based on the type of service. Divide. In order to distinguish the business configuration data of various business types, different business identification numbers can be assigned to the business configuration data of different business types, and the business identification and the business type have a one-to-one correspondence. In actual implementation, you can mark the original configuration file as conf_old and the updated configuration file as conf_new.
  • the business identifier in it can be in the form of "ID+number” for convenience, such as "ID1" "ID2"
  • the service identifier can be a globally unique and complex long character string generated by algorithms such as md5, such as "eebf27f2-2205-435b-8e4d-0f7f7067b8ac”.
  • the following table 1 shows an example of an updated configuration file or original configuration file; both the updated configuration file and the original configuration file belong to the full configuration file, that is, the updated configuration file contains all the related equipment related to the gateway device.
  • Configuration data according to the business identification, the business configuration data in the file can be split into several text blocks, and the different text blocks are completely independent and the business identification is unique;
  • Table 1 takes three types of business types in the file as an example, respectively The corresponding service IDs are ID1, ID2, and ID3, and the content in the text block under each service ID is the service configuration data of the service type corresponding to the service ID.
  • step S304 can also be implemented in the following ways (1)-(4):
  • the service configuration data with the same service identifier in the updated configuration file and the original configuration file and the service configuration data corresponding to the service identifier is marked as unchanged. If a certain service ID exists in both the updated configuration file and the original configuration file, and the service configuration data corresponding to the service ID is also the same in the two files, it means that in the gateway configuration update, the service ID corresponding to the service ID The types and corresponding business configuration data have not changed.
  • Step S306 Determine the business configuration data whose operation is marked as added as the business configuration data that needs to be added; the business configuration data whose operation is marked as deletion is determined as the business configuration data that needs to be deleted; and the operation is marked as modified business configuration data. It is the business configuration data that needs to be modified; the business configuration data whose operation is marked as unchanged is determined as no need to update the business configuration data.
  • the operation ID of the service configuration data corresponding to the service ID is increased, and the service configuration data corresponding to the service ID can be determined as the need to increase Business configuration data.
  • the operation ID of the service configuration data corresponding to the service ID is delete, and the service configuration data corresponding to the service ID can be determined as the service configuration that needs to be deleted data.
  • step S306 is further described below:
  • the first identifier is the service identifier of the service only included in the updated configuration file; the service configuration data corresponding to the first identifier is determined as the new service configuration data.
  • the first identifier refers to a service identifier that exists in the updated configuration file but does not exist in the original configuration file. It means that the service type corresponding to the service identifier and corresponding service configuration data are newly added in the gateway configuration update; At this time, a corresponding operation identifier can be added to the first identifier, for example, the operation identifier of the service configuration data corresponding to the first identifier is "add".
  • the second identifier refers to a service identifier that does not exist in the updated configuration file but exists in the original configuration file, indicating that the service type and corresponding service configuration data corresponding to the service identifier have been deleted during the gateway configuration update; in actual implementation A corresponding operation identifier can be added to the second identifier, for example, the operation identifier of the service configuration data corresponding to the second identifier is "delete".
  • the third identifier is the service identifier of the service included in the original configuration file and the updated configuration file; compare the original configuration file and the updated configuration file, the same Three identify the corresponding business configuration data; determine the business configuration data that needs to be modified according to the configuration data comparison result.
  • the third identifier refers to the service identifier that exists in both the updated configuration file and the original configuration file. If the service configuration data corresponding to the service identifier is the same, it means that in this gateway configuration update, the service type corresponding to the service identifier and the corresponding If the service configuration data does not change, the operation ID of the service configuration data corresponding to the service ID is “no change”; if the service configuration data corresponding to the service ID is different, it means that in this gateway configuration update, the service ID corresponding to the service ID When the service configuration data of the service category changes, the operation ID of the service configuration data corresponding to the service ID is "modify".
  • Step S308 Generate configuration items to be updated according to the service configuration data to be updated.
  • Step S310 Update the configuration parameters of the gateway according to the configuration items to be updated.
  • each item can be obtained
  • the operation identifier of the service configuration data is based on the operation identifier to determine the service configuration data that needs to be updated; based on the service configuration data that needs to be updated, the configuration item to be updated is generated; finally, the gateway configuration is updated according to the configuration item to be updated.
  • This method compares the updated configuration file with the original configuration file based on the business identification, and determines the business configuration data that needs to be updated by adding the operation identification, so the business data that does not need to be updated is removed from the updated configuration file, and only based on the business configuration that needs to be updated
  • the data undergoes a subsequent gateway configuration update process, which reduces data redundancy in the gateway configuration process, thereby shortening the time-consuming update of the gateway configuration, and thereby improving the update efficiency of the gateway configuration.
  • the embodiment of the present application also provides another gateway configuration update method, which is implemented on the basis of the method described in the above embodiment; the method focuses on another way of comparing the updated configuration file with the original configuration file stored in advance, namely The updated configuration file is compared with the original configuration file based on a preset text comparison method.
  • the updated configuration file and the original configuration file can be divided into multiple text blocks, and the service configuration data that needs to be updated can be determined by comparing the divided text blocks.
  • the service configuration data is used as a splitting unit to split the updated configuration file to obtain the first set of text blocks;
  • the business configuration data is that the splitting unit splits the original configuration file to obtain a second text block set; then, each text block in the first text block set and the second text block set is compared.
  • the first text block set may also be referred to as an updated configuration text block set
  • the second text block set may also be referred to as an original configuration text block set.
  • each service configuration data contains a service identifier. Therefore, each text block in the above-mentioned first text block set and the above-mentioned second text block set corresponds to a service identifier, which can be carried in the corresponding In the text block. Therefore, when comparing each text block in the first text block set and the second text block set, the service identification corresponding to the text block can also be compared to obtain the operation identification of each service configuration data.
  • the business identification of each text block in the first text block set and the second text block set can be compared, and the business configuration data corresponding to the business identification contained only in the first text block set can be marked as increased; Only the service configuration data corresponding to the service identifier contained in the second text block set is marked as deleted; the service configuration data that has the same service identifier in the first text block set and the second text block set and the text block where the service identifier is located is marked as deleted To modify; mark the service configuration data in the first text block set and the second text block set with the same service identifier and the same text block where the service identifier is located as no change.
  • the service configuration data corresponding to each service ID in the original configuration file and the updated configuration file can be extracted according to the service ID.
  • Each service ID corresponds to a text block to generate the original configuration text block set (equivalent to the above-mentioned first The second text block set) and the updated configuration text block set (equivalent to the above-mentioned first text block set), each text block in the updated configuration text block set is compared with each text block in the original configuration text block set.
  • the original configuration text block collection can be marked as set_old, and the updated configuration text block collection can be marked as set_new.
  • Figure 4 shows the specific implementation process of determining the service configuration data that needs to be updated; the process uses the service configuration data corresponding to each service identifier as the granularity, and the identified operation identifiers of various identifiers include "add” and “delete”. ""Modification” and "No change”.
  • the original configuration text block set includes ID1, ID3, ID4, ID5, and ID6, and the updated configuration text block set includes ID2, ID3, ID4, ID5, and ID6;
  • the operation of ID1 can be determined through the above comparison process of service identification
  • the identifier is "delete”
  • the operation identifier of ID2 is “add”
  • the operation identifier of ID3 is “modify”
  • the operation identifiers of ID4, ID5, and ID6 are "no change".
  • the method includes the following steps:
  • Step S502 According to a preset sorting rule, the character strings in the two text blocks with the same service identifier are sorted respectively.
  • Step S504 According to the sorting result of the character strings, compare the two text blocks with the same service identifier one by one to see if there are different character strings.
  • the two text blocks are the same, continue to compare the second string in the two text blocks, and so on, if the k-th string in the two text blocks is the same, continue Compare the k+1th character string in the two text blocks, and if the kth character string in the two text blocks is different, you can determine that the two text blocks are not the same; if from the first string to the last If the character strings are the same, it can be determined that the two text blocks are the same, where k is an integer greater than or equal to 1.
  • the service configuration data corresponding to the two text blocks are marked as "no change", that is, there is no need to modify the business configuration data.
  • the service configuration data corresponding to the two text blocks will be changed.
  • the operation identification is marked as "modification”, which is determined as the business configuration data that needs to be modified.
  • the business identification that needs to be modified can be extracted from the business identification that is repeated in the updated configuration file and the original configuration file, and the business data that does not need to be updated is eliminated, and the subsequent gateway is performed based on the business configuration data that needs to be updated
  • the configuration update process reduces the data redundancy in the gateway configuration process, thereby shortening the time-consuming update of the gateway configuration, and thereby improving the update efficiency of the gateway configuration.
  • the embodiment of the present application also provides another more specific gateway configuration update method, which is implemented on the basis of the method described in the above embodiment; the method focuses on describing the service configuration data that needs to be updated and generating configuration items to be updated.
  • the specific implementation process, and the specific implementation process of updating the gateway configuration according to the configuration items to be updated, as shown in Figure 6, the method includes the following steps:
  • Step S602 Obtain an update configuration file; wherein, the update configuration file contains service configuration data.
  • Step S604 Compare the service identification of the service configuration data contained in the updated configuration file and the pre-stored original configuration file.
  • Step S606 Determine the service configuration data that needs to be updated according to the comparison result of the service identifiers.
  • step S608 format analysis is performed on the service configuration data that needs to be updated.
  • the format analysis can be understood as converting the current format of the business configuration data that needs to be updated into a program-recognizable format for subsequent storage, transmission, and processing.
  • the format analysis process can also be achieved through the deserialization process.
  • the configuration data is deserialized to obtain business configuration data in a format that can be recognized by the program.
  • the service configuration data that needs to be updated can be divided into the original configuration difference file and the updated configuration difference file.
  • the gateway client can change the original configuration difference file and the service configuration data in the updated configuration difference file.
  • the current text format is converted into a program-recognizable format for subsequent data processing.
  • Step S610 Check whether each service configuration data in the service configuration data that needs to be updated after the format analysis is legal.
  • This step can also be understood as checking the legality of the service configuration data.
  • the service configuration data that needs to be updated after format analysis can be checked item by item to confirm whether it contains illegal service configuration data.
  • illegal business configuration data may be generated due to an error in some intermediate link (may be the console, management end, etc.). If the gateway client does not check, the illegal business configuration may be Sending data to the gateway software may cause the gateway software to malfunction. Therefore, the gateway client needs to check the service configuration data item by item after parsing the service configuration data.
  • the gateway client separately checks the business configuration data in the original configuration differentiation file after format analysis and the updated configuration differentiation file item by item to confirm their legitimacy.
  • Step S612 if each service configuration data is legal, an incremental configuration file is generated based on the operation identifier of each service configuration data.
  • Step S614 Generate configuration items to be updated according to the service configuration data in the incremental configuration file.
  • the gateway client After confirming that the business configuration data in the original configuration difference file and the updated configuration difference file are legal in the above step S610, the gateway client adds the original configuration difference file and the updated configuration difference file according to the conversion rules in the foregoing embodiment
  • the business configuration data generates configuration items to be updated with text blocks as the smallest granularity.
  • the above-mentioned incremental configuration file includes the original configuration difference file and the updated configuration difference file;
  • the original configuration difference file includes the business configuration data whose operation is marked as deletion and modification, and the updated configuration difference file includes the operation mark as the addition and modification.
  • Business configuration data Then, based on the conversion rules between the service configuration data and the configuration items described in the foregoing embodiment, the configuration items to be updated are generated according to the service configuration data in the original configuration difference file and the updated configuration difference file.
  • the original configuration difference file and the updated configuration difference file can be generated locally, and the text block marked as "added” is written into the updated configuration difference file, such as ID2 above; Write the text block marked as "deleted” into the original configuration difference file, such as ID1; write the text block marked as "modified” into the original configuration difference file and the updated configuration difference file, such as ID3 above;
  • the text block marked as "no change" will not be processed, that is, it will not be written into the original configuration difference file and the updated configuration difference file.
  • the original configuration difference file can be marked as diff_old, and the updated configuration difference file can be marked as diff_new.
  • Step S616 Push the configuration items to be updated to the gateway software of the gateway device to update the gateway configuration through the gateway software.
  • the gateway client in the gateway device can push the above configuration items to be updated to the gateway software.
  • the gateway software modifies the configuration parameters in the gateway software based on the configuration items to be updated to complete the gateway configuration. Update process.
  • Step S618 Receive the configuration update result returned by the gateway software.
  • the update result can be sent to the gateway client, and the gateway client can also feed back the update result to the management terminal in the management server.
  • Another gateway configuration update method provided by the embodiment of the present application does not process the text block whose operation flag is "no change", so that the file level used for subsequent configuration logic input is greatly reduced.
  • the process of parsing, checking, comparing, and writing business configuration data to the gateway memory basically reuses the implementation code of the process in related technologies, and the original configuration difference file and the updated configuration difference file only contain the business configuration data that needs to be updated. Therefore, the file is very small, which can greatly shorten the processing delay, improve processing efficiency, and significantly improve data security.
  • gateway configuration update process in related technologies, including the following steps:
  • Step 1 Read the full configuration file issued by the management end of the management server into the memory of the gateway client, and generate the internal analysis format of the granularity according to the service identification number (abbreviated as ID) in the full configuration file;
  • Step 2 Check the validity of the entries in the full configuration file to prevent incorrect configuration items from being written
  • Step 3 Pull the existing full configuration files in the gateway software to the memory of the gateway client;
  • Step 4 The gateway client compares the full configuration file issued by the management end of the management server with the service configuration data in the existing full configuration file in the gateway software according to the ID, and calculates the ID with the smallest granularity Incremental configuration items, including configuration items that need to be added, configuration items that need to be deleted, and configuration items that need to be modified;
  • Step 5 The gateway client writes the incremental configuration items into the gateway software, and receives the configuration update result returned by the gateway software.
  • the existing gateway configuration update process mainly has the following problems: First, because each change is triggered by a single user, the amount of business configuration data that needs to be updated is extremely limited (usually only a few business identifiers are involved), and most business configuration data does not need to be updated. Update, so the above scheme has greater data redundancy in the configuration update process.
  • the configuration update process most of the business configuration data that has not changed are subjected to equivalent analysis, inspection, and comparison processing, which makes the gateway configuration update time longer;
  • the entire configuration file in the gateway software must be read for each update, which adds a certain degree of uncertainty and risk; in addition, because the configuration refresh process is completely dependent on the user's immediate operation on the console, the configuration refresh interval is uncertain and refreshed. The frequency is high, and there is a lot of randomness in random configuration refresh. If the gateway configuration returns too long, it will affect the next configuration and also affect other linkage mechanisms.
  • steps 1 to 4 in the above-mentioned existing gateway configuration update process are all processed for the full configuration file, which brings huge delay overhead and affects user experience; as the number of users and configurations increase in the future , The delay of the existing scheme based on full configuration refresh will be longer and longer.
  • the gateway configuration update time is measured on the basis of the number of 30,000 services (the more the number, the larger the configuration file), as shown in the table
  • the "LB (Load Balance)" in the table is the "ID text block” in the above embodiment
  • the "number of LB changes” is the "ID text block that needs to be updated” in the above embodiment "Based on practical experience, the "number of LB changes" during each gateway configuration update will basically not be greater than 10. From the data in Table 2, it can be seen that the gateway configuration update method provided in the above embodiment can significantly improve the gateway Configuration update time, reducing the gateway configuration update time from tens of seconds to within 2 seconds.
  • the incremental gateway configuration update method in the above embodiment will not be affected in any way.
  • the gateway cluster will pass the second The response speed within the level is fed back to the management end platform of the cloud network management server, so that the management end logic can be successfully completed, and the completion speed of the entire business connection can be greatly improved. This is ultimately reflected in the cloud network user's business in the console The deployment efficiency has been greatly improved.
  • its stability plays a decisive role in the cloud network. In this application, the original code logic is retained and reused to the greatest extent, and the intrusion to the original product is minimized, which is of great benefit to the rapid launch and stability of the product.
  • the device includes: an obtaining module 80, configured to obtain an updated configuration file; wherein the updated configuration file contains service configuration data; and a comparing module 81, configured to compare and update The configuration file and the pre-stored original configuration file are compared to obtain the comparison result; the determining module 82 is configured to determine the service configuration data that needs to be updated according to the comparison result; the generating module 83 is configured to generate the service configuration data to be updated according to the need to update Configuration items; the update module 84 is set to update the configuration parameters of the gateway according to the configuration items to be updated.
  • the above gateway configuration updating device after obtaining the updated configuration file, first compares the updated configuration file with the pre-stored original configuration file to obtain a comparison result; determines the service configuration data that needs to be updated according to the comparison result; based on the service configuration that needs to be updated According to the data, the configuration items to be updated are generated; finally, the configuration parameters of the gateway are updated according to the configuration items to be updated.
  • the device obtains the service configuration data that needs to be updated by comparing the updated configuration file with the original configuration file. Therefore, the service data that does not need to be updated is excluded from the updated configuration file, and the subsequent gateway configuration update process is performed based only on the service configuration data that needs to be updated. This process reduces the data redundancy in the gateway configuration process, thereby shortening the time-consuming update of the gateway configuration, thereby improving the update efficiency of the gateway configuration.
  • both the updated configuration file and the original configuration file contain multiple pieces of service configuration data, and each piece of service configuration data contains a service identifier.
  • the comparison module is set to compare the service identification of the service configuration data contained in the updated configuration file and the original configuration file to obtain the operation identification of each service configuration data; wherein the operation identification is set to mark whether the service configuration data is Configure data for the business that needs to be updated.
  • the comparison module is configured to: mark the service configuration data corresponding to the service identifier contained only in the updated configuration file as added; mark the service configuration data corresponding to the service identifier contained only in the original configuration file as deleted ; Mark the updated configuration file and the original configuration file with the same service ID and the corresponding service configuration data with different service configuration data as modified; mark the updated configuration file and the original configuration file with the same service ID and the service ID corresponding to the service Business configuration data with the same configuration data is marked as unchanged.
  • the determining module is configured to: determine the service configuration data that has been added as an operation to be added as service configuration data that needs to be added; determine that the service configuration data that is to be deleted as the service configuration data that needs to be deleted; The business configuration data that is identified as modified is determined to be the business configuration data that needs to be modified; the business configuration data that is identified as the operation is not changed is determined to be the business configuration data that does not need to be updated.
  • the comparison module is configured to compare the updated configuration file with the original configuration file based on a preset text comparison method.
  • the aforementioned preset text comparison method includes: splitting the updated configuration file with the business configuration data as the splitting unit to obtain the first set of text blocks; and splitting the original configuration file with the business configuration data as the splitting unit. Perform splitting to obtain the second text block set; compare each text block in the first text block set and the second text block set.
  • the comparison module is configured to: compare the service identifier of each text block in the first text block set and the second text block set; the determining unit is configured to: only be included in the first text block set
  • the service configuration data corresponding to the service identifiers in the set is marked as added; the service configuration data corresponding to the service identifiers contained only in the second text block set is marked as deleted; the service identifiers in the first text block set and the second text block set are marked as deleted
  • the comparison module is further configured to determine whether two text blocks with the same business identifier in the first text block set and the second text block set are the same by the following method: if two text blocks with the same business identifier exist If the character strings are not the same, it is determined that the two text blocks with the same service ID are not the same; if the character strings in the two text blocks with the same service ID are exactly the same, it is determined that the two text blocks with the same service ID are the same.
  • the generation module is configured to: generate an incremental configuration file based on the operation identification of each service configuration data; generate configuration items to be updated based on the service configuration data in the incremental configuration file.
  • the incremental configuration file includes an original configuration difference file and an updated configuration difference file; wherein, the original configuration difference file includes business configuration data whose operation identifiers are deletion and modification, and the updated configuration difference file includes operation identifiers. To add and modify business configuration data.
  • the device further includes: a parsing module configured to format the service configuration data that needs to be updated; and a checking module configured to check whether each service configuration data in the service configuration data that needs to be updated after format analysis Legal; the generating module is set to generate configuration items to be updated based on the service configuration data that needs to be updated after format analysis if each service configuration data is legal.
  • the update module is further configured to: push the configuration items to be updated to the gateway software of the gateway device; and receive the configuration update result returned by the gateway software.
  • gateway configuration update device provided by the embodiments of this application are the same as those in the foregoing embodiment of the gateway configuration update method.
  • the parts not mentioned in the embodiment of the gateway configuration update device please refer to the foregoing Corresponding content in the embodiment of the gateway configuration update method.
  • An embodiment of the present application also provides an electronic device.
  • the electronic device includes a processor 90 and a memory 91.
  • the memory 91 stores machine executable instructions that can be executed by the processor 90.
  • the machine executable instructions are executed to implement the above gateway configuration update method.
  • the electronic device shown in FIG. 9 further includes a bus 92 and a communication interface 93, and the processor 90, the communication interface 93 and the memory 91 are connected by the bus 92.
  • the memory 91 may include a high-speed random access memory (RAM, Random Access Memory), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
  • RAM Random Access Memory
  • non-volatile memory such as at least one disk memory.
  • the communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 93 (which may be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. may be used.
  • the bus 92 may be an ISA bus, PCI bus, EISA bus, or the like. The bus can be divided into address bus, data bus, control bus, etc. For ease of presentation, only one bidirectional arrow is used in FIG. 9, but it does not mean that there is only one bus or one type of bus.
  • the processor 90 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the foregoing method can be completed by an integrated logic circuit of hardware in the processor 90 or instructions in the form of software.
  • the aforementioned processor 90 may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP), etc.; it may also be a digital signal processor (Digital Signal Processor, DSP for short). ), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • CPU Central Processing Unit
  • NP Network Processor
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers.
  • the storage medium is located in the memory 91, and the processor 90 reads the information in the memory 91, and completes the steps of the method of the foregoing embodiment in combination with its hardware.
  • the electronic device provided in the embodiment of the present application may be, for example, the management server mentioned in the above embodiment.
  • the embodiment of the present application also provides a machine-readable storage medium that stores machine-executable instructions.
  • the machine-executable instructions When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor.
  • the foregoing gateway configuration update method is implemented. For specific implementation, please refer to the method embodiment, which will not be repeated here.
  • the gateway configuration update method and device provided by the embodiments of the application and the computer program product of the electronic device include a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the instructions described in the previous method embodiments
  • the instructions included in the program code can be used to execute the instructions described in the previous method embodiments
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the computer software product is stored in a storage medium, including several
  • the instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请提供了一种网关配置更新方法、装置和电子设备,涉及信息技术领域。网关配置更新方法包括:获取到更新配置文件后,首先比较该更新配置文件和预先存储的原始配置文件,得到比较结果;然后根据该比较结果确定需要更新的业务配置数据;之后基于该需要更新的业务配置数据,生成待更新的配置项;最后根据该待更新的配置项更新网关的配置参数。该方法通过比较更新配置文件和原始配置文件,得到需要更新的业务配置数据,因而从更新配置文件中剔除了无需更新的业务数据,仅基于该需要更新的业务配置数据进行后续的网关配置更新流程,该过程减少了网关配置过程中的数据冗余,从而缩短了网关配置更新的耗时,进而提高了网关配置的更新效率。

Description

网关配置更新方法、装置和电子设备
本申请要求于2019年6月28日提交中国专利局、申请号为201910583491.X、申请名称为“网关配置更新方法、装置和服务器”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息技术领域,尤其是涉及一种网关配置更新方法、装置和电子设备。
背景技术
云计算用户在部署业务时,需要通过云计算管理端更新云网络架构中的网关配置。相关技术中,大多采用全量配置文件更新网关配置。具体为:网关接收到全量配置文件后,对该全量配置文件进行解析、合法性检查,并与网关中的原始配置文件进行比较后,更新网关配置。由于全量配置文件数据量较大,且在大多情况下,该全量配置文件中仅有部分数据与原始配置文件不同,数据冗余量较大,导致网关配置更新消耗时间过长。
发明内容
本申请的目的在于提供一种网关配置更新方法、装置和电子设备,以缩短网关配置更新的耗时,进而提高网关配置的更新效率。
第一方面,本申请提供了一种网关配置更新方法,所述方法包括:获取更新配置文件;其中,所述更新配置文件中包含业务配置数据;比较所述更新配置文件和预先存储的原始配置文件,得到比较结果;根据所述比较结果确定需要更新的业务配置数据;根据所述需要更新的业务配置数据,生成待更新的配置项;根据所述待更新的配置项更新网关的配置参数。
第二方面,本申请提供了一种网关配置更新装置,装置包括:获取模块,设置为获取更新配置文件;其中,更新配置文件中包含业务配置数据;比较模块,设置为比较更新配置文件和预先存储的原始配置文件,得到比较结果;确定模块,设置为根据比较结果确定需要更新的业务配置数据;生成模块,设置为根据需要更新的业务配置数据,生成待更新的配置项;更新模块,设置为根据待更新的配置项更新网关的配置参数。
第三方面,本申请提供了一种电子设备,包括处理器和存储器,存储器存储有能够被处理器执行的机器可执行指令,处理器执行机器可执行指令以实现上述第一方面以及第一方面任意一项所述的网关配置更新方法。
第四方面,本申请提供了一种机器可读存储介质,该机器可读存储介质存储有机器 可执行指令,该机器可执行指令在被处理器调用和执行时,机器可执行指令促使处理器实现上述第一方面以及第一方面任意一项所述的网关配置更新方法。
本申请提供的网关配置更新方法、装置和电子设备,获取到更新配置文件后,首先比较该更新配置文件和预先存储的原始配置文件,得到比较结果;根据该比较结果确定需要更新的业务配置数据;基于该需要更新的业务配置数据,生成待更新的配置项;最后根据该待更新的配置项更新网关的配置参数。该方法通过比较更新配置文件和原始配置文件,得到需要更新的业务配置数据,因而从更新配置文件中剔除了无需更新的业务数据,仅基于该需要更新的业务配置数据进行后续的网关配置更新流程,该过程减少了网关配置过程中的数据冗余,从而缩短了网关配置更新的耗时,进而提高了网关配置的更新效率。
本公开的其他特征和优点将在随后的说明书中阐述,或者,部分特征和优点可以从说明书推知或毫无疑义地确定,或者通过实施本公开的上述技术即可得知。
为使本申请的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。
附图说明
为了更清楚地说明本申请具体实施方式或相关技术中的技术方案,下面将对具体实施方式或相关技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种云网络架构的示意图;
图2为本申请实施例提供的一种网关配置更新方法的流程图;
图3为本申请实施例提供的另一种网关配置更新方法的流程图;
图4为本申请实施例提供的确定需要更新的业务配置数据的具体实现过程示意图;
图5为本申请实施例提供的另一种网关配置更新方法的流程图;
图6为本申请实施例提供的另一种网关配置更新方法的流程图;
图7为本申请实施例提供的增量配置文件的生成过程示意图;
图8为本申请实施例提供的一种网关配置更新装置的结构示意图;
图9为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将结合实施例对本申请的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请 保护的范围。
当前云计算技术发展过程中,大型云计算厂商依靠分布式网关集群方式构建基于数据中心的云网络架构;该云网络架构可以对内或对外提供如弹性计算、虚拟化、流量工程、网络安全、网络监控等服务。云计算厂商采用高性能服务器部署自研网络功能软件,该软件以集群方式部署在数据中心各类网关设备上,例如:负载均衡(Load Balancing,简称LB)网关、网络地址转换(Network Address Translation,简称NAT)网关、服务网关(Serving Gateway,简称SGW)、专线网关等网关设备;其中,服务网关可以用于流量限速、流量计费等;这些网关设备的工作行为完全依赖配置。然而,现有的网关配置方式中,云计算管理端采用全量配置文件下发变更配置,整个配置更新过程需要对全量配置文件进行解析、检查、比对等,配置更新消耗时间较长。
为了便于理解,首先描述一种应用场景,如图1所示为一种云网络架构;该网络架构包括管理服务器,该管理服务器通常连接有多个网关设备;管理服务器上安装有管理端;网关设备上安装有网关客户端和网关软件。网关客户端用于管理网关软件中的配置;网关软件为执行网关功能的程序。网关配置更新的过程即更新该网关软件中相关参数的过程。管理服务器的管理端与网关设备中的网关客户端通信连接,网关客户端与同一网关设备中的网关软件通信连接,即每台网关设备中的网关客户端与网关软件为一一对应关系。
现有网关配置方式中,管理服务器上的管理端将配置文件下发至网关设备后,需要由网关设备中的网关客户端对网关软件进行配置更新。更新过程包括:对配置文件进行格式解析,对解析后的配置文件进行合法性检查,将解析后的配置文件读取到内存中并与内存中保存的原始配置文件进行比对,得到两个配置文件的差异,进而根据差异计算出配置项,该配置项通常包括需要增加的配置项、需要删除的配置项、以及需要修改的配置项等;然后再根据配置项对网关软件中的参数进行更新。通常,上述配置文件包括该网关涉及的所有业务的配置数据,本身数据量较大,且对于一次网关配置更新,可能仅有部分业务的配置数据需要更新;但每次网关配置更新时,需要对配置文件中的所有业务的配置数据进行格式解析(即全量解析),对配置文件中的所有业务的配置数据进行合法性检查(即全量检查),将配置文件中所有业务的配置数据与内存中保存的原始配置文件中所有的业务的配置数据进行比对(即全量比对),才能计算出配置项进而完成网关配置更新。由此可知,现有方式在解析、检查和比对的过程中都是针对配置文件的全量进行,而配置文件本身数据量较大,导致网关配置更新整个过程消耗时间过长。
基于上述,本申请实施例首先提供一种网关配置更新方法、装置和电子设备,该技 术可以应用于各类网络的网关管理过程,尤其是云计算、云网络架构中的网关设备管理、配置更新中。
首先,参见图2所示的一种网关配置更新方法的流程图,该方法可以应用于网关设备;该方法包括:
步骤S202,获取更新配置文件;其中,该更新配置文件中包含业务配置数据。
该更新配置文件可以由管理服务器下发;该更新配置文件中可以包含多项业务配置数据,每项业务配置数据对应一项业务。当网关设备所在的云网络需要更新业务时,云网络的管理服务器根据用户或租户的实际业务需求生成上述更新配置文件,再向相关的网关设备下发该更新配置文件。该更新配置文件中通常包含与该网关设备相关的所有业务的配置数据,这些业务配置数据可以基于业务种类进行划分。该业务种类可以为负载均衡业务、弹性网络地址(Elastic Internet Protocol,简称EIP)业务、防火墙隔离业务、虚拟网络互通业务等。
步骤S204,比较更新配置文件和预先存储的原始配置文件,得到比较结果。
步骤S206,根据该比较结果确定需要更新的业务配置数据。
上述预先存储的原始配置文件可以理解为上一次网关配置更新完成后的配置文件,也即网关正在执行的配置文件。该原始配置文件可以保存在网关设备中,如保存在网关设备中网关客户端的内存中。在实际实现时,可以通过预设的比较算法或文件比对算法等方式,比较更新配置文件和原始配置文件,从而得到二者不同的内容,该不同的内容即需要更新的业务配置数据。
需要说明的是,本实施例中,网关设备接收到的更新配置文件通常也是全量配置文件,即该更新配置文件中包含有与该网关设备相关的所有的配置数据;但与相关技术不同的是,网关设备接收到更新配置文件后,即将更新配置文件和原始配置文件比对,得到需要更新的业务配置数据,再基于该需要更新的业务配置数据进行后续的配置更新过程。该过程中,更新配置文件仅参与与原始配置文件的比对过程,由需要更新的业务配置数据参与后续步骤中的生成配置项、更新网关配置的过程。该过程可以减少大量冗余数据参数较多的过程的耗时。
步骤S208,根据需要更新的业务配置数据,生成待更新的配置项。
由上述可知,业务配置数据通常基于业务的种类进行划分,业务配置数据中包含有能够实现各项业务的配置数据。而该步骤中的配置项,通常与网关本身的功能相关,该配置项更加接近于网关的底层功能,例如,该配置项通常包含子网掩码、域名、地址、设备名称等。业务配置数据与配置项之间通常设置有固定的转换规则,基于该转换规则,即可根据需要更新的业务配置数据生成待更新的配置项。
步骤S210,根据待更新的配置项更新网关的配置参数。
在实际实现时,网关设备中的网关客户端可以将上述待更新的配置项推送至网关软件中,该网关软件基于该待更新的配置项更新网关软件中的配置参数,即可完成网关配置的更新过程。网关软件更新完成后,可以向网关客户端发送更新结果,网关客户端也可以将该更新结果反馈至管理服务器中的管理端。
本申请实施例提供的一种网关配置更新方法,获取到更新配置文件后,首先比较该更新配置文件和预先存储的原始配置文件,得到比较结果;根据该比较结果确定需要更新的业务配置数据;基于该需要更新的业务配置数据,生成待更新的配置项;最后根据该待更新的配置项更新网关的配置参数。该方法通过比较更新配置文件和原始配置文件,得到需要更新的业务配置数据,因而从更新配置文件中剔除了无需更新的业务数据,仅基于该需要更新的业务配置数据进行后续的网关配置更新流程,该过程减少了网关配置过程中的数据冗余,从而缩短了网关配置更新的耗时,进而提高了网关配置的更新效率。
本申请实施例还提供另一种网关配置更新方法,该方法在上述实施例所述方法的基础上实现;该方法重点描述比较更新配置文件和预先存储的原始配置文件,根据比较结果确定需要更新的业务配置数据的具体实现过程,其中,更新配置文件和原始配置文件中均包含多项业务配置数据,每项业务配置数据包含一个业务标识。如图3所示,该方法包括如下步骤:
步骤S302,接收管理服务器下发的更新配置文件;其中,该更新配置文件中包含业务配置数据。
步骤S304,比较更新配置文件和原始配置文件中包含的业务配置数据的业务标识,得到每项业务配置数据的操作标识;其中,该操作标识用于标记业务配置数据是否为需要更新的业务配置数据。
由上述实施例可知,更新配置文件中通常包含与该网关设备相关的所有业务的业务配置数据,这些业务配置数据可以基于业务种类进行划分;原始配置文件中的业务配置数据同样可以基于业务种类进行划分。为了区分各类业务种类的业务配置数据,可以对不同业务种类的业务配置数据分配的不同的业务标识号,业务标识与业务种类为一一对应关系。在实际实现时,可以将上述原始配置文件标记为conf_old,上述更新配置文件标记为conf_new,其中的业务标识,在这里为方便说明,可以采用“ID+编号”的形式,如“ID1”“ID2”等,在实际实现时,业务标识可以采用md5等算法生成的全局唯一的复杂的较长字符串,如“eebf27f2-2205-435b-8e4d-0f7f7067b8ac”。
下述表1所示为一种更新配置文件或原始配置文件的示例;更新配置文件和原始配 置文件均属于全量配置文件,即包含有该更新配置文件中包含有与该网关设备相关的所有的配置数据;根据业务标识,可以将文件中的业务配置数据拆分为若干个文本块,不同文本块之间完全独立且业务标识唯一;表1中以文件中包含三类业务种类为例,分别对应的业务标识为ID1、ID2和ID3,每个业务标识下的文本块中的内容为该业务标识对应的业务种类的业务配置数据。
表1
ID1
ID1对应的业务种类的业务配置数据
ID2
ID2对应的业务种类的业务配置数据
ID3
ID3对应的业务种类的业务配置数据
上述步骤S304具体还可以通过下述方式(1)-(4)实现:
(1)将仅包含在更新配置文件中的业务标识对应的业务配置数据标记为增加;如果某业务标识对应的业务配置数据标记为增加,表示此次网关配置更新中新增了该业务标识对应的业务种类及相应的业务配置数据。
(2)将仅包含在原始配置文件中的业务标识对应的业务配置数据标记为删除;如果某业务标识对应的业务配置数据标记为删除,表示此次网关配置更新中删除了该业务标识对应的业务种类及相应的业务配置数据。
(3)将更新配置文件和原始配置文件中业务标识相同且业务标识所对应的业务配置数据不同的业务配置数据标记为修改;如果某业务标识同时存在于更新配置文件和原始配置文件中,但在两个文件中,该业务标识所对应的业务配置数据不同,表示在此次网关配置更新中,该业务标识对应的业务种类的业务配置数据发生了变化。
(4)将更新配置文件和原始配置文件中业务标识相同且业务标识所对应的业务配置数据相同的业务配置数据标记为无变更。如果某业务标识同时存在于更新配置文件和原始配置文件中,且在两个文件中,该业务标识所对应的业务配置数据也相同,表示在此次网关配置更新中,该业务标识对应的业务种类及相应的业务配置数据未发生变化。
步骤S306,将操作标识为增加的业务配置数据确定为需要新增的业务配置数据;将操作标识为删除的业务配置数据确定为需要删除的业务配置数据;将操作标识为修改 的业务配置数据确定为需要修改的业务配置数据;将操作标识为无变更的业务配置数据确定为不需要更新业务配置数据。
例如,如果某业务标识出现在更新配置文件中,而不在原始配置文件中,则该业务标识对应的业务配置数据的操作标识为增加,该业务标识对应的业务配置数据即可确定为需要增加的业务配置数据。如果某业务标识出现在原始配置文件中,而不在更新配置文件中,则该业务标识对应的业务配置数据的操作标识为删除,该业务标识对应的业务配置数据即可确定为需要删除的业务配置数据。
下面进一步描述步骤S306的另一种实现方式:
(1)从业务标识的比较结果中确定出第一标识;该第一标识为仅包含在更新配置文件中的业务的业务标识;将第一标识对应的业务配置数据确定为新增的业务配置数据。
第一标识是指在更新配置文件中存在但在原始配置文件中不存在的业务标识,表示此次网关配置更新中新增了该业务标识对应的业务种类及相应的业务配置数据;在实际实现时,可以为第一标识添加相应的操作标识,如第一标识对应的业务配置数据的操作标识为“增加”。
(2)从业务标识的比较结果中确定出第二标识;该第二标识为仅包含在原始配置文件中的业务的业务标识;将第二标识对应的业务配置数据确定为需要删除的业务配置数据。
第二标识是指在更新配置文件中不存在但在原始配置文件中存在的业务标识,表示此次网关配置更新中删除了该业务标识对应的业务种类及相应的业务配置数据;在实际实现时,可以为第二标识添加相应的操作标识,如第二标识对应的业务配置数据的操作标识为“删除”。
(3)从业务标识的比较结果中确定出第三标识;该第三标识为同时包含在原始配置文件和更新配置文件中的业务的业务标识;比较原始配置文件和更新配置文件中,同一第三标识对应的业务配置数据;根据配置数据比较结果确定需要修改的业务配置数据。
第三标识是指在更新配置文件和原始配置文件中都存在的业务标识,若该业务标识对应的业务配置数据相同,表示在此次网关配置更新中,该业务标识对应的业务种类及相应的业务配置数据未发生变化,则该业务标识对应的业务配置数据的操作标识为“无变更”;若该业务标识对应的业务配置数据不同,表示在此次网关配置更新中,该业务标识对应的业务种类的业务配置数据发生变化,则该业务标识对应的业务配置数据的操作标识为“修改”。
步骤S308,根据需要更新的业务配置数据,生成待更新的配置项。
步骤S310,根据待更新的配置项更新网关的配置参数。
上述方式中,网关设备中的网关客户端接收到管理服务器下发的更新配置文件后,通过比较该更新配置文件和预先存储的原始配置文件中包含的业务配置数据的业务标识,可以得到每项业务配置数据的操作标识,根基该操作标识确定需要更新的业务配置数据;基于该需要更新的业务配置数据,生成待更新的配置项;最后根据该待更新的配置项更新网关配置。该方法以业务标识为标准比较更新配置文件和原始配置文件,通过添加操作标识确定需要更新的业务配置数据,因而从更新配置文件中剔除了无需更新的业务数据,仅基于该需要更新的业务配置数据进行后续的网关配置更新流程,该过程减少了网关配置过程中的数据冗余,从而缩短了网关配置更新的耗时,进而提高了网关配置的更新效率。
本申请实施例还提供另一种网关配置更新方法,该方法在上述实施例所述方法的基础上实现;该方法重点描述另一种比较更新配置文件和预先存储的原始配置文件的方式,即基于预设的文本比较法比较所述更新配置文件和原始配置文件。通过该文本比较法,可以将更新配置文件和原始配置文件划分为多个文本块,通过比较划分出的文本块,确定出需要更新的业务配置数据。
上述基于预设的文本比较法比较所述更新配置文件和原始配置文件的过程,可以具体描述如下:以业务配置数据为拆分单元对更新配置文件进行拆分,得到第一文本块集合;以业务配置数据为拆分单元对原始配置文件进行拆分,得到第二文本块集合;然后再比较该第一文本块集合和该第二文本块集合中的每个文本块。其中,该第一文本块集合也可以称为更新配置文本块集合,第二文本块集合也可以称为原始配置文本块集合。
由前述实施例可知,每项业务配置数据包含一个业务标识,因此,上述第一文本块集合和上述第二文本块集合中的每个文本块均对应一个业务标识,该业务标识可以携带在相应的文本块中。因而在比较第一文本块集合和第二文本块集合中的每个文本块时,也可以比较文本块对应的业务标识,进而得到每项业务配置数据的操作标识。
具体而言,可以比较第一文本块集合和第二文本块集合中的每个文本块的业务标识,将仅包含在第一文本块集合中的业务标识对应的业务配置数据标记为增加;将仅包含在第二文本块集合中的业务标识对应的业务配置数据标记为删除;将第一文本块集合和第二文本块集合中业务标识相同且业务标识所在的文本块不同的业务配置数据标记为修改;将第一文本块集合和第二文本块集合中业务标识相同且业务标识所在的 文本块相同的业务配置数据标记为无变更。
在实际实现时,根据业务标识可以对原始配置文件和更新配置文件中的各个业务标识对应的业务配置数据进行提取,每个业务标识对应一个文本块,生成原始配置文本块集合(相当于上述第二文本块集合)和更新配置文本块集合(相当于上述第一文本块集合),将更新配置文本块集合中的各个文本块与原始配置文本块集合中的各个文本块进行比对。在实际实现时,可以将原始配置文本块集合标记为set_old,将更新配置文本块集合标记为set_new。
作为示例,图4示出了上述确定需要更新的业务配置数据的具体实现过程;该过程以各个业务标识对应的业务配置数据为粒度,识别出的各类标识的操作标识包括“增加”“删除”“修改”和“无变更”。图4中,原始配置文本块集合包括ID1、ID3、ID4、ID5和ID6,更新配置文本块集合包括ID2、ID3、ID4、ID5和ID6;通过上述对业务标识的比较过程,可以确定ID1的操作标识为“删除”,ID2的操作标识为“增加”,ID3的操作标识为“修改”,ID4、ID5和ID6的操作标识为“无变更”。
基于上述实施例,下面进一步描述确定第一文本块集合和第二文本块集合中业务标识相同的两个文本块是否相同的具体实现过程,如图5所示,该方法包括如下步骤:
步骤S502,按照预设的排序规则,分别对业务标识相同的两个文本块内的字符串进行排序。
例如,可以将文本块中的文本行按照字符串内首字母的排列顺序进行排列,如[a,ab,abc,b,ba,bc,c,…],也可以按照字符串的长短进行升序或降序的排列。
步骤S504,按照字符串的排序结果,逐个字符串比较业务标识相同的两个文本块中是否存在不相同的字符串。
如果业务标识相同的两个文本块中存在不相同的字符串,则确定业务标识相同的两个文本块不相同;如果业务标识相同的两个文本块中的字符串完全相同,则确定业务标识相同的两个文本块相同。
例如,如果两个文本块中的第1个字符串相同,则继续比较两个文本块中的第2个字符串,依次类推,如果两个文本块中的第k个字符串相同,则继续比较两个文本块中的第k+1个字符串,而如果两个文本块中的第k个字符串不同,则可以确定两个文本块不相同;如果从第一个字符串至最后一个字符串均相同,则可以确定两个文本块相同,其中,k为大于或等于1的整数。
如果两个文本块相同,表示在此次网关配置更新中,这两个文本块对应的业务标识的业务种类及相应的业务配置数据未发生变化,则将这两个文本块对应的业务配置数 据的操作标识标记为“无变更”,即不需要修改该业务配置数据。
如果两个文本块不同,表示在此次网关配置更新中,这两个文本块对应的业务标识的业务种类及相应的业务配置数据发生变化,则将这两个文本块对应的业务配置数据的操作标识标记为“修改”,确定为需要修改的业务配置数据。
通过上述方式,即可从更新配置文件和原始配置文件中相互重复的业务标识中提取出需要修改的业务标识,剔除了无需更新的业务数据,仅基于该需要更新的业务配置数据进行后续的网关配置更新流程,该过程减少了网关配置过程中的数据冗余,从而缩短了网关配置更新的耗时,进而提高了网关配置的更新效率。
本申请实施例还提供另一种更加具体的网关配置更新方法,该方法在上述实施例所述方法的基础上实现;该方法重点描述根据需要更新的业务配置数据,生成待更新的配置项的具体实现过程,以及根据待更新的配置项更新网关配置的具体实现过程,如图6所示,该方法包括如下步骤:
步骤S602,获取更新配置文件;其中,该更新配置文件中包含业务配置数据。
步骤S604,比较更新配置文件和预先存储的原始配置文件中包含的业务配置数据的业务标识。
步骤S606,根据业务标识的比较结果,确定需要更新的业务配置数据。
步骤S608,将需要更新的业务配置数据进行格式解析。
该格式解析可以理解为将需要更新的业务配置数据的当前格式转化为程序可识别格式,以便于后续的存储、传输和处理等,格式解析的过程也可以通过反序列化过程实现,通过对业务配置数据进行反序列化,得到程序可识别格式的业务配置数据。由上述实施例可知,需要更新的业务配置数据可以划分为原始配置差异化文件和更新配置差异化文件,网关客户端可以将该原始配置差异化文件和更新配置差异化文件中的业务配置数据由当前文本格式转化为程序可识别格式,以便后续对数据进行处理。
步骤S610,检查格式解析后的需要更新的业务配置数据中的每个业务配置数据是否合法。
该步骤也可以理解为对业务配置数据的合法性检查,具体而言,可以为对格式解析后的需要更新的业务配置数据进行逐条目检查,以确认其中是否包含非法的业务配置数据。在整个网关配置更新过程中,可能会由于中间某一环节错误(有可能是控制台、管理端等)生成了非法的业务配置数据,如果网关客户端不做检查就可能将该非法的业务配置数据下发到网关软件,可能会导致网关软件工作故障,所以网关客户端在解析业务配置数据后,需要对其进行逐条目检查。在实际实现时,网关客户端分别对格 式解析后的原始配置差异化文件和更新配置差异化文件中的业务配置数据进行逐条目检查,以确认其合法性。
步骤S612,如果每个业务配置数据均合法,基于每项业务配置数据的操作标识生成增量配置文件。
步骤S614,根据该增量配置文件中的业务配置数据生成待更新的配置项。
经上述步骤S610确认原始配置差异化文件和更新配置差异化文件中的业务配置数据均合法后,按照前述实施例中的转换规则,网关客户端将原始配置差异化文件和更新配置差异化文件中的业务配置数据生成以文本块为最小粒度的待更新的配置项。其中,上述增量配置文件包括原始配置差异化文件和更新配置差异化文件;原始配置差异化文件包括操作标识为删除和修改的业务配置数据,更新配置差异化文件包括操作标识为增加和修改的业务配置数据。然后基于上述实施例中所描述的业务配置数据与配置项之间的转换规则,根据上述原始配置差异化文件和更新配置差异化文件中的业务配置数据生成待更新的配置项。
如图7所示,在实际实现时,可以在本地生成原始配置差异化文件和更新配置差异化文件,将标记为“增加”的文本块写入更新配置差异化文件中,如上述ID2;将标记为“删除”的文本块写入原始配置差异化文件中,如上述ID1;将标记为“修改”的文本块分别写入原始配置差异化文件和更新配置差异化文件中,如上述ID3;标记为“无变更”的文本块不做处理,即不写入原始配置差异化文件和更新配置差异化文件中。在实际实现时,可以将原始配置差异化文件标记为diff_old,将更新配置差异化文件标记为diff_new。
步骤S616,将待更新的配置项推送至网关设备的网关软件,以通过网关软件更新网关配置。
在实际实现时,网关设备中的网关客户端可以将上述待更新的配置项推送至网关软件中,该网关软件基于该待更新的配置项修改网关软件中的配置参数,即可完成网关配置的更新过程。
步骤S618,接收网关软件返回的配置更新结果。
网关软件更新完成后,可以向网关客户端发送更新结果,网关客户端也可以将该更新结果反馈至管理服务器中的管理端。
本申请实施例提供的另一种网关配置更新方法,对操作标识为“无变更”的文本块不做处理,使得用于后续配置逻辑输入的文件量级得到极大限度的缩减,另外,对业务配置数据的解析、检查、比对和写入网关内存的过程基本复用相关技术中该过程的实现代码,且原始配置差异化文件和更新配置差异化文件只包含需要更新的业务配置 数据,因此文件很小,可以极大地缩短处理时延、提升处理效率、且对于数据安全性也有明显改善。
对比而言,下面给出相关技术中的网关配置更新流程,包括如下步骤:
步骤1,对管理服务器的管理端下发的全量配置文件读入到网关客户端的内存,根据全量配置文件中的业务标识号(简称ID)生成该粒度的内部解析格式;
步骤2,对全量配置文件的条目进行合法性检查,以防止写入错误配置项;
步骤3,拉取网关软件中现存的全量配置文件至网关客户端的内存;
步骤4,网关客户端将管理服务器的管理端下发的全量配置文件与网关软件中现存的全量配置文件中的业务配置数据,根据ID进行一一比对,同时计算出以ID为最小粒度的增量配置项,包括需要增加的配置项、需要删除的配置项、以及需要修改的配置项;
步骤5,网关客户端将增量配置项写入网关软件,并接收网关软件返回的配置更新结果。
现有网关配置更新流程主要存在以下问题:首先,由于每次变更为单一用户触发,其需要更新的业务配置数据数量极其有限(涉及的业务标识通常仅有几个),大多数业务配置数据无需更新,因而上述方案在配置更新过程存在较大的数据冗余。
具体而言,一方面,在配置更新过程中,对绝大多数未发生变化的业务配置数据进行等同的解析处理、检查处理、比对处理,使得网关配置更新时间较长;另一方面,每次更新都要对网关软件中的全量配置文件进行读取,增加了一定的不确定性和风险性;另外,由于配置刷新过程完全依赖用户在控制台的即时操作,配置刷新间隔不确定且刷新频率高,随意配置刷新存在很大随机性,如果网关配置返回时间过长,会影响下一次配置,且还会影响其他联动机制。再有,上述现有网关配置更新流程中的步骤1-步骤4都针对全量配置文件进行处理,其所带来的时延开销巨大,影响用户体验;随着未来用户数量的增长、配置的增多,现有基于全量配置刷新的方案时延会越来越长。
以下给出采用上述本申请实施例中的网关配置更新方法时的测试实例,该网关配置更新时间是基于30000个业务数量(数量越多,配置文件越大)的基础上测得的,如表2所示,表中“LB(Load Balance,负载均衡业务)”即为上述实施例中的“ID文本块”,“变配LB数量”即为上述实施例中的“需要更新的ID文本块”,基于实践经验,每次网关配置更新时的“变配LB数量”基本不会大于10个,由表2中数据可以看出,上述实施例中所提供的网关配置更新方法可以显著改善网关配置更新时间,将网关配 置更新时间由数十秒量级降至2秒内完成。
表2
Figure PCTCN2020097912-appb-000001
随着用户数量增多而带来的业务配置数据增多时,上述实施例中的基于增量的网关配置更新方法将不会受到任何影响,网关集群作为云网络业务通路最关键一环,其通过秒级内的响应速度反馈至云网络的管理服务器的管理端平台,使得管理端逻辑得以顺利完成、整个业务打通的完成速度得以极大提升,其最终体现为,云网络用户在控制台内的业务部署效率得以极大提升。对于底层网关产品,其稳定性对云网络起到决定性作用。本申请中,最大限度地保留、复用原有代码逻辑,尽量降低对原有产品的侵入性,这对于产品的快速上线及稳定性是大有裨益的。
参照图8所示的一种网关配置更新装置的结构示意图,该装置包括:获取模块80,设置为获取更新配置文件;其中,更新配置文件中包含业务配置数据;比较模块81,设置为比较更新配置文件和预先存储的原始配置文件,得到比较结果;确定模块82,设置为根据该比较结果确定需要更新的业务配置数据;生成模块83,设置为根据需要更新的业务配置数据,生成待更新的配置项;更新模块84,设置为根据待更新的配置项更新网关的配置参数。
上述网关配置更新装置,获取到更新配置文件后,首先比较该更新配置文件和预先存储的原始配置文件,得到比较结果;根据该比较结果确定需要更新的业务配置数据;基于该需要更新的业务配置数据,生成待更新的配置项;最后根据该待更新的配置项更新网关的配置参数。该装置通过比较更新配置文件和原始配置文件,得到需要更新的业务配置数据,因而从更新配置文件中剔除了无需更新的业务数据,仅基于该需要更新的业务配置数据进行后续的网关配置更新流程,该过程减少了网关配置过程中的数据冗余,从而缩短了网关配置更新的耗时,进而提高了网关配置的更新效率。
在一些实施方式中,更新配置文件和原始配置文件中均包含多项业务配置数据,每项业务配置数据包含一个业务标识。
在一些实施方式中,比较模块设置为:比较更新配置文件和原始配置文件中包含的 业务配置数据的业务标识,得到每项业务配置数据的操作标识;其中,操作标识设置为标记业务配置数据是否为需要更新的业务配置数据。
在一些实施方式中,比较模块设置为:将仅包含在更新配置文件中的业务标识对应的业务配置数据标记为增加;将仅包含在原始配置文件中的业务标识对应的业务配置数据标记为删除;将更新配置文件和原始配置文件中业务标识相同且业务标识所对应的业务配置数据不同的业务配置数据标记为修改;将更新配置文件和原始配置文件中业务标识相同且业务标识所对应的业务配置数据相同的业务配置数据标记为无变更。
在一些实施方式中,确定模块设置为:将操作标识为增加的业务配置数据确定为需要新增的业务配置数据;将操作标识为删除的业务配置数据确定为需要删除的业务配置数据;将操作标识为修改的业务配置数据确定为需要修改的业务配置数据;将操作标识为无变更的业务配置数据确定为不需要更新业务配置数据。
在一些实施方式中,比较模块设置为:基于预设的文本比较法比较更新配置文件和原始配置文件。
在一些实施方式中,上述预设的文本比较法包括:以业务配置数据为拆分单元对更新配置文件进行拆分,得到第一文本块集合;以业务配置数据为拆分单元对原始配置文件进行拆分,得到第二文本块集合;比较第一文本块集合和第二文本块集合中的每个文本块。
在一些实施方式中,比较模块设置为:比较第一文本块集合和第二文本块集合中的每个文本块的业务标识;所述确定单元,设置为:将仅包含在第一文本块集合中的业务标识对应的业务配置数据标记为增加;将仅包含在第二文本块集合中的业务标识对应的业务配置数据标记为删除;将第一文本块集合和第二文本块集合中业务标识相同且业务标识所在的文本块不同的业务配置数据标记为修改;将第一文本块集合和第二文本块集合中业务标识相同且业务标识所在的文本块相同的业务配置数据标记为无变更。
在一些实施方式中,比较模块还设置为:通过以下方法确定第一文本块集合和第二文本块集合中业务标识相同的两个文本块是否相同:如果业务标识相同的两个文本块中存在不相同的字符串,则确定业务标识相同的两个文本块不相同;如果业务标识相同的两个文本块中的字符串完全相同,则确定业务标识相同的两个文本块相同。
在一些实施方式中,上述装置还包括,排序模块,设置为:按照预设的排序规则,分别对业务标识相同的两个文本块内的字符串进行排序;上述比较模块还设置为:按照字符串的排序结果,逐个字符串比较业务标识相同的两个文本块中是否存在不相同的字符串。
在一些实施方式中,生成模块设置为:基于每项业务配置数据的操作标识生成增量配置文件;根据增量配置文件中的业务配置数据生成待更新的配置项。
在一些实施方式中,增量配置文件包括原始配置差异化文件和更新配置差异化文件;其中,原始配置差异化文件包括操作标识为删除和修改的业务配置数据,更新配置差异化文件包括操作标识为增加和修改的业务配置数据。
在一些实施方式中,装置还包括:解析模块,设置为将需要更新的业务配置数据进行格式解析;检查模块,设置为检查格式解析后的需要更新的业务配置数据中的每个业务配置数据是否合法;所述生成模块,设置为如果每个业务配置数据均合法,根据格式解析后的需要更新的业务配置数据生成待更新的配置项。
在一些实施方式中,更新模块还设置为:将待更新的配置项推送至网关设备的网关软件;接收网关软件返回的配置更新结果。
本申请实施例所提供的网关配置更新装置,其实现原理及产生的技术效果和前述网关配置更新方法实施例相同,为简要描述,网关配置更新装置实施例部分未提及之处,可参考前述网关配置更新方法实施例中相应内容。
本申请实施例还提供了一种电子设备,参见图9所示,该电子设备包括处理器90和存储器91,该存储器91存储有能够被处理器90执行的机器可执行指令,该处理器90执行机器可执行指令以实现上述网关配置更新方法。
进一步地,图9所示的电子设备还包括总线92和通信接口93,处理器90、通信接口93和存储器91通过总线92连接。
其中,存储器91可能包含高速随机存取存储器(RAM,Random Access Memory),也可能还包括非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口93(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。总线92可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图9中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。
处理器90可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器90中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器90可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(Digital Signal Processor,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简 称ASIC)、现场可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器91,处理器90读取存储器91中的信息,结合其硬件完成前述实施例的方法的步骤。
本申请实施例提供的电子设备,例如可以是以上实施例提及的管理服务器。
本申请实施例还提供了一种机器可读存储介质,该机器可读存储介质存储有机器可执行指令,该机器可执行指令在被处理器调用和执行时,该机器可执行指令促使处理器实现上述网关配置更新方法,具体实现可参见方法实施例,在此不再赘述。
本申请实施例所提供的网关配置更新方法及装置和电子设备的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行前面方法实施例中所述的方法,具体实现可参见方法实施例,在此不再赘述。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (30)

  1. 一种网关配置更新方法,其中,所述方法包括:
    获取更新配置文件;其中,所述更新配置文件中包含业务配置数据;
    比较所述更新配置文件和预先存储的原始配置文件,得到比较结果;
    根据所述比较结果确定需要更新的业务配置数据;
    根据所述需要更新的业务配置数据,生成待更新的配置项;
    根据所述待更新的配置项更新网关的配置参数。
  2. 根据权利要求1所述的方法,其中,所述更新配置文件和原始配置文件中均包含多项业务配置数据,每项业务配置数据包含一个业务标识。
  3. 根据权利要求2所述的方法,其中,所述比较所述更新配置文件和所述原始配置文件,得到比较结果,包括:
    比较所述更新配置文件和所述原始配置文件中包含的业务配置数据的业务标识,得到每项所述业务配置数据的操作标识;其中,所述操作标识用于标记所述业务配置数据是否为需要更新的业务配置数据。
  4. 根据权利要求3所述的方法,其中,所述比较所述更新配置文件和所述原始配置文件中包含的业务配置数据的业务标识,得到每项业务配置数据的操作标识,包括:
    将仅包含在所述更新配置文件中的业务标识对应的业务配置数据标记为增加;
    将仅包含在所述原始配置文件中的业务标识对应的业务配置数据标记为删除;
    将所述更新配置文件和所述原始配置文件中业务标识相同且业务标识所对应的业务配置数据不同的业务配置数据标记为修改;
    将所述更新配置文件和所述原始配置文件中业务标识相同且业务标识所对应的业务配置数据相同的业务配置数据标记为无变更。
  5. 根据权利要求3或4所述的方法,其中,所述根据所述比较结果确定需要更新的业务配置数据,包括:
    将操作标识为增加的业务配置数据确定为需要新增的业务配置数据;
    将操作标识为删除的业务配置数据确定为需要删除的业务配置数据;
    将操作标识为修改的业务配置数据确定为需要修改的业务配置数据;
    将操作标识为无变更的业务配置数据确定为不需要更新业务配置数据。
  6. 根据权利要求3-5任一项所述的方法,其中,基于预设的文本比较法比较所述更新配置文件和所述原始配置文件,得到所述比较结果。
  7. 根据权利要求6所述的方法,其中,所述基于预设的文本比较法比较所述更新配置文件和所述原始配置文件包括:
    以所述业务配置数据为拆分单元对所述更新配置文件进行拆分,得到第一文本块集合;
    以所述业务配置数据为拆分单元对所述原始配置文件进行拆分,得到第二文本块集合;
    比较所述第一文本块集合和所述第二文本块集合中的每个文本块。
  8. 根据权利要求7所述的方法,其中,所述比较所述更新配置文件和所述原始配置文件中包含的业务配置数据的业务标识,得到每项业务配置数据的操作标识,包括:
    比较所述第一文本块集合和所述第二文本块集合中的每个文本块的业务标识;
    将仅包含在所述第一文本块集合中的业务标识对应的业务配置数据标记为增加;
    将仅包含在所述第二文本块集合中的业务标识对应的业务配置数据标记为删除;
    将所述第一文本块集合和所述第二文本块集合中业务标识相同且业务标识所在的文本块不同的业务配置数据标记为修改;
    将所述第一文本块集合和所述第二文本块集合中业务标识相同且业务标识所在的文本块相同的业务配置数据标记为无变更。
  9. 根据权利要求8所述的方法,其中,通过以下方法确定所述第一文本块集合和所述第二文本块集合中业务标识相同的两个文本块是否相同:
    如果所述业务标识相同的两个文本块中存在不相同的字符串,则确定所述业务标识相同的两个文本块不相同;
    如果所述业务标识相同的两个文本块中的字符串完全相同,则确定所述业务标识相同的两个文本块相同。
  10. 根据权利要求8或9所述的方法,其中,在所述确定所述业务标识相同的两个文本块是否相同之前,还包括:按照预设的排序规则,分别对所述业务标识相同的两个文本块内的字符串进行排序;
    所述确定所述业务标识相同的两个文本块是否相同,包括:
    按照字符串的排序结果,逐个字符串比较所述业务标识相同的两个文本块中是否存在不相同的字符串。
  11. 根据权利要求2或3所述的方法,其中,所述根据所述需要更新的业务配置数据,生成待更新的配置项,包括:
    基于每项业务配置数据的操作标识生成增量配置文件;
    根据所述增量配置文件中的业务配置数据生成待更新的配置项。
  12. 根据权利要求11所述的方法,其中,所述增量配置文件包括原始配置差异化文件和更新配置差异化文件;其中,所述原始配置差异化文件包括操作标识为删除和修改的业务配置数据,所述更新配置差异化文件包括操作标识为增加和修改的业务配置数据。
  13. 根据权利要求1-12任意一项所述的方法,其中,在所述根据所述需要更新的业务配置数据,生成待更新的配置项的步骤之前,还包括:
    将所述需要更新的业务配置数据进行格式解析;
    检查格式解析后的所述需要更新的业务配置数据中的每个业务配置数据是否合法;
    如果每个所述业务配置数据均合法,根据格式解析后的所述需要更新的业务配置数据生成待更新的配置项。
  14. 根据权利要求1-13任意一项所述的方法,其中,根据所述待更新的配置项更新网关的配置参数的步骤,包括:
    将所述待更新的配置项推送至网关设备的网关软件;
    接收所述网关软件返回的配置更新结果。
  15. 一种网关配置更新装置,其中,所述装置包括:
    获取模块,设置为获取更新配置文件;其中,所述更新配置文件中包含业务配置数据;
    比较模块,设置为比较所述更新配置文件和预先存储的原始配置文件,得到比较结果;
    确定模块,设置为根据所述比较结果确定需要更新的业务配置数据;
    生成模块,设置为根据所述需要更新的业务配置数据,生成待更新的配置项;
    更新模块,设置为根据所述待更新的配置项更新网关的配置参数。
  16. 根据权利要求15所述的装置,其中,所述更新配置文件和原始配置文件中均包含多项业务配置数据,每项业务配置数据包含一个业务标识。
  17. 根据权利要求16所述的装置,其中,所述比较模块设置为:
    比较所述更新配置文件和所述原始配置文件中包含的业务配置数据的业务标识,得到每项所述业务配置数据的操作标识;其中,所述操作标识用于标记所述业务配置数据是否为需要更新的业务配置数据。
  18. 根据权利要求17所述的装置,其中,所述比较模块设置为:
    将仅包含在所述更新配置文件中的业务标识对应的业务配置数据标记为增加;
    将仅包含在所述原始配置文件中的业务标识对应的业务配置数据标记为删除;
    将所述更新配置文件和所述原始配置文件中业务标识相同且业务标识所对应的业务配置数据不同的业务配置数据标记为修改;
    将所述更新配置文件和所述原始配置文件中业务标识相同且业务标识所对应的业务配置数据相同的业务配置数据标记为无变更。
  19. 根据权利要求17或18所述的装置,其中,所述确定模块设置为:
    将操作标识为增加的业务配置数据确定为需要新增的业务配置数据;
    将操作标识为删除的业务配置数据确定为需要删除的业务配置数据;
    将操作标识为修改的业务配置数据确定为需要修改的业务配置数据;
    将操作标识为无变更的业务配置数据确定为不需要更新业务配置数据。
  20. 根据权利要求17-19任意一项所述的装置,其中,所述比较模块设置为:
    基于预设的文本比较法比较所述更新配置文件和所述原始配置文件,得到所述比较结果。
  21. 根据权利要求20所述的装置,其中,所述比较模块设置为:
    以所述业务配置数据为拆分单元对所述更新配置文件进行拆分,得到第一文本块集合;
    以所述业务配置数据为拆分单元对所述原始配置文件进行拆分,得到第二文本块集合;
    比较所述第一文本块集合和所述第二文本块集合中的每个文本块,得到所述比较结果。
  22. 根据权利要求21所述的装置,其中,
    所述比较模块设置为:
    比较所述第一文本块集合和所述第二文本块集合中的每个文本块的业务标识;
    所述确定单元,设置为:
    将仅包含在所述第一文本块集合中的业务标识对应的业务配置数据标记为增加;
    将仅包含在所述第二文本块集合中的业务标识对应的业务配置数据标记为删除;
    将所述第一文本块集合和所述第二文本块集合中业务标识相同且业务标识所在的文本块不同的业务配置数据标记为修改;
    将所述第一文本块集合和所述第二文本块集合中业务标识相同且业务标识所在的文本块相同的业务配置数据标记为无变更。
  23. 根据权利要求22所述的装置,其中,所述比较模块还设置为:
    确定所述第一文本块集合和所述第二文本块集合中业务标识相同的两个文本块是否相同:
    如果所述业务标识相同的两个文本块中存在不相同的字符串,则确定所述业务标识相同的两个文本块不相同;
    如果所述业务标识相同的两个文本块中的字符串完全相同,则确定所述业务标识相同的两个文本块相同。
  24. 根据权利要求22或23所述的装置,其中,所述装置还包括:排序模块,设置为:按照预设的排序规则,分别对所述业务标识相同的两个文本块内的字符串进行排序;
    所述比较模块还设置为:按照字符串的排序结果,逐个字符串比较所述业务标识相同的两个文本块中是否存在不相同的字符串。
  25. 根据权利要求16或17所述的装置,其中,所述生成模块设置为:
    基于每项业务配置数据的操作标识生成增量配置文件;
    根据所述增量配置文件中的业务配置数据生成待更新的配置项。
  26. 根据权利要求25所述的装置,其中,所述增量配置文件包括原始配置差异化文件和更新配置差异化文件;其中,所述原始配置差异化文件包括操作标识为删除和修改的业务配置数据,所述更新配置差异化文件包括操作标识为增加和修改的业务配置数据。
  27. 根据权利要求15-26任意一项所述的装置,其中,所述装置还包括:
    解析模块,设置为将所述需要更新的业务配置数据进行格式解析;
    检查模块,设置为检查格式解析后的所述需要更新的业务配置数据中的每个业务配置数据是否合法;
    所述生成模块,设置为如果每个所述业务配置数据均合法,根据格式解析后的所述需要更新的业务配置数据生成待更新的配置项。
  28. 根据权利要求15-27任意一项所述的装置,其中,所述更新模块还设置为:
    将所述待更新的配置项推送至网关设备的网关软件;
    接收所述网关软件返回的配置更新结果。
  29. 一种电子设备,其中,包括处理器和存储器,所述存储器存储有能够被所述处理器执行的机器可执行指令,所述处理器执行所述机器可执行指令以实现权利要求1至14任一项所述的网关配置更新方法。
  30. 一种机器可读存储介质,其中,该机器可读存储介质存储有机器可执行指令,该机器可执行指令在被处理器调用和执行时,机器可执行指令促使处理器实现权利要求1至14任一项所述的网关配置更新方法。
PCT/CN2020/097912 2019-06-28 2020-06-24 网关配置更新方法、装置和电子设备 WO2020259533A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910583491.XA CN110224878A (zh) 2019-06-28 2019-06-28 网关配置更新方法、装置和服务器
CN201910583491.X 2019-06-28

Publications (1)

Publication Number Publication Date
WO2020259533A1 true WO2020259533A1 (zh) 2020-12-30

Family

ID=67815612

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/097912 WO2020259533A1 (zh) 2019-06-28 2020-06-24 网关配置更新方法、装置和电子设备

Country Status (2)

Country Link
CN (1) CN110224878A (zh)
WO (1) WO2020259533A1 (zh)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110224878A (zh) * 2019-06-28 2019-09-10 北京金山云网络技术有限公司 网关配置更新方法、装置和服务器
CN112822031A (zh) * 2019-11-18 2021-05-18 中盈优创资讯科技有限公司 网络设备配置文件解析方法及装置
CN111078257B (zh) * 2019-12-19 2023-09-08 杭州安恒信息技术股份有限公司 一种h5应用包的加载方法及相关装置
CN111142903B (zh) * 2019-12-23 2023-09-22 杭州安恒信息技术股份有限公司 一种基于文件对比的配置文件交互式更新方法及装置
CN111092774A (zh) * 2019-12-25 2020-05-01 中国联合网络通信集团有限公司 采集网关的配置方法及设备
CN111343005B (zh) * 2020-02-11 2024-01-30 杭州涂鸦信息技术有限公司 一种本地自动化配置快速生效的方法及系统
CN113312250A (zh) * 2020-02-27 2021-08-27 华为技术有限公司 软件合规性的检测方法及装置
CN111541563A (zh) * 2020-04-17 2020-08-14 成都千立网络科技有限公司 有序生效配置的系统及方法
CN111726249B (zh) * 2020-06-02 2022-10-04 中盈优创资讯科技有限公司 网络设备的配置文件处理方法及装置
CN112099831B (zh) * 2020-09-28 2024-10-29 中国银行股份有限公司 配置文件的批量更新方法及装置
CN112612833B (zh) * 2020-12-18 2024-03-29 中国平安人寿保险股份有限公司 规则包更新方法、装置、设备及存储介质
CN112947973A (zh) * 2021-04-08 2021-06-11 天津天地伟业智能安全防范科技有限公司 中间件服务程序的配置更新方法、装置及电子设备
CN113542109B (zh) * 2021-07-19 2022-06-07 江西省能源大数据有限公司 一种5g智慧能源网关的数据采集方法
CN113507392B (zh) * 2021-07-22 2022-12-02 中国工商银行股份有限公司 网络运维方法、装置、电子设备、介质和程序产品
CN115695169B (zh) * 2021-07-28 2024-07-26 中国联合网络通信集团有限公司 一种配置信息下发方法、装置及存储介质
CN114095379B (zh) * 2021-10-30 2023-07-18 北京天融信网络安全技术有限公司 基于物联网的一种快速建模方法及系统
CN114978903B (zh) * 2022-05-20 2023-10-31 中国电信股份有限公司 配置下发方法、装置、服务器及可读存储介质
CN117579485B (zh) * 2024-01-12 2024-04-09 腾讯科技(深圳)有限公司 配置变更方法、装置、设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040044693A1 (en) * 2002-08-27 2004-03-04 Andrew Hadley Automated logging of system configurations
CN104717182A (zh) * 2013-12-12 2015-06-17 华为技术有限公司 网络防火墙的安全策略部署方法和装置
CN108829459A (zh) * 2018-05-31 2018-11-16 康键信息技术(深圳)有限公司 基于Nginx服务器的配置方法、装置、计算机设备和存储介质
CN108965381A (zh) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 基于Nginx的负载均衡实现方法、装置、计算机设备和介质
CN110224878A (zh) * 2019-06-28 2019-09-10 北京金山云网络技术有限公司 网关配置更新方法、装置和服务器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040044693A1 (en) * 2002-08-27 2004-03-04 Andrew Hadley Automated logging of system configurations
CN104717182A (zh) * 2013-12-12 2015-06-17 华为技术有限公司 网络防火墙的安全策略部署方法和装置
CN108829459A (zh) * 2018-05-31 2018-11-16 康键信息技术(深圳)有限公司 基于Nginx服务器的配置方法、装置、计算机设备和存储介质
CN108965381A (zh) * 2018-05-31 2018-12-07 康键信息技术(深圳)有限公司 基于Nginx的负载均衡实现方法、装置、计算机设备和介质
CN110224878A (zh) * 2019-06-28 2019-09-10 北京金山云网络技术有限公司 网关配置更新方法、装置和服务器

Also Published As

Publication number Publication date
CN110224878A (zh) 2019-09-10

Similar Documents

Publication Publication Date Title
WO2020259533A1 (zh) 网关配置更新方法、装置和电子设备
CN111580884A (zh) 配置更新方法、装置、服务器和电子设备
WO2019154353A1 (zh) 系统运行参数查询方法、匹配方法、装置及节点设备
CN108234233B (zh) 日志处理方法及装置
CN108256587A (zh) 一种字符串相似度的确定方法、装置、计算机及存储介质
KR20070048638A (ko) 볼륨 이미지 및 그것을 포함하는 컴퓨터 판독가능 매체
CN110809048B (zh) 一种数据中转方法、装置和计算机可读存储介质
CN112667636A (zh) 索引建立方法、装置及存储介质
CN112667601A (zh) 区块链标识的管理方法、终端设备及计算机可读存储介质
CN111581344B (zh) 一种接口信息审核方法、装置、计算机设备及存储介质
US20070198549A1 (en) Data entry systems and methods
US20230327945A1 (en) Testing framework for adaptive virtual services
CN115051859B (zh) 情报分析方法、情报分析装置、电子设备及介质
CN115293685A (zh) 物流订单的状态跟踪方法、装置、设备和存储介质
CN115544132A (zh) 数据导入方法、系统及电子设备
CN110866083B (zh) 一种电力标准结构化地址库的地址稽核方法
US11088898B2 (en) Updating logging behavior of a computer system using collaboration within interconnected systems
CN106993036B (zh) 运行环境信息处理方法及交换机
US10469319B2 (en) Certification tool gap analyzer
CN110096504B (zh) 流式事件特征匹配方法及装置
CN116366534B (zh) 基于硬件卸载的组播流量复制的方法以及相关装置
TWI844091B (zh) 特徵匹配規則構建、特徵匹配方法、裝置、設備及介質
JP7415363B2 (ja) ログ分析装置、方法及びプログラム
CN111159146B (zh) 一种嵌入式数据库的处理方法及其装置
CN114611155A (zh) 一种数据治理节点的校验方法、装置、设备及介质

Legal Events

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

Ref document number: 20833647

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.06.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20833647

Country of ref document: EP

Kind code of ref document: A1