Data processing method and device, server and storage medium

By configuring a second process during the hot upgrade process, transferring network interface permissions and memory data, and using hash values ​​to identify data fragments, a smooth program upgrade under high concurrency scenarios is achieved. This solves the problem of packet loss time intervals during the upgrade process in existing technologies, and improves upgrade efficiency and resource utilization.

CN116225476BActive Publication Date: 2026-02-24CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111480951.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2026-02-24
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

Existing technologies cannot achieve smooth upgrades of the network forwarding data plane in high-concurrency scenarios, resulting in long packet loss intervals during program upgrades.

Method used

By configuring and running a second process during the hot upgrade process, transferring the network interface permissions and memory data of the first process to a preset storage area, and shutting down the first process after the second data is completely written, the hash value is used to identify the data slice for reading and processing, thus achieving a smooth switch between the old and new versions of the code.

Benefits of technology

It achieves seamless switching for program upgrades under high-traffic concurrent scenarios, reduces memory resource consumption, and ensures the smoothness of the upgrade process and the continuity of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116225476B_ABST
    Figure CN116225476B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method and device, a server and a storage medium. The data processing method comprises: when performing hot upgrade on a first program of a target application, configuring a second process running a second program according to configuration parameters of a first process running the first program; wherein the second program is an upgrade program of the first program; transferring usage permission of a network interface of the first process to the second process, so that the network interface submits received first data to the second process; wherein second data stored in a first memory configured for the first process is written into a preset storage area; wherein the data written into the preset storage area is used for reading and processing by the second program; and closing the first process after the second data is completely written into the preset storage area. Thus, lossless hot upgrade of a program in a large-flow concurrent scenario can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a data processing method, apparatus, server, and storage medium. Background Technology

[0002] With the continuous development of computer technology, the need for hot upgrades of network forwarding data plane has become inevitable due to the rapid iteration of products and the redundancy requirements of abnormal data.

[0003] The current industry practice for upgrading network forwarding data programs mainly involves creating a new process while the original process is providing services. The new process then inherits the file descriptors of the original process to provide services, thus enabling hot upgrades. However, this approach cannot achieve smooth upgrades in high-traffic, high-concurrency scenarios. Summary of the Invention

[0004] In view of this, the embodiments of this application provide a data processing method, apparatus, server and storage medium to solve at least one problem existing in the prior art, and realize smooth upgrades in high-concurrency scenarios.

[0005] To achieve the above objectives, the technical solution of this application embodiment is implemented as follows:

[0006] In a first aspect, embodiments of this application provide a data processing method, the method comprising:

[0007] When performing a hot upgrade on the first program of the target application, a second process for running the second program is configured according to the configuration parameters of the first process running the first program; wherein, the second program is the upgrade program of the first program.

[0008] The access rights to the network interface of the first process are transferred to the second process, so that the network interface can submit the received first data to the second process; wherein,

[0009] The second data configured for the first process in the first memory storage is written into a preset storage area; wherein the data written into the preset storage area is for the second program to read and process;

[0010] After the second data is completely written to the preset storage area, the first process is closed.

[0011] In the above technical solution, writing the second data configured for the first process in the first memory storage to the preset storage area includes:

[0012] The second data is divided into one or more data slices;

[0013] The data slice and its data identifier are stored in the preset storage area. The data identifier is transmitted to the second process and is used by the second process to read the data slice from the preset storage area.

[0014] In the above technical solution, the data identifier is the hash value corresponding to the data slice.

[0015] In the above technical solution, dividing the second data into one or more data slices includes:

[0016] The second data is divided into one or more data slices according to a predetermined data structure and data volume.

[0017] The method in the above technical solution further includes:

[0018] After the second process obtains the data identifier of the second data, it sends a switching request to the first process; the switching request is used to trigger the first process to shut down.

[0019] The method in the above technical solution further includes:

[0020] Upon detecting a shutdown command for the second process, update the configuration information of the target application according to the storage directory of the second program;

[0021] Delete the first program.

[0022] The method in the above technical solution further includes:

[0023] The second process concatenates the first data and the second data;

[0024] Forward the concatenated first data and second data.

[0025] Secondly, embodiments of this application provide a data processing apparatus, the apparatus comprising:

[0026] A configuration module is used to configure a second process running a second program according to the configuration parameters of the first process running the first program when hot-upgrading the first program of the target application; wherein the second program is the upgrade program of the first program;

[0027] A transfer module is used to transfer the usage rights of the network interface of the first process to the second process, so that the network interface can submit the received first data to the second process; wherein,

[0028] The writing module is used to write the second data configured for the first process in the first memory storage to a preset storage area; wherein the data written to the preset storage area is used for the second program to read and process;

[0029] The shutdown module is used to shut down the first process after the second data has been completely written to the preset storage area.

[0030] Thirdly, embodiments of this application provide a server, the server comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the data processing method steps provided in the first aspect above.

[0031] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the data processing method provided in the first aspect.

[0032] This application provides a data processing method, apparatus, server, and storage medium. During a hot upgrade of a first program of a target application, a second process running a second program is configured based on the configuration parameters of the first process running the first program. The second program is an upgrade program of the first program. The network interface access rights of the first process are transferred to the second process, allowing the network interface to submit received first data to the second process. Second data stored in the first memory configured for the first process is written to a preset storage area. The data written to the preset storage area is used for reading and processing by the second program. After the second data is completely written to the preset storage area, the first process is closed, completing the hot upgrade of the first program. In this software upgrade process, the forwarding and reading of the first and second data enables a smooth switch between different processes running the old and new versions of the code. Furthermore, after the second process is created, the network interface access rights are promptly transferred to the second process, and the first process is closed after transferring the data in its allocated first memory to the preset storage area. Thus, the first memory is promptly released upon the closure of the first process, resulting in low memory resource consumption during the upgrade process and enabling lossless hot upgrades of programs under high-traffic concurrent scenarios. Attached Figure Description

[0033] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0034] Figure 2 A flowchart illustrating a method for receiving and sending data using a network interface card (NIC) according to an embodiment of this application;

[0035] Figure 3A schematic diagram illustrating a target application upgrade process based on a network interface card (NIC) and a disk, provided as an embodiment of this application;

[0036] Figure 4 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0037] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. Unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other. The steps shown in the flowcharts can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowcharts, in some cases, the steps shown or described may be performed in a different order than that shown here.

[0039] The data processing method provided in this application embodiment can be applied to a server. The functions to be implemented by this method can be achieved by calling program code through the processor in the terminal. Of course, the program code can be stored in the computer storage medium. It can be seen that the server includes at least a processor and a storage medium.

[0040] This application provides a data processing method. Figure 1 This is a schematic diagram illustrating the implementation flow of a data processing method provided in an embodiment of this application, such as... Figure 1 The method mainly includes the following steps:

[0041] Step 101: When performing a hot upgrade on the first program of the target application, configure the second process of the second program to run according to the configuration parameters of the first process running the first program; wherein, the second program is the upgrade program of the first program.

[0042] Here, the target application refers to any application in an electronic device that needs to be upgraded. In some embodiments, the electronic device can be a computer, and the target application can be a browser application (APP).

[0043] In some embodiments, the electronic device can be a mobile phone, tablet, or other handheld device, and the target application can be a shopping app, a game app, a social app, etc.

[0044] Here, the first program is the program that needs to be upgraded in the target application to be replaced, hereinafter also referred to as the original program. Correspondingly, the second program is the upgrade program of the first program, also referred to as the new program. The first process of the first program is the process that needs to be upgraded in the target application to be replaced, hereinafter also referred to as the original process. Correspondingly, the second process is the upgrade process of the first process, also referred to as the new process. The configuration parameters may include data such as the permissions of the database corresponding to the original program, the network port parameters used, the listening port parameters of the management process, and the definition of a data delay warning mechanism.

[0045] The above process migrates the configuration parameters of the original process to the new process. This allows the new process to continue running using the extracted configuration parameters after a hot upgrade, effectively ensuring that no program memory data is lost during the hot upgrade process.

[0046] Step 102: Transfer the usage rights of the network interface of the first process to the second process, so that the network interface can submit the received first data to the second process;

[0047] Here, the first process network interface may be a network card interface in some embodiments, including but not limited to wired network card interfaces and / or wireless network card interfaces.

[0048] Here, the usage permission can be the permission to read the network interface to receive data from peripherals, and / or the permission to send data outwards through the network interface. The relevant information of the network interface is recorded in the first process as a text descriptor. If the first process provides the text descriptor to the second process through an inter-process communication interface, the second process can read and identify the network interface, thereby enabling the second process to obtain usage permission for the network interface.

[0049] Here, the first data can be any data in the first process, including but not limited to application control information and program metadata information.

[0050] In one embodiment, such as Figure 2 The present invention discloses a method for implementing a first data transfer, which mainly includes the following steps:

[0051] Step S01: The first process assigns a uniquely identifiable socket (Unix Socket) or other identification information other than a socket to each network card;

[0052] Unix Socket is a socket-based inter-process communication (IPC) function. Compared with ordinary network sockets, it does not require complex data packaging and unpacking, checksum calculation and verification, and does not need to go through the network protocol stack. Moreover, it is safe and reliable, and messages will not be lost or out of order.

[0053] In step S02, data is stored in the ring buffer or other type of buffer of each network interface in the first process.

[0054] A circular buffer, used as a data structure to store data sent and received during communication, is a first-in-first-out circular buffer that provides mutual exclusion access to the buffer for the communication program.

[0055] Step S03: The second process connects to the aforementioned network card, matches the corresponding Unix Socket, and caches the Ring Buffer data in the Unix Socket;

[0056] In step S04, after the second process completes the buffering of data in the Ring Buffer of the Unix Scoket, the first process releases the network card usage rights, and the second process takes over.

[0057] In this embodiment, application memory data can be transferred between different processes using a network interface. Unix Sockets are used to enable data communication between the first and second processes during the update and switching process. Since the speed at which network card data is written to the memory of the forwarding program is much greater than the speed at which the forwarding program processes data in memory, the problem of long packet loss intervals during the upgrade and switching process of the first and second processes can be effectively solved.

[0058] like Figure 1 As shown, the method further includes:

[0059] Step 103: The second data configured for the first process in the first memory storage is written into a preset storage area; wherein the data written into the preset storage area is used for the second program to read and process.

[0060] Here, the second data stored in the first memory configured by the first process is data that has not yet been forwarded in the first process.

[0061] Here, writing the second data configured for the first process in the first memory storage to the preset storage area includes: dividing the second data into one or more data slices; storing the data slices and their data identifiers in the preset storage area, wherein the data identifiers are transmitted to the second process and are used for the second process to read the data slices from the preset storage area;

[0062] Here, dividing the second data into one or more data slices includes: dividing the second data into one or more data slices according to a predetermined data structure and data volume.

[0063] Here, the data identifier is the hash value corresponding to the data slice.

[0064] A hash algorithm can convert a piece of data into a unique identifier, which is closely related to every byte of the source data. Another characteristic of hash algorithms is that it is difficult to find a reverse pattern. Using hashes, data fragments can be uniquely identified, facilitating the second process to read and forward data from the preset storage area.

[0065] Here, the data slices can be arrays, sets, or other structural forms.

[0066] Here, the preset storage area may be a disk in a PC in some embodiments, or a storage device in other devices in other embodiments.

[0067] Here, after transmitting the data identifier to the second process, the method further includes: after the second process obtains the data identifier of the second data, sending a switching request to the first process; the switching request is used to trigger the first process to shut down.

[0068] Here, further, in an optional embodiment, the switching request is sent by the second process after receiving a preset number of the data identifiers;

[0069] In another alternative embodiment, the switching request is sent by the second process after a specific duration has elapsed;

[0070] In another alternative embodiment, the switching request is sent after the second process receives new data from the network interface or writes new data to the network interface.

[0071] After receiving the switching request, the first process responds to the switching request and closes its own program. Considering that if the first process exits midway through the upgrade request processing, it may easily lead to problems such as program operation errors, further, in an optional embodiment, before closing the process of the first program of the target application, the data processing method provided in this application embodiment may further include:

[0072] Upon receiving a switching request, the target application's first process checks whether it is currently forwarding the data identifier of the data slice. If so, it waits until the target application's first process has forwarded all the data identifiers of the data slices before executing the step of shutting down its own process. Of course, if it detects that there are no data identifiers of the data slices currently being forwarded, it can safely shut down its own process.

[0073] Here, after writing the second data configured for the first process in the first memory storage into the preset storage area, the process further includes: the second process concatenating the first data and the second data; and forwarding the concatenated first data and the second data.

[0074] In one embodiment, the second process of the target application second program concatenates the first data received from the network card in new memory with the second data of the first process of the target application first program on the disk, thereby ensuring that the second process of the second program can obtain the memory resource data occupied by the first process of the first program relatively smoothly.

[0075] Step 104: After the second data is completely written to the preset storage area, close the first process;

[0076] Here, the method further includes: when a shutdown command of the second process is detected, updating the configuration information of the target application according to the storage directory of the second program; and deleting the first program.

[0077] Here, in one optional embodiment, the second process concatenates the first data received from the network card with the second data of the first process on the disk in new memory. After the data concatenation is completed, the second process issues a command to close its own process, updates the configuration information of the target application to be upgraded according to the storage directory of the second program, and then deletes the first program and closes its own process. The configuration information includes: the running status information of the first program, the update content information of the second program, and other data.

[0078] In summary, the data processing method provided in the embodiments of this specification can effectively achieve a relatively smooth data forwarding of the target application without causing operational errors or interrupting the program, thus enabling hot upgrades of the target application.

[0079] Typically, applications upgrade by having a new process take over and register the original process's file descriptor while the original process runs, and then providing services. However, due to the switching between the old and new processes, this method results in a relatively long packet loss interval. This large packet loss interval is mainly caused by the alternation of usage rights of the network interface between the old and new processes. The two processes simultaneously manage the same network interface to achieve data and state synchronization. The drawback of this approach is the need to solve the technical challenge of allowing two processes to manage the hardware network interface simultaneously. Since each network interface has only one unique file descriptor in the operating system, and generally cannot be registered and managed by two processes at the same time, this approach is problematic. Here, the old process is the first process mentioned earlier; the new process is the second process mentioned earlier.

[0080] This disclosure provides a method for hot-upgrading a user-space network data forwarding program. Since the speed at which data is written to memory from the network interface card (NIC) is much faster than the speed at which the forwarding program processes data in memory, this disclosure utilizes this mechanism to propose an upgrade service module. This module writes unforwarded memory data to the hard disk using a pre-defined data structure and size, and identifies the corresponding data slice using its hash value. The new process then searches based on the hash value, thus ensuring good smoothness of the forwarding service when replacing old and new processes. The method steps of this embodiment include:

[0081] 1) The new process sends an upgrade request to the original process, activating the upgrade service module of both the old and new processes;

[0082] 2) The original process releases its exclusive resources and sends configuration parameters, etc., to the upgrade service module thread of the new process, such as... Figure 3 As shown in process flow 110;

[0083] 3) The upgrade service module of the original process records the memory data that has not yet been forwarded in data slices of a predetermined data structure and size, and writes the data slice and its hash value to the hard disk, such as... Figure 3 As shown in process flow 120;

[0084] 4) The upgrade service module of the original process simultaneously transmits the hash value to the upgrade service module of the new process, such as... Figure 3 As shown in process flow 130;

[0085] 5) The new process is initialized using the configuration parameters of the old process;

[0086] 6) Once the upgrade service module of the new process has acquired a certain number of hashes, it initiates a process switch request to the original process, such as... Figure 3 As shown in process flow 140;

[0087] 7) The original process releases memory and processing resources, and passes the hash value of the last forwarded data slice in memory to the new process through the upgrade service module. Then the original process exits. Figure 3 The process flow is shown in step 150.

[0088] 8) The upgrade service module of the new process uses hash values ​​to write the data fragments that the original process has not yet completed forwarding from the disk into the new memory, and continues to forward them in the form of data packets, such as... Figure 3 The process flow is shown in step 160.

[0089] 9) The upgrade service module of the new process will combine the new data received from the network card in memory with the data of the original process on disk. The upgrade service module of the new process will then shut down, completing the hot upgrade. Figure 3 The process flow is shown in step 170.

[0090] Secondly, based on the same inventive concept as the data processing method provided in the first aspect of the embodiments described above, this application also provides a data processing method apparatus. For example... Figure 4 As shown, the data processing device 300 includes:

[0091] The configuration module 301 is used to configure a second process running a second program according to the configuration parameters of the first process running the first program when hot-upgrading the first program of the target application; wherein the second program is the upgrade program of the first program.

[0092] Transfer module 302 is used to transfer the usage rights of the network interface of the first process to the second process, so that the network interface can submit the received first data to the second process; wherein,

[0093] The writing module 303 is used to write the second data configured for the first process in the first memory storage to a preset storage area; wherein the data written to the preset storage area is used for the second program to read and process;

[0094] The shutdown module 304 is used to shut down the first process after the second data has been completely written to the preset storage area.

[0095] It should be noted that the configuration module 301 can be further configured to, in response to receiving an upgrade request for the target application, determine the configuration parameters of the first process of the first program, and configure the second process of the second program according to the configuration parameters of the first process of the first program; the configuration parameters include, but are not limited to: the permissions of the database corresponding to the original program, the network port parameters used, the listening port parameters of the management process, and the definition of a data delay warning mechanism.

[0096] It should be noted that the transfer module 302 is specifically used to assign a unique identifier to each of the first process network interfaces, and to connect according to the unique identifier, transfer the first data received by the first process network interface to the second process, and transfer the usage rights of the first process network interface to the second process; the first data includes any data of the first process.

[0097] It should be noted that the writing module 303 is used to write the second data configured for the first process in the first memory storage to a preset storage area. The second data is memory data that the first process has not yet forwarded. The preset storage area can be a PC's disk device. The writing module 303 also includes:

[0098] According to a predetermined data structure and data volume, the second data is divided into one or more data slices, and the data slices and their data identifiers are stored in the preset storage area. The data identifiers are transmitted to the second process and are used by the second process to read the data slices from the preset storage area. The data identifiers are hash values. The second process concatenates the first data and the second data and forwards the concatenated first data and the second data.

[0099] It should be noted that the shutdown module 304 is specifically used to detect whether the target application first process is currently forwarding the data identifier of the data slice after receiving the process switching request. If so, the target application first process will execute the step of shutting down its own process after it has finished forwarding the data identifiers of all data slices. Of course, if it detects that there is no data identifier of the data slice currently being forwarded, it can safely shut down its own process.

[0100] Furthermore, in an alternative embodiment, such as Figure 3 As shown, the upgrade service module includes: a configuration module, a writing module, and a shutdown module.

[0101] In practical applications, the configuration module to the shutdown module of the data processing method can be implemented by the processor in the data processing method device. Of course, the processor needs to run the computer program in the memory to implement its function.

[0102] In the embodiments provided in this application, it should be understood that the disclosed methods and apparatus can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be indirect coupling or communication connection through some interfaces, devices, or units, and can be electrical, mechanical, or other forms.

[0103] Thirdly, such as Figure 5 As shown, the data processing device 400 provided in this application embodiment includes: at least one processor 401, a memory 402, and a network interface 403.

[0104] The data processing method disclosed in this application embodiment can be applied to or implemented by processor 401. Processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the data processing method can be completed by the integrated logic circuit of the hardware in processor 401 or by instructions in the form of software. The processor 401 mentioned above may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 401 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of this application can be directly reflected as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in memory 402. Processor 401 reads the information in memory 402 and, in conjunction with its hardware, completes the steps of the data processing method provided in the embodiments of this application.

[0105] In the embodiments of this application, the data processing device may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned methods.

[0106] It is understood that memory 402 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.

[0107] It is understandable that network interface 403 can be used to interact with peer devices over a network.

[0108] The data processing device may be the aforementioned terminal device and / or server in the service platform.

[0109] Fourthly, in this application embodiment, a storage medium is also provided, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 402 including a computer program. The computer program can be executed by the processor 401 of a data processing device to complete the steps described in the method of this application embodiment. The computer-readable storage medium can be a ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM, etc.

[0110] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0111] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.

[0112] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data processing method, characterized in that, The method includes: When hot-upgrading the first program of the target application, a second process for running the second program is configured according to the configuration parameters of the first process running the first program; wherein, the second program is the new program that the first program is about to be upgraded. The access rights to the network interface of the first process are transferred to the second process, so that the network interface can submit the received first data to the second process; wherein, The second data configured for the first process in the first memory storage is written to a preset storage area; wherein the data written to the preset storage area is used by the second program to read and process; After the second data is completely written to the preset storage area, the first process is closed; The step of writing the second data configured in the first memory storage for the first process into a preset storage area includes: dividing the second data into one or more data slices; storing the data slices and their data identifiers in the preset storage area, wherein the data identifiers are transmitted to the second process and used by the second process to read the data slices from the preset storage area; the data identifiers are hash values ​​corresponding to the data slices.

2. The method according to claim 1, characterized in that, The step of dividing the second data into one or more data slices includes: The second data is divided into one or more data slices according to a predetermined data structure and data volume.

3. The method according to any one of claims 1 to 2, characterized in that, The method further includes: After the second process obtains the data identifier of the second data, it sends a switching request to the first process; the switching request is used to trigger the first process to shut down.

4. The method according to claim 3, characterized in that, The method further includes: Upon detecting a shutdown command for the second process, update the configuration information of the target application according to the storage directory of the second program; Delete the first program.

5. The method according to any one of claims 1 to 2, characterized in that, The method further includes: The second process concatenates the first data and the second data; Forward the first and second data after splicing.

6. A data processing apparatus, comprising: A configuration module is used to configure a second process running a second program according to the configuration parameters of the first process running the first program when hot-upgrading the first program of the target application; wherein the second program is the new program that the first program is about to be upgraded. A transfer module is used to transfer the usage rights of the network interface of the first process to the second process, so that the network interface can submit the received first data to the second process; wherein, The writing module is used to write the second data configured for the first process in the first memory storage to a preset storage area; wherein the data written to the preset storage area is used for the second program to read and process; The shutdown module is used to shut down the first process after the second data has been completely written to the preset storage area; The writing module is further configured to divide the second data into one or more data slices; store the data slices and their data identifiers in the preset storage area, wherein the data identifiers are transmitted to the second process and used by the second process to read the data slices from the preset storage area; the data identifiers are hash values ​​corresponding to the data slices.

7. A server, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and system for processing data in network equipment

    CN106161110A

  • Network upgrading method, device and equipment and medium

    CN109921929A