Process creation method, system, device and medium

By querying the status information and port usage status of the first child process after the server application is upgraded, a second child process is created to continue executing the task. By managing port usage duration, the problem of abnormal termination of service requests after application upgrade is solved, and task continuity and effective utilization of port resources are achieved.

CN115269063BActive Publication Date: 2025-12-16JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210855878.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-19
Publication Date
2025-12-16
Estimated Expiration
2042-07-19

AI Technical Summary

Technical Problem

After the server application was upgraded, the processing tasks for the original service requests were abnormally terminated.

Method used

By querying the status information of the first child process created by the first main process before the application upgrade, the second main process obtains the identification information of the first port and the information of the task to be executed from the target database, creates the second child process to continue executing the task, and determines the free port to create the third child process by querying the port occupancy status information.

Benefits of technology

This solution resolves the issue of abnormal service request termination after application upgrades, ensuring task continuity and efficient use of port resources while avoiding port conflicts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269063B_ABST
    Figure CN115269063B_ABST
Patent Text Reader

Abstract

The present disclosure provides a process creation method, system, device and medium, which can be applied to the technical field of computer. The process creation method comprises: in response to an upgrade operation of an application program, creating a second main process for processing a service request associated with the application program; querying state information of a first sub-process through the second main process; in the case that the state information of the first sub-process meets a preset condition, acquiring, by the second main process, identification information of a first port and to-be-executed task information of the first sub-process from a target database according to the state information of the first sub-process; and creating, by the second main process, a second sub-process according to the identification information of the first port and the to-be-executed task information of the first sub-process, so that the second sub-process continues to execute the to-be-executed task of the first sub-process by accessing the first port.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and more particularly, to a process creation method, system, device, medium and program product. BACKGROUND

[0002] In the application scenario of video stream data transmission, a data collection end establishes a long connection with a server. When an application program of the server is upgraded, the traditional way is that, after the application program of the server is upgraded, a new master process closes a port of an atomic process, and creates a new child process to execute a task related to a service request.

[0003] However, in the process of implementing the present disclosure, the inventors found that at least the following problem exists in the related art: after the application program of the server is upgraded, the processing task of the original service request abnormally terminates. SUMMARY

[0004] Therefore, the present disclosure provides a process creation method, device, equipment, medium and program product.

[0005] According to a first aspect of the present disclosure, a process creation method is provided, comprising:

[0006] creating, in response to an upgrade operation of an application program, a second master process for processing a service request associated with the application program;

[0007] querying, by the second master process, state information of a first child process, wherein the first child process is created by a first master process before the upgrade of the application program, and the state information of the first child process represents a state of executing a task by the first child process through accessing a first port before the upgrade of the application program;

[0008] in a case where the state information of the first child process satisfies a preset condition, acquiring, by the second master process, identification information of the first port and to-be-executed task information of the first child process from a target database according to the state information of the first child process; and

[0009] creating, by the second master process, a second child process according to the identification information of the first port and the to-be-executed task information of the first child process, so that the second child process continues to execute the to-be-executed task of the first child process by accessing the first port.

[0010] According to an embodiment of the present disclosure, the process creation method further comprises:

[0011] in response to a service request initiated by a client after the upgrade of the application program, determining, by the second master process, a second port according to port occupation state information of each port in the target database;

[0012] create a third sub-process according to the second port and the service request by the second master process, wherein the third sub-process is used to execute a task in response to the service request.

[0013] According to an embodiment of the present disclosure, in response to a service request initiated by a client after an application is upgraded, a second port is determined by a second master process according to port occupancy state information of each port in a target database, comprising:

[0014] In response to a service request initiated by a client after an application is upgraded, port occupancy state information of each port in a target database is queried by a second master process;

[0015] A port with the port occupancy state information in an idle state is determined as the second port.

[0016] According to an embodiment of the present disclosure, the process creation method further comprises:

[0017] A port with the port occupancy state information in an occupied state is determined as a third port;

[0018] The port occupancy state information of the third port is changed according to an occupied duration of the third port.

[0019] According to an embodiment of the present disclosure, the port occupancy state information of the third port is changed according to an occupied duration of the third port, comprising:

[0020] Time information of two adjacent occupancies of the third port is obtained from the target database;

[0021] The occupied duration of the third port is calculated according to the time information of two adjacent occupancies of the third port;

[0022] In a case where the occupied duration of the third port exceeds a preset threshold, the port occupancy state information of the third port is changed to an idle state.

[0023] According to an embodiment of the present disclosure, the process creation method further comprises:

[0024] In a case where the state information of the first sub-process does not satisfy a preset condition, the first sub-process is closed by the second master process;

[0025] The port occupancy state information of the first port is queried from the target database according to the port identifier information of the first port;

[0026] The port occupancy state information of the first port is changed to an idle state.

[0027] Another aspect of the present disclosure provides a process creation system, comprising: a first creation module, a first query module, an acquisition module, and a second creation module. The first creation module is configured to create a second master process for processing a service request associated with an application in response to an upgrade operation of the application. The first query module is configured to query, by the second master process, state information of a first child process, wherein the first child process is created by a first master process before the upgrade of the application, and the state information of the first child process represents a state of performing a task by the first child process through accessing a first port before the upgrade of the application. The acquisition module is configured to acquire, by the second master process, identification information of the first port and to-be-executed task information of the first child process from a target database according to the state information of the first child process, in a case where the state information of the first child process satisfies a preset condition. The second creation module is configured to create, by the second master process, a second child process according to the identification information of the first port and the to-be-executed task information of the first child process, so that the second child process continues to perform the to-be-executed task of the first child process by accessing the first port.

[0028] According to an embodiment of the present disclosure, the process creation system further comprises a first determination module and a third creation module. The first determination module is configured to determine, by the second master process, a second port according to port occupancy state information of each port in the target database in response to a service request initiated by a client after the upgrade of the application. The third creation module is configured to create, by the second master process, a third child process according to the second port and the service request, wherein the third child process is configured to perform a task in response to the service request.

[0029] According to an embodiment of the present disclosure, the first determination module comprises a query unit and a first determination unit. The query unit is configured to query, by the second master process, the port occupancy state information of each port from the target database in response to a service request initiated by a client after the upgrade of the application. The first determination unit is configured to determine a port whose port occupancy state information is an idle state as the second port.

[0030] According to an embodiment of the present disclosure, the process creation system further comprises a second determination unit and a change unit. The second determination unit is configured to determine a port whose port occupancy state information is an occupied state as a third port. The change unit is configured to change the port occupancy state information of the third port according to an occupied duration of the third port.

[0031] According to an embodiment of the present disclosure, the first changing unit comprises an obtaining subunit, a calculating subunit and a changing subunit. The obtaining subunit is configured to obtain time information of adjacent two times of occupation of the third port from the target database. The calculating subunit is configured to calculate the occupation duration of the third port according to the time information of adjacent two times of occupation of the third port. The changing subunit is configured to change the port occupation state information of the third port to the idle state in the case that the occupation duration of the third port exceeds the preset threshold.

[0032] According to an embodiment of the present disclosure, the process creation method further comprises a closing module, a second querying module and a changing module. The closing module is configured to close the first sub-process by the second main process in the case that the state information of the first sub-process does not satisfy the preset condition. The second querying module is configured to query the port occupation state information of the first port from the target database according to the port identification information of the first port. The changing module is configured to change the port occupation state information of the first port to the idle state.

[0033] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the process creation method described above.

[0034] A fourth aspect of the present disclosure further provides a computer-readable storage medium having stored executable instructions, which are executed by a processor to execute the process creation method described above.

[0035] A fifth aspect of the present disclosure further provides a computer program product comprising a computer program, which is executed by a processor to implement the process creation method described above.

[0036] According to an embodiment of the present disclosure, because the state information of the first sub-process created by the first main process before the application program is upgraded is queried, and then the identification information of the first port and the to-be-executed task information of the first sub-process are obtained from the target database according to the state information of the first sub-process by the second main process, and then the second sub-process is created according to the identification information of the first port and the to-be-executed task information of the first sub-process by the second main process. Since the second sub-process is created according to the port of the first sub-process and the to-be-executed task information of the first sub-process after the application program is upgraded, the second sub-process can continue to execute the to-be-executed task of the first sub-process by accessing the first port, so that the technical problem of abnormal termination of the service request before the application program is upgraded is at least partially overcome, and the technical effect that the second sub-process created after the application program is upgraded can continue to execute the to-be-executed task by accessing the first port before the application program is upgraded is achieved. BRIEF DESCRIPTION OF DRAWINGS

[0037] The above and other objects, features and advantages of the present disclosure will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which:

[0038] Figure 1 An exemplary system architecture diagram to which the process creation method of the present disclosure can be applied is schematically shown;

[0039] Figure 2 A flowchart of the process creation method according to an embodiment of the present disclosure is schematically shown;

[0040] Figure 3 A logic block diagram of the process creation method in response to a service request initiated by a client after an application upgrade according to an embodiment of the present disclosure is schematically shown;

[0041] Figure 4 A storage format of port occupancy state information in a target database according to an embodiment of the present disclosure is schematically shown;

[0042] Figure 5 A process creation system block diagram according to an embodiment of the present disclosure is schematically shown; and

[0043] Figure 6 A block diagram of an electronic device suitable for implementing the process creation method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0044] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It is to be understood, however, that the description is merely exemplary of the present disclosure, and is not intended to limit the scope of the present disclosure. In the following detailed description of the embodiments of the present disclosure, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure. However, it would be apparent to one skilled in the art that the present disclosure can be practiced without these specific details. In other instances, well-known structures and functions have not been described in detail in order to avoid obscuring aspects of the present disclosure.

[0045] The terms used herein are merely used to describe specific embodiments, and are not intended to limit the present disclosure. The terms "include" and "have" and the like used herein indicate the presence of the described features, steps, operations, and / or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.

[0046] All terms used herein, including technical and scientific terms, have the same meanings as those generally understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having meanings consistent with the context of the present specification, and should not be interpreted in an idealized or excessively formal manner.

[0047] In the event that a phrase such as "at least one of A, B, and C, etc." is used herein, it is intended that the phrase be interpreted to mean that an "A" alone is possible, a "B" alone is possible, a "C" alone is possible, "A" and "B" in combination are possible, "A" and "C" in combination are possible, "B" and "C" in combination are possible, or "A," "B," and "C" in combination are possible, etc.

[0048] In the application scenario of video stream data transmission, the data collection end establishes a long connection with the server. When the application program of the server is upgraded, the traditional way is that after the application program of the server is upgraded, the new master process closes the port of the atomic process, and creates a new child process to execute the task related to the service request.

[0049] The inventors have found that in this traditional way, because before the application program of the server is upgraded, the atomic process has handled the task related to the service request by accessing the port, after the application program is upgraded, the access port of the child process is closed, and the task related to the service request handled by the atomic process will be abnormally terminated.

[0050] Therefore, the embodiments of the present disclosure provide a process creation method. The method comprises querying state information of a first child process created by a first master process before an application program is upgraded, then acquiring identification information of a first port and to-be-executed task information of the first child process from a target database according to the state information of the first child process by a second master process, and creating a second child process according to the identification information of the first port and the to-be-executed task information of the first child process by the second master process. Because after the application program is upgraded, the second child process is created by the second master process according to the port of the first child process and the to-be-executed task information of the first child process, the second child process can continue to execute the to-be-executed task of the first child process by accessing the first port, so that at least part of the technical problems of abnormal termination of service request before the application program is upgraded are overcome, and the technical effect that the second child process created after the application program is upgraded can continue to execute the to-be-executed task by accessing the first port before the application program is upgraded is achieved.

[0051] Figure 1 An exemplary system architecture 100 to which the process creation method according to the embodiments of the present disclosure can be applied is schematically shown. It should be noted that, Figure 1 The shown is only an example of the system architecture to which the embodiments of the present disclosure can be applied, to help those skilled in the art understand the technical content of the present disclosure, but does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.

[0052] As Figure 1As shown, the system architecture 100 according to this embodiment can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired and / or wireless communication links, and the like.

[0053] A user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, and the like. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, and the like (only as examples).

[0054] The terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0055] The server 105 can be a server providing various services, such as a background management server providing support for websites browsed by users using the terminal devices 101, 102, 103 (only as an example). The background management server can analyze and process received user requests and the like, and feed back the processing results (such as web pages, information, or data, and the like obtained or generated according to user requests) to the terminal devices.

[0056] It should be noted that the process creation method provided by the embodiments of the present disclosure can generally be executed by the server 105. Accordingly, the process creation system provided by the embodiments of the present disclosure can generally be arranged in the server 105. The process creation method provided by the embodiments of the present disclosure can also be executed by a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the process creation system provided by the embodiments of the present disclosure can also be arranged in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and / or the server 105.

[0057] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the system architecture 100 is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks, and servers.

[0058] Figure 2 A flowchart of a process creation method according to an embodiment of the present disclosure is schematically shown.

[0059] As Figure 2As shown, the method includes operations S210-S240.

[0060] In operation S210, in response to an upgrade operation of an application, a second master process for processing a service request associated with the application is created.

[0061] According to an embodiment of the present disclosure, the application can include a streaming media application, such as various types of audio and video playing applications, video interactive applications, and the like. The service request associated with the application can include a service request related to a streaming media service, such as a video screenshot, and the like.

[0062] In operation S220, the second master process queries state information of the first sub-process, wherein the first sub-process is created by the first master process before the application is upgraded, and the state information of the first sub-process represents a state of performing a task by the first sub-process through accessing the first port before the application is upgraded.

[0063] According to an embodiment of the present disclosure, taking a video screenshot service request as an example, before the application is upgraded, the server maintains a high-concurrency long connection with a collection end, and the first master process creates the first sub-process to perform a video screenshot task by accessing the first port. The second master process can obtain the state information of the first sub-process by querying the listening information of the first master process. The state information of the first sub-process can also be stored in a shared memory or a target database.

[0064] In operation S230, in a case where the state information of the first sub-process satisfies a preset condition, the second master process obtains identification information of the first port and to-be-executed task information of the first sub-process from the target database according to the state information of the first sub-process.

[0065] According to an embodiment of the present disclosure, the preset condition can be that the state information of the first sub-process is “unprocessed” or “processing”, indicating that the state of performing a task by the first sub-process through accessing the first port before the application is upgraded is “unprocessed” or “processing”. For example, port A is a port through which the server establishes a long connection with a client. The task performed by the first sub-process through accessing port A can be a video screenshot task, and when the application is upgraded, the video stream data received by the first sub-process from the client through port A can be only a part of the video stream data, i.e., not all of the video stream data is downloaded.

[0066] According to an embodiment of the present disclosure, the target database can store port identification information, to-be-executed task information of the first sub-process, and identification information of the first sub-process. The to-be-executed task information of the first sub-process can be marked with a file identifier in the target database. For example, the second main process can obtain, from the target database, identification information of the port A and video screenshot task information to be executed by the first sub-process according to the identification information of the first sub-process in a case where the state information of the first sub-process satisfies the preset condition.

[0067] In operation S240, a second sub-process is created by the second main process according to the identification information of the first port and the to-be-executed task information of the first sub-process, so that the second sub-process continues to execute the to-be-executed task of the first sub-process by accessing the first port.

[0068] According to an embodiment of the present disclosure, for example, the second sub-process can be created by the second main process according to the identification information of the port A and the video screenshot task information to be executed by the first sub-process. Since the second sub-process reuses the port A, the second sub-process can continue to execute the video screenshot task information to be executed by the first sub-process by accessing the port A, that is, continue to download another part of the video stream data by accessing the port A and complete the video screenshot task.

[0069] According to an embodiment of the present disclosure, because the technical means of querying the state information of the first sub-process created by the first main process before the application program is upgraded, then obtaining the identification information of the first port and the to-be-executed task information of the first sub-process from the target database by the second main process according to the state information of the first sub-process, and then creating the second sub-process by the second main process according to the identification information of the first port and the to-be-executed task information of the first sub-process is adopted. Since the second sub-process is created by the second main process according to the port of the first sub-process and the to-be-executed task information of the first sub-process after the application program is upgraded, the second sub-process can continue to execute the to-be-executed task of the first sub-process by accessing the first port, so that the technical problem of abnormal termination of the service request before the application program is upgraded is at least partially overcome, and the technical effect that the second sub-process created after the application program is upgraded can continue to execute the to-be-executed task by accessing the first port before the application program is upgraded is achieved.

[0070] According to an embodiment of the present disclosure, the process creation method further includes:

[0071] In response to a service request initiated by a client after the application program is upgraded, a second port is determined by the second main process according to the port occupation state information of each port in the target database.

[0072] A third sub-process is created by the second main process according to the second port and the service request, wherein the third sub-process is used to execute a task in response to the service request.

[0073] According to an embodiment of the present disclosure, the target database can store the occupation state information of each port. The second port can be determined by the second master process according to the port occupation state information of each port in the target database. For example, the target database includes port A, port B, and port C. The port occupation state of port A is occupied, the port occupation state of port B is occupied, and the port occupation state of port C is idle. The second port can be determined directly from the port with an idle state, that is, port C is determined as the second port.

[0074] According to an embodiment of the present disclosure, for example, the service request initiated by the client after the application upgrade can be a video stream download task. The second master process can take the port with an idle state in the target database as the second port, and then create a third sub-process according to the service request, so that the third sub-process executes the video stream download task by accessing port C.

[0075] According to an embodiment of the present disclosure, for the service request initiated by the client after the application upgrade, the port with an idle state can be taken as an access port for processing a task associated with the service request by querying the port occupation state in the target database, which can effectively avoid the problem of abnormal termination of the service request caused by the port conflict during the application upgrade.

[0076] According to an embodiment of the present disclosure, in response to the service request initiated by the client after the application upgrade, the second port is determined by the second master process according to the port occupation state information of each port in the target database, comprising:

[0077] In response to the service request initiated by the client after the application upgrade, the second master process queries the port occupation state information of each port from the target database;

[0078] The port with an idle state in the port occupation state information is determined as the second port.

[0079] According to an embodiment of the present disclosure, for example, the service request initiated by the client after the application upgrade can be a video stream download task, and the port occupation state information queried by the second master process from the target database can be: the port occupation state information of port A is occupied, the port occupation state information of port B is idle, and the port occupation state information of port C is occupied.

[0080] According to an embodiment of the present disclosure, the port B with an idle state in the port occupation state information can be taken as the second port.

[0081] According to the embodiment of the present disclosure, for the service request initiated by the client after the application upgrade, the idle port can be taken as the access port for processing the task associated with the service request by querying the port occupation state in the target database, which not only solves the problem that the tasks processed by the atomic process are forced to be interrupted due to the closing of all the ports of the sub-process before the application upgrade in the traditional way, but also solves the problem of port conflict caused by the application upgrade.

[0082] According to the embodiment of the present disclosure, the process creation method further includes:

[0083] The port with the port occupation state information in the occupied state is determined as a third port;

[0084] The port occupation state information of the third port is changed according to the occupied duration of the third port.

[0085] According to the embodiment of the present disclosure, since the second master process or the first master process cannot update the port occupation state information in the target database in time when the port is abnormally closed, the port occupation state information of the abnormally closed port may be in the occupied state for a long time, so that the port cannot be normally reused. Therefore, the occupied duration of the port can be queried to change the occupation state information of the port in time.

[0086] According to the embodiment of the present disclosure, the second master process can query the occupied duration of the port in the occupied state from the target database by executing a timing task. For example, the occupied duration of the port in the occupied state can be queried every 10s. A maximum threshold of the occupied duration can be set as a maximum survival duration of the port, for example, the occupied duration of port A is 10min, the occupied duration of port B is 45min, and the maximum survival duration of the port is 15min. Since the occupied duration of port B is greater than the maximum survival duration of the port, port B can be determined as an abnormally closed port, and the port occupation state of port B is changed to the idle state, so that the second master process can reuse port B to create a new sub-process.

[0087] According to the embodiment of the present disclosure, by querying the occupied duration of the port in the occupied state and changing the occupation state information of the port in time, the problem that the port reuse is hindered due to the failure of updating the port occupation state in time caused by the abnormal closing of the port can be solved.

[0088] According to the embodiment of the present disclosure, the port occupation state information of the third port is changed according to the occupied duration of the third port, including:

[0089] The time information of the adjacent two occupations of the third port is obtained from the target database;

[0090] According to the time information of the third port being occupied for two adjacent times, the occupied time length of the third port is calculated;

[0091] In the case where the occupied time length of the third port exceeds the preset threshold, the port occupation state information of the third port is changed to the idle state.

[0092] According to an embodiment of the present disclosure, the second main process or the first main process can record the start timestamp and the end timestamp of the port being occupied in the target database when the port is occupied. The time information of the third port being occupied for two adjacent times can be the start time stamp information of the third port being occupied for the nth time and the start time stamp information of the third port being occupied for the n-1th time, or the end time stamp information of the third port being occupied for the nth time and the end time stamp information of the third port being occupied for the n-1th time. For example, the start time stamp information of the third port being occupied for the nth time is t1, the start time stamp information of the third port being occupied for the n-1th time is t2, and the time information of the third port being occupied for two adjacent times can be t1 and t2. The end time stamp information of the third port being occupied for the nth time is t3, the end time stamp information of the third port being occupied for the n-1th time is t4, and the time information of the third port being occupied for two adjacent times can be t3 and t4.

[0093] According to an embodiment of the present disclosure, according to the time information of the third port being occupied for two adjacent times, the occupied time length of the third port can be the difference t1-t2 between the start time stamps of the third port being occupied for two adjacent times, or the difference t3-t4 between the end time stamps of the third port being occupied for two adjacent times.

[0094] According to an embodiment of the present disclosure, the preset threshold can be a preset maximum survival time length Δt of the port max When t1-t2 or t3-t4 is greater than Δt max , it can be determined that the port has an abnormal closing condition, and the port occupation state information of the port can be changed to the idle state to facilitate the use of other child processes.

[0095] According to an embodiment of the present disclosure, according to the time information of the port being occupied for two adjacent times, the occupied time length of the port is determined, in the case where the occupied time length of the port exceeds the preset threshold, the port occupation state information of the port is changed to the idle state to facilitate the use of other child processes, in the case where the port resources are limited, the idle port is released in time for the use of other child processes, so as to achieve the purpose of fully utilizing the limited port resources on the premise of avoiding port conflicts.

[0096] Figure 3 The process creation method logic block diagram in response to the service request initiated by the client after the application program is upgraded is schematically shown according to an embodiment of the present disclosure.

[0097] As shown in Figure 3 , this embodiment includes operations S301-S310.

[0098] In operation S301, in response to a service request initiated by a client after an application upgrade, querying, by a second master process, port occupancy state information of each port from a target database;

[0099] In operation S302, determining whether the port occupancy state of the port is an idle state, if yes, performing operation S303; if not, performing operation S305.

[0100] In operation S303, determining the port whose port occupancy state information is in the idle state as a second port;

[0101] In operation S304, creating, by the second master process, a third sub-process according to the second port and the service request, wherein the third sub-process is used to perform a task in response to the service request;

[0102] In operation S305, determining the port whose port occupancy state information is in the occupied state as a third port;

[0103] In operation S306, obtaining, from the target database, time information of adjacent two times of occupation of the third port;

[0104] In operation S307, calculating, according to the time information of adjacent two times of occupation of the third port, an occupied duration of the third port;

[0105] In operation S308, determining whether the occupied duration of the third port is greater than a preset threshold, if yes, performing operation S309, if not, performing operation S310.

[0106] In operation S309, changing the port occupancy state information of the third port to the idle state, so as to be used by other sub-processes.

[0107] In operation S310, no processing is performed.

[0108] According to embodiments of the present disclosure, the process creation method further includes:

[0109] In a case where the state information of the first sub-process does not satisfy a preset condition, closing, by the second master process, the first sub-process;

[0110] Querying, from the target database, port occupancy state information of the first port according to port identification information of the first port;

[0111] Changing the port occupancy state information of the first port to the idle state.

[0112] According to an embodiment of the present disclosure, the preset condition can be that the state information of the first sub-process is "unprocessed" or "processing", indicating that the state of the first sub-process performing a task by accessing the first port before the application program is upgraded is "unprocessed" or "processing". When the state information of the first sub-process does not satisfy the preset condition, the state of the first sub-process performing a task by accessing the first port can be "completed". For example, port A is a port for the server to establish a long connection with the client. The task performed by the first sub-process by accessing port A can be a video screenshot task. When the application program is upgraded, the first sub-process receives all video stream data from the client through port A and completes the video screenshot task.

[0113] According to an embodiment of the present disclosure, the first sub-process can be closed by the second main process. The identification information of the first port can be queried from the target database, and the port occupation state information of the first port can be changed to an idle state for use by other sub-processes. For example, when the state information of the first sub-process is "completed", the first sub-process performs a processing task by accessing port A, and the identification information of port A can be queried from the target database. The port occupation state information of port A is changed from an occupied state to an idle state.

[0114] According to an embodiment of the present disclosure, by querying the state information of the first sub-process, the access port of the sub-process that has completed the processing task is closed in time for use by other sub-processes. In the case of limited port resources, idle ports are released in time for use by other sub-processes, so as to fully utilize the limited port resources under the premise of avoiding port conflicts.

[0115] Figure 4 The storage format of the port occupation state information in the target database according to an embodiment of the present disclosure is schematically shown.

[0116] As shown in Figure 4 , a plurality of storage formats can be set in the target database, and the first addresses of the plurality of storage formats are mapped to each element of the storage format pointer array. Each storage format is provided with an index, and the indexes can be 0, 1, 2, 3...N respectively. Each index can represent a relative value of a port identification. For example, the starting port can be 9000. If the index of the storage format is 3, it can be indicated that the storage format stores the port occupation state information of the port with the port identification of 9003.

[0117] Based on the process creation method described above, the present disclosure further provides a process creation system. The apparatus will be described in detail below. Figure 5 The apparatus will be described in detail below.

[0118] Figure 5 The structure block diagram of the process creation system according to an embodiment of the present disclosure is schematically shown.

[0119] As Figure 5 shown, the process creation system of this embodiment includes a first creation module 510, a first query module 520, an acquisition module 530, and a second creation module 540.

[0120] The first creation module 510 is configured to create, in response to an upgrade operation of an application program, a second master process for processing a service request associated with the application program. In an embodiment, the first creation module 510 can be configured to perform operation S210 described above, and thus repeated details are not provided herein.

[0121] The first query module 520 is configured to query, by the second master process, state information of a first sub-process, wherein the first sub-process is created by a first master process before the upgrade of the application program, and the state information of the first sub-process represents a state of performing a task by the first sub-process through accessing a first port before the upgrade of the application program. In an embodiment, the first query module 520 can be configured to perform operation S220 described above, and thus repeated details are not provided herein.

[0122] The acquisition module 530 is configured to, in a case where the state information of the first sub-process satisfies a preset condition, acquire, by the second master process, identification information of the first port and to-be-executed task information of the first sub-process from a target database according to the state information of the first sub-process. In an embodiment, the acquisition module 530 can be configured to perform operation S230 described above, and thus repeated details are not provided herein.

[0123] The second creation module 540 is configured to create, by the second master process, a second sub-process according to the identification information of the first port and the to-be-executed task information of the first sub-process, so that the second sub-process continues to perform the to-be-executed task of the first sub-process by accessing the first port. In an embodiment, the second creation module 540 can be configured to perform operation S240 described above, and thus repeated details are not provided herein.

[0124] According to an embodiment of the present disclosure, the process creation system further includes a first determination module and a third creation module. The first determination module is configured to determine, in response to a service request initiated by a client after the upgrade of the application program, a second port according to port occupation state information of each port in the target database by the second master process. The third creation module is configured to create, by the second master process, a third sub-process according to the second port and the service request, wherein the third sub-process is configured to perform a task in response to the service request.

[0125] According to an embodiment of the present disclosure, the first determining module comprises a querying unit and a first determining unit. The querying unit is configured to query, by the second main process, the port occupation state information of each port from the target database in response to a service request initiated by the client after the application is upgraded. The first determining unit is configured to determine a port whose port occupation state information is an idle state as a second port.

[0126] According to an embodiment of the present disclosure, the process creation system further comprises a second determining unit and a changing unit. The second determining unit is configured to determine a port whose port occupation state information is an occupied state as a third port. The changing unit is configured to change the port occupation state information of the third port according to the occupied duration of the third port.

[0127] According to an embodiment of the present disclosure, the first changing unit comprises an obtaining subunit, a calculating subunit and a changing subunit. The obtaining subunit is configured to obtain, from the target database, time information of adjacent two occupied times of the third port. The calculating subunit is configured to calculate the occupied duration of the third port according to the time information of the adjacent two occupied times of the third port. The changing subunit is configured to change the port occupation state information of the third port to an idle state if the occupied duration of the third port exceeds a preset threshold.

[0128] According to an embodiment of the present disclosure, the process creation method further comprises a closing module, a second querying module and a changing module. The closing module is configured to close the first sub-process by the second main process if the state information of the first sub-process does not satisfy a preset condition. The second querying module is configured to query, from the target database, the port occupation state information of the first port according to the port identifier information of the first port. The changing module is configured to change the port occupation state information of the first port to an idle state.

[0129] Any one or more of modules, units, sub-units according to embodiments of the present disclosure, or at least part of functions of any one or more of them, can be implemented in one module. Any one or more of modules, units, sub-units according to embodiments of the present disclosure can be split into a plurality of modules to be implemented. Any one or more of modules, units, sub-units according to embodiments of the present disclosure can be implemented at least in part as a hardware circuit, for example, a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of hardware or firmware by integrating or packaging circuits, or in any one of software, hardware and firmware, or in a proper combination of any one or more of them. Alternatively, one or more of modules, units, sub-units according to embodiments of the present disclosure can be implemented at least in part as computer program modules, which can perform corresponding functions when the computer program modules are run.

[0130] For example, any one or more of the first creating module 510, the first querying module 520, the obtaining module 530 and the second creating module 540 can be combined in one module / unit / sub-unit to be implemented, or any one of them can be split into a plurality of modules / units / sub-units. Alternatively, at least part of functions of one or more of the modules / units / sub-units can be combined with at least part of functions of other modules / units / sub-units, and implemented in one module / unit / sub-unit. According to embodiments of the present disclosure, at least one of the first creating module 510, the first querying module 520, the obtaining module 530 and the second creating module 540 can be implemented at least in part as a hardware circuit, for example, a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of hardware or firmware by integrating or packaging circuits, or in any one of software, hardware and firmware, or in a proper combination of any one or more of them. Alternatively, at least one of the first creating module 510, the first querying module 520, the obtaining module 530 and the second creating module 540 can be implemented at least in part as computer program modules, which can perform corresponding functions when the computer program modules are run.

[0131] Figure 6 A block diagram of an electronic device suitable for implementing the process creation method described above according to embodiments of the present disclosure is schematically shown. Figure 6 The electronic device shown is merely an example, and should not bring any limitation to the functions and use range of embodiments of the present disclosure.

[0132] AsFigure 6 As shown, the electronic device 600 according to embodiments of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to programs stored in a read only memory (ROM) 602 or loaded into a random access memory (RAM) 603 from a storage section 608. The processor 601 can include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor, and / or a related chip set, and / or a dedicated microprocessor (e.g., an application specific integrated circuit (ASIC)), and so on. The processor 601 can also include an on-board memory for cache use. The processor 601 can include a single processing unit or multiple processing units for executing different actions of the method processes according to embodiments of the present disclosure.

[0133] In the RAM 603, various programs and data required for the operation of the electronic device 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method processes according to embodiments of the present disclosure by executing the programs in the ROM 602 and / or the RAM 603. Note that the programs can also be stored in one or more memories other than the ROM 602 and the RAM 603. The processor 601 can also perform various operations of the method processes according to embodiments of the present disclosure by executing the programs stored in the one or more memories.

[0134] According to embodiments of the present disclosure, the electronic device 600 can further include an input / output (I / O) interface 605, which is also connected to the bus 604. The system 600 can further include one or more of the following components connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as necessary. A removable recording medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 610 as necessary, so that a computer program read out therefrom is installed in the storage section 608 as necessary.

[0135] According to an embodiment of the present disclosure, the method flow according to the embodiments of the present disclosure can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product comprising a computer program that, when executed by a processor, causes the processor to perform the above-described functions defined in the system implementing the embodiments of the present disclosure. According to an embodiment of the present disclosure, the above-described system, device, apparatus, module, unit, and the like described above can be implemented by computer program modules.

[0136] The present disclosure also provides a computer readable storage medium, which can be included in the device / apparatus / system described in the above embodiments, or can exist separately without being assembled into the device / apparatus / system. The above computer readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present disclosure.

[0137] According to an embodiment of the present disclosure, the computer readable storage medium can be a non-volatile computer readable storage medium. For example, it can include, but is not limited to, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any appropriate combination thereof. In the present disclosure, the computer readable storage medium can be any tangible medium that contains, or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device.

[0138] For example, according to an embodiment of the present disclosure, the computer readable storage medium can include one or more memories of the above-described ROM 602 and / or RAM 603 and / or one or more memories other than the ROM 602 and RAM 603.

[0139] The computer program product of the first aspect can include one or more non-transitory computer-readable media storing instructions that, when executed, cause one or more processors to perform the operations of the first aspect. The one or more non-transitory computer-readable media can include, for example, magnetic media such as one or more magnetic disks, magnetic tapes or cassettes; optical media such as one or more compact discs (CD), optical discs or discs (for example, DVD, Blu-ray Disc®, digital video disc, ultra density disc, ultra-compact disc, any optical media, etc.); semiconductor media such as solid state hard drives (for example, flash memory, solid state USB drives, etc.); any other suitable medium; or any suitable combination of media.

[0140] Those skilled in the art will understand that features of the various embodiments and / or claims of the present disclosure can be combined and / or sub-combined, even if such combinations or sub-combinations are not expressly noted in the present disclosure. In particular, features of the various embodiments and / or claims of the present disclosure can be combined and / or sub-combined in any number of ways, without departing from the spirit and scope of the present disclosure. All such combinations and / or sub-combinations are within the scope of the present disclosure.

[0141] The above describes embodiments of the present disclosure. However, these embodiments are merely for illustrative purposes, and are not intended to limit the scope of the present disclosure. Although the above describes each embodiment separately, this does not mean that the measures in each embodiment cannot be used advantageously in combination. The scope of the present disclosure is defined by the appended claims and their equivalents. Those skilled in the art can make various substitutions and modifications without departing from the scope of the present disclosure, and all such substitutions and modifications shall fall within the scope of the present disclosure.

Claims

1. A process creation method, comprising: creating, in response to an upgrade operation of an application, a second master process for processing a service request associated with the application; inquiring, by the second master process, state information of a first child process, wherein the first child process is created by a first master process before the upgrade of the application, and the state information of the first child process represents a state of performing a task by the first child process through accessing a first port before the upgrade of the application; in a case where the state information of the first child process satisfies a preset condition, obtaining, by the second master process, identification information of the first port and to-be-executed task information of the first child process from a target database according to the state information of the first child process; and creating, by the second master process, a second child process according to the identification information of the first port and the to-be-executed task information of the first child process, so that the second child process continues to perform the to-be-executed task of the first child process by accessing the first port. 2.The method of claim 1, further comprising: determining, by the second master process, a second port according to port occupancy state information of each port in the target database, in response to a service request initiated by a client after the upgrade of the application; creating, by the second master process, a third child process according to the second port and the service request, wherein the third child process is used to perform a task in response to the service request.

3. The method of claim 2, wherein, The determining, by the second master process, a second port according to port occupancy state information of each port in the target database, in response to a service request initiated by a client after the upgrade of the application, comprises: inquiring, by the second master process, the port occupancy state information of each port from the target database, in response to a service request initiated by a client after the upgrade of the application; determining a port whose port occupancy state information is an idle state as the second port. 4.The method of claim 3, further comprising: determining a port whose port occupancy state information is an occupied state as a third port; changing the port occupancy state information of the third port according to an occupied duration of the third port.

5. The method of claim 4, wherein, The changing the port occupancy state information of the third port according to an occupied duration of the third port, comprises: obtaining, from the target database, time information of adjacent two times of occupation of the third port; calculating the occupied duration of the third port according to the time information of adjacent two times of occupation of the third port; in a case where the occupied duration of the third port exceeds a preset threshold, changing the port occupancy state information of the third port to an idle state. 6.The method of claim 1, further comprising: in a case where the state information of the first child process does not satisfy the preset condition, closing, by the second master process, the first child process; inquiring, from the target database, port occupancy state information of the first port according to port identification information of the first port; changing the port occupancy state information of the first port to an idle state.

7. A process creation system, comprising: a first creation module configured to, in response to an upgrade operation of an application, create a second master process for processing service requests associated with the application; a first query module configured to query, by the second master process, state information of a first child process, wherein the first child process is created by a first master process before the upgrade of the application, and the state information of the first child process represents a state of performing a task by the first child process through accessing a first port before the upgrade of the application; an acquisition module configured to, in a case where the state information of the first child process satisfies a preset condition, acquire, by the second master process, identification information of the first port and to-be-executed task information of the first child process from a target database according to the state information of the first child process; a second creation module configured to, by the second master process, create a second child process according to the identification information of the first port and the to-be-executed task information of the first child process, so that the second child process continues to perform the to-be-executed task of the first child process by accessing the first port.

8. An electronic device, comprising: one or more processors; a storage device configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1-6.

9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method according to any one of claims 1-6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Multi-process processing method and device, terminal equipment and computer readable storage medium

    CN110413386A

  • Data file transmission method and device, storage medium and electronic equipment

    CN111049913A