Gateway Configuration Method, Device, Server, and Medium

By updating configuration information when the gateway access frequency is greater than the threshold, and excluding the configuration file with the largest frequency of use, the operational instability of the aggregated gateway due to excessive data volume is solved, and the stability of the gateway is improved.

CN115706700BActive Publication Date: 2025-06-27SHANGHAI PATEO INTERNET TECH SERVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110899099.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-05
Publication Date
2025-06-27
Estimated Expiration
2041-08-05

AI Technical Summary

Technical Problem

Under the microservice architecture, the aggregation gateway is unstable due to the large amount of data, which is difficult to maintain.

Method used

When the access frequency of the gateway is greater than the access frequency threshold, the configuration information of the gateway is updated so that the updated configuration information includes other configuration files other than the configuration file with the largest frequency, thereby reducing the data processing volume and improving the stability of the gateway.

Benefits of technology

By reducing the data processing volume of the gateway, the stability of the gateway is improved and the operational instability caused by excessive access is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115706700B_ABST
    Figure CN115706700B_ABST
Patent Text Reader

Abstract

An embodiment of the present application discloses a gateway configuration method, device, server, and storage medium. Among them, the method includes: when a first gateway detects that the first access frequency of the first gateway is greater than a first access frequency threshold, obtaining configuration information of the first gateway including multiple configuration files and configuration file usage information. Each configuration file in the multiple configuration files is used to indicate the correspondence between a data request of an item and a server for processing the data request, and the configuration file usage information is used to indicate the usage situation of each configuration file in the multiple configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets. Then, determining a target configuration file with the highest usage frequency among the multiple configuration files according to the configuration file usage information. Finally, updating the configuration information according to the target configuration file, and the updated configuration information includes configuration files other than the target configuration file among the multiple configuration files. By adopting the present application, the stability of the gateway is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of gateways, and in particular to a gateway configuration method, device, server, and medium. Background Art

[0002] Under the microservices architecture, there are numerous gateways, which consume a large amount of resources and are difficult to maintain. The concept of aggregation emerged. For these duplicate gateway services, one aggregation service is used to replace them. That is to say, now only one gateway service is needed.

[0003] In the prior art, multiple gateways are configured in an aggregation gateway, and all projects access the projects through the aggregation gateway. When the data volume of the aggregation gateway reaches a certain amount, it may cause the operation of the aggregation gateway to be unstable. Summary of the Invention

[0004] Embodiments of this application provide a gateway configuration method, device, server, and medium. It is expected that when the access frequency of the gateway is greater than the access frequency threshold, the configuration information of the gateway is updated, so that the updated configuration information includes other configuration files in the multiple configuration files included in the configuration information before the update, except for the configuration file with the highest usage frequency, so that the gateway stops processing the data corresponding to the configuration file with the highest usage frequency, reduces the data processing volume of the gateway, and improves the stability of the gateway.

[0005] In a first aspect, an embodiment of this application provides a gateway configuration method, which is applied to a first gateway. The method includes the following steps: when it is detected that the first access frequency of the first gateway is greater than the first access frequency threshold, obtain the configuration information and configuration file usage information of the first gateway. The configuration information includes multiple configuration files, and each configuration file in the multiple configuration files is used to indicate the correspondence between a data request of a project and a first server. The first server is the server that processes the data request. The configuration file usage information is used to indicate the usage situation of each configuration file in the multiple configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets;

[0006] Determine a target configuration file with the highest usage frequency in the multiple configuration files according to the configuration file usage information;

[0007] Update the configuration information according to the target configuration file. The updated configuration information includes the configuration files in the multiple configuration files except the target configuration file.

[0008] Wherein, the method further includes the following steps: generating a first control instruction according to the target configuration file, and sending the first control instruction to a second gateway, the first control instruction being used to indicate updating configuration information, and the updated configuration information including the target configuration file; generating a second control instruction according to the target configuration file, and sending the second control instruction to a target electronic device, the second control instruction being used to indicate that a target data request corresponds to the second gateway, and the target data request being a data request for an item indicated by the target configuration file.

[0009] Wherein, the sending the first control instruction to the second gateway includes the following steps: when a second access frequency of the second gateway is less than a second access frequency threshold, sending the first control instruction to the second gateway, and the second access frequency being a frequency at which the second gateway receives data packets.

[0010] Wherein, the obtaining the configuration information of the first gateway includes the following steps: obtaining the configuration information from a local database.

[0011] Wherein, the obtaining the configuration information of the first gateway includes the following steps: sending a configuration information obtaining request to a second server; receiving the configuration information from the second server.

[0012] Wherein, the updating the configuration information according to the target configuration file includes the following steps: generating a configuration information updating request according to the target configuration file; sending the configuration information updating request to the second server; receiving the updated configuration information from the second server.

[0013] In a second aspect, an embodiment of the present application provides a gateway configuration device, which is applied to a first gateway. The device includes: an obtaining unit, configured to obtain the configuration information of the first gateway and configuration file usage information when it is detected that a first access frequency of the first gateway is greater than a first access frequency threshold, the configuration information including a plurality of configuration files, each configuration file in the plurality of configuration files being used to indicate a correspondence between a data request for an item and a first server, the first server being a server for processing the data request, and the configuration file usage information being used to indicate the usage situation of each configuration file in the plurality of configuration files, and the first access frequency being a frequency at which the first gateway receives data packets;

[0014] a target configuration file determining unit, configured to determine a target configuration file with the highest usage frequency among the plurality of configuration files according to the configuration file usage information;

[0015] A configuration information update unit, configured to update the configuration information according to the target configuration file, and the updated configuration information includes configuration files other than the target configuration file among the multiple configuration files.

[0016] Wherein, the apparatus further includes: a first control instruction sending unit, configured to generate a first control instruction according to the target configuration file and send the first control instruction to a second gateway, the first control instruction being used to indicate updating the configuration information, and the updated configuration information includes the target configuration file; a second control instruction sending unit, configured to generate a second control instruction according to the target configuration file and send the second control instruction to a target electronic device, the second control instruction being used to indicate that a target data request corresponds to the second gateway, and the target data request refers to a data request for an item indicated by the target configuration file.

[0017] Wherein, in terms of sending the first control instruction to the second gateway, the first control instruction sending unit is specifically configured to: when a second access frequency of the second gateway is less than a second access frequency threshold, send the first control instruction to the second gateway, where the second access frequency refers to a frequency at which the second gateway receives data packets.

[0018] Wherein, in terms of obtaining the configuration information of the first gateway, the obtaining unit is specifically configured to: obtain the configuration information from a local database.

[0019] Wherein, in terms of obtaining the configuration information of the first gateway, the obtaining unit is specifically configured to: send a configuration information obtaining request to a second server; receive the configuration information from the second server.

[0020] Wherein, in terms of updating the configuration information according to the target configuration file, the configuration information update unit is specifically configured to: generate a configuration information update request according to the target configuration file; send the configuration information update request to the second server; receive the updated configuration information from the second server.

[0021] In a third aspect, an embodiment of the present application provides a first gateway, which includes: a processor, a memory, a communication interface, and one or more programs, the one or more programs are stored in the memory and are configured to be executed by the processor, and the one or more programs include instructions for performing the steps in the method described below:

[0022] When it is detected that the first access frequency of the first gateway is greater than the first access frequency threshold, obtain the configuration information of the first gateway and the configuration file usage information. The configuration information includes multiple configuration files, and each configuration file in the multiple configuration files is used to indicate the correspondence between a data request of an item and a first server. The first server is the server that processes the data request. The configuration file usage information is used to indicate the usage situation of each configuration file in the multiple configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets;

[0023] Determine the target configuration file with the highest usage frequency among the multiple configuration files according to the configuration file usage information;

[0024] Update the configuration information according to the target configuration file. The updated configuration information includes the configuration files in the multiple configuration files except the target configuration file.

[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to execute the steps in the method described below:

[0026] When it is detected that the first access frequency of the first gateway is greater than the first access frequency threshold, obtain the configuration information of the first gateway and the configuration file usage information. The configuration information includes multiple configuration files, and each configuration file in the multiple configuration files is used to indicate the correspondence between a data request of an item and a first server. The first server is the server that processes the data request. The configuration file usage information is used to indicate the usage situation of each configuration file in the multiple configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets;

[0027] Determine the target configuration file with the highest usage frequency among the multiple configuration files according to the configuration file usage information;

[0028] Update the configuration information according to the target configuration file. The updated configuration information includes the configuration files in the multiple configuration files except the target configuration file.

[0029] It can be seen that in the embodiments of the present application, when the first gateway detects that the first access frequency of the first gateway is greater than the first access frequency threshold, the configuration information including multiple configuration files and the configuration file usage information of the first gateway are obtained. Each configuration file in the multiple configuration files is used to indicate the correspondence between the data request of an item and the server for processing the data request. The configuration file usage information is used to indicate the usage situation of each configuration file in the multiple configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets. Then, the target configuration file with the highest usage frequency among the multiple configuration files is determined according to the configuration file usage information. Finally, the configuration information is updated according to the target configuration file, and the updated configuration information includes the configuration files other than the target configuration file among the multiple configuration files. It can be seen that by adopting the present application, when the access frequency of the gateway is greater than the access frequency threshold, the configuration information of the gateway is updated, so that the updated configuration information includes the configuration files other than the configuration file with the highest usage frequency among the multiple configuration files included in the configuration information before the update, so that the gateway stops processing the data corresponding to the configuration file with the highest usage frequency, reduces the data processing volume of the gateway, and improves the stability of the gateway. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0031] Figure 1 is a schematic structural diagram of a gateway configuration system provided by an embodiment of the present application;

[0032] Figure 2 is a schematic flowchart of a gateway configuration method provided by an embodiment of the present application;

[0033] Figure 3 is a schematic structural diagram of a gateway configuration device provided by an embodiment of the present application;

[0034] Figure 4 is a schematic structural diagram of a gateway provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0036] The terms "first", "second", etc. in the description, claims and the above-mentioned drawings of this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, device, storage medium, product or equipment that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or equipment.

[0037] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in connection with the embodiment can be included in at least one embodiment of this application. The phrase appearing at various positions in the description does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0038] The electronic device in the embodiments of this application can be a user equipment (UE), access electronic device, user unit, user station, mobile station, mobile device, remote station, remote electronic device, mobile device, user electronic device, intelligent electronic device, wireless communication device, user agent or user device. The electronic device can also be a cellular phone, cordless phone, session initiation protocol (SIP) phone, wireless local loop (WLL) station, personal digital assistant (PDA), handheld device with wireless communication function, computing device or other processing device connected to a wireless modem, relay device, vehicle-mounted device, wearable device, Internet of Things device, electronic device in a next-generation communication system such as an NR network, or an electronic device in a future evolved public land mobile network (PLMN), etc., and no specific limitation is made thereto.

[0039] In order to enable those skilled in the art to better understand the solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts shall fall within the scope of protection of this application.

[0040] Currently, multiple gateways are configured in an aggregated gateway, and all projects access the projects through the aggregated gateway. When the data volume of the aggregated gateway reaches a certain amount, it may cause the operation of the aggregated gateway to be unstable.

[0041] Based on the above problems, an embodiment of the present invention provides a gateway configuration method, which is described in detail as follows.

[0042] Please refer to Figure 1 , Figure 1 which is a schematic architecture diagram of a gateway configuration system provided by an embodiment of the present application. As Figure 1 shown, the gateway configuration system includes a first gateway 110, at least one electronic device 120, and at least one first server 130. The first gateway 110 is communicatively connected to the at least one electronic device 120 and the at least one first server 130 respectively.

[0043] Based on Figure 1 the system architecture shown, the first gateway 110 can receive data requests from the at least one electronic device 120, and send the received data requests to the server in the at least one first server 130 that processes the data requests according to the configuration information in the first gateway 110.

[0044] In a possible example, the gateway configuration system further includes a second server 140. The second server 140 is communicatively connected to the first gateway 110, and the second server 140 can set configuration information for the first gateway.

[0045] It should be noted that Figure 1 the forms and quantities of the first server 130 and the electronic device 120 shown in

[0046] are only for illustration and do not constitute a limitation on the embodiments of the present application. Figure 2 Next, a gateway configuration method in an embodiment of the present application will be described in conjunction with Figure 2 which is a flowchart of a gateway configuration method provided by an embodiment of the present application. The method specifically includes the following steps S101 to S103.

[0047] S101, when the first gateway detects that the first access frequency of the first gateway is greater than the first access frequency threshold, obtain the configuration information of the first gateway and the configuration file usage information, where the configuration information includes multiple configuration files.

[0048] Among them, each of the multiple configuration files is used to indicate the correspondence between a data request of a project and a first server, where the first server is the server that processes the data request, the configuration file usage information is used to indicate the usage of each of the multiple configuration files, and the first access frequency refers to the frequency at which the first gateway receives data packets.

[0049] Among them, the project is not specifically limited. The first access frequency threshold is not specifically limited. In practical applications, users can set this first access frequency threshold as needed. It can be understood that the access frequency thresholds corresponding to different gateways can be different. The multiple configuration files include 3, 4, 10, 100 configuration files, etc., and the number of configuration files in the configuration information is not specifically limited.

[0050] It can be understood that different projects correspond to different configuration files. Only when the configuration information of the first gateway includes the configuration file of a certain project can the first gateway transmit the data of that project to achieve the data processing of that project.

[0051] It can be seen that in this example, the gateway needs to obtain the configuration information and configuration file usage information of the gateway when it detects that the access frequency of the gateway is greater than the access frequency threshold, so as to update the configuration information of the gateway and ensure that the gateway can effectively avoid the abnormal operation of the gateway caused by excessive access volume.

[0052] S102. The first gateway determines the target configuration file with the highest usage frequency among the multiple configuration files according to the configuration file usage information.

[0053] Among them, the highest usage frequency, that is, the highest call frequency. The usage frequency refers to the effective usage frequency. It should be noted that one effective usage of a configuration file means that the first gateway completes a data forwarding based on the correspondence between the data request of the project in the configuration file and the server.

[0054] It can be seen that in this example, the gateway can independently determine the target configuration file with the highest usage frequency among the multiple configuration files, improving the intelligence of the gateway.

[0055] S103. The first gateway updates the configuration information according to the target configuration file, and the updated configuration information includes the configuration files other than the target configuration file among the multiple configuration files.

[0056] For example, the configuration information of Gateway A includes configuration files A, B, C, D, E, F, G, and H. When the access frequency of the first gateway is greater than the access frequency threshold, if it is determined that the configuration file with the highest usage frequency is configuration file G based on the usage information of the configuration files of this Gateway A, then the configuration information of this Gateway A is updated. The updated configuration information of this Gateway A includes configuration files A, B, C, D, E, F, and H.

[0057] It can be seen that in this example, when the access frequency of the gateway is greater than the access frequency threshold, the configuration information of the gateway is updated, so that the updated configuration information includes the other configuration files in the multiple configuration files included in the configuration information before the update, except for the configuration file with the highest usage frequency, so that the gateway stops processing the data corresponding to the configuration file with the highest usage frequency, reducing the data processing volume of the gateway and improving the stability of the gateway.

[0058] It can be seen that in the embodiment of this application, when the first gateway detects that the first access frequency of the first gateway is greater than the first access frequency threshold, it obtains the configuration information including multiple configuration files and the configuration file usage information of the first gateway. Each configuration file in the multiple configuration files is used to indicate the correspondence between a data request of a project and the server for processing the data request. The configuration file usage information is used to indicate the usage situation of each configuration file in the multiple configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets. Then, according to the configuration file usage information, the target configuration file with the highest usage frequency in the multiple configuration files is determined. Finally, the configuration information is updated according to the target configuration file. The updated configuration information includes the configuration files in the multiple configuration files except the target configuration file. It can be seen that by adopting this application, when the access frequency of the gateway is greater than the access frequency threshold, the configuration information of the gateway is updated, so that the updated configuration information includes the other configuration files in the multiple configuration files included in the configuration information before the update, except for the configuration file with the highest usage frequency, so that the gateway stops processing the data corresponding to the configuration file with the highest usage frequency, reducing the data processing volume of the gateway and improving the stability of the gateway.

[0059] In a possible example, the method further includes the following steps: The first gateway generates a first control instruction according to the target configuration file, and sends the first control instruction to the second gateway. The first control instruction is used to indicate the update of configuration information, and the updated configuration information includes the target configuration file. The first gateway generates a second control instruction according to the target configuration file, and sends the second control instruction to the target electronic device. The second control instruction is used to indicate that the target data request corresponds to the second gateway, and the target data request refers to the data request of the item indicated by the target configuration file.

[0060] It can be understood that after receiving the first control instruction, the second gateway will add the target configuration file to the second gateway configuration information. It should be noted that both the first gateway and the second gateway can communicate with the user equipment that sends the data request and the server that processes the data request for the item corresponding to the target configuration file. It can be seen that the updated configuration information of the first gateway no longer includes the target configuration file, but the updated configuration information of the first gateway adds the target configuration file. In other words, the target configuration file is transplanted from the first gateway to the second gateway, while maintaining the stability of the first gateway, ensuring that the item corresponding to the target configuration file can pass through the second gateway.

[0061] Among them, the target electronic device refers to the user equipment of the item corresponding to the target configuration file. After receiving the second control instruction, the target electronic device can send the data request of the item indicated by the generated target configuration file to the second gateway based on the second control instruction, so as to realize data forwarding through the second gateway. In other words, the processing flow of the item indicated by the target configuration file is transferred from the first gateway to the second gateway.

[0062] As a possible implementation manner, the first gateway sending the first control instruction to the second gateway includes the following steps: The first gateway sends the first control instruction to the second gateway when the second access frequency of the second gateway is less than the second access frequency threshold, and the second access frequency refers to the frequency at which the second gateway receives data packets.

[0063] Among them, the second access frequency threshold is not specifically limited, and the user can set it according to needs. The second access frequency threshold is much smaller than the maximum access frequency value at which the first gateway can operate normally.

[0064] It can be seen that in this example, when the access frequency of the first gateway to the second gateway is less than the second access frequency threshold of the second gateway, the first gateway sends the first control instruction to the second gateway, ensuring that after the processing flow of the items indicated in the target configuration file is transferred from the first gateway to the second gateway, the second gateway can operate normally.

[0065] Optionally, the first gateway obtains the configuration information of the first gateway, including the following steps: the first gateway obtains the configuration information from the local database.

[0066] It can be seen that in this example, the first gateway can directly obtain the local configuration information from the local database, improving the intelligence of gateway configuration.

[0067] Optionally, the first gateway obtains the configuration information of the first gateway, including the following steps: the first gateway sends a configuration information acquisition request to the second server; the first gateway receives the configuration information from the second server.

[0068] Among them, the second server refers to the server that provides the configuration information for the first gateway. The second server can be an overall structure composed of the configuration center config-server and the repository gitlab in the microservice framework. The configuration information is stored in gitlab, and config-server synchronizes the configuration in the gitlab repository every few minutes. When the first gateway service starts, it will pull its own configuration information from config-server.

[0069] It can be seen that in this example, the first gateway can obtain the local configuration information from the corresponding server, improving the intelligence of gateway configuration.

[0070] As a possible implementation method, the first gateway updates the configuration information according to the target configuration file, including the following steps: the first gateway generates a configuration information update request according to the target configuration file; the first gateway sends the configuration information update request to the second server; the first gateway receives the updated configuration information from the second server.

[0071] It can be seen that in this example, the first gateway can request the corresponding server based on the target configuration file, and thus receive the updated configuration information from the server.

[0072] In the case of adopting integrated units, please refer to Figure 3 , Figure 3A block diagram of the functional units of a gateway configuration device is provided. The gateway configuration device 200 is applied to a first gateway. The device 200 specifically includes: an acquisition unit 202, configured to acquire the configuration information and configuration file usage information of the first gateway when it is detected that the first access frequency of the first gateway is greater than a first access frequency threshold. The configuration information includes a plurality of configuration files, and each configuration file in the plurality of configuration files is used to indicate the correspondence between the data requests of an item and a first server. The first server is the server for processing the data requests. The configuration file usage information is used to indicate the usage situation of each configuration file in the plurality of configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets.

[0073] A target configuration file determination unit 203, configured to determine the target configuration file with the highest usage frequency among the plurality of configuration files according to the configuration file usage information.

[0074] A configuration information update unit 204, configured to update the configuration information according to the target configuration file. The updated configuration information includes the configuration files in the plurality of configuration files except the target configuration file.

[0075] The gateway configuration device 200 may further include a storage unit 201, configured to store the program code and data of the terminal.

[0076] When the storage unit 201 is a memory, the gateway configuration device 200 involved in the embodiments of the present application may be Figure 4 the first gateway shown.

[0077] It should be noted that the specific implementation of each operation can be found in the description in the above Figure 2 method embodiment shown, and will not be specifically described herein.

[0078] It can be seen that in the embodiments of the present application, when the first gateway detects that the first access frequency of the first gateway is greater than the first access frequency threshold, the first gateway obtains the configuration information including multiple configuration files and the configuration file usage information of the first gateway. Each configuration file in the multiple configuration files is used to indicate the correspondence between the data request of an item and the server for processing the data request, and the configuration file usage information is used to indicate the usage situation of each configuration file in the multiple configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets. Then, the target configuration file with the highest usage frequency among the multiple configuration files is determined according to the configuration file usage information. Finally, the configuration information is updated according to the target configuration file, and the updated configuration information includes the configuration files in the multiple configuration files except the target configuration file. It can be seen that by adopting the present application, when the access frequency of the gateway is greater than the access frequency threshold, the configuration information of the gateway is updated, so that the updated configuration information includes the configuration files in the multiple configuration files included in the configuration information before the update, except for the configuration file with the highest usage frequency, so that the gateway stops processing the data corresponding to the configuration file with the highest usage frequency, reduces the data processing amount of the gateway, and improves the stability of the gateway.

[0079] In a possible example, the device 200 further includes: a first control instruction sending unit 205, configured to generate a first control instruction according to the target configuration file and send the first control instruction to a second gateway, where the first control instruction is used to indicate updating the configuration information, and the updated configuration information includes the target configuration file; a second control instruction sending unit 206, configured to generate a second control instruction according to the target configuration file and send the second control instruction to a target electronic device, where the second control instruction is used to indicate that the target data request corresponds to the second gateway, and the target data request refers to the data request of the item indicated by the target configuration file.

[0080] In a possible example, in terms of sending the first control instruction to the second gateway, the first control instruction sending unit 205 is specifically configured to: when the second access frequency of the second gateway is less than the second access frequency threshold, send the first control instruction to the second gateway, where the second access frequency refers to the frequency at which the second gateway receives data packets.

[0081] In a possible example, in terms of obtaining the configuration information of the first gateway, the obtaining unit 202 is specifically configured to: obtain the configuration information from a local database.

[0082] In a possible example, in terms of obtaining the configuration information of the first gateway, the obtaining unit 202 is specifically configured to: send a configuration information obtaining request to a second server; receive the configuration information from the second server.

[0083] In a possible example, in terms of updating the configuration information according to the target configuration file, the configuration information update unit 204 is specifically configured to: generate a configuration information update request according to the target configuration file; send the configuration information update request to the second server; and receive the updated configuration information from the second server.

[0084] Please refer to Figure 4 , which is a schematic structural diagram of a first gateway provided by an embodiment of the present application. As Figure 4 shown, the first gateway 300 in this embodiment may include: a processing module 310, a memory 320, a communication interface 330, and one or more programs 321. The one or more programs 321 are stored in the memory 320 and are configured to be executed by the processing module 310. The one or more programs 321 include instructions for performing the steps in the method described below:

[0085] When it is detected that the first access frequency of the first gateway is greater than the first access frequency threshold, obtain the configuration information of the first gateway and the configuration file usage information. The configuration information includes multiple configuration files, and each configuration file in the multiple configuration files is used to indicate the correspondence between a data request of an item and a first server. The first server is a server for processing the data request. The configuration file usage information is used to indicate the usage situation of each configuration file in the multiple configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets;

[0086] Determine the target configuration file with the highest usage frequency among the multiple configuration files according to the configuration file usage information;

[0087] Update the configuration information according to the target configuration file. The updated configuration information includes the configuration files other than the target configuration file among the multiple configuration files.

[0088] The processing module 310 may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0089] It should be noted that the specific implementation of each operation can be found in the description in the foregoing Figure 2 method embodiments shown, and will not be elaborated herein.

[0090] It can be seen that in the embodiments of the present application, when the first gateway detects that the first access frequency of the first gateway is greater than the first access frequency threshold, the configuration information including a plurality of configuration files and the configuration file usage information of the first gateway are obtained. Each configuration file in the plurality of configuration files is used to indicate the correspondence between a data request of a project and a server for processing the data request, and the configuration file usage information is used to indicate the usage situation of each configuration file in the plurality of configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets. Then, the target configuration file with the highest usage frequency among the plurality of configuration files is determined according to the configuration file usage information. Finally, the configuration information is updated according to the target configuration file, and the updated configuration information includes the configuration files other than the target configuration file among the plurality of configuration files. It can be seen that by adopting the present application, when the access frequency of the gateway is greater than the access frequency threshold, the configuration information of the gateway is updated, so that the updated configuration information includes the configuration files other than the configuration file with the highest usage frequency among the plurality of configuration files included in the configuration information before the update, so that the gateway stops processing the data corresponding to the configuration file with the highest usage frequency, reduces the data processing amount of the gateway, and improves the stability of the gateway.

[0091] In a possible example, the one or more programs 321 further include instructions for performing the steps in the following method: generating a first control instruction according to the target configuration file, and sending the first control instruction to a second gateway, where the first control instruction is used to indicate updating the configuration information, and the updated configuration information includes the target configuration file; generating a second control instruction according to the target configuration file, and sending the second control instruction to a target electronic device, where the second control instruction is used to indicate that a target data request corresponds to the second gateway, and the target data request refers to a data request of a project indicated by the target configuration file.

[0092] In a possible example, with regard to sending the first control instruction to the second gateway, the instructions in the one or more programs 321 are specifically used to perform the following steps:

[0093] When the second access frequency of the second gateway is less than the second access frequency threshold, sending the first control instruction to the second gateway, where the second access frequency refers to the frequency at which the second gateway receives data packets.

[0094] In a possible example, in terms of obtaining the configuration information of the first gateway, the instructions in the one or more programs 321 are specifically configured to perform the following steps: obtain the configuration information from a local database.

[0095] In a possible example, in terms of obtaining the configuration information of the first gateway, the instructions in the one or more programs 321 are specifically configured to perform the following steps: send a configuration information acquisition request to a second server; receive the configuration information from the second server.

[0096] In a possible example, in terms of updating the configuration information according to the target configuration file, the instructions in the one or more programs 321 are specifically configured to perform the following steps: generate a configuration information update request according to the target configuration file; send the configuration information update request to the second server; receive the updated configuration information from the second server.

[0097] An embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, they implement the gateway configuration method as shown in Figure 2 the embodiment.

[0098] The computer-readable storage medium may be an internal storage unit of the first gateway in any of the foregoing embodiments, such as a hard disk or memory of a control device. The computer-readable storage medium may also be an external storage device of the control device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the control device. Further, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the control device. The computer-readable storage medium is used to store the computer program and other programs and data required by the control device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0099] As an example, the above computer-readable storage medium may be deployed to be executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected by a communication network. The multiple computer devices distributed at multiple locations and interconnected by a communication network may form a blockchain network.

[0100] As described above, it is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims

1. A gateway configuration method, characterized in that, Applied to a first gateway, the method includes the following steps: When it is detected that the first access frequency of the first gateway is greater than a first access frequency threshold, obtain the configuration information of the first gateway and the configuration file usage information. The configuration information includes a plurality of configuration files, and each configuration file in the plurality of configuration files is used to indicate the correspondence between the data requests of a project and a first server. The first server is the server that processes the data requests, and the configuration file usage information is used to indicate the usage situation of each configuration file in the plurality of configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets. Determine the target configuration file with the highest usage frequency among the plurality of configuration files according to the configuration file usage information; wherein, the usage frequency refers to the effective usage frequency, and an effective usage of a configuration file means that the first gateway completes a data forwarding based on the correspondence between the data requests of the project in the configuration file and the server. Update the configuration information according to the target configuration file. The updated configuration information includes the configuration files in the plurality of configuration files except the target configuration file.

2. The method according to claim 1, wherein, The method further includes the following steps: Generate a first control instruction according to the target configuration file and send the first control instruction to a second gateway. The first control instruction is used to indicate an update of the configuration information, and the updated configuration information includes the target configuration file. Generate a second control instruction according to the target configuration file and send the second control instruction to a target electronic device. The second control instruction is used to indicate that the target data request corresponds to the second gateway. The target data request refers to the data request of the project indicated by the target configuration file.

3. The method according to claim 2, wherein, The step of sending the first control instruction to the second gateway includes the following steps: When the second access frequency of the second gateway is less than a second access frequency threshold, send the first control instruction to the second gateway. The second access frequency refers to the frequency at which the second gateway receives data packets.

4. The method according to claim 1, wherein The step of obtaining the configuration information of the first gateway includes the following steps: Obtain the configuration information from a local database.

5. The method according to claim 1, wherein The step of obtaining the configuration information of the first gateway includes the following steps: Send a configuration information acquisition request to a second server; Receive the configuration information from the second server.

6. The method according to claim 5, wherein, The step of updating the configuration information according to the target configuration file includes the following steps: Generate a configuration information update request according to the target configuration file; Send the configuration information update request to the second server; Receive the updated configuration information from the second server.

7. A gateway configuration device, characterized in that, Applied to a first gateway, the device includes units for implementing the method according to any one of claims 1-6. The device includes: An acquisition unit, configured to acquire the configuration information and configuration file usage information of the first gateway when it is detected that the first access frequency of the first gateway is greater than a first access frequency threshold, where the configuration information includes a plurality of configuration files, each of the plurality of configuration files is used to indicate the correspondence between the data requests of an item and a server, the server is the server for processing the data requests, and the configuration file usage information is used to indicate the usage of each of the plurality of configuration files. The first access frequency refers to the frequency at which the first gateway receives data packets; A target configuration file determination unit, configured to determine a target configuration file with the highest usage frequency among the plurality of configuration files according to the configuration file usage information; A configuration information update unit, configured to update the configuration information according to the target configuration file, and the updated configuration information includes the configuration files other than the target configuration file among the plurality of configuration files.

8. The device according to claim 7, characterized in that, The apparatus further includes: A sending unit, configured to generate a first control instruction according to the target configuration file and send the first control instruction to a second gateway, where the first control instruction is used to indicate updating the configuration information, and the updated configuration information includes the target configuration file; and configured to generate a second control instruction according to the target configuration file and send the second control instruction to a target electronic device, where the second control instruction is used to indicate that a target data request corresponds to the second gateway, and the target data request is the data request of the item indicated by the target configuration file.

9. A first gateway, characterized in that, Comprising a processor, a memory, a communication interface, and one or more programs, the one or more programs are stored in the memory and configured to be executed by the processor, and the one or more programs include instructions for performing the steps in the method according to any one of claims 1-6.

10. A computer-readable storage medium, characterized in that, A computer program stored for electronic data exchange, wherein the computer program causes a computer to execute the steps in the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Data processing method and apparatus for implementing reconfiguration of automobile communication gateway software

    CN102811232A

  • Task-driven multi-gateway cooperation method

    CN108174397A