CN115426361A - Distributed client packaging method and device, main server and storage medium - Google Patents

Distributed client packaging method and device, main server and storage medium Download PDF

Info

Publication number
CN115426361A
CN115426361A CN202211049809.4A CN202211049809A CN115426361A CN 115426361 A CN115426361 A CN 115426361A CN 202211049809 A CN202211049809 A CN 202211049809A CN 115426361 A CN115426361 A CN 115426361A
Authority
CN
China
Prior art keywords
server
slave
packaged
task
tasks
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
CN202211049809.4A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202211049809.4A priority Critical patent/CN115426361A/en
Publication of CN115426361A publication Critical patent/CN115426361A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a distributed client packaging method, a distributed client packaging device, a main server and a storage medium, which can be used in the field of financial technology or other fields, wherein the method comprises the following steps: after receiving the task to be packaged, the master server acquires load information of each slave server; the master server selects a slave server for executing the task to be packaged based on the load information of each server; and the master server distributes the tasks to be packaged to the slave servers so that the slave servers execute the tasks to be packaged and generate a client installation package. By the method, the utilization rate of computing resources can be effectively improved, the blockage is reduced, and meanwhile, the communication cost is reduced.

Description

Distributed client packaging method and device, main server and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a distributed client packaging method and apparatus, a master server, and a storage medium.
Background
With the diversification of program products, the packaging task of the client is increasing, and the packaging efficiency of the client becomes an object of attention of researchers.
In the related art, in order to improve the efficiency of client packing, a client batch packing mode is generally adopted, and in the batch packing process, a server processes a large number of packing tasks at the same time, so that the server is subjected to blocking pressure, or the sequential relation between the edition lifting time and the packing time of each packing task needs to be communicated, so that the communication cost is high, and the resource utilization rate of the server is low.
Therefore, it is desirable to provide a client packing scheme that can effectively reduce the server pressure, reduce the communication cost, and improve the resource utilization.
Disclosure of Invention
In order to solve the above problems, that is, to solve the problems of high server blocking pressure, high communication cost, low resource utilization rate, and the like in the client task packing process, the present application provides a distributed client packing method, apparatus, main server, and storage medium.
In order to achieve the above purpose, the present application provides the following technical solutions:
according to an aspect of the present application, a distributed client packaging method is provided, including:
after receiving the task to be packaged, the master server acquires load information of each slave server;
the master server selects a slave server for executing the task to be packaged based on the load information of each server;
and the master server distributes the tasks to be packaged to the slave servers so that the slave servers execute the tasks to be packaged and generate a client installation package.
In an embodiment, the load information includes the number of packing tasks currently executed by the corresponding server, and before the master server selects a slave server for executing the task to be packed based on the load information of each server, the method further includes:
the master server rejects slave servers, of which the number of the currently executed packing tasks reaches a preset threshold value, in each server;
the main server selects the slave server for executing the task to be packaged based on the load information of each server, and the method comprises the following steps:
and the master server selects the slave server with the least number of the packaging tasks currently executed in the removed slave servers as the slave server for executing the tasks to be packaged.
In one embodiment, the master server selects the slave server for executing the task to be packaged based on load information of each server, and further includes:
if the number of the packaging tasks currently executed by each server reaches a preset threshold value, adding the tasks to be packaged into a waiting execution queue;
and continuously monitoring the execution condition of each slave server, and if the number of the executed packing tasks is monitored to be lower than a preset threshold value, distributing the tasks to be packed to the corresponding slave servers according to the sequence of the waiting execution queue.
In one embodiment, the master server selects the slave server for executing the task to be packaged based on load information of each server, and further includes:
if the number of the packaging tasks currently executed by each server reaches a preset threshold value, the main server acquires cache queue information of each slave server, wherein the cache queue information carries the number of the packaging tasks waiting for each slave server;
the master server selects a slave server for executing the task to be packaged based on the cache queue information;
the master server distributes the tasks to be packaged to the slave servers, and the method comprises the following steps: the server distributes the tasks to be packaged to a buffer queue of the slave server, so that the slave server executes the tasks to be packaged based on the buffer queue.
In one embodiment, each slave server is in a sleep state without performing a packing task.
In one embodiment, before obtaining the load information of each slave server, the method further includes:
and if the slave servers in the current state in the dormant state do not exist in the slave servers, the master server executes the step of acquiring the load information of the slave servers.
In one embodiment, before obtaining the load information of each slave server, the method further includes:
if the slave servers in the current state in the dormant state exist in each slave server, screening out the slave servers in the current state in the dormant state by the main server;
and the master server randomly awakens the slave server with the current state being the dormant state and distributes the task to be packaged to the slave server.
In one embodiment, the method further comprises:
the main server configures a secure shell protocol (SSH) service;
the main server distributes the tasks to be packaged to the slave servers, and the method comprises the following steps:
the master server distributes the tasks to be packaged to the slave servers based on the SSH service.
In an embodiment, after receiving the task to be packaged and before acquiring the load information of each slave server, the master server further includes:
the main server checks whether the task to be packaged is executed or not or is executing;
and the main server responds to the executed or executing verification result of the task to be packaged, discards the task to be packaged and jumps out of the step of acquiring the load information of each slave server.
In one embodiment, the method further comprises:
the master server receives the packaged logs of the slave servers, wherein the packaged logs comprise packaged records of packaged tasks executed by the servers;
the main server checks whether the task to be packaged is executed or is being executed, and the checking comprises the following steps:
and if the packaging log has the packaging record of the task to be packaged, the main server checks whether the task to be packaged is executed or is being executed based on the packaging record.
According to another aspect of the present application, there is also provided a distributed client packaging apparatus, including:
the receiving module is arranged for acquiring the load information of each slave server after receiving the task to be packaged;
the selection module is used for selecting the slave servers for executing the tasks to be packaged based on the load information of each server;
and the task distribution module is used for distributing the tasks to be packaged to the slave servers so as to enable the slave servers to execute the tasks to be packaged and generate the client installation package.
According to still another aspect of the present application, there is also provided a main server including: a memory and a processor;
the memory stores computer execution instructions;
the processor executes the computer-executable instructions stored by the memory to cause the host server to perform the distributed client packaging method.
According to yet another aspect of the present application, there is also provided a computer-readable storage medium having stored therein computer-executable instructions, which when executed by a processor, are configured to implement the distributed client packaging method.
It can be understood that, according to the distributed client packing method, the distributed client packing device, the master server and the storage medium provided in the embodiments of the present application, after receiving the task to be packed, the master server obtains load information of each slave server, selects a slave server for executing the task to be packed based on the load information of each server, and allocates the task to be packed to the slave server, so that the slave server executes the task to be packed, generates the client installation package, and feeds back the client installation package to the master server. The method and the device can effectively improve the utilization rate of computing resources and reduce blocking, avoid the condition that one packing server runs a plurality of packing tasks concurrently and other packing servers are idle, reduce communication cost and avoid the communication between the edition lifting time and the packing time.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic diagram of one possible scenario provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a distributed client packing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another distributed client packaging method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another distributed client packaging method according to an embodiment of the present application;
FIG. 5 is a schematic flow chart diagram of an exemplary embodiment of the present application;
fig. 6 is a schematic structural diagram of a distributed client packaging apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a main server according to an embodiment of the present application.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Before introducing the embodiments of the present application, the technical background of the embodiments of the present application is explained first:
packaging the client: taking an android system as an example, the client packaging is a process of converting a source code into a DEX file, converting other contents into a compiled resource, and combining the DEX file and the compiled resource into a client installation package. The packaging process can also include the procedures of signature, obfuscation, reinforcement and the like. It will be appreciated that the DEX file is an executable file of the android system, containing all the operating instructions and runtime data of the application.
SSH (Secure Shell, secure Shell protocol): SSH is a security protocol built on an application layer basis. SSH is a protocol which is reliable and is specially used for providing security for remote login session and other network services, and the problem of information leakage in the remote management process can be effectively prevented by utilizing the SSH protocol.
Distributed: when programs and data for a computer are distributed over a network on more than one computer, the computations are distributed.
In order to make the objects, technical solutions and advantages of the present application clearer, the technical solutions in the embodiments of the present application will be described in more detail below with reference to the accompanying drawings in the embodiments of the present application. In the drawings, the same or similar reference numerals denote the same or similar components or components having the same or similar functions throughout. The embodiments described are some, but not all embodiments of the disclosure. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a schematic view of a possible scenario provided in the embodiment of the present application, and it should be noted that the distributed client packaging method and apparatus of the present disclosure may be used in the field of financial technology or other related fields. The method and the device for packaging the distributed client can also be used in any field except the field of financial science and technology, and the application field of the method and the device for packaging the distributed client is not limited.
As shown in fig. 1, the terminal device 110, the master server 120, and the slave servers 130 are included, where the terminal device 110 is electrically connected to the master server 120, the number of the slave servers may be one or more, the master server 120 is electrically connected to the terminal device 110 and each slave server 130, and the master server 120 is configured to receive a task packaging request initiated by the terminal device and control each slave server to execute a packaging task. Optionally, during the installation package packing task, the primary server 120 undertakes primary computation, and the secondary server 130 undertakes secondary computation; or each slave server 130 undertakes primary computational work and the master server 120 undertakes secondary computational work.
The client 110 may include, but is not limited to, a computer, a smart phone, a tablet computer, an e-book reader, a motion Picture experts group audio layer III (MP 3) player, a motion Picture experts group audio layer IV (MP 4) player, a portable computer, a vehicle-mounted computer, a wearable device, a desktop computer, a set-top box, a smart television, and the like.
The master server 120 or the slave server 130 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Optionally, the number of the terminals 110 or the master servers 120 and the slave servers 130 may be more or less, which is not limited in this embodiment of the application. In some embodiments, the terminal 110, the master server 120, and the slave server 130 may also serve as nodes in the blockchain system, and synchronize the packaging task or the client installation package to other nodes in the blockchain, so as to achieve wide application of the client installation package.
The above briefly describes a scene schematic diagram of the present application, and the following takes the master server 120 applied in fig. 1 as an example to describe in detail the distributed client packaging method provided in the embodiment of the present application.
Referring to fig. 2, fig. 2 is a schematic flowchart of a distributed client packaging method according to an embodiment of the present application, including steps S201 to S203.
Step S201, after receiving the task to be packaged, the master server obtains load information of each slave server.
In the embodiment, a client-side distributed packaging mode is adopted, the number of the tasks to be packaged is one or more than one, and when the number of the tasks to be packaged is large, a plurality of slave servers can be used for executing the packaging tasks at the same time, so that the packaging efficiency of the tasks of the installation package can be effectively improved.
In an embodiment, taking the current reception of a new task to be packaged as an example, the load information of the slave server may include the number of packaging tasks currently executed by the corresponding server, and in some embodiments, if the slave server executes other tasks in addition to the packaging tasks, the load information may also take into account factors such as computing resources required for executing other tasks from the server.
In an implementation mode, different terminals are supported to simultaneously access a main server to Input tasks to be packaged, and the main server can realize asynchronous processing of a plurality of tasks to be packaged through a lock file and an FIFO (First Input First Output) message queue, so that the execution sequence of the tasks is ensured, and the problems of dirty writing and dirty reading are effectively avoided. Furthermore, the main server also has a caching function, so that the tasks to be packaged can be cached under the condition that the packaging tasks cannot be executed in time, and the terminal does not need to perform task coordination and communication processing after submitting the task requests to be packaged.
And S202, the master server selects a slave server for executing the task to be packaged based on the load information of each server.
In one embodiment, in selecting the slave servers for executing the tasks to be packaged, in addition to the load information of each server, the historical packaging execution condition of each server can be considered, and the historical packaging execution condition can be obtained on the basis of (end-to-end) packaging log calculation of the slave servers without adopting a separate git code analysis module, a server performance module and a network module for calculation. It will be appreciated that the historical packing performance may be packing efficiency, e.g., the time required to perform a packing task,
for example, the slave server 1 and the slave server 2 have the same load information, the slave server 1 has higher packing efficiency than the slave server 2, and the slave server 1 may be preferentially selected for executing the task to be packed. Further, under the condition that the number of the tasks to be packaged is large and the load information between the slave servers is the same, the number of the slave servers capable of receiving and executing the tasks to be packaged within a certain time can be calculated according to the time for each slave server to execute one packaging task and the number of the tasks to be packaged, and then the corresponding slave servers are distributed for the tasks to be packaged.
Step S203, the master server allocates the task to be packaged to the slave server, so that the slave server executes the task to be packaged, and generates a client installation package.
In this embodiment, the slave server executes the corresponding packaging task according to the allocation condition of the master server, and may feed back the execution condition to the master server.
In one embodiment, each slave server generates a client installation package and then transmits the client installation package to the resource server, so that a user can download the corresponding client installation package from the resource server, wherein the resource server is a server which is independent of the master server and the slave servers and performs resource storage, and can acquire the client installation package from the slave servers through File Transfer Protocol (FTP), and then the user can download the installation package on a web page, so that the installation package can be taken by the user for product, development, test and the like.
In another embodiment, the client installation package is generated by the slave server and then fed back to the master server, and the master server transmits the package to the resource server, so that the user can download the package at the resource server. Further, each slave server may generate a respective packing log, record a task and a packing process of packing thereof based on the packing log, feed back the packing log simultaneously when feeding back a client installation package to the client, or feed back the packing log to the master server when the master server needs to check the packing log, and in some implementations, may also generate and obtain the packing log in other manners.
In one implementation, after receiving a task to be packaged, a slave server pulls the latest code of a task-specified engineering branch corresponding to the task to be packaged from a code management server, and executes the task to be packaged based on the latest code, wherein a code service manager is a server specially used for version management of a remote warehouse and can store engineering codes for executing the packaging task.
In one embodiment, the load information includes the number of packing tasks currently executed by the corresponding server, and before the master server selects a slave server for executing the task to be packed based on the load information of each server (step S202), the method further includes the following steps:
the master server rejects slave servers, of which the number of the currently executed packing tasks reaches a preset threshold value, from the servers;
the method comprises the following steps that the main server selects a slave server for executing the task to be packaged based on the load information of each server, and specifically comprises the following steps:
and the master server selects the slave server with the least number of the packaging tasks currently executed in the removed slave servers as the slave server for executing the tasks to be packaged.
It should be noted that, a person skilled in the art may adaptively set the preset threshold in combination with the actual application, for example, the preset threshold may be 1, that is, each slave server may currently execute at most 1 packing task, and when a new task to be packed is received, the selected slave server selects the slave servers whose number of packing tasks currently executed by the selected slave server is less than 1. It is understood that the number of packing tasks is a positive integer, and the specific numerical value is not limited, and the above is only one example of the present application.
When the preset threshold is 1, the number of the packing tasks is 0, and when the number of the packing tasks currently executed by only one slave server is 0, the slave server is selected as the slave server for executing the to-be-packed task, and when the number of the packing tasks of a plurality of slave servers is 0, the master server can randomly select one of the slave servers as the slave server for executing the to-be-packed task. In some embodiments, for the case that the number of the packing tasks of a plurality of slave servers is 0, the slave server with the highest packing efficiency may be selected to execute the task to be packed in combination with the historical packing efficiencies of the slave servers.
By the method, the task distribution and execution are realized in a global angle, the calculation pressure of the server is effectively reduced, and the resource utilization rate of the server is improved.
In one embodiment, the master server selects a slave server for executing the task to be packaged based on load information of each server (step S202), and further includes the following steps:
if the number of the packing tasks currently executed by each server reaches a preset threshold value, adding the tasks to be packed into a waiting execution queue;
and continuously monitoring the execution condition of each slave server, and if the number of the executed packing tasks is monitored to be lower than a preset threshold value, distributing the tasks to be packed to the corresponding slave servers according to the sequence of the waiting execution queue.
Specifically, the master server has the capacity of caching and packaging tasks, numerous users do not need to perform subsequent operations after inputting task requests with specific parameters, and even if the load information of the current slave server is not ideal, the master server can perform task distribution and execution in a global excellent angle.
In another embodiment, the master server selects a slave server for executing the task to be packaged based on load information of each server (step S202), and further includes the following steps:
if the number of the packaging tasks currently executed by each server reaches a preset threshold value, the main server acquires cache queue information of each slave server, wherein the cache queue information carries the number of the packaging tasks waiting for each slave server;
the master server selects a slave server for executing the task to be packaged based on the cache queue information;
the master server distributes the task to be packaged to the slave servers (step S203), including: the server distributes the tasks to be packaged to a buffer queue of the slave server, so that the slave server executes the tasks to be packaged based on the buffer queue.
Specifically, continuing to take the preset threshold as 1 as an example, when all the slave servers connected to the master server execute the packing task, if the task to be packed is directly allocated at this time, congestion of the slave servers may be caused, and this embodiment implements efficient and orderly execution of the packing task by adding the buffer queue of the slave server.
In some embodiments, in a case that all the slave servers are executing the packing task, and the current buffer queue of each slave server is in an idle state, that is, the buffer queue of each slave server does not have the packing task waiting to be executed, the packing efficiency of each slave server or the remaining time for each slave server to execute the current packing task may be calculated, and the task to be packed is allocated to the buffer queue of the slave server that completes the packing task first.
In some embodiments, in addition to the above manner, in the case that all the slave servers are executing the packed tasks, the slave servers may be added to the wait execution queue of the master server, the master server monitors the packing status of each slave server in real time, and in the presence of the idle status of the slave servers, the tasks are allocated to the slave servers based on the order of the wait execution queue.
By the method, the resource utilization rate of each slave server can be further optimized, and the probability of congestion of the slave servers is reduced.
In one embodiment, to reduce the power consumption of each slave server, each slave server is in a sleep state without performing a packing task.
Illustratively, in an initial state where the task to be packaged is not received, each slave server is in a dormant state.
In one embodiment, before obtaining the load information of each slave server (step S201), the method further includes the following steps:
if the slave servers in the current state in the dormant state do not exist in the slave servers, the master server executes the step of acquiring the load information of the slave servers;
if the slave servers in the current state in the dormant state exist in each slave server, screening out the slave servers in the current state in the dormant state by the main server;
and the master server randomly awakens the slave server with the current state being the dormant state and distributes the task to be packaged to the slave server.
In this embodiment, after receiving the task to be packaged and before acquiring the load information of each slave server, first, the state information of each slave server is acquired, and the task to be packaged is preferentially allocated to the slave server in the sleep mode.
In other embodiments, in the initial state, a plurality of slave servers are set to be in a sleep state, and a plurality of slave servers are set to be in an awake state, and the slave servers in the awake state can rapidly perform a working state after the master server receives the task to be packaged.
In other embodiments, the task to be packaged is executed in a resource pool setting mode, a thread pool similar to a computer is started, a plurality of slave servers are started and are in a dormant state, when a new task exists in a master server, one slave server in the resource pool is awakened to execute the task, after the task is processed, the slave server informs the master server, the master server determines whether to dispatch the task according to the task queue condition, and if the task is not dispatched, the slave server is in the dormant state. If the number of the tasks waiting in the task queue is more than 1/2 of the number of the servers which are executing the packed tasks, a new slave server can be started (the configuration is lower, the local cache codes are old due to infrequent use, and the efficiency is lower compared with the slave servers which are executing the tasks frequently). Since the starting and the sleep standby of the servers consume resources, and the communication between the master server and the slave server and the fetch of the remote code are time-consuming, all the slave servers are not made to stand by at first, but some resources need to be prepared in advance in order to start the packing task as soon as possible, and the slave servers can be reused when the packing task needs to be executed.
Referring to fig. 3, fig. 3 is a schematic flow diagram of another distributed client packaging method provided in an embodiment of the present application, and based on the above embodiment, in the embodiment, in consideration of the information security problem between the master server and the slave server, the SSH service is configured to implement data transmission security between the master server and the slave server, and specifically, the method further includes step S301.
Step S301, the main server configures SSH service.
SSH (Secure Shell) is a security protocol built on an application layer basis. SSH is a relatively reliable protocol that provides security specifically for telnet sessions and other web services. The SSH protocol can effectively prevent the problem of information leakage in the remote management process.
Illustratively, the master server and the slave server establish a communication connection, and the SSH service is configured in a transmission channel of the master server and the slave server.
In an embodiment, the allocating, by the master server, the task to be packaged to the slave server (step S203), specifically includes the following steps:
step S203a, the master server allocates the task to be packaged to the slave server based on the SSH service.
Further, the slave server feeds back the client installation package to the master server based on the SSH service.
In this embodiment, by configuring the SSH service, the situation that the client installation package and/or the task to be packaged is rewritten during transmission can be effectively reduced, and the security of data transmission between the master server and the slave server is improved, that is, the security of packaging the distributed client is effectively improved.
Referring to fig. 4, fig. 4 is a schematic flow diagram of another distributed client packaging method provided in this embodiment of the present application, on the basis of the foregoing embodiment, before executing a plurality of steps of task allocation to be packaged, in this embodiment, first, a task to be packaged is checked, and a packaged task that has been executed or is being executed is directly discarded, so as to avoid repeated execution of tasks and occupy system resources, specifically, after receiving a task to be packaged, before acquiring load information of each slave server (step S201), the master server further includes the following step S401 and step S402.
Step S401, the main server checks whether the task to be packaged is executed or not.
As can be appreciated, executing includes waiting to execute in a slave server or in a cache queue of a server.
In some embodiments, if there are executed packaging tasks that fail packaging or are not successfully executed, the task system to be packaged corresponding to such executed packaging tasks may be allocated and executed again. In practical application, for the packing task executed in the type, a notational description of the packing failure can be made in the log.
Step S402, the main server responds to the executed or executing verification result of the task to be packaged, discards the task to be packaged, and jumps out of the step of acquiring the load information of each slave server.
In one embodiment, the method further comprises the steps of:
the master server receives the packaged logs of the slave servers, wherein the packaged logs comprise packaged records of packaged tasks executed by the servers.
In this embodiment, the packaging record carries a whole process record of each server from the reception of the task to be packaged, where the reception of the task to be packaged includes adding the task to be packaged in the slave server cache queue. It can be understood that the packed log in this embodiment is real-time information.
The main server checks whether the task to be packaged is executed or not (step S401), and specifically includes the following steps:
and if the packaging log has the packaging record of the task to be packaged, the main server checks whether the task to be packaged is executed or is being executed based on the packaging record.
It can be understood that if the packing log of each slave server does not have the packing record of the task to be packed, it indicates that all the slave servers have not received the task to be packed, and the method proceeds to a plurality of steps of executing task distribution to be packed, and executes the task to be packed.
Referring to fig. 5, fig. 5 is a schematic flow chart of an exemplary embodiment of the present application, including the following flows:
a. initiating a task to be packaged (hereinafter referred to as a package), wherein the task to be packaged carries information such as a channel, a type, a category, a version and the like of a client, and an android test shouji 2204 \_B is taken as an example;
b. searching a packaging record of the package in a packaging log;
c. judging whether a packaging log has a packaging record of the package, if not, directly executing the step g, and if so, executing the step d;
d. continuously judging the concrete condition of the packaging record, namely successful packaging or executing, failed packaging or abnormal execution, executing the steps if the packaging is successful or executing, and executing the steps if the packaging is failed or abnormal execution
e. Continuously judging whether the latest edition lifting recording time is earlier than the latest packing time, if so, executing the step f, otherwise, executing the step g;
f. discarding the task to be packaged and quitting, and prompting a user that the task to be packaged is packaged or is in execution;
g. starting a distributed packaging task;
h. traversing all slave servers for packaging, and judging and outputting available machines and the load conditions of the available machines;
i. judging whether a slave server meeting the load requirement exists according to the available machine and the load condition of the available machine, if so, executing the step j, otherwise, executing the step h;
j. preferentially selecting a slave server, and distributing a packing task to the slave server with the lightest load;
k. the slave server receives the task to be packaged, automatically executes the whole flow of the task to be packaged, and transmits the task to the master server;
h. adding the packaging task into a waiting execution queue to wait for the server to be idle; or adding the data to a cache queue of the slave server with the lowest current load to wait for execution;
l, judging whether the queue waiting for execution is empty, if so, ending the process, and if not, executing the step m;
and m, the idle slave server takes the waiting task at the head of the queue in the waiting queue and executes the packing task.
Specifically, the above-mentioned steps a to j are the execution steps of the main server, where a specific process of checking whether the task to be packaged is a repeated packaging task may be, according to a latest packaging record (a packaging log) of a type of a client to be packaged that is newly received in the local file, where the record format is a slave server address used for packaging, a task start time, a type of a client system (Android, iOS), an issue type (test, product, beta), a type of a client (shouji, xingtong, pinghu, hushang, bishan), a git branch (2209\ b,2209 \ e,2210 \\ b), and a task state (building, success, fail)' which is compared with a latest mit record of a branch of a git remote warehouse of the type of the client to be packaged that is newly received. And if the source code of the latest version has completed apk or is performing the packaging task, judging the packaging task to be an invalid task.
Specifically, all machine-running packaging tasks are fed back on the primary server each time a new package is started. Can include, the task is executing the packer, the start time of the task, the client system type, the issue type, the client type, git branch
Specifically, in the embodiment, one machine controls all the machines, and the packaging task is reasonably distributed according to the load condition. At present, the single packing task mode is set to be that the upper limit of the packing task of each packing machine in operation is 1, and if no idle machine exists, the task is written into a waiting execution queue. When one machine releases computing resources, the tasks can be directly executed from the waiting execution queue of the main server to the dequeuing position.
As can be appreciated, the embodiment can effectively improve the utilization rate of computing resources and reduce congestion, and avoid the situation that one packing server runs a plurality of packing tasks concurrently while other packing servers are idle; meanwhile, the communication cost is reduced, the packing personnel and the demand packing personnel do not need to communicate the precedence relationship between the edition lifting time and the packing time, and the situation that the same task is repeatedly executed can be avoided.
According to another aspect of the embodiments of the present application, there is also provided a distributed client packaging apparatus, as shown in fig. 6, including:
the receiving module 61 is configured to obtain load information of each slave server after receiving the task to be packaged;
a selection module 62 configured to select a slave server for executing the task to be packaged based on load information of each server;
and the task distribution module 63 is configured to distribute the tasks to be packaged to the slave servers, so that the slave servers execute the tasks to be packaged to generate a client installation package.
In one embodiment, the load information includes a number of packing tasks currently performed by the corresponding server,
the selection module 62 includes:
the removing unit is used for removing the slave servers, the number of the packing tasks currently executed in each server reaches a preset threshold value;
and the first selection unit is used for selecting the slave server with the least number of packaging tasks currently executed in each removed slave server as the slave server for executing the tasks to be packaged.
In one embodiment, the selecting module 62 further includes the following steps:
the adding unit is set to add the tasks to be packaged into the waiting execution queue if the number of the packaging tasks currently executed by each server reaches a preset threshold value;
and the monitoring and distributing unit is configured to continuously monitor the execution condition of each slave server, and if the number of the executed packing tasks is monitored to be lower than a preset threshold value, distribute the tasks to be packed to the corresponding slave servers according to the sequence of the waiting execution queue.
In one embodiment, the selecting module 62 further includes:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is set to acquire cache queue information of each slave server when the number of the packaging tasks currently executed by each server reaches a preset threshold value, and the cache queue information carries the number of the packaging tasks waiting for each slave server;
a second selecting unit configured to select a slave server for executing the task to be packed based on the cache queue information;
the task allocating module 63 is specifically configured to allocate the task to be packaged to a cache queue of the slave server, so that the slave server executes the task to be packaged based on the cache queue.
In one embodiment, each slave server is in a sleep state without performing a packing task.
In an embodiment, the receiving module 61 is specifically configured to, when there is no slave server in the dormant state in the slave servers, the master server performs the step of acquiring the load information of each slave server.
In one embodiment, the apparatus further comprises:
the screening module is arranged for screening the slave servers with the current states being the dormant states when the slave servers with the current states being the dormant states exist in the slave servers;
and the random awakening module is set to awaken the slave server in the dormant state at random, and distributes the task to be packaged to the slave server.
In one embodiment, the apparatus further comprises: a configuration module configured to configure a secure Shell protocol, SSH, service to cause the slave server to feed back the client installation package to the master server based on the SSH service.
In an embodiment, the task allocating module 63 is specifically configured to allocate the task to be packaged to the slave server based on the SSH service.
In one embodiment, the apparatus further comprises:
a checking module configured to check whether the task to be packed is executed or is being executed;
a discarding module configured to discard the task to be packed in response to a check result that the task to be packed has been executed or is being executed;
and a stop execution module which is arranged as a jump-out receiving module and stops executing the step of acquiring the load information of each slave server.
In one embodiment, the receiving module 61 is further configured to receive a packed log of each slave server, where the packed log includes packed records of packed tasks performed by each server;
the checking module is specifically configured to, when a packing record of the task to be packed exists in the packing log of the slave server, check whether the task to be packed is executed or is being executed based on the packing record.
It should be noted that, the apparatus provided in the present application can correspondingly implement all the method steps implemented by the main server in the foregoing method embodiments, and can achieve the same technical effect, and detailed descriptions of the same parts and beneficial effects as those of the method embodiments are not repeated herein.
According to another aspect of the embodiments of the present application, there is also provided a main server, as shown in fig. 7, including: a memory 71 and a processor 72;
the memory 71 stores computer-executable instructions;
the processor 72 executes the computer-executable instructions stored by the memory 71 to cause the host server to perform the distributed client packaging method.
It should be noted that, the main server provided in the present application can correspondingly implement all the method steps implemented by the main server in the method embodiments, and can achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those in the method embodiments are omitted here.
According to another aspect of the embodiments of the present application, there is provided a computer-readable storage medium having stored therein computer-executable instructions, which when executed by a processor, are used to implement the distributed client packaging method.
It should be noted that, the computer-readable storage medium provided in the present application can correspondingly implement all the method steps implemented by the main server in the method embodiments, and can achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those of the method embodiments in this embodiment are not repeated herein.
The present invention also provides a computer program product, which includes a computer program code, and when the computer program code runs on a computer, the computer executes the database updating method.
The embodiment of the present application correspondingly provides a chip, which includes a memory and a processor, where the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, and execute the database updating method.
It will be understood by those of ordinary skill in the art that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
The term computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as is well known to those of ordinary skill in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by a computer.
In addition, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media as known to those skilled in the art.
In the description of the embodiments of the present application, the term "and/or" merely represents an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may represent: a exists alone, A and B exist simultaneously, and B exists alone. Additionally, the term "at least one" means any one of a variety or any combination of at least two of a variety, for example, including at least one of A, B, and may represent any one or more elements selected from the group consisting of A, B and C communication. Further, the term "plurality" means two or more unless specifically stated otherwise.
In the description of the embodiments of the present application, the terms "first," "second," "third," "fourth," and the like (if any) are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (13)

1. A distributed client packing method is characterized by comprising the following steps:
after receiving the task to be packaged, the master server acquires load information of each slave server;
the master server selects a slave server for executing the task to be packaged based on the load information of each server;
and the master server distributes the tasks to be packaged to the slave servers so that the slave servers execute the tasks to be packaged and generate a client installation package.
2. The method of claim 1, wherein the load information includes the number of packing tasks currently executed by the corresponding server, and before the master server selects the slave server for executing the task to be packed based on the load information of each server, the method further includes:
the master server rejects slave servers, of which the number of the currently executed packing tasks reaches a preset threshold value, from the servers;
the main server selects the slave server for executing the task to be packaged based on the load information of each server, and the method comprises the following steps:
and the master server selects the slave server with the least number of the packaging tasks currently executed in the removed slave servers as the slave server for executing the tasks to be packaged.
3. The method according to claim 1 or 2, wherein the master server selects the slave server for executing the task to be packaged based on load information of each server, further comprising:
if the number of the packing tasks currently executed by each server reaches a preset threshold value, adding the tasks to be packed into a waiting execution queue;
and continuously monitoring the execution condition of each slave server, and if the number of the executed packing tasks is monitored to be lower than a preset threshold value, distributing the tasks to be packed to the corresponding slave servers according to the sequence of the waiting execution queue.
4. The method according to claim 1 or 2, wherein the master server selects the slave server for executing the task to be packaged based on load information of each server, further comprising:
if the number of the packaging tasks currently executed by each server reaches a preset threshold value, the main server acquires cache queue information of each slave server, wherein the cache queue information carries the number of the packaging tasks waiting for each slave server;
the master server selects a slave server for executing the task to be packaged based on the cache queue information;
the main server distributes the tasks to be packaged to the slave servers, and the method comprises the following steps: the server distributes the tasks to be packaged to a buffer queue of the slave server, so that the slave server executes the tasks to be packaged based on the buffer queue.
5. The method of claim 1, wherein each slave server is dormant without performing a packing task.
6. The method according to claim 1 or 5, before obtaining the load information of each slave server, further comprising:
and if the slave servers in the current state in the dormant state do not exist in the slave servers, the master server executes the step of acquiring the load information of the slave servers.
7. The method according to claim 1 or 5, before obtaining the load information of each slave server, further comprising:
if the slave servers in the current state in the dormant state exist in each slave server, screening out the slave servers in the current state in the dormant state by the master server;
and the master server randomly awakens the slave server with the current state being the dormant state and distributes the task to be packaged to the slave server.
8. The method of claim 1, further comprising:
the main server configures a secure shell protocol (SSH) service;
the main server distributes the tasks to be packaged to the slave servers, and the method comprises the following steps:
the master server distributes the tasks to be packaged to the slave servers based on the SSH service.
9. The method according to claim 1, wherein after receiving the task to be packaged and before acquiring the load information of each slave server, the master server further comprises:
the main server checks whether the task to be packaged is executed or not or is executing;
and the main server responds to the executed or executing verification result of the task to be packaged, discards the task to be packaged and jumps out of the step of acquiring the load information of each slave server.
10. The method of claim 9, further comprising:
the master server receives the packaged logs of the slave servers, wherein the packaged logs comprise packaged records of packaged tasks executed by the servers;
the main server checks whether the task to be packaged is executed or is being executed, and the checking comprises the following steps:
and if the packaging log has the packaging record of the task to be packaged, the main server checks whether the task to be packaged is executed or is being executed based on the packaging record.
11. A distributed client packing apparatus, comprising:
the receiving module is arranged for acquiring the load information of each slave server after receiving the task to be packaged;
the selection module is arranged for selecting the slave servers for executing the tasks to be packaged based on the load information of each server;
and the task distribution module is used for distributing the tasks to be packaged to the slave servers so as to enable the slave servers to execute the tasks to be packaged and generate the client installation package.
12. A primary server, comprising: a memory and a processor;
the memory stores computer-executable instructions;
the processor executes the memory-stored computer-executable instructions to cause the host server to perform the distributed client packaging method of any of claims 1-10.
13. A computer-readable storage medium having computer-executable instructions stored thereon, which when executed by a processor, are configured to implement the distributed client packaging method of any of claims 1-10.
CN202211049809.4A 2022-08-30 2022-08-30 Distributed client packaging method and device, main server and storage medium Pending CN115426361A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211049809.4A CN115426361A (en) 2022-08-30 2022-08-30 Distributed client packaging method and device, main server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211049809.4A CN115426361A (en) 2022-08-30 2022-08-30 Distributed client packaging method and device, main server and storage medium

Publications (1)

Publication Number Publication Date
CN115426361A true CN115426361A (en) 2022-12-02

Family

ID=84199571

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211049809.4A Pending CN115426361A (en) 2022-08-30 2022-08-30 Distributed client packaging method and device, main server and storage medium

Country Status (1)

Country Link
CN (1) CN115426361A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981811A (en) * 2022-12-19 2023-04-18 杭州新迪数字工程系统有限公司 Task scheduling method, system, electronic equipment and storage medium
CN117938840A (en) * 2024-03-21 2024-04-26 北京火山引擎科技有限公司 Method, apparatus, device and medium for data transmission in content distribution network

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115981811A (en) * 2022-12-19 2023-04-18 杭州新迪数字工程系统有限公司 Task scheduling method, system, electronic equipment and storage medium
CN115981811B (en) * 2022-12-19 2024-03-15 上海新迪数字技术有限公司 Task scheduling method, system, electronic device and storage medium
CN117938840A (en) * 2024-03-21 2024-04-26 北京火山引擎科技有限公司 Method, apparatus, device and medium for data transmission in content distribution network

Similar Documents

Publication Publication Date Title
US10292044B2 (en) Apparatus for end-user transparent utilization of computational, storage, and network capacity of mobile devices, and associated methods
CN107241281B (en) Data processing method and device
US9577961B2 (en) Input/output management in a distributed strict queue
CN105049268A (en) Distributed computing resource allocation system and task processing method
CN104092719B (en) Document transmission method, device and distributed cluster file system
CN105357296A (en) Elastic caching system based on Docker cloud platform
US9843528B2 (en) Client selection in a distributed strict queue
US20180176070A1 (en) System and method to handle events using historical data in serverless systems
US8606908B2 (en) Wake-up server
CN114070822B (en) Kubernetes Overlay IP address management method
CN113361913A (en) Communication service arranging method, device, computer equipment and storage medium
CN112698838A (en) Multi-cloud container deployment system and container deployment method thereof
CN104052677A (en) Soft load balancing method and apparatus of single data source
CN112559461A (en) File transmission method and device, storage medium and electronic equipment
CN115426361A (en) Distributed client packaging method and device, main server and storage medium
US9577878B2 (en) Geographic awareness in a distributed strict queue
CN108111630B (en) Zookeeper cluster system and connection method and system thereof
US10348814B1 (en) Efficient storage reclamation for system components managing storage
CN117407159A (en) Memory space management method and device, equipment and storage medium
CN109005071B (en) Decision deployment method and scheduling equipment
CN108737120A (en) A kind of idle method and set-top box of set-top box
CN115686813A (en) Resource scheduling method and device, electronic equipment and storage medium
CN108255820B (en) Method and device for data storage in distributed system and electronic equipment
CN111431951A (en) Data processing method, node equipment, system and storage medium
CN107959719B (en) Cache-based multi-server calling method and system

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