CN115269063A - Process creation method, system, device and medium - Google Patents

Process creation method, system, device and medium Download PDF

Info

Publication number
CN115269063A
CN115269063A CN202210855878.8A CN202210855878A CN115269063A CN 115269063 A CN115269063 A CN 115269063A CN 202210855878 A CN202210855878 A CN 202210855878A CN 115269063 A CN115269063 A CN 115269063A
Authority
CN
China
Prior art keywords
port
sub
state information
information
executed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210855878.8A
Other languages
Chinese (zh)
Inventor
张俊勤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Information Technology Co Ltd
Original Assignee
Jingdong Technology Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jingdong Technology Information Technology Co Ltd filed Critical Jingdong Technology Information Technology Co Ltd
Priority to CN202210855878.8A priority Critical patent/CN115269063A/en
Publication of CN115269063A publication Critical patent/CN115269063A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • G06F9/4484Executing subprograms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure provides a process creation method, a system, a device and a medium, which can be applied to the technical field of computers. The process creation method comprises the following steps: creating a second host process for processing a service request associated with the application program in response to an upgrade operation of the application program; querying the state information of the first sub-process through the second main process; under the condition that the state information of the first subprocess meets the preset condition, acquiring the identification information of the first port and the task information to be executed of the first subprocess from the target database through the second main process according to the state information of the first subprocess; and creating a second sub-process through the second main process according to the identification information of the first port and the task information to be executed of the first sub-process, so that the second sub-process continues to execute the task to be executed of the first sub-process by accessing the first port.

Description

Process creation method, system, device and medium
Technical Field
The present disclosure relates to the field of computer technology, and more particularly, to a process creation method, system, device, medium, and program product.
Background
In an application scene of video stream data transmission, a data acquisition end establishes long connection with a server. When an application program of a server is upgraded, a traditional method is that after the application program of the server is upgraded, a new main process closes a port of an atomic process, and a new sub-process is created to execute tasks related to a service request.
However, in the course of implementing the disclosed concept, the inventors found that there are at least the following problems in the related art: after the application program of the server is upgraded, the processing task of the original service request is abnormally terminated.
Disclosure of Invention
In view of the above, the present disclosure provides a process creation method, apparatus, device, medium, and program product.
According to a first aspect of the present disclosure, there is provided a process creation method including:
creating a second host process for processing a service request associated with the application program in response to an upgrade operation of the application program;
querying, by a second host process, state information of a first sub-process, wherein the first sub-process is created by the first host process before the application program is upgraded, the state information of the first sub-process representing a state in which a task is executed by the first sub-process by accessing the first port before the application program is upgraded;
under the condition that the state information of the first subprocess meets the preset condition, acquiring the identification information of the first port and the task information to be executed of the first subprocess from the target database through the second main process according to the state information of the first subprocess; and
and creating a second sub-process by the second main process according to the identification information of the first port and the task information to be executed of the first sub-process, so that the second sub-process continues to execute the task to be executed of the first sub-process by accessing the first port.
According to an embodiment of the present disclosure, the process creating method further includes:
responding to a service request initiated by a client after the application program is upgraded, and determining a second port through a second main process according to the port occupation state information of each port in the target database;
and creating a third sub-process according to the second port and the service request through the second main process, wherein the third sub-process is used for executing the task responding to the service request.
According to an embodiment of the present disclosure, determining, by a second host process, a second port according to port occupation state information of each port in a target database in response to a service request initiated by a client after an application program is upgraded, includes:
responding to a service request initiated by a client after the application program is upgraded, and inquiring port occupation state information of each port from a target database through a second main process;
and determining the port with the port occupation state information in an idle state as a second port.
According to an embodiment of the present disclosure, the process creation method further includes:
determining the port with the port occupation state information as an occupation state as a third port;
and changing the port occupation state information of the third port according to the occupied duration of the third port.
According to the embodiment of the present disclosure, changing the port occupation state information of the third port according to the occupied duration of the third port includes:
acquiring the time information of two adjacent occupied times of the third port from a target database;
calculating the occupied time length of the third port according to the information of the time when the third port is occupied twice;
and under the condition that the occupied duration of the third port exceeds a preset threshold value, changing the port occupation state information of the third port into an idle state.
According to an embodiment of the present disclosure, the process creation method further includes:
under the condition that the state information of the first sub-process does not meet the preset condition, closing the first sub-process through the second main process;
according to the port identification information of the first port, inquiring the port occupation state information of the first port from the target database;
and changing the port occupation state information of the first port into an idle state.
Another aspect of the present disclosure provides a process creation system, including: the device comprises a first creating module, a first inquiring module, an obtaining module and a second creating module. The first creating module is used for responding to the upgrading operation of the application program and creating a second main process used for processing the service request associated with the application program. And the first query module is used for querying the state information of the first subprocess through the second main process, wherein the first subprocess is created by the first main process before the application program is upgraded, and the state information of the first subprocess represents the state of executing the task by the first subprocess through accessing the first port before the application program is upgraded. And the acquisition module is used for acquiring the identification information of the first port and the to-be-executed task information of the first subprocess from the target database by the second main process according to the state information of the first subprocess under the condition that the state information of the first subprocess meets the preset condition. And the second creating module is used for creating a second subprocess through the second main process according to the identification information of the first port and the information of the task to be executed of the first subprocess, so that the second subprocess can continuously execute the task to be executed of the first subprocess by accessing the first port.
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 determining module is used for responding to a service request initiated by a client after an application program is upgraded and determining a second port through a second main process according to port occupation state information of each port in a target database. And the third creating module is used for creating a third sub-process through the second main process according to the second port and the service request, wherein the third sub-process is used for executing the task responding to the service request.
According to an embodiment of the present disclosure, the first determining module includes a querying unit and a first determining unit. The query unit is used for responding to a service request initiated by the client after the application program is upgraded and querying the port occupation state information of each port from the target database through the second main process. And the first determining unit is used for determining the port with the port occupation state information in an idle state as a second port.
According to an embodiment of the present disclosure, the process creation system further includes a second determination unit and a change unit. The second determining unit is configured to determine the port with the port occupation state information being an occupation state as a third port. And the changing unit is used for changing the port occupation state information of the third port according to the occupied duration of the third port.
According to an embodiment of the present disclosure, the first alteration unit includes an acquisition subunit, a calculation subunit, and an alteration subunit. The acquiring subunit is configured to acquire time information of two adjacent times of the third port from the target database. And the calculating subunit is used for calculating the occupied duration of the third port according to the information of the two adjacent times of occupation of the third port. And the changing subunit is configured to change the port occupation state information of the third port to an idle state when the occupied duration of the third port exceeds a preset threshold.
According to the embodiment of the disclosure, the process creation method further includes a closing module, a second query module, and a changing module. And the closing module is used for closing the first subprocess through the second main process under the condition that the state information of the first subprocess does not meet the preset condition. And the second query module is used for querying the port occupation state information of the first port from the target database according to the port identification information of the first port. And the changing module is used for changing the port occupation state information of the first port into an idle state.
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 the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the process creation method described above.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described process creation method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described process creation method.
According to the embodiment of the disclosure, a technical means is adopted for creating the state information of the first sub-process by querying the first main process before the application program is upgraded, then obtaining the identification information of the first port and the task information to be executed of the first sub-process from the target database through the second main process according to the state information of the first sub-process, and then creating the second sub-process through the second main process according to the identification information of the first port and the task information to be executed of the first sub-process. After the application program is upgraded, the second main process is the second sub process established according to the port of the first sub process and the information of the task to be executed of the first sub process, so that the second sub process can continue to execute the task to be executed of the first sub process by accessing the first port, the technical problem that the service request before the application program is upgraded is abnormally terminated is at least partially solved, and the technical effect that the second sub process established after the application program is upgraded can continue to execute the task to be executed by accessing the first port before the application program is upgraded is achieved.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments of the present disclosure with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an exemplary system architecture diagram to which the process creation method of the present disclosure may be applied;
FIG. 2 schematically shows a flow diagram of a process creation method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a logical block diagram of a 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;
fig. 4 schematically illustrates a storage format of port occupation state information in a target database according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates a process creation system block diagram in accordance with an embodiment of the disclosure; and
fig. 6 schematically shows a block diagram of an electronic device adapted to implement a process creation method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
In those instances where a convention analogous to "at least one of A, B, and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B, and C" would include but not be limited to systems that have A alone, B alone, C alone, A and B together, A and C together, B and C together, and/or A, B, and C together, etc.).
In an application scene of video stream data transmission, a data acquisition end establishes long connection with a server. When an application program of a server is upgraded, a traditional method is that after the application program of the server is upgraded, a new main process closes a port of an atomic process, and a new sub-process is created to execute tasks related to a service request.
The inventor finds that: in this conventional manner, since the atomic process has already processed the task related to the service request through the access port before the application program of the server is upgraded, and the access port of the sub-process is closed after the application program is upgraded, the task related to the service request processed by the atomic process may have an abnormal termination problem.
In view of this, embodiments of the present disclosure provide a process creation method. The method comprises the technical means that state information of a first sub-process created by a first main process before application program upgrading is inquired, then identification information of a first port and task information to be executed of the first sub-process are obtained from a target database through a second main process according to the state information of the first sub-process, and then the second main process creates a second sub-process according to the identification information of the first port and the task information to be executed of the first sub-process. After the application program is upgraded, the second main process is the second sub process established according to the port of the first sub process and the task information to be executed of the first sub process, so that the second sub process can continue to execute the task to be executed of the first sub process by accessing the first port, the technical problem that the service request before the application program is upgraded is abnormally terminated and abnormally terminated is at least partially solved, and the technical effect that the second sub process established after the application program is upgraded can continue to execute the task to be executed by accessing the first port before the application program is upgraded is achieved.
FIG. 1 schematically shows an exemplary system architecture 100 to which a process creation method may be applied, according to an embodiment of the disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired and/or wireless communication links, and so forth.
A user may use terminal devices 101, 102, 103 to interact with a server 105 over a network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, and/or social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the process creation method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the process creation system provided by the disclosed embodiments may be generally disposed in the server 105. The process creation method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the process creation system provided by the embodiment of the present disclosure may also be disposed 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.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for an implementation.
Fig. 2 schematically shows a flow chart of a process creation method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S240.
In operation S210, a second host process for processing a service request associated with an application program is created in response to an upgrade operation of the application program.
According to an embodiment of the present disclosure, the application program may include a streaming media application program, such as: various types of video and audio playback applications, video interaction applications, and the like. The service request associated with the application may include a service request related to a streaming media service, such as: video screenshots, and the like.
In operation S220, state information of a first sub-process is queried by a second host process, wherein the first sub-process is created by the first host process before the application upgrade, and the state information of the first sub-process characterizes a state of a task performed by the first sub-process by accessing the first port before the application upgrade.
According to the embodiment of the disclosure, taking a video screenshot service request as an example, before an application program is upgraded, a server keeps a long connection with an acquisition end, and a first main process creates a first sub-process and executes a task of video screenshot by accessing a first port. The second main process may acquire the state information of the first sub-process by querying the monitoring information of the first main process. The first sub-process's body information may also be stored in a shared memory or a target database.
In operation S230, when the state information of the first sub-process satisfies the preset condition, the second main process obtains, according to the state information of the first sub-process, the identification information of the first port and the to-be-executed task information of the first sub-process from the target database.
According to an embodiment of the present disclosure, the preset condition may be that the state information of the first sub-process is "unprocessed" or "in processing", which means that the state of the task executed by the first sub-process by accessing the first port before the application program is upgraded is "unprocessed" or "in processing". For example: port a is the port where the server establishes a long connection with the client. The task executed by the first sub-process through the access port a may be a video capture task, and when the application program is upgraded, the video stream data received by the first sub-process from the client through the access port a may be only a part of the video stream data, that is, the video stream data is not downloaded to the whole video stream data.
According to the embodiment of the disclosure, the port identification information, the to-be-executed task information of the first sub-process, and the identification information of the first sub-process may be stored in the target database. The information of the task to be executed of the first sub-process may be marked with a file identifier in the target database. For example: the second main process may obtain, from the target database, the identification information of the port a and the information of the video screenshot task to be executed by the first sub-process, according to the identification information of the first sub-process, when the state information of the first sub-process satisfies the preset condition.
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.
According to an embodiment of the present disclosure, for example: and creating a second subprocess through the second main process according to the identification information of the port A and the information of the video screenshot task to be executed of the first subprocess. Because the second sub-process multiplexes the port A, the information of the video screenshot task to be executed of the first sub-process can be continuously executed through the access port A, that is, another part of video stream data is continuously downloaded through the access port A, and the video screenshot task is completed.
According to the embodiment of the disclosure, a technical means is adopted for creating the state information of the first sub-process by querying the first main process before the application program is upgraded, then obtaining the identification information of the first port and the task information to be executed of the first sub-process from the target database through the second main process according to the state information of the first sub-process, and then creating the second sub-process through the second main process according to the identification information of the first port and the task information to be executed of the first sub-process. After the application program is upgraded, the second main process is the second sub process established according to the port of the first sub process and the information of the task to be executed of the first sub process, so that the second sub process can continue to execute the task to be executed of the first sub process by accessing the first port, the technical problem that the service request before the application program is upgraded is abnormally terminated is at least partially solved, and the technical effect that the second sub process established after the application program is upgraded can continue to execute the task to be executed by accessing the first port before the application program is upgraded is achieved.
According to an embodiment of the present disclosure, the process creating method further includes:
responding to a service request initiated by a client after the application program is upgraded, and determining a second port through a second main process according to port occupation state information of each port in a target database;
and creating a third sub-process according to the second port and the service request through the second main process, wherein the third sub-process is used for executing the task responding to the service request.
According to an embodiment of the present disclosure, the occupancy state information of each port may be stored in the target database. And determining the second port by the second main process according to the port occupation state information of each port in the target database. For example: the target database comprises a port A, a port B and a port C. The port occupation state of the port A is an occupation state, the port occupation state of the port B is an occupation state, and the port occupation state of the port C is an idle state. The second port determined by the port with the idle state can be directly determined, that is, the port C is determined as the second port.
According to an embodiment of the present disclosure, for example: the service request initiated by the client after the application upgrade may be a video stream download task. The second main process may use a port in the idle state occupied by the port 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 a task of downloading the video stream through the access port C.
According to the embodiment of the disclosure, for the service request initiated by the client after the application program is upgraded, the port in the idle state can be used as an access port for processing the task associated with the service request by inquiring the port occupation state in the target database, so that the problem of abnormal termination of the service request caused by port conflict caused by the application program upgrading can be effectively avoided.
According to an embodiment of the present disclosure, determining, by a second host process, a second port according to port occupation state information of each port in a target database in response to a service request initiated by a client after an application program is upgraded, includes:
in response to a service request initiated by a client after application program upgrading, inquiring port occupation state information of each port from a target database through a second main process;
and determining the port with the idle state information as the second port.
According to an embodiment of the present disclosure, for example: the service request initiated by the client after the application program is upgraded may be a video stream downloading task, and the port occupation state information queried from the target database by the second host process may be: the port occupation state information of the port A is an occupation state, the port occupation state information of the port B is an idle state, and the port occupation state information of the port C is an occupation state.
According to the embodiment of the present disclosure, the port B whose port occupation state information is the idle state may be taken as the second port.
According to the embodiment of the disclosure, for the service request initiated by the client after the application program is upgraded, the port in the idle state can be used as an access port for processing the task associated with the service request by inquiring the port occupation state in the target database, so that the problem that the task processed by the atomic process is forced to be interrupted because the ports of the subprocess before the application program is upgraded are all closed in the traditional mode is solved, and the problem of port conflict caused by the application program upgrading is also solved.
According to an embodiment of the present disclosure, the process creation method further includes:
determining the port with the port occupation state information as an occupation state as a third port;
and changing the port occupation state information of the third port according to the occupied duration of the third port.
According to the embodiment of the disclosure, when the port is abnormally closed, the second host process or the first host process cannot update the port occupation state information in the target database in time, which may cause the port occupation state information of the abnormally closed port to be in an occupation state for a long time, so that the port cannot be normally multiplexed. Therefore, the occupied time of the port can be inquired, and the occupied state information of the port can be changed in time.
According to the embodiment of the disclosure, the second master process may query the occupied duration of the port in the occupied state from the target database by executing the timing task. For example, the occupied duration of a port in an occupied state may be queried every 10 s. A maximum threshold for the occupied duration may be set as the port maximum lifetime duration, for example: the occupied time of the port A is 10min, the occupied time of the port B is 45min, and the maximum survival time of the port is 15min. The occupied duration of the port B is longer than the maximum survival duration of the port, the port B can be determined to be an abnormal closed port, and the port occupied state of the port B is changed into an idle state, so that the second main process can multiplex the port B to create a new sub-process.
According to the embodiment of the disclosure, the occupied duration of the port in the occupied state is inquired, the occupied state information of the port is changed in time, and the problem that the port is blocked from being reused due to the fact that the port is abnormally closed and the occupied state of the port cannot be updated in time can be solved.
According to the embodiment of the present disclosure, changing the port occupation state information of the third port according to the occupied duration of the third port includes:
acquiring the time information of two adjacent occupied times of the third port from a target database;
calculating the occupied time length of the third port according to the information of the time when the third port is occupied twice;
and under the condition that the occupied duration of the third port exceeds a preset threshold value, changing the port occupation state information of the third port into an idle state.
According to an embodiment of the present disclosure, the second main advanceThe program or first host process may record in the target database the start and end timestamps for which the port is occupied when the port is occupied. The time information of the third port which is occupied twice can be the start time timestamp information of the third port which is occupied for the nth time, the start time timestamp information of the third port which is occupied for the (n-1) th time, the end time timestamp information of the third port which is occupied for the nth time and the end time timestamp information of the third port which is occupied for the (n-1) th time. For example: the time stamp information of the start time of the nth occupied port A is t1The time stamp information of the n-1 th occupied starting time is t2The time information of two adjacent occupied times of the third port can be t1、t2. The time stamp information of the termination time of the n-th occupied port A is t3The time stamp information of the n-1 th occupied termination time is t4The time information of two adjacent occupied times of the third port can be t3、t4
According to the embodiment of the disclosure, according to the information of the time when the third port is occupied twice, calculating the occupied time length of the third port can be the difference t between the timestamps of the starting time when the third port is occupied twice1-t2The time stamp difference t may be the time stamp difference between the end times of two adjacent occupied third ports3-t4
According to an embodiment of the present disclosure, the preset threshold may be a preset port maximum survival time Δ tmaxWhen t is1-t2Or t3-t4Greater than Δ tmaxIn this case, it may be determined that the port is abnormally closed, and the port occupation state information of the port may be changed to an idle state, so as to be used by other subprocesses.
According to the embodiment of the disclosure, the occupied time length of the port is determined according to the time information of two adjacent occupied times of the port, the occupied state information of the port is changed into the idle state under the condition that the occupied time length of the port exceeds the preset threshold value, so that other subprocesses can use the occupied state information, and the idle port is released in time to be used by other subprocesses under the condition that the port resources are limited, so that the purpose of fully utilizing the limited port resources on the premise of avoiding port conflicts is achieved.
FIG. 3 schematically illustrates a logical block diagram of a 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.
As shown in fig. 3, this embodiment includes operations S301 to S310.
In operation S301, in response to a service request initiated by a client after an application program is upgraded, port occupation state information of each port is queried from a target database through a second host process;
in operation S302, determining whether a port occupation state of a port is an idle state, and if so, performing operation S303; if not, operation S305 is performed.
In operation S303, determining the port whose port occupation state information is an idle state as a second port;
in operation S304, creating, by the second main process, a third sub-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;
in operation S305, determining the port of which the port occupation state information is an occupation state as a third port;
in operation S306, time information of two adjacent times of the third port being occupied is obtained from the target database;
in operation S307, an occupied duration of the third port is calculated according to information of two adjacent occupied times of the third port;
in operation S308, it is determined whether the occupied duration of the third port is greater than a preset threshold, if so, operation S309 is performed, and if not, operation S310 is performed.
In operation S309, the port occupation state information of the third port is changed to an idle state for use by other child processes.
In operation S310, no processing is performed.
According to an embodiment of the present disclosure, the process creating method further includes:
under the condition that the state information of the first sub-process does not meet the preset condition, closing the first sub-process through the second main process;
according to the port identification information of the first port, inquiring the port occupation state information of the first port from the target database;
and changing the port occupation state information of the first port into an idle state.
According to an embodiment of the present disclosure, the preset condition may be that the state information of the first sub-process is "unprocessed" or "in-process", which means that the state of executing the task by accessing the first port by the first sub-process before the application program is upgraded is "unprocessed" or "in-process". The state information of the first sub-process does not meet the preset condition, and the state of the first sub-process executing the task by accessing the first port can be 'finished'. For example: port a is the port where the server establishes a long connection with the client. The task executed by the first sub-process through the access port a can be a video screenshot task, and when the application program is upgraded, the first sub-process receives all video stream data from the client through the port a and completes the video screenshot task.
According to the embodiment of the disclosure, the first sub-process can be closed through the second main process, the identification information of the first port can be inquired from the target database, and the port occupation state information of the first port is changed into the idle state for other sub-processes to use. For example: the state information of the first sub-process is "completed", and the processing task executed by the port a during the first sub-process is accessed, the identification information of the port a can be inquired from the target database, and the port occupation state information of the port a is changed from the occupation state to the idle state.
According to the embodiment of the disclosure, the access port of the subprocess which has completed the processing task is closed in time for use by other subprocesses by querying the state information of the first subprocess, and the idle port is released in time for use by other subprocesses under the condition of limited port resources, so that the limited port resources are fully utilized on the premise of avoiding port conflict.
Fig. 4 schematically illustrates a storage format of port occupation state information in a target database according to an embodiment of the present disclosure.
As shown in fig. 4, a plurality of storage formats may be set in the target database, and the first addresses for storing the plurality of storage formats are mapped to the elements of the storage format pointer array. Each storage format is provided with an index, which may be 0,1, 2, 3.. N, respectively, each index may represent a relative value of a port identification, for example: the starting port may be 9000, and if the subscript of the storage format is 3, it may indicate that the storage format stores the port occupation state information of the port identified as 9003.
Based on the process creation method, the disclosure also provides a process creation system. The apparatus will be described in detail below with reference to fig. 5.
Fig. 5 schematically shows a block diagram of a process creation system according to an embodiment of the present disclosure.
As shown in fig. 5, 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.
The first creation module 510 is for creating a second host process for processing a service request associated with an application in response to an upgrade operation of the application. In an embodiment, the first creating module 510 may be configured to perform the operation S210 described above, and is not described herein again.
The first query module 520 is configured to query, by the second host process, state information of a first sub-process, where the first sub-process is created by the first host process before the application upgrade, and the state information of the first sub-process represents a state of a task executed by the first sub-process by accessing the first port before the application upgrade. In an embodiment, the first query module 520 may be configured to perform the operation S220 described above, which is not described herein again.
The obtaining module 530 is configured to, when the state information of the first sub-process meets a preset condition, obtain, by the second main process, the identification information of the first port and the task information to be executed by the first sub-process from the target database according to the state information of the first sub-process. In an embodiment, the obtaining module 530 may be configured to perform the operation S230 described above, which is not described herein again.
The second creating module 540 is configured to create, 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. In an embodiment, the second creating module 540 may be configured to perform the operation S240 described above, and is not described herein again.
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 determining module is used for responding to a service request initiated by a client after an application program is upgraded and determining a second port through a second main process according to port occupation state information of each port in a target database. And the third creating module is used for creating a third sub-process through the second main process according to the second port and the service request, wherein the third sub-process is used for executing a task responding to the service request.
According to an embodiment of the present disclosure, the first determining module includes a querying unit and a first determining unit. The query unit is used for responding to a service request initiated by the client after the application program is upgraded, and querying the port occupation state information of each port from the target database through the second main process. And the first determining unit is used for determining the port with the port occupation state information in an idle state as a second port.
According to an embodiment of the present disclosure, the process creation system further includes a second determination unit and a change unit. The second determining unit is configured to determine the port whose port occupation state information is an occupation state as a third port. And the changing unit is used for changing the port occupation state information of the third port according to the occupied duration of the third port.
According to an embodiment of the present disclosure, the first alteration unit includes an acquisition subunit, a calculation subunit, and an alteration subunit. The acquiring subunit is configured to acquire, from the target database, time information that the third port is occupied twice next to the third port. And the calculating subunit is used for calculating the occupied duration of the third port according to the information of the two adjacent times of occupation of the third port. And the changing subunit is configured to change the port occupation state information of the third port to an idle state when the occupied duration of the third port exceeds a preset threshold.
According to the embodiment of the disclosure, the process creation method further includes a closing module, a second query module, and a changing module. And the closing module is used for closing the first subprocess through the second main process under the condition that the state information of the first subprocess does not meet the preset condition. And the second query module is used for querying the port occupation state information of the first port from the target database according to the port identification information of the first port. And the changing module is used for changing the port occupation state information of the first port into an idle state.
Any of the modules, units, sub-units, or at least part of the functionality of any of them according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, units, sub-units according to the embodiments of the present disclosure may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of three implementations of software, hardware, and firmware, or in any suitable combination of any of them. Alternatively, one or more of the modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as computer program modules, which, when executed, may perform the corresponding functions.
For example, any plurality of the first creating module 510, the first querying module 520, the obtaining module 530 and the second creating module 540 may be combined and implemented in one module/unit/sub-unit, or any one of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least part of the functionality of one or more of these modules/units/sub-units may be combined with at least part of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to an embodiment 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 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or may be implemented by any one of three implementations of software, hardware and firmware, or any suitable combination of any 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 may be at least partially implemented as a computer program module, which when executed, may perform a corresponding function.
Fig. 6 schematically shows a block diagram of an electronic device adapted to implement the above described process creation method according to an embodiment of the present disclosure. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, an electronic device 600 according to an embodiment of the present disclosure includes a processor 601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. The processor 601 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 603, various programs and data necessary for the operation of the electronic apparatus 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 flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 600 may also include input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604, according to an embodiment of the disclosure. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609 and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be embodied in the device/apparatus/system described in the above embodiments; or may exist alone without being assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to an embodiment of the present disclosure, the computer readable storage medium may be a non-volatile computer readable storage medium. Examples may include, but are 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 suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A process creation method, comprising:
in response to an upgrade operation of an application program, creating a second host process for processing a service request associated with the application program;
querying, by the second host process, state information of a first sub-process, wherein the first sub-process is created by the first host process before the application is upgraded, and the state information of the first sub-process characterizes a state of a task executed by the first sub-process by accessing the first port before the application is upgraded;
under the condition that the state information of the first subprocess meets the preset condition, acquiring the identification information of the first port and the task information to be executed of the first subprocess from a target database through the second main process according to the state information of the first subprocess; and
and creating a second sub-process by the second main process according to the identification information of the first port and the information of the task to be executed of the first sub-process, so that the second sub-process continues to execute the task to be executed of the first sub-process by accessing the first port.
2. The method of claim 1, further comprising:
responding to a service request initiated by a client after the application program is upgraded, and determining a second port through the second main process according to the port occupation state information of each port in the target database;
creating, by the second host 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.
3. The method of claim 2, wherein the determining, by the second host process, a second port according to the port occupancy status information of each port in the target database in response to a service request initiated by a client after the application upgrade comprises:
responding to a service request initiated by a client after the application program is upgraded, and inquiring port occupation state information of each port from the target database through the second main process;
and determining the port with the idle state information as the second port.
4. The method of claim 3, further comprising:
determining the port with the port occupation state information as an occupation state as a third port;
and changing the port occupation state information of the third port according to the occupied duration of the third port.
5. The method according to claim 4, wherein the changing the port occupation state information of the third port according to the occupied duration of the third port comprises:
acquiring the time information of two adjacent times of the third port from the target database;
calculating the occupied time length of the third port according to the information of the time when the third port is occupied twice;
and changing the port occupation state information of the third port into an idle state under the condition that the occupied duration of the third port exceeds a preset threshold value.
6. The method of claim 1, further comprising:
under the condition that the state information of the first sub-process does not meet the preset condition, closing the first sub-process through the second main process;
inquiring port occupation state information of the first port from the target database according to the port identification information of the first port;
and changing the port occupation state information of the first port into an idle state.
7. A process creation system, comprising:
a first creation module for creating a second host process for processing a service request associated with an application program in response to an upgrade operation of the application program;
a first query module, configured to query, by the second host process, state information of a first sub-process, where the first sub-process is created by the first host process before the application program is upgraded, and the state information of the first sub-process represents a state where a task is executed by the first sub-process by accessing the first port before the application program is upgraded;
an obtaining module, configured to, when the state information of the first sub-process meets a preset condition, obtain, by the second main process, identification information of the first port and task information to be executed of the first sub-process from a target database according to the state information of the first sub-process;
and the second creating module is used for creating a second sub-process through the second main process according to the identification information of the first port and the task information to be executed of the first sub-process, so that the second sub-process continues to execute the task to be executed of the first sub-process by accessing the first port.
8. An electronic device, comprising:
one or more processors;
a storage device to store one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-6.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, carries out the method according to any one of claims 1 to 6.
CN202210855878.8A 2022-07-19 2022-07-19 Process creation method, system, device and medium Pending CN115269063A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210855878.8A CN115269063A (en) 2022-07-19 2022-07-19 Process creation method, system, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210855878.8A CN115269063A (en) 2022-07-19 2022-07-19 Process creation method, system, device and medium

Publications (1)

Publication Number Publication Date
CN115269063A true CN115269063A (en) 2022-11-01

Family

ID=83766087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210855878.8A Pending CN115269063A (en) 2022-07-19 2022-07-19 Process creation method, system, device and medium

Country Status (1)

Country Link
CN (1) CN115269063A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775084A (en) * 2023-08-23 2023-09-19 荣耀终端有限公司 System upgrading method and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116775084A (en) * 2023-08-23 2023-09-19 荣耀终端有限公司 System upgrading method and electronic equipment
CN116775084B (en) * 2023-08-23 2023-11-24 荣耀终端有限公司 System upgrading method and electronic equipment

Similar Documents

Publication Publication Date Title
US9374407B2 (en) Mobile device application streaming
US9182975B2 (en) Automatic application updates
US10712915B2 (en) Information presentation using a client on a terminal
CN109862100B (en) Method and device for pushing information
CN111367687A (en) Inter-process data communication method and device
WO2022082892A1 (en) Big data analysis method and system, and computer device and storage medium thereof
CN107347093B (en) Configuration method and device for distributed server system
CN115269063A (en) Process creation method, system, device and medium
US8938522B2 (en) Tiered XML services in a content management system
CN109683992B (en) Method and apparatus for managing objects
CN116302271A (en) Page display method and device and electronic equipment
CN111625326A (en) Task pipeline execution method and device and electronic equipment
CN112163176A (en) Data storage method and device, electronic equipment and computer readable medium
CN115333871B (en) Firewall operation and maintenance method and device, electronic equipment and readable storage medium
CN113641966B (en) Application integration method, system, equipment and medium
CN112749073B (en) Service testing method and device, storage medium and electronic equipment
CN111460273B (en) Information pushing method and device
CN109871303B (en) Information processing method and system, computer system and readable storage medium
CN112596873A (en) Workflow dependency management method and device, computer equipment and storage medium
CN114338697A (en) Method and device for providing shared cloud service, electronic equipment and storage medium
CN114579277A (en) Task processing method and device, electronic equipment and medium
CN114218330A (en) ES cluster selection method, ES cluster selection device, ES cluster selection apparatus, ES cluster selection medium, and program product
CN117255028A (en) Model acquisition method and device, equipment and storage medium
CN113760885A (en) Incremental log processing method and device, electronic equipment and storage medium
CN116841976A (en) Log dynamic control method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination