Software hot upgrade method and device, computer equipment, readable storage medium and program product
By sending the data tables of the old version process to the new version process during the software hot upgrade process and managing the dirty table of the table in the address space, the hardware flow table is solved, and the seamless relationship between the software flow table and the hardware flow table is achieved and data consistency is achieved.
Patent Information
- Application Number
- CN202510570821.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-05-06
AI Technical Summary
During the software hot upgrade process, the upgraded software version cannot directly inherit the old version of the flow table rules, resulting in a conflict between the hardware flow table and the new software logic. Clearing the hardware flow table will cause a brief interruption of traffic and cause the hardware flow table to be deducted.
During the software hot upgrade process, the data paths of the old version process are sent to the new version process and stored in the address space; the statistical count corresponding to the old version process is deleted; when the target dp flow table is not queried, the marking table is dirty; when the number of tables reaches the preset number, the data is continued to be sent to the new version process until the number is less than the preset number.
Reassociation of software flow tables and hardware flow tables is realized without hardware perception, avoiding hardware flow table detuning and ensuring seamless switching of the system and data consistency.
Smart Images

Figure CN120540682A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software upgrade technology, and in particular to a software hot upgrade method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] During a hot software upgrade, if the upgraded software version cannot directly inherit the flow table rules of the old version, the old rules in the hardware flow table may conflict with the new software logic. In this case, the hardware flow table must be cleared to prevent incorrect forwarding. However, clearing the hardware flow table will cause a brief interruption in traffic flow and may trigger hardware flow table management. Summary of the Invention
[0003] Based on this, it is necessary to provide a software hot upgrade method, device, computer equipment, computer-readable storage medium and computer program product that can avoid hardware flow table disconnection to address the above technical problems.
[0004] In a first aspect, the present application provides a software hot upgrade method, the method comprising:
[0005] During the software hot upgrade process, the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version of the software process are sent to the new version of the software process, and the data received by the new version process is stored in the address space of the new version process; the dirty table includes the dirty table of the CT table and the dirty table of the FOC table;
[0006] For any foc table entry in the foc table stored in the address space, delete the statistical count corresponding to the old version process in the foc table entry, and query the target dp flow table corresponding to the foc table entry from the dp flow table stored in the address space based on the index of the dp flow table recorded in the foc table entry;
[0007] If the target dp flow table is not found, the table bit corresponding to the foc table entry in the dirty table stored in the address space is marked dirty;
[0008] Obtain the number of dirty bits in the dirty table stored in the address space. If the number is not less than a preset number, return to the step of sending the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software, and continue executing until the number is less than the preset number.
[0009] In one embodiment, sending the data path DP flow table and the dirty table of the old version process of the software to the new version process of the software includes:
[0010] At the start of a software hot upgrade, a domain message channel is created between the new version process and the old version process;
[0011] Send the DP flow table of the old version process to the new version process through the domain message channel;
[0012] When the DP flow table is sent, the dirty table of the old version process in the shared memory of the software is copied to the address space, and the dirty table bit of the copied dirty table is cleared.
[0013] In one embodiment, sending the connection tracking ct table and the flow operation cache foc table of the old version process of the software to the new version process of the software includes:
[0014] Based on the dirty table with the dirty table bit cleared, the ct table and foc table in the shared memory are mapped to the address space;
[0015] During the software hot upgrade process, for any table entry in the ct table or foc table in the shared memory, if the table entry exists in the address space, the table entry in the address space is deleted and the table entry in the shared memory is copied to the address space.
[0016] In one embodiment, after mapping the ct table and the foc table in the shared memory to the address space, the method further includes:
[0017] During the software hot upgrade process, for any table position in the dirty table of the old version process, if the table position is a dirty table position and the state of the table entry corresponding to the dirty table position is deleted, the DP flow table corresponding to the table position stored in the address space is deleted; wherein the table entry corresponding to the table position is an entry in the CT table or the FOC table.
[0018] In one embodiment, storing the data received by the new version process into the address space of the new version process includes:
[0019] Update the aging time of the DP flow table received by the new version process, and store the DP flow table with the updated aging time in the address space.
[0020] In one embodiment, after searching the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space, the method further includes:
[0021] When the target DP flow table is found, the corresponding statistical counts of the new version process are obtained from the target DP flow table, and the corresponding statistical counts of the new version process are updated to the foc table entry;
[0022] Build an association between the foc table entry and the target dp flow table.
[0023] In a second aspect, the present application further provides a software hot upgrade device, comprising:
[0024] The sending module is used to send the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software during the software hot upgrade process, and store the data received by the new version process in the address space of the new version process; wherein the dirty table includes the dirty table of the CT table and the dirty table of the FOC table;
[0025] A deletion module is used to delete the statistical count corresponding to the old version process in any foc table entry in the foc table stored in the address space, and query the target dp flow table corresponding to the foc table entry from the dp flow table stored in the address space based on the index of the dp flow table recorded in the foc table entry;
[0026] The dirty module is used to mark the table bit corresponding to the foc table entry in the dirty table stored in the address space dirty when the target dp flow table is not queried;
[0027] The acquisition module is used to obtain the number of dirty table bits in the dirty table stored in the address space. If the number is not less than a preset number, the module returns to the step of sending the data path DP flow table, dirty table, connection tracking CT table and flow operation cache FOC table of the old version process of the software to the new version process of the software, and continues to execute until the number is less than the preset number.
[0028] In a third aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any of the above embodiments when executing the computer program.
[0029] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method in any one of the above embodiments.
[0030] In a fifth aspect, the present application further provides a computer program product, which includes a computer program that implements the steps of the method in any one of the above embodiments when executed by a processor.
[0031] The software hot upgrade method, apparatus, computer device, computer-readable storage medium, and computer program product described above include, during the software hot upgrade process, sending the DP flow table, dirty table, CT table, and FOC table of the old version process of the software to the new version process of the software, and storing the data received by the new version process in the address space of the new version process; deleting the statistical count corresponding to the old version process in any FOC table entry in the FOC table stored in the address space, and querying the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space based on the index of the DP flow table recorded in the FOC table entry; marking the table bit corresponding to the FOC table entry in the dirty table stored in the address space as dirty if the target DP flow table is not found; obtaining the number of dirty table bits in the dirty table stored in the address space, and if the number is not less than a preset number, returning to the step of sending the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software, and continuing the step until the number is less than the preset number. The method provided in this application can effectively solve the problem of hardware flow table disconnection during software hot upgrade, thereby achieving re-association between software flow table and hardware flow table without hardware perception. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0033] Figure 1 Schematic diagram of a software hot upgrade method in one embodiment;
[0034] Figure 2 Schematic diagram of a flow chart of a form sending method in one embodiment;
[0035] Figure 3 A flowchart of a software hot upgrade method according to another embodiment;
[0036] Figure 4 This is a structural block diagram of a software hot upgrade device in one embodiment;
[0037] Figure 5 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0039] In one embodiment, Figure 1 As shown, a method for hot software upgrade is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0040] S102. During the software hot upgrade process, the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software are sent to the new version process of the software, and the data received by the new version process is stored in the address space of the new version process; wherein the dirty table includes the dirty table of the CT table and the dirty table of the FOC table.
[0041] Among them, software hot upgrade refers to the technology of updating or upgrading running software without interrupting service or restarting the system; the old version process refers to the process instance running before the hot upgrade, that is, the original process to which the new code or configuration has not been applied; the new version process refers to the process instance started after the hot upgrade, which is usually loaded with new code, configuration or function; the dp (datapath flow entry) flow table refers to a table or data structure used to record and track the flow path of data in the system or network; the ct table (conntrack entry) refers to a core data structure in network devices or software-defined networks, used to dynamically record and manage the status information of network connections; the foc (flow offloading cache) table is a high-performance cache structure used to optimize the real-time computing and query performance of streaming data; the dirty table is an intermediate table that temporarily stores data to be processed, used to mark and manage the incomplete / pending correction status during data changes or calculations.
[0042] Optionally, the software may be, but is not limited to, openvswitch, which is an open source virtual switch software mainly used to implement high-performance network switching functions in a virtualized environment.
[0043] Optionally, before the software hot upgrade begins, the ct table, foc table, and dirty table of the old version process are mapped from the software's shared memory to the huge page memory.
[0044] Optionally, the old version's ct table, foc table, and dirty table are stored in the software's shared memory. The new version's ct table, foc table, and dirty table are mmap'ed from the shared memory and simultaneously created for the new version. Mmap (Memory Mapping) is a mechanism for mapping file or device memory directly into a process's address space.
[0045] S104. For any foc table entry in the foc table stored in the address space, delete the statistical count corresponding to the old version process in the foc table entry, and based on the index of the dp flow table recorded in the foc table entry, query the target dp flow table corresponding to the foc table entry from the dp flow table stored in the address space.
[0046] Among them, statistical counts are dynamic indicators related to file operations recorded in the FOC table entry, which are usually used for performance monitoring, resource allocation, or policy decision-making; the index of the DP flow table is a key value (such as an integer index or hash value) stored in the FOC table entry pointing to the DP flow table, which is used to quickly associate the FOC table entry with its underlying data flow.
[0047] S106: If the target dp flow table is not found, mark the table bit corresponding to the foc table entry in the dirty table stored in the address space as dirty.
[0048] Optionally, if the target dp flow table is not found, the table bit corresponding to the foc table entry in the dirty table stored in the address space is marked dirty. This is a fault isolation and delay processing mechanism to ensure that the system can still operate safely when the metadata is inconsistent.
[0049] S108. Obtain the number of dirty bits in the dirty table stored in the address space. If the number is not less than a preset number, return to the step of sending the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software, and continue executing until the number is less than the preset number.
[0050] Optionally, if the number of dirty tables is not less than a preset number, the new version process sends a message to the old version process to continue synchronizing the newly added DP flow table. The old version process synchronizes the newly added DP flow table to the new version process and sends a DP flow table synchronization end message after synchronization is complete. If no new DP flow table is added, the old version process sends a DP flow table synchronization end message to the new version process. After receiving the DP flow table synchronization end message, the new version process obtains the dirty table of the old version process and copies it to the address space of the new version process. At this time, the dirty table is no longer cleared, and the ct table and foc table of the old version process are synchronized based on the dirty table.
[0051] Optionally, when the number of dirty epitopes is less than a preset number, a last synchronization message is sent to the old version process, and after receiving the message, the old version process closes packet receiving.
[0052] Optionally, after the synchronization is completed, the new version process umap (unmaps the memory) the shared memory of the old version process and destroys the domain message channel between the new version process and the old version process.
[0053] In the above-mentioned software hot upgrade method, during the software hot upgrade process, the DP flow table, dirty table, CT table, and FOC table of the old version process of the software are sent to the new version process of the software, and the data received by the new version process is stored in the address space of the new version process; for any FOC table entry in the FOC table stored in the address space, the statistical count corresponding to the old version process in the FOC table entry is deleted, and based on the index of the DP flow table recorded in the FOC table entry, the target DP flow table corresponding to the FOC table entry is queried from the DP flow table stored in the address space; if the target DP flow table is not found, the table bit corresponding to the FOC table entry in the dirty table stored in the address space is marked dirty; the number of dirty table bits in the dirty table stored in the address space is obtained, and if the number is not less than a preset number, the step of sending the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software is returned to the step of sending the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software is continued until the number is less than the preset number. The method provided in this application can effectively solve the problem of hardware flow table disconnection during software hot upgrade, thereby achieving re-association between software flow table and hardware flow table without hardware perception.
[0054] In some embodiments, as Figure 2 As shown, the data path DP flow table and dirty table of the old version process of the software are sent to the new version process of the software, including:
[0055] S202: At the start of the software hot upgrade, a domain message channel is created between the new version process and the old version process.
[0056] S204. Send the DP flow table of the old version process to the new version process through the domain message channel.
[0057] S206. When the DP flow table is sent, the dirty table of the old version process in the shared memory of the software is copied to the address space, and the dirty table bit of the copied dirty table is cleared.
[0058] Among them, the Unix Domain Socket is a mechanism for inter-process communication (IPC) on the same host, which allows different versions of processes (new and old) to exchange data; the dirty bit is a binary flag in the dirty table used to mark whether a data page has been modified.
[0059] Optionally, when the DP flow table is sent, a DP flow table synchronization completion message is sent to the new version process; after the new version process receives the synchronization completion message, it copies the dirty table of the old version process in the shared memory of the software to the address space of the new version process, and clears the dirty table bit of the copied dirty table. At the same time, it continues to update the foc table and ct table of the old version process in the shared memory, and sets their dirty tables.
[0060] In this embodiment, the DP flow table of the old version process is sent to the new version process through the domain message channel. When the DP flow table is sent, the dirty table of the old version process in the shared memory of the software is copied to the address space, and the dirty table bit of the copied dirty table is cleared. This can more efficiently and accurately migrate the data of the old version process to the new version process.
[0061] In some embodiments, the connection tracking ct table and the stream operation cache foc table of the old version process of the software are sent to the new version process of the software, including: mapping the ct table and the foc table in the shared memory to the address space based on clearing the dirty table bit; during the hot upgrade of the software, for any table entry in the ct table or any table in the foc table in the shared memory, if the table entry exists in the address space, deleting the table entry in the address space and copying the table entry in the shared memory to the address space.
[0062] Optionally, during the hot software upgrade process, the old version process may have modified the table entries in the foc table or ct table during operation, and the new version process may have loaded outdated or partially initialized table entries when it started. This may cause the table entries of the old version process to be different from the corresponding table entries of the new version process. At this time, in order to ensure data consistency between the old and new processes, it is necessary to delete the table entries of the new version process and migrate the table entries of the old version process to the address space of the new version process.
[0063] In this embodiment, during the hot upgrade of the software, for any table entry in the ct table or the foc table in the shared memory, if the table entry exists in the address space, the table entry in the address space is deleted and the table entry in the shared memory is copied to the address space, which can achieve seamless switching and data consistency between the new and old processes.
[0064] In some embodiments, after mapping the ct table and the foc table in the shared memory to the address space, the method further includes: during a hot software upgrade, for any table position in the dirty table of the old version process, if the table position is a dirty table position and the dirty table position represents that the state of the table entry corresponding to the table position is a deleted state, deleting the dp flow table corresponding to the table position stored in the address space; wherein the table entry corresponding to the table position is a table entry in the ct table or the foc table.
[0065] Optionally, the old version process may have performed logical deletions on some table entries, but these table entries are still retained in the address space of the new version process. In this case, in order to ensure the consistency between the old and new processes, it is necessary to delete the DP flow table corresponding to the table position stored in the address space of the new version process.
[0066] In this embodiment, when the table position is a dirty table position and the dirty table position indicates that the state of the table entry corresponding to the table position is deleted, the DP flow table corresponding to the table position stored in the address space is deleted. This can ensure that the new and old processes have consistent understanding of the deleted table entry, avoid the new process retaining invalid data that should be deleted, and thus ensure the system state consistency and resource recovery efficiency.
[0067] In some embodiments, storing the data received by the new version process in the address space of the new version process includes: updating the aging time of the dp flow table received by the new version process, and storing the dp flow table with the updated aging time in the address space.
[0068] The aging time refers to the maximum time a DP flow table entry remains in the flow table after it is not matched (that is, no data packet hits it). When a flow table entry is not used for more than the aging time, the device automatically deletes the entry to free up resources and keep the flow table fresh.
[0069] In this embodiment, by updating the aging time of the DP flow table received by the new version process, it is avoided that the flow table is filled with outdated and useless entries, which affects the processing efficiency of new flows.
[0070] In some embodiments, after querying the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space, it also includes: when the target DP flow table is queried, obtaining the statistical count corresponding to the new version process from the target DP flow table, and updating the statistical count corresponding to the new version process to the FOC table entry; building an association relationship between the FOC table entry and the target DP flow table.
[0071] Optionally, by periodically pulling statistics from the DP flow table and updating it into the FOC table entry, the FOC controller can be ensured to have the latest network status.
[0072] In this embodiment, the statistical counts corresponding to the new version process are obtained from the target dp flow table, and the statistical counts corresponding to the new version process are updated to the foc table entry, which can achieve efficient, consistent and scalable flow table management.
[0073] In one embodiment, Figure 3 As shown, another software hot upgrade method is provided, which includes the following contents:
[0074] 1) Openvswitch uses shared memory to map the ct table entries, the foc table, and the ct and foc dirty tables into huge page memory.
[0075] 2) After the hot upgrade begins, the new process creates a Unix-domain message channel for the DP flow table with the old process. The new process mmaps the shared memory mapped to the CT table entries, FOC table, and dirty table created by the old process. The new process also creates its own CT table and FOC table.
[0076] 3) The old process first sends the dp flow table to the new process using the dp flow table channel.
[0077] 4) After receiving the flow table, the new process installs the dp flow table locally and updates the aging time of the dp flow table.
[0078] 5) After the DP flow table is sent, the old process sends a DP flow table synchronization completion message to the new process. Upon receiving the message, the new process obtains the old process's dirty table, which records the changes in foc and ct, copies it locally, and clears the corresponding dirty table bit. The old process then continues to update foc and ct and set the dirty table.
[0079] 6) The new process, based on the locally copied dirty table, obtains the foc and ct tables from the shared memory created by the old process and copies them to the new process. If the entry already exists in the new process, the new entry is deleted and the latest entry is obtained from the old process and copied to the new process. If the dirty table is set and the foc and ct entries are in the deleted state, the new process's existing flow table at the corresponding location is deleted.
[0080] 7) After the entry is synchronized to the new process, the count related to the old process in the FOC entry is cleared. The DP flow table is queried based on the index of the DP flow table recorded in the FOC entry. If the DP flow table statistics count that updates the FOC entry is found, the DP flow table records the associated FOC entry. If the query fails, the dirty bit corresponding to the old process FOC is marked dirty.
[0081] 8) After table entry synchronization is complete, the new process checks the number of bits set in the old process's dirty table. If the number is greater than the minimum synchronization threshold, the new process sends a signal to the old process to continue synchronizing the new DP flow table. If no new DP flow table has been added, the old process directly sends a DP flow table synchronization completion marker. The new process then proceeds with steps 5), 6), and 7) to synchronize the CT and FOC table entries based on the dirty table.
[0082] 9) If the number of newly marked dirty tables is less than the minimum synchronization threshold, a final synchronization message is sent to the old process.
[0083] 10) After receiving the last synchronization message, the old process closes the packet receiving function.
[0084] 11) The old process synchronizes the new DP flow table to the new process. After the synchronization is complete, the DP flow table synchronization completion mark is sent.
[0085] 12) After receiving the DP flow table synchronization completion mark from the old process, the new process obtains the old process's dirty table and copies it to the local process. At this point, the dirty table is no longer cleared, and the foc and ct table entries are synchronized based on the dirty table. For example, synchronize the table entries in 5), 6), and 7.
[0086] 13) After synchronization is complete, the new process umaps the shared memory created by the old process and destroys the DP flow table transmission channel.
[0087] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0088] Based on the same inventive concept, embodiments of the present application also provide a software hot upgrade device for implementing the aforementioned software hot upgrade method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more software hot upgrade device embodiments provided below can be found in the aforementioned limitations of the software hot upgrade method and will not be further elaborated here.
[0089] In an exemplary embodiment, Figure 4As shown, a software hot upgrade device 400 is provided, comprising: a sending module 401, a deleting module 402, a dirty marking module 403 and an obtaining module 404, wherein:
[0090] The sending module 401 is used to send the data path DP flow table, dirty table, connection tracking CT table and flow operation cache FOC table of the old version process of the software to the new version process of the software during the software hot upgrade process, and store the data received by the new version process in the address space of the new version process; wherein the dirty table includes the dirty table of the CT table and the dirty table of the FOC table.
[0091] The deletion module 402 is used to delete the statistical count corresponding to the old version process in any foc table entry in the foc table stored in the address space, and based on the index of the dp flow table recorded in the foc table entry, query the target dp flow table corresponding to the foc table entry from the dp flow table stored in the address space.
[0092] The dirty marking module 403 is used to mark the table bit corresponding to the foc table entry in the dirty marking table stored in the address space dirty when the target dp flow table is not found.
[0093] The acquisition module 404 is used to obtain the number of dirty table bits in the dirty table stored in the address space. If the number is not less than a preset number, the module returns to the step of sending the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software, and continues to execute until the number is less than the preset number.
[0094] In some embodiments, the sending module 401 is also used to create a domain message channel between the new version process and the old version process at the start of the software hot upgrade; send the DP flow table of the old version process to the new version process through the domain message channel; when the DP flow table is sent, copy the dirty table of the old version process in the shared memory of the software to the address space, and clear the dirty table bit of the copied dirty table.
[0095] In some embodiments, the sending module 401 is also used to map the ct table and the foc table in the shared memory to the address space based on the dirty table that clears the dirty table bit; during the software hot upgrade process, for any table entry in the ct table or any table in the foc table in the shared memory, if there is a table entry in the address space, the table entry in the address space is deleted and the table entry in the shared memory is copied to the address space.
[0096] In some embodiments, the sending module 401 is also used to, during the process of hot software upgrade, for any table position in the dirty table of the old version process, delete the DP flow table corresponding to the table position stored in the address space when the table position is a dirty table position and the dirty table position represents that the state of the corresponding table entry of the table position is a deleted state; wherein the table entry corresponding to the table position is a table entry in the CT table or the FOC table.
[0097] In some embodiments, the sending module 401 is further configured to update the aging time of the DP flow table received by the new version process, and store the DP flow table with the updated aging time in the address space.
[0098] In some embodiments, the deletion module 402 is also used to obtain the corresponding statistical counts of the new version process from the target DP flow table when the target DP flow table is queried, and update the corresponding statistical counts of the new version process to the FOC table item; and establish an association relationship between the FOC table item and the target DP flow table.
[0099] Each module in the aforementioned software hot-upgrade device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0100] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 5 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner. The wireless manner can be achieved through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, a software hot upgrade method is implemented.
[0101] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0102] In an exemplary embodiment, a computer device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented: during a software hot upgrade, a data path DP flow table, a dirty table, a connection tracking CT table, and a flow operation cache FOC table of an old version process of the software are sent to a new version process of the software, and data received by the new version process is stored in the address space of the new version process; wherein the dirty table includes a dirty table of the CT table and a dirty table of the FOC table; for any FOC table entry in the FOC table stored in the address space, the data in the FOC table entry that is related to the old version is deleted. The corresponding statistical count of this process is performed, and based on the index of the DP flow table recorded in the FOC table entry, the target DP flow table corresponding to the FOC table entry is queried from the DP flow table stored in the address space; if the target DP flow table is not found, the table bit corresponding to the FOC table entry in the dirty table stored in the address space is marked dirty; the number of dirty table bits in the dirty table stored in the address space is obtained, and if the number is not less than the preset number, the step of sending the data path DP flow table, dirty table, connection tracking CT table and flow operation cache FOC table of the old version process of the software to the new version process of the software is returned, and the execution is continued until the number is less than the preset number.
[0103] In one embodiment, the method implemented by the processor when executing a computer program to send the data path DP flow table and dirty table of the old version process of the software to the new version process of the software includes: creating a domain message channel between the new version process and the old version process at the start of the software hot upgrade; sending the DP flow table of the old version process to the new version process through the domain message channel; when the DP flow table is sent, copying the dirty table of the old version process in the shared memory of the software to the address space, and clearing the dirty table bit of the copied dirty table.
[0104] In one embodiment, the method implemented by a processor executing a computer program of sending a connection tracking ct table and a stream operation cache foc table of an old version process of the software to a new version process of the software includes: mapping the ct table and the foc table in the shared memory to the address space based on a dirty table that clears dirty table bits; during a hot software upgrade, for any table entry in either the ct table or the foc table in the shared memory, if the table entry exists in the address space, deleting the table entry in the address space and copying the table entry in the shared memory to the address space.
[0105] In one embodiment, after the processor executes the computer program and maps the ct table and the foc table in the shared memory to the address space, the method further includes: during a software hot upgrade, for any table position in the dirty table of the old version process, if the table position is a dirty table position and the dirty table position indicates that the state of the table entry corresponding to the table position is a deleted state, deleting the dp flow table corresponding to the table position stored in the address space; wherein the table entry corresponding to the table position is a table entry in the ct table or the foc table.
[0106] In one embodiment, the processor executes a computer program to store data received by the new version process in the address space of the new version process, including: updating the aging time of the DP flow table received by the new version process, and storing the DP flow table after the aging time is updated in the address space.
[0107] In one embodiment, after querying the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space, the method implemented by the processor when executing the computer program also includes: when the target DP flow table is queried, obtaining the statistical count corresponding to the new version process from the target DP flow table, and updating the statistical count corresponding to the new version process to the FOC table entry; and establishing an association relationship between the FOC table entry and the target DP flow table.
[0108] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: during a software hot upgrade, the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software are sent to the new version process of the software, and the data received by the new version process is stored in the address space of the new version process; wherein the dirty table includes the dirty table of the CT table and the dirty table of the FOC table; for any FOC table entry in the FOC table stored in the address space, the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table corresponding to the old version process are deleted. Counting the count, and based on the index of the DP flow table recorded in the FOC table entry, querying the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space; if the target DP flow table is not found, marking the table bit corresponding to the FOC table entry in the dirty table stored in the address space dirty; obtaining the number of dirty table bits in the dirty table stored in the address space, and if the number is not less than a preset number, returning to the step of sending the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software, and continuing the execution until the number is less than the preset number.
[0109] In one embodiment, the computer program implemented by the processor when executed is sending the data path DP flow table and dirty table of the old version process of the software to the new version process of the software, including: creating a domain message channel between the new version process and the old version process at the start of the software hot upgrade; sending the DP flow table of the old version process to the new version process through the domain message channel; when the DP flow table is sent, copying the dirty table of the old version process in the shared memory of the software to the address space, and clearing the dirty table bit of the copied dirty table.
[0110] In one embodiment, the computer program implemented by the processor when executed by the processor to send the connection tracking CT table and the flow operation cache FOC table of the old version process of the software to the new version process of the software includes: mapping the CT table and the FOC table in the shared memory to the address space based on the dirty table that clears the dirty table bit; during the software hot upgrade process, for any table entry in any table of the CT table or the FOC table in the shared memory, if the table entry exists in the address space, deleting the table entry in the address space and copying the table entry in the shared memory to the address space.
[0111] In one embodiment, after mapping the ct table and the foc table in the shared memory to the address space, the computer program implemented by the processor when executed further includes: during a software hot upgrade, for any table position in the dirty table of the old version process, if the table position is a dirty table position and the dirty table position indicates that the state of the table entry corresponding to the table position is a deleted state, deleting the dp flow table corresponding to the table position stored in the address space; wherein the table entry corresponding to the table position is a table entry in the ct table or the foc table.
[0112] In one embodiment, the computer program implemented by the processor when executing the computer program stores the data received by the new version process in the address space of the new version process, including: updating the aging time of the DP flow table received by the new version process, and storing the DP flow table after the aging time is updated in the address space.
[0113] In one embodiment, the computer program implemented by the processor when executed further includes: after querying the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space, obtaining the statistical count corresponding to the new version process from the target DP flow table, and updating the statistical count corresponding to the new version process into the FOC table entry; and establishing an association relationship between the FOC table entry and the target DP flow table.
[0114] In one embodiment, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the following steps: during a software hot upgrade, sending a data path DP flow table, a dirty table, a connection tracking CT table, and a flow operation cache FOC table of an old version process of the software to a new version process of the software, and storing data received by the new version process in an address space of the new version process; wherein the dirty table includes a dirty table of the CT table and a dirty table of the FOC table; for any FOC table entry in the FOC table stored in the address space, deleting the statistics corresponding to the old version process in the FOC table entry; Count, and based on the index of the DP flow table recorded in the FOC table entry, query the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space; if the target DP flow table is not found, mark the table bit corresponding to the FOC table entry in the dirty table stored in the address space as dirty; obtain the number of dirty table bits in the dirty table stored in the address space, and if the number is not less than a preset number, return to the step of sending the data path DP flow table, dirty table, connection tracking CT table and flow operation cache FOC table of the old version process of the software to the new version process of the software, and continue executing until the number is less than the preset number.
[0115] In one embodiment, the computer program implemented by the processor when executed is sending the data path DP flow table and dirty table of the old version process of the software to the new version process of the software, including: creating a domain message channel between the new version process and the old version process at the start of the software hot upgrade; sending the DP flow table of the old version process to the new version process through the domain message channel; when the DP flow table is sent, copying the dirty table of the old version process in the shared memory of the software to the address space, and clearing the dirty table bit of the copied dirty table.
[0116] In one embodiment, the computer program implemented by the processor when executed by the processor to send the connection tracking CT table and the flow operation cache FOC table of the old version process of the software to the new version process of the software includes: mapping the CT table and the FOC table in the shared memory to the address space based on the dirty table that clears the dirty table bit; during the software hot upgrade process, for any table entry in any table of the CT table or the FOC table in the shared memory, if the table entry exists in the address space, deleting the table entry in the address space and copying the table entry in the shared memory to the address space.
[0117] In one embodiment, after mapping the ct table and the foc table in the shared memory to the address space, the computer program implemented by the processor when executed further includes: during a software hot upgrade, for any table position in the dirty table of the old version process, if the table position is a dirty table position and the dirty table position indicates that the state of the table entry corresponding to the table position is a deleted state, deleting the dp flow table corresponding to the table position stored in the address space; wherein the table entry corresponding to the table position is a table entry in the ct table or the foc table.
[0118] In one embodiment, the computer program implemented by the processor when executing the computer program stores the data received by the new version process in the address space of the new version process, including: updating the aging time of the DP flow table received by the new version process, and storing the DP flow table after the aging time is updated in the address space.
[0119] In one embodiment, the computer program implemented by the processor when executed further includes: after querying the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space, obtaining the statistical count corresponding to the new version process from the target DP flow table, and updating the statistical count corresponding to the new version process into the FOC table entry; and establishing an association relationship between the FOC table entry and the target DP flow table.
[0120] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0121] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0122] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0123] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A software hot upgrade method, characterized in that: The method comprises: During a software hot upgrade, the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software are sent to the new version process of the software, and the data received by the new version process is stored in the address space of the new version process; wherein the dirty table includes the dirty table of the CT table and the dirty table of the FOC table; For any foc table entry in the foc table stored in the address space, delete the statistical count corresponding to the old version process in the foc table entry, and query the target dp flow table corresponding to the foc table entry from the dp flow table stored in the address space based on the index of the dp flow table recorded in the foc table entry; In the case that the target dp flow table is not found, marking the table bit corresponding to the foc table entry in the dirty table stored in the address space dirty; Obtain the number of dirty table bits in the dirty table stored in the address space. If the number is not less than a preset number, return to the step of sending the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software, and continue executing until the number is less than the preset number.
2. The method according to claim 1, characterized in that The step of sending the data path DP flow table and the dirty table of the old version process of the software to the new version process of the software includes: At the start of the software hot upgrade, a domain message channel is created between the new version process and the old version process; Sending the DP flow table of the old version process to the new version process through the domain message channel; When the DP flow table is sent, the dirty table of the old version process in the shared memory of the software is copied to the address space, and the dirty table bit of the copied dirty table is cleared.
3. The method according to claim 2, characterized in that The sending of the connection tracking ct table and the flow operation cache foc table of the old version process of the software to the new version process of the software includes: Mapping the ct table and the foc table in the shared memory to the address space based on the dirty table with the dirty table bit cleared; During the software hot upgrade process, for any table entry in the ct table or any table in the foc table in the shared memory, if the table entry exists in the address space, the table entry in the address space is deleted and the table entry in the shared memory is copied to the address space.
4. The method according to claim 3, characterized in that After mapping the ct table and the foc table in the shared memory to the address space, the method further includes: During the software hot upgrade, for any table position in the dirty table of the old version process, if the table position is a dirty table position and the dirty table position indicates that the state of the table entry corresponding to the table position is a deleted state, the DP flow table corresponding to the table position stored in the address space is deleted; wherein the table entry corresponding to the table position is an entry in the CT table or the FOC table.
5. The method according to claim 1, wherein The storing the data received by the new version process into the address space of the new version process includes: The aging time of the dp flow table received by the new version process is updated, and the dp flow table with the updated aging time is stored in the address space.
6. The method according to claim 1, characterized in that After querying the target DP flow table corresponding to the FOC table entry from the DP flow table stored in the address space, the method further includes: When the target dp flow table is found, the statistical count corresponding to the new version process is obtained from the target dp flow table, and the statistical count corresponding to the new version process is updated into the foc table entry; Construct an association relationship between the foc table entry and the target dp flow table.
7. A software hot upgrade device, characterized in that: The device comprises: a sending module, configured to send the data path DP flow table, dirty table, connection tracking CT table, and flow operation cache FOC table of the old version process of the software to the new version process of the software during a software hot upgrade, and store the data received by the new version process in the address space of the new version process; wherein the dirty table includes the dirty table of the CT table and the dirty table of the FOC table; a deletion module, configured to delete, for any one foc table entry in the foc table stored in the address space, the statistical count corresponding to the old version process in the foc table entry, and query, from the dp flow table stored in the address space, a target dp flow table corresponding to the foc table entry based on the index of the dp flow table recorded in the foc table entry; a dirty marking module, configured to mark a table bit corresponding to the foc table entry in the dirty marking table stored in the address space dirty when the target dp flow table is not found; an acquisition module, configured to acquire the number of dirty table bits in the dirty table stored in the address space, and, if the number is not less than a preset number, return to the step of sending the data path DP flow table, the dirty table, the connection tracking CT table, and the flow operation cache FOC table of the old version process of the software to the new version process of the software, and continue executing the step until the number is less than the preset number.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Resource interval adjustment method and device
CN110943871A
Multi-core SDN switch flow table management method and system based on batch updating
CN112260948A
Synchronization method and device of Ethernet layer 2 forwarding table
CN117811989A
Intelligent network card hot upgrade method based on OVS-DPDK
CN117857342A
System and Method for Providing Uninterrupted Operation of a Replication System During a Software Upgrade
US20080301663A1