A service traffic switching method and related apparatus
By working together with the user access unit, data processing unit, and configuration query and modification unit, the system automatically processes business traffic switching requests, solving the problems of low efficiency and poor accuracy of manual configuration modification, and achieving efficient and accurate business traffic switching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-27
- Publication Date
- 2026-03-20
AI Technical Summary
In existing technologies, manually modifying the backend software configuration is inefficient and prone to errors, resulting in poor accuracy in business traffic switching.
The user access unit, data processing unit, and configuration query and modification unit work together to receive, verify, and parse service traffic switching requests, generate scripts to modify parameters, and execute the configuration modification scripts to automatically modify the configuration, ensuring the correctness of the data format.
It improves the accuracy and efficiency of business traffic switching, reduces the risk of misoperation and data format errors, and shortens the configuration modification time.
Smart Images

Figure CN119211370B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a service traffic switching method and related device. BACKGROUND
[0002] With the rapid expansion of business scale, enterprises are facing increasingly fierce market competition and rapidly changing market demand. Enterprises need to dynamically adjust the allocation of user requests among different services or products to adapt to different business scenarios. Therefore, the importance of service traffic switching is increasingly prominent.
[0003] At present, the configuration of the background software is usually manually modified.
[0004] However, when the configuration content of the background software is complex or numerous, manual modification one by one is inefficient, and input errors or omissions are prone to occur, resulting in poor accuracy of service traffic switching. SUMMARY
[0005] In view of the above problems, the present application provides a service traffic switching method and related device to improve the efficiency and accuracy of service traffic switching. The specific scheme is as follows:
[0006] The first aspect of the present application provides a service traffic switching device, comprising a user access unit, a data processing unit and a configuration checking and modifying unit,
[0007] The user access unit is configured to receive a service traffic switching request of a user, wherein the service traffic switching request carries a parameter for modifying a target modification configuration of a background software and a digital signature certificate for identifying the identity of the user, and the target modification configuration is a configuration required to be modified for service traffic switching;
[0008] The user access unit is further configured to check the service traffic switching request, and if the check is passed, the parameter for modifying the target modification configuration of the background software is sent to the data processing unit;
[0009] The data processing unit is configured to parse the parameter for modifying the target modification configuration of the background software, obtain at least one group of configuration modification data, perform format checking on the obtained configuration modification data, and if the format checking is passed, convert the obtained configuration modification data into a script modification parameter and send it to the configuration checking and modifying unit;
[0010] The configuration checking and modifying unit is configured to input the script modification parameter into a preset configuration modification script, and then execute the configuration modification script to modify the target modification configuration.
[0011] The second aspect of the present application provides a service traffic switching method applied to the service traffic switching device, and the method comprises the following steps:
[0012] The user access unit receives a service traffic switching request of a user, wherein the service traffic switching request carries a parameter for modifying a target modification configuration of background software and a digital signature certificate for identifying the identity of the user, and the target modification configuration is a configuration required to be modified for service traffic switching;
[0013] The user access unit checks the service traffic switching request, and if the checking is passed, the parameter for modifying the target modification configuration of the background software is sent to the data processing unit;
[0014] The data processing unit analyzes the parameter for modifying the target modification configuration of the background software, obtains at least one group of configuration modification data, performs format checking on the obtained configuration modification data, if the format checking is passed, converts the obtained configuration modification data into a script modification parameter, and sends the script modification parameter to the configuration checking and modifying unit;
[0015] The configuration checking and modifying unit inputs the script modification parameter into a preset configuration modification script, and then executes the configuration modification script to modify the target modification configuration.
[0016] The third aspect of the present application provides a computer program product, comprising computer readable instructions, when the computer readable instructions run on an electronic device, the electronic device can realize the service traffic switching method of the second aspect.
[0017] The fourth aspect of the present application provides an electronic device, comprising at least one processor and a memory connected with the processor, wherein:
[0018] The memory is used for storing a computer program;
[0019] The processor is used for executing the computer program, so that the electronic device can realize the service traffic switching method of the second aspect.
[0020] The fifth aspect of the present application provides a computer storage medium, the storage medium carries one or more computer programs, when the one or more computer programs are executed by an electronic device, the electronic device can realize the service traffic switching method of the second aspect.
[0021] By means of the technical scheme, the application provides a service flow switching method and related device. The device comprises a user access unit, a data processing unit and a configuration checking and modifying unit. The user access unit is configured to receive a service flow switching request of a user, check the service flow switching request, and if the check is passed, send the modified parameters of the configuration required for service flow switching of the background software to the data processing unit. Only legitimate requests can be further processed, reducing the possibility of misoperation. The data processing unit is configured to analyze the modified parameters of the target modified configuration of the background software, obtain at least one set of configuration modification data, perform format checking on the obtained configuration modification data, if the format checking is passed, convert the obtained configuration modification data into script modification parameters, and send the script modification parameters to the configuration checking and modifying unit, reducing the risk of configuration errors caused by data format errors. The configuration checking and modifying unit is configured to input the script modification parameters into a preset configuration modification script, automatically modify the target modified configuration by executing the configuration modification script, greatly shorten the configuration modification time, and greatly improve the accuracy and efficiency of service flow switching. BRIEF DESCRIPTION OF DRAWINGS
[0022] The above and other features, advantages and aspects of embodiments of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which:
[0023] Figure 1 A structural schematic diagram of a service flow switching device provided by an embodiment of the application;
[0024] Figure 2 A flowchart of a service flow switching method provided by an embodiment of the application;
[0025] Figure 3 A flowchart of another service flow switching method provided by an embodiment of the application;
[0026] Figure 4 A hardware structural schematic diagram of a service flow switching device provided by an embodiment of the application. DETAILED DESCRIPTION
[0027] Embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein, but rather, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the scope of protection of the present disclosure.
[0028] The term "include" and variations thereof as used herein mean "to include, without limitation." The term "based on" means "based at least in part on." The term "one embodiment" means "at least one embodiment." The term "another embodiment" means "at least one additional embodiment." The term "some embodiments" means "at least some embodiments." Related terms shall be construed accordingly.
[0029] It should be noted that the terms "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modification of "one" or "multiple" mentioned in the present disclosure is illustrative and not restrictive, and those skilled in the art should understand that unless otherwise explicitly indicated in the context, it should be understood as "one or more".
[0031] In order to improve the efficiency and accuracy of service traffic switching, the present application provides a service traffic switching device, which will be described in further detail below in combination with the drawings and specific embodiments.
[0032] Please refer to the accompanying Figure 1 , Figure 1 A structural schematic diagram of a service traffic switching device provided by an embodiment of the present application. The service traffic switching device comprises a user access unit 11, a data processing unit 12 and a configuration modification unit 13.
[0033] The user access unit 11 is configured to receive a service traffic switching request of a user, wherein the service traffic switching request carries a parameter for modifying a target modification configuration of a background software and a digital signature certificate for identifying the identity of the user, and the target modification configuration is a configuration required to be modified for service traffic switching.
[0034] It should be noted that the user needs to understand and master the corresponding relationship between the service and the configuration in advance, i.e., to know which service corresponds to which configuration, which helps the user to more accurately construct the parameter for modifying the target modification configuration of the background software in the service traffic switching request and avoid unnecessary errors or confusion.
[0035] In this application, the user access unit 11 acts as a bridge for interaction with users, who are usually business callers or maintenance personnel of the background software, and they want to achieve fast switching of business traffic by modifying the configuration of the background software. The user access unit 11 is mainly responsible for receiving, processing and forwarding the user's business traffic switching request. The business traffic switching request usually contains parameters for modifying the target modification configuration of the background software, and a digital signature certificate Token for identifying the user's identity. Among them, the parameters for modifying the target modification configuration of the background software specifically describe how the user wants to modify the configuration to achieve the switching of business traffic.
[0036] The user access unit 11 is also used to check the business traffic switching request, and if the check is passed, the parameters for modifying the target modification configuration of the background software are sent to the data processing unit.
[0037] In this application, the upstream software will configure the username and password used to call the Token authentication API (Application Programming Interface, API) in the device, and the user logs in using the above username and password. After receiving the business traffic switching request (such as HTTP request) from the user, the user access unit 11 can verify the user's username and password through the protocol-based (such as HTTP) interface (such as Token authentication API), and after verification, generate a Token according to the username and password and return the Token to the user.
[0038] At this time, the user has successfully authenticated through the Token authentication API and obtained the Token, and when the user calls the configuration modification API, the user needs to put this Token into the header information (such as HTTP Header) of the business traffic switching request. The user access unit 11 will extract the Token from the header information of the business traffic switching request and compare it with the Token stored in the device in advance to verify the legitimacy of the user's identity. It ensures that only authorized users can access and modify the configuration.
[0039] After the Token authentication is passed, the user access unit 11 may also perform a series of checks on the business traffic switching request itself to ensure the legitimacy, validity and security of the business traffic switching request. These checks may include checking the integrity, format compliance, permission verification, etc. of the parameters for modifying the target modification configuration of the background software.
[0040] If the business traffic switching request passes the identity verification and checks, the user access unit 11 will extract the parameters for modifying the target modification configuration of the background software from the business traffic switching request and send them to the data processing unit.
[0041] If the identity authentication or verification fails, the service traffic switching request is rejected, and error information is returned to the user.
[0042] The data processing unit 12 is configured to parse the parameters for modifying the target modification configuration of the background software, obtain at least one set of configuration modification data, perform format verification on the obtained configuration modification data, if the format verification passes, convert the obtained configuration modification data into script modification parameters, and send the script modification parameters to the configuration modification unit 13.
[0043] In the present application, the data processing unit 12 first parses the received parameters for modifying the target modification configuration of the background software, extracts useful data, i.e., configuration modification data, from the parameters, and then performs format verification (such as checking data types, value ranges, format specifications, etc.) on the configuration modification data. If the format verification passes, it means that the configuration modification data meets the expected format requirements of the device, and the data processing unit 12 converts the configuration modification data into script modification parameters. Finally, the script modification parameters are sent to the configuration modification unit 13.
[0044] It should be noted that the parameters for modifying the target modification configuration of the background software have various forms, such as JSON, XML, CSV, etc. The script modification parameters also have various forms, such as Bash, Python, PowerShell, etc., which are specifically designed for the preset configuration modification script to enable the script to understand and execute the corresponding modification operations.
[0045] The configuration modification unit 13 is configured to pass the script modification parameters into the preset configuration modification script, and then execute the configuration modification script to modify the target modification configuration.
[0046] In the present application, the configuration modification unit 13 first passes the received script modification parameters into the preset configuration modification script, and then executes the configuration modification script. The configuration modification script determines the target modification configuration according to the script modification parameters, establishes a parameter modification file with the current timestamp as a suffix, writes the script modification parameters into the parameter modification file, and sends the parameter modification file to the server running the background software, so that the server modifies the target modification configuration according to the parameter modification file.
[0047] It should be noted that the configuration modification script is pre-written and contains all the logic and instructions required for executing configuration modification. The configuration modification script automatically modifies the configuration of the background software according to the transmitted script modification parameters.
[0048] Specifically, the configuration checking and modifying unit 13 can check the incoming script modification parameter, determine which configuration item is modified by the user, create a parameter modification file with a current timestamp as a suffix respectively, write the script modification parameter into the parameter modification file, connect multiple servers of the upstream software by using a multi-thread technology, transmit the parameter modification file to the servers in parallel, and instruct the servers to perform addition, deletion, replacement and other modification operations on the target modification configuration according to the parameter modification file. The parameter modification file is used to store parameter information required by the configuration modification script execution.
[0049] To sum up, the application provides a service traffic switching device. The device includes a user access unit, a data processing unit and a configuration checking and modifying unit. The user access unit is configured to receive a service traffic switching request of a user, check the service traffic switching request, and send modification parameters of a configuration to be modified for service traffic switching of a background software to the data processing unit if the check is passed. Only a legal request can be further processed, reducing the possibility of misoperation. The data processing unit is configured to analyze the modification parameters of the target modification configuration of the background software, obtain at least one group of configuration modification data, perform format checking on the obtained configuration modification data, convert the obtained configuration modification data into script modification parameters if the format checking is passed, and send the script modification parameters to the configuration checking and modifying unit, reducing the risk of configuration errors caused by data format errors. The configuration checking and modifying unit is configured to input the script modification parameters into a preset configuration modification script, automatically modify the target modification configuration by executing the configuration modification script, greatly shorten the configuration modification time, and greatly improve the accuracy and efficiency of service traffic switching.
[0050] Further, on the basis of the above device, the device can further include:
[0051] The configuration checking and modifying unit 13 is further configured to obtain modification result data of the target modification configuration, and send the modification result data to the data processing unit 12.
[0052] In the application, a log modification file is also created at the same time of creating the parameter modification file with a current timestamp as a suffix. The log modification file is used to record result data generated by the execution of the configuration modification script. Therefore, after the execution of the configuration modification script to complete the modification of the target modification configuration, the modification result is written back to the local log modification file. The configuration checking and modifying unit 13 analyzes the log file, compares, de-duplicates, aggregates and processes the recorded operation results to generate final modification result data, and returns the final modification result data to the data processing unit 12.
[0053] It should be noted that the modification result data lists the modification result of each configuration item in detail, including which modification is successful, which modification fails and the reason for the failure, etc.
[0054] The data processing unit 12 is further configured to parse the modification result data, and filter the parsed modification data according to the service traffic switching request, and send the filtered modification data to the user access unit 11.
[0055] In the present application, after receiving the modification result data, the data processing unit 12 first parses the received data to extract specific modification result information. Then, according to the specific indication or requirement contained in the service traffic switching request, the parsed modification data is filtered to extract the key information or specific format response data that the user may be interested in. Finally, the filtered modification data is sent to the user access unit 11.
[0056] The user access unit 11 is further configured to output the filtered modification data to the user.
[0057] In the present application, the user access unit 11 first converts the received filtered modification data into a format suitable for user reception (such as JSON, XML, HTML, etc.), and then sends the filtered modification data back to the user through a corresponding network protocol (such as HTTP). The user can receive and view the filtered modification data through a browser, command line tool, API client, etc.
[0058] In summary, by configuring the cooperative work of the modification and query unit, the data processing unit and the user access unit, the present application greatly reduces the redundancy and irrelevant information of the data, improves the data utilization, enables the user to obtain the modification result more quickly, and ensures the user experience of the user.
[0059] Further, on the basis of the above-mentioned device, it can further include:
[0060] The user access unit 11 is further configured to receive a configuration query request of the user, the configuration query request carrying a parameter for querying the target query configuration of the background software and a digital signature certificate for identifying the identity of the user, and the target query configuration being a configuration required for querying the service traffic switching.
[0061] It should be noted that the user needs to understand and master the corresponding relationship between the service and the configuration in advance, that is, to clearly know which service corresponds to which configuration, which helps the user to more accurately construct the parameter for querying the target query configuration of the background software in the configuration query request, and avoids unnecessary errors or confusion.
[0062] In the present application, the user access unit 11 acts as a bridge for interaction with the user, who is usually the business caller or the maintenance personnel of the background software. The user access unit 11 is mainly responsible for receiving, processing and forwarding the user's configuration query request. The configuration query request usually contains parameters for querying the target query configuration of the background software, and a digital signature certificate Token for identifying the user's identity.
[0063] The user access unit 11 is also used to check the configuration query request, and if the check is passed, the parameters for querying the target query configuration of the background software are sent to the data processing unit 12.
[0064] In the present application, the upstream software will configure the username and password for calling the Token authentication API in the device, and the user will use the above-mentioned username and password for login. After receiving the configuration query request (such as HTTP request) from the user, the user access unit 11 can verify the username and password of the user through the protocol-based (such as HTTP) interface (such as Token authentication API), and after verification, generate a Token according to the username and password and return the Token to the user.
[0065] At this time, the user has successfully authenticated through the Token authentication API and obtained the Token, and when the user calls the configuration query API, the user needs to put this Token into the header information (such as HTTP Header) of the configuration query request. The user access unit 11 will extract the Token from the header information of the configuration query request and compare it with the Token stored in the device in advance to verify the legitimacy of the user's identity. It is ensured that only authorized users can access and query the configuration.
[0066] After the Token authentication is passed, the user access unit 11 can also perform a series of checks on the configuration query request itself to ensure the legitimacy, validity and security of the business traffic switching request. These checks may include checking the integrity, format compliance, permission verification, etc. of the parameters for querying the target query configuration of the background software.
[0067] If the configuration query request passes the identity verification and check, the user access unit 11 will extract the parameters for querying the target query configuration of the background software from the configuration query request and send them to the data processing unit 12.
[0068] If the identity verification or check fails, the configuration query request will be rejected and an error message will be returned to the user.
[0069] The data processing unit 12 is further configured to parse the parameters for querying the target query configuration of the background software, obtain at least one set of configuration query data, perform format checking on the obtained configuration query data, convert the obtained configuration query data into script query parameters if the format checking is passed, and send the script query parameters to the configuration query and modification unit 13.
[0070] In the present application, the data processing unit 12 first parses the received parameters for querying the target query configuration of the background software, extracts useful data, i.e., configuration query data, from the parameters, and then performs format checking (such as checking data types, value ranges, format specifications, etc.) on the configuration query data. If the format checking is passed, it means that the configuration query data meets the expected format requirements of the device, and the data processing unit 12 converts the configuration query data into script query parameters. Finally, the script query parameters are sent to the configuration query and modification unit 13.
[0071] It should be noted that the parameters for querying the target query configuration of the background software have various forms, such as JSON, XML, CSV, etc. The script query parameters also have various forms, such as Bash, Python, PowerShell, etc., which are specifically designed for the preset configuration query script to enable the script to understand and execute corresponding query operations.
[0072] The configuration query and modification unit 13 is further configured to pass the script query parameters into the preset configuration query script, and then execute the configuration query script to query the target query configuration.
[0073] In the present application, the configuration query and modification unit 13 first passes the received script query parameters into the preset configuration query script, and then executes the configuration query script. The configuration query script determines the target query configuration according to the script query parameters, establishes a parameter query file with the current timestamp as a suffix, writes the script query parameters into the parameter query file, and sends the parameter query file to the server running the background software, so that the server queries the target query configuration according to the parameter query file.
[0074] It should be noted that the configuration query script is pre-written and contains all the logic and instructions required for executing configuration queries. The configuration query script automatically queries the configuration of the background software according to the passed script query parameters.
[0075] Specifically, the configuration checking and changing unit 13 can check the incoming script query parameter, determine which configuration item is queried by the user, create a parameter query file with a current timestamp as a suffix respectively, write the script query parameter into the parameter query file, connect multiple servers of the upstream software by using a multi-thread technology, transmit the parameter query file to the servers in parallel, and instruct the servers to query the target query configuration according to the parameter query file. The parameter query file is used to store the parameter information required by the configuration query script execution.
[0076] To sum up, the device provided in the application comprises a user access unit, a data processing unit and a configuration checking and changing unit. The user access unit is configured to receive a configuration query request of a user, check the configuration query request, and send the parameters for querying the configuration required for service flow switching of the background software to the data processing unit if the check is passed. Only a legal request can be further processed, thereby reducing the possibility of misoperation. The data processing unit is configured to analyze the parameters for querying the target query configuration of the background software, obtain at least one group of configuration query data, perform format checking on the obtained configuration query data, convert the obtained configuration query data into script query parameters if the format checking is passed, and send the script query parameters to the configuration checking and changing unit, thereby reducing the risk of configuration errors caused by data format errors. The configuration checking and changing unit is configured to input the script query parameters into a preset configuration query script, automatically query the target query configuration by executing the configuration query script, greatly shorten the configuration query time, and thereby accelerate the service flow switching speed.
[0077] Further, the device can further comprise:
[0078] The configuration checking and changing unit 13 is further configured to obtain query result data of the target query configuration, and send the query result data to the data processing unit 12.
[0079] In the application, the log query file is created at the same time as the parameter query file with a current timestamp as a suffix. The log query file is used to record the result data generated by the configuration query script execution. Therefore, after the configuration query script is executed to complete the query of the target query configuration, the query result is written back to the local log query file. The configuration checking and changing unit 13 analyzes the log file, compares, removes duplicates, aggregates and processes the recorded operation results, generates the final query result data, and returns the final query result data to the data processing unit 12.
[0080] It should be noted that the query result data lists the query result of each configuration item in detail, including which query is successful, which query fails, and the reason for the failure.
[0081] The data processing unit 12 is further configured to parse the query result data, and filter the parsed query data according to the configuration query request, and send the filtered query data to the user access unit 11.
[0082] In the present application, after receiving the query result data, the data processing unit 12 first parses the received data to extract specific query result information. Then, according to the specific indication or requirement contained in the configuration query request, the parsed query data is filtered to extract the key information or specific format response data that the user may be interested in. Finally, the filtered query data is sent to the user access unit 11.
[0083] The user access unit 11 is further configured to output the filtered query data to the user.
[0084] In the present application, the user access unit 11 first converts the received filtered query data into a format suitable for user reception (such as JSON, XML, HTML, etc.), and then sends the filtered query data back to the user through a corresponding network protocol (such as HTTP). The user can receive and view the filtered query data through a browser, command line tool, API client, etc.
[0085] In summary, the present application greatly reduces the redundancy and irrelevant information of data through the cooperative work of the configuration query unit, the data processing unit and the user access unit, improves the data utilization rate, enables the user to query the result faster, and ensures the user experience of the user.
[0086] The business traffic switching device is described in detail in the embodiments disclosed in the present application, and various forms of methods can be applied to the business traffic switching device of the present application. Therefore, the business traffic switching method provided by the present application is further described in detail below in combination with the drawings and specific embodiments.
[0087] Please refer to the accompanying Figure 2 , Figure 2 A flowchart of a business traffic switching method provided by an embodiment of the present application. The method applied to any of the above business traffic switching devices can include the following steps:
[0088] Step S101: The user access unit receives a business traffic switching request of a user, the business traffic switching request carrying a parameter for modifying a target modification configuration of a background software and a digital signature certificate for identifying the identity of the user, the target modification configuration being a configuration required to be modified for business traffic switching.
[0089] Step S102: The user access unit verifies the business traffic switching request, and if the verification is passed, sends the parameter for modifying the target modification configuration of the background software to the data processing unit.
[0090] Step S103: The data processing unit parses the parameters for modifying the target modification configuration of the background software, obtains at least one set of configuration modification data, performs format checking on the obtained configuration modification data, if the format checking passes, converts the obtained configuration modification data into script modification parameters, and sends the script modification parameters to the configuration checking and modifying unit.
[0091] Step S104: The configuration checking and modifying unit inputs the script modification parameters into a preset configuration modification script, and then executes the configuration modification script to modify the target modification configuration.
[0092] On the basis of the above method, the method can further include the following steps:
[0093] Step S105: The configuration checking and modifying unit obtains modification result data of the target modification configuration, and sends the modification result data to the data processing unit.
[0094] Step S106: The data processing unit parses the modification result data, and filters the parsed modification data according to the service traffic switching request, and sends the filtered modification data to the user access unit.
[0095] Step S107: The user access unit outputs the filtered modification data to the user.
[0096] On the basis of the above embodiment of the present application, in another embodiment of the present application, the specific implementation mode of service traffic switching is described in detail.
[0097] As an implementable mode, please refer to the accompanying drawings Figure 3 , which is a flowchart of another service traffic switching method provided by the embodiment of the present application. The method can include the following steps:
[0098] Step S201: The user access unit receives a configuration query request of a user, the configuration query request carrying parameters for querying a target query configuration of a background software and a digital signature certificate for identifying the identity of the user, the target query configuration being a configuration required to be queried for service traffic switching.
[0099] Step S202: The user access unit checks the configuration query request, and if the checking passes, sends the parameters for querying the target query configuration of the background software to the data processing unit.
[0100] Step S203: The data processing unit parses the parameters for querying the target query configuration of the background software, obtains at least one set of configuration query data, performs format checking on the obtained configuration query data, and if the format checking passes, converts the obtained configuration query data into script query parameters and sends the script query parameters to the configuration query and modification unit.
[0101] Step S204: The configuration query and modification unit inputs the script query parameters into a preset configuration query script, and then executes the configuration query script to query the target query configuration.
[0102] On the basis of the above method, the method can further include the following steps:
[0103] Step S205: The configuration query and modification unit obtains the query result data of the target query configuration, and sends the query result data to the data processing unit.
[0104] Step S206: The data processing unit parses the query result data, and filters the parsed query data according to the configuration query request, and sends the filtered query data to the user access unit.
[0105] Step S207: The user access unit outputs the filtered query data to the user.
[0106] On the basis of the above embodiment of the present application, in another embodiment of the present application, the specific implementation manner of the configuration query and modification unit executing the configuration query script to query the target query configuration is described in detail.
[0107] As an implementable manner, the method can be specifically set as:
[0108] The configuration query and modification unit executes the configuration query script, the configuration query script determines the target query configuration according to the script query parameters, establishes a parameter query file with a current timestamp as a suffix, writes the script query parameters into the parameter query file, and sends the parameter query file to a server running the background software, so that the server modifies the target query configuration according to the parameter query file.
[0109] On the basis of the above embodiment of the present application, in another embodiment of the present application, the specific implementation manner of the configuration query and modification unit executing the configuration query script to query the target query configuration is described in detail.
[0110] As an implementable manner, the method can be specifically set as:
[0111] The configuration checking and correcting unit executes a configuration query script, the configuration query script determines a target query configuration according to script query parameters, establishes a parameter query file with a current timestamp as a suffix, writes the script query parameters into the parameter query file, and sends the parameter query file to a server of the running background software, so that the server queries the target query configuration according to the parameter query file.
[0112] An electronic device is also provided in the embodiments of the present application. Figure 4 As shown in FIG. 1, Figure 4 The electronic device shown in FIG. 1 is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0113] As shown in FIG. 1, Figure 4 The electronic device can include a processing device (for example, a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 402 or loaded from a storage device 408 into a random access memory (RAM) 403. In a state where the electronic device is powered on, the RAM 403 also stores various programs and data required for operation of the electronic device. The processing device 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0114] Generally, the following devices can be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a memory card, a hard disk, etc.; and a communication device 409. The communication device 409 can allow the electronic device to communicate with other devices wirelessly or through wires to exchange data. Although Figure 4 The electronic device is shown with various devices, but it should be understood that all the shown devices are not required to be implemented or possessed. More or fewer devices can be alternatively implemented or possessed.
[0115] A computer program product including computer readable instructions is also provided in the embodiments of the present application, which, when executed on an electronic device, causes the electronic device to implement any one of the service traffic switching methods provided in the embodiments of the present application.
[0116] The embodiment of the present application further provides a computer readable storage medium, the storage medium carries one or more computer programs, when the one or more computer programs are executed by an electronic device, the electronic device can realize any service traffic switching method provided by the embodiment of the present application.
[0117] In addition, it should be noted that the apparatus embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment. In addition, the connection relationship between the modules in the apparatus embodiment provided by the present application indicates that there is a communication connection between them, which can be implemented as one or more communication buses or signal lines.
[0118] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be realized by means of software and necessary general hardware, and of course can also be realized by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. Generally, functions completed by computer programs can be easily realized by corresponding hardware, and the specific hardware structure for realizing the same function can also be various, such as analog circuit, digital circuit or special circuit, etc. However, for the present application, software program implementation is a better embodiment. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products, which are stored in readable storage media, such as computer floppy disks, U disks, mobile hard disks, ROM, RAM, magnetic or optical disks, etc., including a plurality of instructions for making a computer device (which can be a personal computer, a training device, or a network device, etc.) execute the methods described in various embodiments of the present application.
[0119] In the above embodiments, all or part can be realized by software, hardware, firmware or any combination thereof. When realized by software, it can be realized in the form of a computer program product in whole or in part.
[0120] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, training device or data center to another website, computer, training device or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be stored by the computer or a data storage device such as a training device, a data center, etc. integrated with one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.
Claims
1. A service traffic switching device, characterized in that, include: User access unit, data processing unit, and configuration query and modification unit. The user access unit is used to receive a user's service traffic switching request. The service traffic switching request carries parameters for modifying the target modification configuration of the backend software and a digital signature credential for identifying the user's identity. The target modification configuration is the configuration that needs to be modified for service traffic switching. The user access unit is also used to verify the service traffic switching request. If the verification passes, the parameters for modifying the target configuration of the backend software are sent to the data processing unit. The data processing unit is used to parse the parameters for modifying the target configuration of the background software, obtain at least one set of configuration modification data, perform format verification on the obtained configuration modification data, and if the format verification passes, convert the obtained configuration modification data into script modification parameters and send them to the configuration query and modification unit. The configuration query and modification unit is used to pass the script modification parameters to a preset configuration modification script, and then execute the configuration modification script to modify the target configuration. Specifically, the configuration query and modification unit executes the configuration modification script to modify the target configuration, which is configured as follows: the configuration query and modification unit executes the configuration modification script; the configuration modification script determines the target configuration based on the script modification parameters; a parameter modification file is created with the current timestamp as a suffix; the script modification parameters are written into the parameter modification file; a log modification file is created to record the result data generated by the execution of the configuration modification script; and multi-threading technology is used to transmit the parameter modification file in parallel to multiple servers running the background software, instructing the servers to modify the target configuration based on the parameter modification file. The configuration query and modification unit is also used to parse the log modification file after the server performs the modification, compare, deduplicate and aggregate the operation results recorded in the log modification file, generate modification result data and send it to the data processing unit.
2. The service traffic switching device according to claim 1, characterized in that, The data processing unit is also used to parse the modified result data, filter the parsed modified data according to the service traffic switching request, and send the filtered modified data to the user access unit. The user access unit is also used to output the filtered modified data to the user.
3. The service traffic switching device according to claim 1, characterized in that, The user access unit is also configured to receive the user's configuration query request, the configuration query request carrying parameters for querying the target query configuration of the backend software and a digital signature credential for identifying the user's identity, the target query configuration being the configuration required for switching business traffic; The user access unit is also used to verify the configuration query request. If the verification passes, the parameters for querying the target query configuration of the backend software are sent to the data processing unit. The data processing unit is also used to parse the parameters for querying the target query configuration of the background software, obtain at least one set of configuration query data, perform format verification on the obtained configuration query data, and if the format verification passes, convert the obtained configuration query data into script query parameters and send them to the configuration query and modification unit. The configuration query and modification unit is also used to pass the script query parameters to a preset configuration query script, and then execute the configuration query script to query the target query configuration.
4. The service traffic switching device according to claim 3, characterized in that, The configuration query and modification unit is also used to obtain the query result data of the target query configuration and send the query result data to the data processing unit; The data processing unit is also used to parse the query result data, filter the parsed query data according to the configured query request, and send the filtered query data to the user access unit. The user access unit is also used to output the filtered query data to the user.
5. The service traffic switching device according to claim 3, characterized in that, The configuration query and modification unit executes the configuration query script to query the target query configuration, specifically configured as follows: The configuration query and modification unit executes the configuration query script. The configuration query script determines the target query configuration based on the script query parameters, creates a parameter query file with the current timestamp as a suffix, writes the script query parameters into the parameter query file, and sends the parameter query file to the server running the background software, so that the server can query the target query configuration based on the parameter query file.
6. A method for switching service traffic, characterized in that, The method, applied to any of the service traffic switching devices described in claims 1-5, comprises: The user access unit receives a user's service traffic switching request. The service traffic switching request carries parameters for modifying the target modification configuration of the backend software and a digital signature credential for identifying the user's identity. The target modification configuration is the configuration that needs to be modified for service traffic switching. The user access unit verifies the service traffic switching request. If the verification passes, the user access unit sends the parameters for modifying the target configuration of the backend software to the data processing unit. The data processing unit parses the parameters that modify the target configuration of the background software to obtain at least one set of configuration modification data. The obtained configuration modification data is then format-validated. If the format validation passes, the obtained configuration modification data is converted into script modification parameters and sent to the configuration query and modification unit. The configuration query and modification unit inputs the script modification parameters into a preset configuration modification script, and then executes the configuration modification script to modify the target configuration. Specifically, the configuration query and modification unit executes the configuration modification script to modify the target configuration, which is configured as follows: the configuration query and modification unit executes the configuration modification script; the configuration modification script determines the target configuration based on the script modification parameters; a parameter modification file is created with the current timestamp as a suffix; the script modification parameters are written into the parameter modification file; a log modification file is created to record the result data generated by the execution of the configuration modification script; and multi-threading technology is used to transmit the parameter modification file in parallel to multiple servers running the background software, instructing the servers to modify the target configuration based on the parameter modification file. After the server performs the modification, the configuration query and modification unit parses the log modification file, compares, deduplicates, and aggregates the operation results recorded in the log modification file, generates modification result data, and sends it to the data processing unit.
7. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the service traffic switching method as described in claim 6.
8. An electronic device, characterized in that, It includes at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the service traffic switching method as described in claim 6.
9. A computer storage medium, characterized in that, The storage medium carries one or more computer programs, which, when executed by an electronic device, enable the electronic device to implement the service traffic switching method as described in claim 6.
Citation Information
Patent Citations
Traffic switching method and device and computer equipment
CN108459792A
System configuration method and related device
CN111538542A