Disclosure of Invention
In view of this, embodiments of the present invention provide a code updating method and apparatus, where a code updating file including a user identifier and a code updating command is obtained, a code updating command that can be invoked is determined, and then the code updating command is invoked to perform code updating. The invention can directly update the code of the server without manual operation, thereby saving time and labor.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a code updating method.
The code updating method of the embodiment of the invention comprises the following steps: acquiring a code updating file, wherein the code updating file indicates a user identifier and a code updating command; determining that the code updating command indicated by the code updating file can be called according to a preset user authority list, the user identification indicated by the code updating file and the code updating command; and calling the code updating command to update the code by executing the code updating command.
Optionally, the obtaining a code update file includes: polling to access a mailbox server according to a preset time interval; when a new mail is detected, judging whether the new mail indicates the code updating command or not; and when the code updating command is indicated in the new mail, taking the new mail as the code updating mail, wherein the sender of the new mail is the user identification.
Optionally, the determining, according to the preset user permission list, the user identifier indicated by the code update file, and the code update command, that the code update command indicated by the code update file may be called includes: comparing the user identification indicated by the code updating file with the user identification included in the preset user authority list; under the condition that the preset user authority list comprises the user identification indicated by the code updating file, comparing the code updating command indicated by the code updating file with an executable code updating command corresponding to the user identification in the preset user authority list; in the event that the code update command indicated by the update file matches the executable code update command, the code update command indicated by the code update file may be invoked.
Optionally, the method further comprises: and receiving a return result after the code updating command is executed, and pushing the return result to the user in a mail sending mode.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a code updating apparatus.
The code updating device of the embodiment of the invention comprises: the code updating module is used for acquiring a code updating file, wherein the code updating file indicates a user identifier and a code updating command; the determining module is used for determining that the code updating command indicated by the code updating file can be called according to a preset user authority list, the user identifier indicated by the code updating file and the code updating command; and the updating module is used for calling the code updating command so as to update the code by executing the code updating command.
Optionally, the obtaining module is further configured to: polling to access a mailbox server according to a preset time interval; when a new mail is detected, judging whether the new mail indicates the code updating command; and when the code updating command is indicated in the new mail, taking the new mail as the code updating mail, wherein the sender of the new mail is the user identification.
Optionally, the determining module is further configured to: comparing the user identification indicated by the code updating file with the user identification included in the preset user authority list; under the condition that the preset user authority list comprises the user identification indicated by the code updating file, comparing the code updating command indicated by the code updating file with an executable code updating command corresponding to the user identification in the preset user authority list; and in the case that the code update command indicated by the update file matches the executable code update command, the code update command indicated by the code update file may be invoked.
Optionally, the apparatus further comprises: and the pushing module is used for receiving a return result after the code updating command is executed and pushing the return result to the user in a mail sending mode.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided an electronic apparatus.
An electronic device of an embodiment of the present invention includes: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement a code updating method of an embodiment of the present invention.
To achieve the above object, according to still another aspect of embodiments of the present invention, there is provided a computer-readable medium.
A computer-readable medium of an embodiment of the present invention has stored thereon a computer program that, when executed by a processor, implements a code updating method of an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: the code updating file comprising the user identification and the code updating command is obtained, the code updating command which can be called is determined, then the code updating command is called to update the code, the code of the server can be directly updated, manual operation is not needed, and time and labor are saved; the user sends the mail for updating the code to the mailbox server, so that the server can obtain a new mail through a mechanism of polling to access the mailbox server, the user and the server are bridged, the code of the server is directly updated, and the code updating efficiency is improved; presetting a user authority list to find out a code updating file meeting the user authority list, avoiding a user without authority from updating a code of a server, and ensuring the safety of code updating; and pushing a return result after the execution of the code updating command is finished to the user, so that the user can conveniently know the success or failure condition of the code updating.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of main steps of a code updating method according to an embodiment of the present invention. As shown in fig. 1, the code updating method according to the embodiment of the present invention mainly includes the following steps:
step S101: a code update file is obtained, wherein the code update file indicates a user identification and a code update command. The code update command, such as git (distributed version control system with open source) command, svn (subversion, version control system with open source) command. The code update file can be a code update mail or a code update configuration file, and if the code update file is the code update mail, a mailbox server needs to be accessed through a polling mechanism to acquire the code update mail; if the code update file is a code update configuration file, the code update configuration file can be transmitted through an HTTP (hyper text transport protocol) protocol to be directly acquired.
Step S102: and determining that the code updating command indicated by the code updating file can be called according to a preset user authority list, the user identification indicated by the code updating file and the code updating command. The user authority list comprises user identifications of users with code updating authority and corresponding executable code updating commands. Comparing the user identification of the code updating file with the user identification of a user authority list; comparing a code updating command of the code updating file with an executable code updating command corresponding to the user identifier in the user authority list under the condition that the user identifier of the code updating file exists in the user authority list; when the code update command matches the executable code update command, the code update command of the code update file may be invoked; when the code update command does not match the executable code update command, the code update command of the code update file may not be invoked.
Step S103: and calling the code updating command to update the code by executing the code updating command. And under the condition that the code updating command of the code updating file can be called, calling the code updating command to execute the code updating command under the path of updating the code, and finishing the code updating. The path of the update code is the storage address of the update code in a code server, and the code server is a server for storing the code inside a company.
Fig. 2 is a schematic main flow chart of a code updating method according to an embodiment of the invention. As shown in fig. 2, the code updating method according to an embodiment of the present invention mainly includes the following steps:
step S201: the server accesses the mailbox server through a polling mechanism to acquire the code updating mail. Wherein, the code updating mail is sent to the mailbox server by the user through the mailbox client, and comprises a user (namely a sender) name, a mailbox address and a code updating command. The mailbox server, such as the mailbox servers of Singal, 163 and the like, needs to start third party authorization, and is connected with the open address of the mailbox server through the mailbox client so as to realize the communication between the mailbox client and the mailbox server. In an embodiment, the server is a Windows server, and accesses the mailbox server at preset time intervals, such as 10 seconds, 5 seconds, and the like, determines whether the mailbox server receives the code update mail, and stores the mailbox address of the sender in a variable form if the mailbox server receives the code update mail. The polling may be implemented as: obtaining an unread mail from a mailbox server every 5 seconds, aiming at detecting whether a new mail exists or not and judging whether the new mail comprises a code updating command or not, and if the new mail exists and the new mail comprises the code updating command, taking the new mail as the code updating mail; if no new mail exists or no code updating command is included in the new mail, the Windows server sleeps for 5 seconds, and after 5 seconds, the unread mail is continuously acquired from the mailbox server to judge whether the mail is a code updating mail.
Step S202: the server judges whether the code updating command indicated by the code updating mail can be called or not according to a preset user authority list, the user identification of the code updating mail and the code updating command, and if the code updating command can be called, the step S203 is executed; if it cannot be called, the flow ends. In the embodiment, if the user can not be called, prompt information without the updating authority can be fed back to the corresponding user. In order to ensure the security of code update, the Windows server stores a user permission list, where the user permission list includes a user name, a corresponding mailbox address, and a corresponding executable code update command, which is specifically shown in table 1.
TABLE 1 user Authority List
User name
|
Mailbox address
|
Executable code update command
|
Zhang San
|
zhangsan@sina.com
|
git pull
|
Li Si
|
lisi@sina.com
|
git commit
|
Wang Wu
|
wangwu@163.com
|
git add |
Wherein, the git pull command in table 1 retrieves the update of a branch of the remote host, and then merges with the local designated branch. Common usage formats are:
git pull < remote host name > < remote branch name > < local branch name >
git commit command, submitting the locally modified content into the cache. A common usage format may be:
git commit-m 'XXX', XXX represents the modified content.
gitadd command, add file content to index (add modifications to scratch). The basic usage format is:
gitadd < path >, which may be a file or a directory, indicates that information for modifying (excluding deleted files) or newly adding files is added to the index repository.
List 1 is merely an example, and the executable code update command may be a git command and/or a svn command. In a preferred embodiment, since the mailbox address can be used as a unique user identifier, the user name in the user authority list can be omitted, and only the mailbox address and the corresponding executable code update command are stored. Correspondingly, the user name in the user authority list can also be used as a unique user identifier, so that the mailbox address in the user authority list can be omitted, and only the user name and the corresponding executable code updating command are stored.
The Windows server acquires a mailbox address and a code updating command of a code updating mail, compares the acquired mailbox address with a mailbox address of the user permission list, compares the code updating command with an executable code updating command corresponding to the mailbox address if the mailbox address exists in the user permission list, and indicates that the code updating command of the code updating mail can be called if the code updating command is matched with the executable code updating command; and if the mailbox address does not exist in the user permission list or the mailbox address exists in the user permission list but the code updating command does not match with the executable code updating command corresponding to the mailbox address, indicating that the code updating command of the code updating mail cannot be called. For example, the Windows server acquires a code update mail sent by zhang san, and if a code update command in the code update mail has a git pull word, the code update command of the code update mail can be called; if the code update command in the code update mail carries a git commit word, the code update command stating that the code update mail cannot be called.
In a preferred embodiment, the code update command may be written in the mail subject and/or the mail body, the mail subject area and/or the mail body area are retrieved, and if the area contains the code update command, the code update command is obtained and compared with the executable code update command corresponding to the mailbox address.
Step S203: the server-opening sub-process calls the code update command to execute the code update command under a path of the update code. And the updating code is a code which is pushed to the code server after the original code is updated by the developer. The Windows server opens a subprocess by using Python language, calls a code updating command by using the subprocess, executes the code updating command under a path of updating codes, and monitors a return result of the subprocess. For example, a git pull command is executed that compares whether the local branch code differs from the most recent code of the corresponding remote branch, and if so, updates the delta code. After the git pull command is executed, returning results possibly comprise updated (availability up-to-date), update error (error), update failure (fail) and other keywords, judging whether the updated (availability up-to-date) exists in the returning results, if so, indicating that the code updating is completed, and the remote branch and the code of the local corresponding branch are consistent without incremental codes; if keywords such as error and fail exist, the code update exception is explained. The incremental code is a part of a remote branch code which is different from a local corresponding branch code.
Step S204: and the server receives a return result after the code updating command is executed, and calls an email sending program to push the return result to the user. For example, taking the execution of the git pull command as an example, if the return result contains an available up-to-date keyword, the instruction code is updated, the return result is saved in a variable form, an e-mail sending program is called, and the return result is fed back to the user (sender). If the keyword does not have any update up-to-date, the code update is abnormal, the return result is stored in a variable form, and the return result is fed back to a user (sender) to inform the user of the abnormal update. The mail subject may be "update completion notification of the Windows server", the receiver is the sender saved in step S201, and the mail content is the return result.
The following takes the mailbox server as the newwave mailbox server as an example, and further explains the code updating method of the embodiment of the present invention.
Firstly, updating the code of the code server, specifically: web service is deployed in the Windows server cluster, and after developers develop new functions of the Web service, newly added codes are pushed to a remote code server through a git push command. In this step, the client used by the developer development program needs to install the git client. The git address of the code server to which the new code is pushed by git push command is a URL (Uniform Resource Locator) address, such as https:// github.
And then updating codes of the Windows server cluster, specifically: a developer sends a mail to a Xinlang mailbox, and the subject of the mail is git pull; after the transmission is successful, the Windows server detects an unread mail, acquires a sender, a mailbox address and a code updating command of the unread mail, and stores the mailbox address of the sender through a first variable; judging whether the sender and the code updating command meet the requirement of a user permission list, when the sender and the code updating command meet the requirement of the user permission list, starting a Python subprocess by the Windows server to call a git pull command so as to execute the git pull command under a path (namely a git address) of a newly added code, monitoring a return value of the subprocess, and storing the return value through a second variable; and after the git pull command is executed, sending the return value serving as the text of the feedback mail to the stored mailbox address of the sender.
FIG. 3 is a main flowchart of a code updating method according to another embodiment of the present invention. As shown in FIG. 3, the code updating method of another embodiment of the present invention mainly includes the following steps
Step S301: the server acquires a code updating configuration file, and analyzes the updating configuration file to obtain a user identifier and a code updating command. Wherein the code update configuration file is defined by a developer and comprises a user identification and a code update command. In the embodiment, the user identifier is a user name, and the code update configuration file can be sent to the Windows server in the form of an email or directly sent to the Windows server through an HTTP protocol.
Step S302: the server judges whether the code updating command of the code updating configuration file can be called or not according to a preset user authority list, the user identification of the code updating configuration file and the code updating command, and if the code updating command can be called, the step S303 is executed; if it cannot be called, the flow ends. In this embodiment, the user permission list includes column 1 labeled user name and column 3 labeled executable code update command in table 1. Comparing a user identifier with a user name of the user authority list, if the user identifier exists in the user authority list, comparing the code updating command with an executable code updating command corresponding to the user identifier, and if the code updating command is matched with the executable code updating command, indicating that the code updating command of the code updating configuration file can be called; and if the user identification does not exist in the user authority list or the user identification exists in the user authority list but the code updating command does not match with the executable code updating command corresponding to the user identification, indicating that the code updating command of the code updating configuration file cannot be called. For example, the Windows server acquires an update configuration file, the user identifier is zhang san, and the code update command has a git pull word, which indicates that the code update command of the code update configuration file can be called; if the code update command carries a git commit word, then the code update command that states the code update configuration file may not be invoked.
Step S303: the server-opening sub-process calls the code update command to execute the code update command under a path of the update code. The specific implementation process of this step is the same as step S203.
Step S304: and the server receives a return result after the code updating command is executed, and pushes the return result to the user through the updating result configuration file. And storing the return result in the update result configuration file. For example, taking the execution of a git pull command as an example, if an available up-to-date keyword exists in the returned result, it indicates that the code is updated, and the returned result is saved in an update result configuration file in a variable form; and if the keyword does not have the overload up-to-date, indicating that the code is abnormal, and storing the return result in an update result configuration file in a variable form. In an embodiment, the update result configuration file may be sent to the Windows server in the form of an email, or may be directly sent to the Windows server through an HTTP protocol.
According to the code updating method provided by the embodiment of the invention, the code updating file comprising the user identification and the code updating command is obtained to determine the code updating command which can be called, and then the code updating command is called to update the code, so that the code of the server can be directly updated, manual operation is not needed, and time and labor are saved; the user sends the mail for updating the code to the mailbox server, so that the server can obtain a new mail through a mechanism of polling access to the mailbox server, the user and the server are bridged, the code of the server is directly updated, and the code updating efficiency is improved; presetting a user authority list to find out a code updating file meeting the user authority list, avoiding a user without authority from updating a code of a server, and ensuring the safety of code updating; and pushing a return result after the execution of the code updating command is finished to the user, so that the user can conveniently know the success or failure condition of the code updating.
Fig. 4 is a schematic diagram of main modules of a code updating apparatus according to an embodiment of the present invention. As shown in fig. 4, the code updating apparatus 400 according to the embodiment of the present invention mainly includes:
an obtaining module 401, configured to obtain a code update file, where the code update file indicates a user identifier and a code update command. The code update commands, such as git commands, svn commands. The code update file can be a code update mail or a code update configuration file, and if the code update file is the code update mail, a mailbox server needs to be accessed through a polling mechanism to acquire the code update mail; if the code update file is a code update configuration file, the code update configuration file can be transmitted through an HTTP (hyper text transport protocol) so as to be directly acquired.
A determining module 402, configured to determine, according to a preset user permission list, a user identifier indicated by the code update file, and a code update command, that the code update command indicated by the code update file may be invoked. The user authority list comprises user identifications of users with code updating authority and corresponding executable code updating commands. Comparing the user identification of the code updating file with the user identification of a user authority list; comparing a code updating command of the code updating file with an executable code updating command corresponding to the user identifier in the user authority list under the condition that the user identifier of the code updating file exists in the user authority list; when the code update command matches the executable code update command, the code update command of the code update file may be invoked; when the code update command does not match the executable code update command, the code update command of the code update file may not be invoked.
An updating module 403, configured to invoke the code updating command, so as to perform code updating by executing the code updating command. And under the condition that the code updating command of the code updating file can be called, calling the code updating command to execute the code updating command under the path of updating the code, and finishing the code updating. The path of the update code is the storage address of the update code in a code server, and the code server is a server for storing the code inside a company.
In addition, the code updating apparatus 400 according to the embodiment of the present invention may further include: and a pushing module (not shown in fig. 4) configured to receive a return result after the code update command is executed, and push the return result to the user in a manner of sending an email.
FIG. 5 is a schematic diagram of the main modules of a code update system according to an embodiment of the present invention. As shown in fig. 5, a code updating system 500 according to an embodiment of the present invention includes: a client 501, a mailbox server 502, a Windows server 503 (i.e., the code update apparatus 400), and a code server 504. The developer sends a new mail to the mailbox server 502 through a mailbox client installed in the client 501, and pushes (push) the updated code to the code server 504 through the client 501. Mailbox server 502 receives new mail from the developer. The Windows server 503 judges whether a new mail is received in the mailbox server 502 through a polling mechanism, and when the new mail is received in the mailbox server 502 and the new mail includes a code update command, the new mail is used as a code update mail; then judging whether the code updating command in the code updating mail can be called or not according to the user authority list, the user identification in the code updating mail and the code updating command; when the code updating mail code updating command can be called, calling the code updating command to execute the command under the path of the updating code and receiving a return result after the command is executed; the return result is sent to the client 501 of the developer as the body of the mail sending.
As can be seen from the above description, the code update file including the user identifier and the code update command is obtained, the code update command that can be called is determined, and then the code update command is called to update the code, so that the code of the server can be directly updated without manual operation, and time and labor are saved; the user sends the mail for updating the code to the mailbox server, so that the server can obtain a new mail through a mechanism of polling access to the mailbox server, the user and the server are bridged, the code of the server is directly updated, and the code updating efficiency is improved; presetting a user authority list to find out a code updating file meeting the user authority list, avoiding a user without authority from updating a code of a server, and ensuring the safety of code updating; and pushing a return result after the execution of the code updating command is finished to the user, so that the user can conveniently know the success or failure condition of the code updating.
Fig. 6 illustrates an exemplary system architecture 600 to which the code updating method or code updating apparatus of embodiments of the present invention may be applied.
As shown in fig. 6, the system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. The network 604 serves to provide a medium for communication links between the terminal devices 601, 602, 603 and the server 605. Network 604 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 601, 602, 603 to interact with a server 605, via a network 604, to receive or send messages or the like. Various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like, may be installed on the terminal devices 601, 602, and 603.
The terminal devices 601, 602, 603 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 605 may be a server that provides various services, such as a background management server that provides support for code update mails generated by users using the terminal apparatuses 601, 602, 603. The background management server can analyze and the like the received code updating mail and call a code updating command in the code updating mail according to an analysis result (for example, according with an updating authority rule).
It should be noted that the code updating method provided in the embodiment of the present application is generally executed by the server 605, and accordingly, the code updating apparatus is generally disposed in the server 605.
It should be understood that the number of terminal devices, networks, and servers in fig. 6 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides an electronic device and a computer readable medium according to the embodiment of the invention.
The electronic device of the present invention includes: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement a code updating method of an embodiment of the present invention.
The computer-readable medium of the present invention has stored thereon a computer program which, when executed by a processor, implements a code updating method of an embodiment of the present invention.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use with an electronic device implementing an embodiment of the present invention. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the computer system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, the processes described above with respect to the main step diagrams may be implemented as computer software programs, according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program containing program code for performing the method illustrated in the main step diagram. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 701.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, 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), an optical fiber, 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 invention, 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. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
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 invention. 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 which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an acquisition module, a determination module, and an update module. The names of these modules do not in some cases constitute a limitation on the module itself, and for example, the acquiring module may also be described as a "module that acquires a code update file".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a code update file, wherein the code update file indicates a user identifier and a code update command; determining that the code updating command indicated by the code updating file can be called according to a preset user authority list, the user identification indicated by the code updating file and the code updating command; and calling the code updating command to update the code by executing the code updating command.
As can be seen from the above description, the code update file including the user identifier and the code update command is obtained, the code update command that can be called is determined, and then the code update command is called to update the code, so that the code of the server can be directly updated without manual operation, and time and labor are saved; the user sends the mail for updating the code to the mailbox server, so that the server can obtain a new mail through a mechanism of polling to access the mailbox server, the user and the server are bridged, the code of the server is directly updated, and the code updating efficiency is improved; a user authority list is preset to find out a code updating file meeting the user authority list, so that the condition that a user without authority updates a code of a server is avoided, and the safety of code updating is ensured; and pushing a return result after the execution of the code updating command is finished to the user, so that the user can conveniently know the success or failure condition of the code updating.
The product can execute the method provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. For technical details that are not described in detail in this embodiment, reference may be made to the method provided by the embodiment of the present invention.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.