Method, apparatus, storage medium, and electronic device for processing event requests
By establishing the original operation flow table on the switching device and obtaining the target operation table entries, the problem of low utilization of storage resources by switching devices is solved, and efficient utilization of storage resources and functional expansion is achieved.
Patent Information
- Application Number
- CN202111670404.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2041-12-30
AI Technical Summary
The low utilization rate of storage resources of switching devices leads to a high utilization rate of storage resources, reducing the utilization rate of storage resources and the expansion ability of other new functions.
After establishing the original operation flow table on the switching device, by obtaining the target event request, responding to the target event request, obtaining the target operation table entry from the original operation flow table, and calling the target operation table entry to execute the target event, multiplexing the existing flow table resources without adding new storage resources.
The storage resource utilization rate of switching devices is improved, and new functions are expanded without increasing storage resources are realized.
Smart Images

Figure CN116414826B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of switches, and in particular, to a method, device, storage medium, and electronic device for processing an event request. Background Art
[0002] Table lookups in switching devices are typically based on a key-action lookup process. After the switch system boots up, the chip's memory resources are divided according to the functional modules. In other words, the flow table corresponding to a specific function only contains the corresponding key and action information. The chip groups keys based on different key types and then uses a hash polynomial for compression calculation to obtain the key table index, which is then used to retrieve information from the action table. This specialized nature of the flow table results in high switch memory usage, reducing memory resource utilization and the expansion of new functions.
[0003] Currently, no effective solution has been proposed to the problem of low utilization of storage resources of switching devices in related technologies. Summary of the Invention
[0004] The embodiments of the present invention provide a method, device, storage medium and electronic device for processing an event request, so as to at least solve the problem of low utilization rate of storage resources of switching devices existing in the related art.
[0005] According to one embodiment of the present invention, a method for processing an event request is provided, comprising: obtaining a target event request received on a switching device, wherein the target event request is used to request execution of a target event on the switching device; in a case where the target event is an event that the switching device is determined to be allowed to execute after an original operation flow table is established on the switching device, responding to the target event request, obtaining the target operation table entry from the original operation flow table, wherein the original operation flow table records an original flow table entry corresponding to the original event that the switching device is allowed to execute and a target operation table entry corresponding to the target event, and the flow table entry recorded in the original operation flow table is used to store the operation for executing the corresponding event; and calling the target operation table entry to execute the target event.
[0006] Optionally, the response to the target event request obtains the target operation table item from the original operation flow table, including: obtaining target index information corresponding to the target event from events and index information with corresponding relationships, wherein the target index information is used to indicate the target storage location of the target operation table item in the original operation flow table; and searching the original operation flow table for data stored at the target storage location as the target operation table item according to the target index information.
[0007] Optionally, searching the original operation flow table for the data stored at the target storage location as the target operation table entry according to the target index information includes: obtaining the target operation flow table identified by the flow table index included in the target index information from the original operation flow table established on the switching device; obtaining the target information table identified by the table item type index included in the target index information from the information table included in the target operation flow table; and searching the target information table for the data stored at the storage location index included in the target index information as the target operation table entry.
[0008] Optionally, obtaining the target information table identified by the table item type index included in the target index information from the information table included in the target operation flow table includes: when the table item type index is a first identifier, determining that the target information table is the target operation information table included in the target operation flow table, wherein the first identifier is used to indicate that the storage capacity of the target operation table item is less than or equal to the storage space allowed for use in the operation information table; when the table item type index is a second identifier, determining that the target information table is the target index information table and the target operation information table included in the target operation flow table, wherein the second identifier is used to indicate that the storage capacity of the target operation table item is greater than the storage space allowed for use in the operation information table.
[0009] Optionally, before obtaining the target operation table entry from the original operation flow table, the method further includes: obtaining an event type identifier from the target event request, wherein the event type identifier is used to indicate the timing when the switching device is allowed to execute the target event; when the event type identifier is a target identifier, determining that the target event is an event that the switching device is allowed to execute after the original operation flow table is established on the switching device.
[0010] Optionally, before responding to the target event request and obtaining the target operation table entry from the original operation flow table, the method also includes: obtaining target operation information for executing the target event, and the target storage capacity of the target operation information; obtaining a target operation flow table whose allowed storage capacity meets the target storage capacity from the original operation flow table established on the switching device; and storing the target operation information as the target operation table entry in the target operation flow table.
[0011] Optionally, obtaining a target operation flow table whose allowed storage amount satisfies the target storage amount from the original operation flow table established on the switching device includes: obtaining, from the original operation flow table established on the switching device, an original operation flow table whose storage space allowed to be used on the operation information table included therein is greater than or equal to the target storage amount as the target operation flow table, wherein the target operation table item is stored in the target operation information table included in the target operation flow table; in the case that an original operation flow table whose storage space allowed to be used on the operation information table included therein is greater than or equal to the target storage amount is not obtained, obtaining, from the original operation flow table established on the switching device, an original operation flow table whose total storage space allowed to be used on the operation information table and index information table included therein is greater than or equal to the target storage amount as the target operation flow table, wherein the target operation table item is stored in the target operation information table and target index information table included in the target operation flow table.
[0012] According to another embodiment of the present invention, there is also provided an event request processing device, comprising: a first acquisition module, configured to acquire a target event request received on a switching device, wherein the target event request is used to request execution of a target event on the switching device; a response module, configured to respond to the target event request, when the target event is an event that the switching device is determined to be allowed to execute after an original operation flow table is established on the switching device, and to acquire the target operation table entry from the original operation flow table, wherein the original operation flow table records an original flow table entry corresponding to the original event that the switching device is allowed to execute and a target operation table entry corresponding to the target event, and the flow table entry recorded in the original operation flow table is used to store an operation for executing the corresponding event; and a calling module, configured to call the target operation table entry to execute the target event.
[0013] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when run.
[0014] According to another embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any one of the above method embodiments.
[0015] According to the present invention, a target event request received on a switching device is obtained, wherein the target event request is used to request execution of a target event on the switching device; when the target event is an event that is determined to be allowed to be executed by the switching device after an original operation flow table is established on the switching device, a target operation table item is obtained from the original operation flow table in response to the target event request, wherein the original operation flow table records an original flow table item corresponding to the original event allowed to be executed by the switching device and a target operation table item corresponding to the target event, and the flow table item recorded in the original operation flow table is used to store the operation for executing the corresponding event; the target operation table item is called to execute the target event, that is, the original operation flow table records an original flow table item corresponding to the original event allowed to be executed by the switching device, and the original operation flow table is called to record the target operation table item corresponding to the target event. Then, after receiving the target event request, the target operation is executed on the switching device by calling the target operation table item, thereby realizing calling the space in the original operation flow table to record the target operation table item corresponding to the execution of the target event, rather than creating a new operation flow table to record the target operation table item for the execution of the target event for the target event. Therefore, the problem of low storage resource utilization of the switching device existing in the related art is solved, and the storage resource utilization of the switching device is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 1 is a block diagram of the hardware structure of a mobile terminal according to the method for processing an event request according to an embodiment of the present invention;
[0017] Figure 2 is a flowchart of a method for processing an event request according to an embodiment of the present invention;
[0018] Figure 3 is an optional event request processing flow chart according to an embodiment of the present invention;
[0019] Figure 4 4 is a structural block diagram of an event request processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with embodiments.
[0021] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0022] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a block diagram of the hardware structure of a mobile terminal according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown) a processor 102 (the processor 102 may include but is not limited to a microprocessor MCU or a programmable logic device FPGA and other processing devices) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It will be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown.
[0023] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for processing event requests in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, that is, implementing the above-mentioned method. The memory 104 may include a high-speed random access memory and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0024] The transmission device 106 is used to receive or send data via a network. A specific example of the aforementioned network may include a wireless network provided by the mobile terminal's communications provider. In one embodiment, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In one embodiment, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0025] In this embodiment, a method for processing an event request is provided. Figure 2 FIG. 1 is a flow chart of a method for processing an event request according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0026] Step S202: Acquire a target event request received on a switching device, wherein the target event request is used to request execution of a target event on the switching device;
[0027] Step S204: If the target event is an event that the switching device is determined to be allowed to execute after the original operation flow table is established on the switching device, in response to the target event request, obtain the target operation table entry from the original operation flow table, wherein the original operation flow table records the original flow table entry corresponding to the original event that the switching device is allowed to execute and the target operation table entry corresponding to the target event, and the flow table entry recorded in the original operation flow table is used to store the operation for executing the corresponding event;
[0028] Step S206: calling the target operation entry to execute the target event.
[0029] Through the above steps, the original operation flow table records the original flow table entry corresponding to the original event allowed to be executed by the switching device, calls the original operation flow table to record the target operation table entry corresponding to the target event, and then, after receiving the target event request, executes the target operation on the switch device by calling the target operation table entry, thereby realizing calling the space record in the original operation flow table to execute the target operation table entry corresponding to the target event, rather than opening a new operation flow table to record the target operation table entry to execute the target event for the target event. Therefore, the problem of low storage resource utilization of the switching device existing in the related technology is solved, and the effect of improving the storage resource utilization of the switching device is achieved.
[0030] In the technical solution provided in the above step S202, the switching device may include, but is not limited to, a user network edge device, a service provider edge device, etc. For example, the user network edge device may include a switch, a router, and the service provider edge device may be a base station, etc.
[0031] In the technical solution provided in the above step S204, the original operation flow table is used to record the original operation information of executing the original event. The original operation flow table includes original flow table entries recording the original operation information and empty flow table entries that do not record any information.
[0032] Optionally, in this embodiment, the target operation table entry is a flow table entry in the original operation flow table that does not record the original operation information.
[0033] Optionally, in this embodiment, the original operation flow table can be a single table or multiple tables used to execute an original event. For example, the event storage mechanism of the Key-Action table commonly used in switching equipment, the Key table is a key value table in the switch used to find information about execution events, and the Action table is a table item that stores information about the action strategy for executing the original event. The original event flow table can be one or more of the Key table or the Action table, and this solution does not limit this.
[0034] In the technical solution provided in the above step S206, calling the target operation table item to execute the target event can be to run the data stored in the flow table item in the target operation table item, thereby executing the target event, or it can be to extract the data stored in the target operation table item and input the data into other programs for execution. This solution does not limit this.
[0035] As an optional embodiment, the step of responding to the target event request and obtaining the target operation entry from the original operation flow table includes:
[0036] Acquire target index information corresponding to the target event from events and index information having a corresponding relationship, wherein the target index information is used to indicate a target storage location of the target operation entry in the original operation flow table;
[0037] The data stored in the target storage location is searched in the original operation flow table according to the target index information as the target operation table entry.
[0038] Optionally, in this embodiment, the target storage location may be any location in the original operation flow table, such as a table header, a table footer, and the like.
[0039] As an optional embodiment, searching the original operation flow table for the data stored at the target storage location as the target operation table entry according to the target index information includes:
[0040] Acquire a target operation flow table identified by the flow table index included in the target index information from an original operation flow table established on the switching device;
[0041] Acquire, from the information table included in the target operation flow table, the target information table identified by the entry type index included in the target index information;
[0042] The target information table is searched for data stored in the storage location index included in the target index information as the target operation table entry.
[0043] Optionally, in this embodiment, the target information table may be a table in one original operation flow table, or may be a table in multiple original operation flow tables, which is not limited in this solution.
[0044] Optionally, in this embodiment, the target information table may be one or more flow tables in the original operation flow table, which is not limited in this solution.
[0045] Figure 3It is an optional event request processing flow chart according to an embodiment of the present invention, which can be applied to, but is not limited to, searching for operation information stored on a switching device for executing an event. For example, an original event has been created in the switching chip, that is, an original operation flow table corresponding to the original event has been created (a key table and an action table, a keyType is placed in the key table to avoid mismatching, and the action table stores operation information for executing the event corresponding to the key table). In order to execute the original event, the HASH table corresponding to the specific module usually contains multiple key types. After receiving the original event request, the chip performs a key flow table search to obtain the Action flow table index AD index for executing the original event, and indexes the Action flow table ADindex through the BUS, thereby finding the Action table item that stores the event information for executing the original event and performing the message editing action. The present invention stores the operation information of the target event in a table entry in the original operation flow table corresponding to the original event, which does not store the operation information of the original event, such as the unoccupied space in the Key table or the Action table, when adding the operation information of the target event after the original operation flow table of the original event already exists on the switching device. The target event is executed by reusing the unoccupied space in the original operation flow table without adding additional storage resources. When an event request for executing the event is obtained, Figure 3 As shown, it may include but is not limited to the following:
[0046] Step S301: After obtaining the event request, detect the event type identifier KeyType of the event;
[0047] Step S302: When it is detected that the event type identifier is the identifier key corresponding to the original event, it is determined that the event request is a request for requesting execution of the original event, and step S303 is executed;
[0048] Step S303: determine the path information for searching the corresponding original operation flow table through a hash algorithm, and search the Key Memory space storing the Key table based on the path information to find the corresponding Action table;
[0049] Step S304: When the event type identifier is detected as the identifier XKey corresponding to the target event, step S305 is executed;
[0050] Step S305: Obtain target index information corresponding to the target event from the events and index information having a corresponding relationship, and determine whether the entry type storing the operation information corresponding to the target event is a DirectAd type according to the target index information;
[0051] Step S306: When it is determined from the target index information that the table entry type storing the operation information corresponding to the target event is of the DirectAd type, and the Action table entry in the original operation flow table is large enough, and all the operation information corresponding to the target event is stored in the Action table in the original operation flow table, the index path adIndex for searching the target operation table entry storing the operation information of the target event is obtained, and step S312 is executed.
[0052] Step S307: When it is determined that the entry type storing the operation information corresponding to the target event is not a DirectAd type, determine whether the entry type storing the operation information corresponding to the target event is a DirectKeytAd type;
[0053] Step S308: When it is determined from the target index information that the table entry type storing the operation information corresponding to the target event is of the DirecKeytAd type, and the Action table entry in the original operation flow table is not large enough, and the operation information corresponding to the target event is partially stored in the Action table in the original operation flow table and partially stored in the Key table, an index path AdIndex for searching for the target operation table entry storing the operation information of the target event in the Action table and the Key table is obtained. The index path includes the location of the target operation table entry in the Action table and the Key table.
[0054] Step S309: Check whether the depth of the index path is greater than the depth of the target operation entry in the Action table. If the depth of the index path is greater than the depth of the target operation entry in the Action table, execute step S310. If the depth of the index path is not greater than the depth of the target operation entry in the Action table, execute step S312.
[0055] Step S310: When the depth of the index path is greater than the depth of the target operation entry in the Action table, the target operation entry in the Action flow table is deleted from the index path to obtain a deleted index path. The deleted index path only contains the index path used to search for the target operation entry in the Key table, and then step S311 is executed.
[0056] Step S311, searching for the corresponding target operation entry in the Key Memory space storing the Key table according to the index path;
[0057] Step S312: Search the Ad Memory space storing the Action table for the corresponding target operation entry according to the index path.
[0058] The embodiments of the present invention flexibly utilize the key and action storage resources of each level of flow tables to place the action table entry corresponding to a specific flow table. This allows for flexible placement of specific actions within the pipeline architecture and allows for new functionality expansion by reusing existing flow table resources without adding new storage resources. Furthermore, this design does not affect the existing functionality of each level of flow tables, but rather provides a mechanism for flexible resource sharing.
[0059] As an optional embodiment, obtaining the target information table identified by the entry type index included in the target index information from the information table included in the target operation flow table includes:
[0060] In a case where the entry type index is a first identifier, determining that the target information table is a target operation information table included in the target operation flow table, wherein the first identifier is used to indicate that a storage capacity of the target operation table entry is less than or equal to a storage space allowed to be used in the operation information table;
[0061] When the table entry type index is a second identifier, the target information table is determined to be a target index information table and a target operation information table included in the target operation flow table, wherein the second identifier is used to indicate that the storage capacity of the target operation table entry is greater than the storage space allowed in the operation information table.
[0062] Optionally, in this embodiment, the storage space allowed to be used in the operation information table is the storage space that does not store the operation information corresponding to the execution of the original event.
[0063] As an optional embodiment, before obtaining the target operation table entry from the original operation flow table, the method further includes:
[0064] Acquire an event type identifier from the target event request, wherein the event type identifier is used to indicate a timing at which the switching device is allowed to execute the target event;
[0065] In a case where the event type identifier is a target identifier, the target event is determined to be an event that the switching device is allowed to execute after the original operation flow table is established on the switching device.
[0066] Optionally, in this embodiment, the timing of executing the target event is determined according to the setting time of the target event and the original event on the switching device.
[0067] As an optional embodiment, before responding to the target event request and obtaining the target operation table entry from the original operation flow table, the method further includes:
[0068] Acquire target operation information for executing the target event and a target storage capacity of the target operation information;
[0069] Acquire a target operation flow table whose allowed storage amount satisfies the target storage amount from the original operation flow table established on the switching device;
[0070] The target operation information is stored as the target operation table entry in the target operation flow table.
[0071] Optionally, in this embodiment, the target operation flow table obtained can be an operation flow table in the original operation flow table corresponding to the same original event, or any multiple operation flow tables in multiple original operation flow tables corresponding to multiple original events. This solution does not limit this.
[0072] As an optional embodiment, obtaining a target operation flow table in which the allowed storage amount satisfies the target storage amount from the original operation flow table established on the switching device includes:
[0073] acquiring, from the original operation flow table established on the switching device, an original operation flow table whose storage space allowed to be used on the operation information table included therein is greater than or equal to the target storage amount as the target operation flow table, wherein the target operation table entry is stored in the target operation information table included in the target operation flow table;
[0074] In the case that the original operation flow table in which the storage space allowed to be used on the included operation information table is greater than or equal to the target storage amount is not obtained, the original operation flow table in which the total storage space allowed to be used on the included operation information table and index information table is greater than or equal to the target storage amount is obtained from the original operation flow table established on the switching device as the target operation flow table, wherein the target operation table entry is stored in the target operation information table and target index information table included in the target operation flow table.
[0075] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0076] This embodiment also provides a device for processing event requests. Figure 4 FIG. 1 is a structural block diagram of an apparatus for processing event requests according to an embodiment of the present invention. Figure 4 As shown, the device includes:
[0077] A first acquisition module 42 is configured to acquire a target event request received on a switching device, wherein the target event request is used to request execution of a target event on the switching device;
[0078] a response module 44 configured to, when the target event is an event that the switching device is determined to be allowed to execute after the original operation flow table is established on the switching device, respond to the target event request and obtain the target operation table entry from the original operation flow table, wherein the original operation flow table records the original flow table entry corresponding to the original event that the switching device is allowed to execute and the target operation table entry corresponding to the target event, and the flow table entry recorded in the original operation flow table is used to store the operation for executing the corresponding event;
[0079] The calling module 46 is configured to call the target operation entry to execute the target event.
[0080] Optionally, the response module includes: a first acquisition unit, used to obtain target index information corresponding to the target event from events and index information with corresponding relationships, wherein the target index information is used to indicate the target storage position of the target operation table item in the original operation flow table; a search unit, used to search the original operation flow table for data stored at the target storage position as the target operation table item according to the target index information.
[0081] Optionally, the search unit is used to: obtain the target operation flow table identified by the flow table index included in the target index information from the original operation flow table established on the switching device; obtain the target information table identified by the table item type index included in the target index information from the information table included in the target operation flow table; and search the target information table for the data stored on the storage location index included in the target index information as the target operation table item.
[0082] Optionally, the search unit is used to: when the table item type index is a first identifier, determine that the target information table is a target operation information table included in the target operation flow table, wherein the first identifier is used to indicate that the storage capacity of the target operation table item is less than or equal to the storage space allowed for use in the operation information table; when the table item type index is a second identifier, determine that the target information table is a target index information table and a target operation information table included in the target operation flow table, wherein the second identifier is used to indicate that the storage capacity of the target operation table item is greater than the storage space allowed for use in the operation information table.
[0083] Optionally, the device also includes: a second acquisition module, used to obtain an event type identifier from the target event request before obtaining the target operation table entry from the original operation flow table, wherein the event type identifier is used to indicate the timing when the switching device is allowed to execute the target event; a determination module, used to determine, when the event type identifier is a target identifier, that the target event is an event that the switching device is allowed to execute after the original operation flow table is established on the switching device.
[0084] Optionally, the device also includes: a third acquisition module, used to obtain target operation information for executing the target event and the target storage capacity of the target operation information before obtaining the target operation table item from the original operation flow table in response to the target event request; a fourth acquisition module, used to obtain a target operation flow table whose allowed storage capacity meets the target storage capacity from the original operation flow table established on the switching device; and a storage module, used to store the target operation information as the target operation table item in the target operation flow table.
[0085] Optionally, the fourth acquisition module includes: a second acquisition unit, used to obtain, from the original operation flow table established on the switching device, an original operation flow table in which the storage space allowed to be used on the operation information table included is greater than or equal to the target storage amount as the target operation flow table, wherein the target operation table item is stored in the target operation information table included in the target operation flow table; a third acquisition unit, used to obtain, from the original operation flow table established on the switching device, an original operation flow table in which the total storage space allowed to be used on the operation information table and the index information table included is greater than or equal to the target storage amount as the target operation flow table, when the original operation flow table in which the storage space allowed to be used on the operation information table included is greater than or equal to the target storage amount is not obtained, wherein the target operation table item is stored in the target operation information table and the target index information table included in the target operation flow table.
[0086] It should be noted that the above modules can be implemented through software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0087] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any one of the above method embodiments when running.
[0088] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0089] An embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0090] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0091] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail here.
[0092] Obviously, those skilled in the art will appreciate that the various modules or steps of the present invention described above can be implemented using a general-purpose computing device, can be centralized on a single computing device, or can be distributed across a network of multiple computing devices. They can be implemented using program code executable by the computing device, and thus, can be stored in a storage device and executed by the computing device. In some cases, the steps shown or described herein can be performed in a different order than that shown, or can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0093] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for processing an event request, characterized in that: include: Acquire a target event request received on a switching device, wherein the target event request is used to request execution of a target event on the switching device; In a case where the target event is an event that is determined to be allowed to be executed by the switching device after an original operation flow table is established on the switching device, in response to the target event request, obtaining a target operation table entry from the original operation flow table, wherein the original operation flow table records an original flow table entry corresponding to the original event allowed to be executed by the switching device and a target operation table entry corresponding to the target event, and the flow table entry recorded in the original operation flow table is used to store the operation for executing the corresponding event; The target operation entry is called to execute the target event.
2. The method according to claim 1, characterized in that The step of responding to the target event request and obtaining the target operation entry from the original operation flow table includes: Acquire target index information corresponding to the target event from events and index information having a corresponding relationship, wherein the target index information is used to indicate a target storage location of the target operation entry in the original operation flow table; The data stored in the target storage location is searched in the original operation flow table according to the target index information as the target operation table entry.
3. The method according to claim 2, characterized in that The step of searching the original operation flow table for the data stored at the target storage location as the target operation table entry according to the target index information includes: Acquire a target operation flow table identified by the flow table index included in the target index information from an original operation flow table established on the switching device; Acquire, from the information table included in the target operation flow table, the target information table identified by the entry type index included in the target index information; The target information table is searched for data stored in the storage location index included in the target index information as the target operation table entry.
4. The method according to claim 3, characterized in that The step of obtaining the target information table identified by the entry type index included in the target index information from the information table included in the target operation flow table includes: In a case where the entry type index is a first identifier, determining that the target information table is a target operation information table included in the target operation flow table, wherein the first identifier is used to indicate that a storage capacity of the target operation table entry is less than or equal to a storage space allowed to be used in the operation information table; When the table entry type index is a second identifier, the target information table is determined to be a target index information table and a target operation information table included in the target operation flow table, wherein the second identifier is used to indicate that the storage capacity of the target operation table entry is greater than the storage space allowed in the operation information table.
5. The method according to claim 1, characterized in that Before obtaining the target operation table entry from the original operation flow table, the method further includes: Acquire an event type identifier from the target event request, wherein the event type identifier is used to indicate a timing at which the switching device is allowed to execute the target event; In a case where the event type identifier is a target identifier, the target event is determined to be an event that the switching device is allowed to execute after the original operation flow table is established on the switching device.
6. The method according to claim 1, characterized in that Before responding to the target event request and obtaining the target operation table entry from the original operation flow table, the method further includes: Acquire target operation information for executing the target event and a target storage capacity of the target operation information; Acquire a target operation flow table whose allowed storage amount satisfies the target storage amount from the original operation flow table established on the switching device; The target operation information is stored as the target operation table entry in the target operation flow table.
7. The method according to claim 6, characterized in that The step of obtaining a target operation flow table whose allowed storage amount satisfies the target storage amount from the original operation flow table established on the switching device includes: acquiring, from the original operation flow table established on the switching device, an original operation flow table whose storage space allowed to be used on the operation information table included therein is greater than or equal to the target storage amount as the target operation flow table, wherein the target operation table entry is stored in the target operation information table included in the target operation flow table; In the case that the original operation flow table in which the storage space allowed to be used on the included operation information table is greater than or equal to the target storage amount is not obtained, the original operation flow table in which the total storage space allowed to be used on the included operation information table and index information table is greater than or equal to the target storage amount is obtained from the original operation flow table established on the switching device as the target operation flow table, wherein the target operation table entry is stored in the target operation information table and target index information table included in the target operation flow table.
8. An event request processing device, characterized in that: include: A first acquisition module is configured to acquire a target event request received on a switching device, wherein the target event request is used to request execution of a target event on the switching device; a response module, configured to, when the target event is an event that the switching device is determined to be allowed to execute after an original operation flow table is established on the switching device, respond to the target event request and obtain a target operation table entry from the original operation flow table, wherein the original operation flow table records an original flow table entry corresponding to the original event that the switching device is allowed to execute and a target operation table entry corresponding to the target event, and the flow table entry recorded in the original operation flow table is used to store an operation for executing the corresponding event; The calling module is used to call the target operation table item to execute the target event.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 7 are implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Method and device for processing operation requests in storage system
JP2018026184A
Implementing a software defined network using event records that are transmitted from a network switch
US20140003422A1