CN108984197A - A kind of code update method and device - Google Patents

A kind of code update method and device Download PDF

Info

Publication number
CN108984197A
CN108984197A CN201810762250.7A CN201810762250A CN108984197A CN 108984197 A CN108984197 A CN 108984197A CN 201810762250 A CN201810762250 A CN 201810762250A CN 108984197 A CN108984197 A CN 108984197A
Authority
CN
China
Prior art keywords
code update
code
order
file
user
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.)
Granted
Application number
CN201810762250.7A
Other languages
Chinese (zh)
Other versions
CN108984197B (en
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.)
Beijing Jingdong Financial Technology Holding Co Ltd
Original Assignee
Beijing Jingdong Financial Technology Holding Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Financial Technology Holding Co Ltd filed Critical Beijing Jingdong Financial Technology Holding Co Ltd
Priority to CN201810762250.7A priority Critical patent/CN108984197B/en
Publication of CN108984197A publication Critical patent/CN108984197A/en
Application granted granted Critical
Publication of CN108984197B publication Critical patent/CN108984197B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Library & Information Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of code update method and devices, are related to field of computer technology.One specific embodiment of this method includes: to obtain code update file, wherein the code update file indicates user identifier and code update order;According to user identifier and code update order indicated by preset user right list, the code update file, determine that code update order indicated by the code update file can be called;The code update order is called, to carry out code update by executing the code update order.This method determines the code update order that can be called, calls the code update order to carry out code update later by obtaining the code update file including user identifier and code update order.The present invention can directly update the code of server, without human intervention, time saving and energy saving.

Description

A kind of code update method and device
Technical field
The present invention relates to computer field more particularly to a kind of code update methods and device.
Background technique
In the development process of software product, issued code is frequently necessary to be updated.Based on Windows Account Dept When the Web service of administration carries out code update, developer need to be submitted to Windows server some newly-built branch code or Some or all of updated code is carried out to existing branch.
The method of code update in the prior art, usually there are two types of modes.Mode one: on Windows server manually User name, password are inputted, passes through order more fresh code later.Mode two: by Windows system carry remote tools or Third party's tool logs in Windows server, the more fresh code by way of remote operation.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery: needing in mode one Manual operation Windows server, pulls code and is updated, time-consuming and laborious;Two medium-long range of mode connection be easy to appear disconnection, Unknown unstable factor is more, and if corporate networks limit, the network between two-server is unable to intercommunication, then can not be real Now long-range more fresh code.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of code update method and device, it include user identifier by obtaining With the code update file of code update order, determines the code update order that can be called, call the code later more Newer command is to carry out code update.The present invention can directly update the code of server, without human intervention, time saving and energy saving.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of code update method is provided.
A kind of code update method of the embodiment of the present invention, comprising: obtain code update file, wherein the code is more New file indicates user identifier and code update order;According to preset user right list, the code update file institute The user identifier and code update order of instruction determine that code update order indicated by the code update file can be adjusted With;The code update order is called, to carry out code update by executing the code update order.
Optionally, the acquisition code update file, comprising: according to prefixed time interval, poll accesses mailbox server; When detecting new mail, judge whether the new mail indicates the code update order;It is indicated when in the new mail When the code update order, using the new mail as the code update mail, transmitting for the new mail is artificial described User identifier.
Optionally, the user identifier according to indicated by preset user right list, the code update file and Code update order determines that code update order indicated by the code update file can be called, comprising: by the code User identifier indicated by file is updated to be compared with user identifier included by the preset user right list;Institute It states in the case that preset user right list includes user identifier indicated by the code update file, more by the code Code update order indicated by new file is corresponding with user identifier described in the preset user right list executable Code update order is compared;The code update order indicated by the update file and the executable code, which update, orders In the case that order matches, code update order indicated by the code update file can be called.
Optionally, the method also includes: receive returning the result after executing the code update order, sent with mail Mode described return the result is pushed into user.
To achieve the above object, according to another aspect of an embodiment of the present invention, a kind of code update device is provided.
A kind of code update device of the embodiment of the present invention, comprising: module is obtained, for obtaining code update file, In, the code update file indicates user identifier and code update order;Determining module, for being weighed according to preset user User identifier and code update order indicated by list, the code update file are limited, determines the code update file institute The code update order of instruction can be called;Update module, for calling the code update order, by executing the generation Code more newer command carries out code update.
Optionally, the acquisition module, is also used to: according to prefixed time interval, poll accesses mailbox server;Work as detection When to new mail, judge whether the new mail indicates the code update order;And when indicating institute in the new mail When stating code update order, using the new mail as the code update mail, the new mail transmits the artificial use Family mark.
Optionally, the determining module, is also used to: by user identifier indicated by the code update file with it is described pre- If user right list included by user identifier be compared;It include the code in the preset user right list Update indicated by file in the case where user identifier, by code update order indicated by the code update file with it is described The corresponding executable code of user identifier more newer command described in preset user right list is compared;And it is described more Code update order indicated by new file and the executable code are in the case that more newer command matches, the code update Code update order indicated by file can be called.
Optionally, described device further include: pushing module, for receiving the return knot after executing the code update order Described return the result is pushed to user in such a way that mail is sent by fruit.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of electronic equipment.
The a kind of electronic equipment of the embodiment of the present invention, comprising: one or more processors;Storage device, for storing one A or multiple programs, when one or more of programs are executed by one or more of processors, so that one or more A processor realizes a kind of code update method of the embodiment of the present invention.
To achieve the above object, according to an embodiment of the present invention in another aspect, providing a kind of computer-readable medium.
A kind of computer-readable medium of the embodiment of the present invention, is stored thereon with computer program, and described program is processed A kind of code update method of the embodiment of the present invention is realized when device executes.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that includes user identifier and generation by obtaining The code update file of code more newer command, determines the code update order that can be called, and the code update is called to order later It enables to carry out code update, can directly update the code of server, it is without human intervention, time saving and energy saving;User will be used for generation The mail that code updates is sent to mailbox server, enables the server to obtain newly by the mechanism that poll accesses mailbox server Mail is bridged user and server, directly updates the code of server, promotes code update efficiency;Pre-set user power List is limited, to find out the code update file for meeting user right list, the user of not permission is avoided to update the generation of server Code, guarantees the safety of code update;Returning the result of being finished of code update order is pushed into user, user is facilitated to obtain Know the success or failure situation of code update.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of code update method according to an embodiment of the present invention;
Fig. 2 is the main flow schematic diagram of code update method according to an embodiment of the invention;
Fig. 3 is the main flow schematic diagram of code update method according to another embodiment of the present invention;
Fig. 4 is the schematic diagram of the main modular of code update device according to an embodiment of the present invention;
Fig. 5 is the schematic diagram of the main modular of code update system according to an embodiment of the present invention;
Fig. 6 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 7 is the structural schematic diagram for being suitable for the computer installation of the electronic equipment to realize the embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 1 is the schematic diagram of the key step of code update method according to an embodiment of the present invention.As shown in Figure 1, this hair The code update method of bright embodiment, mainly includes the following steps:
Step S101: code update file is obtained, wherein the code update file indicates user identifier and code more Newer command.The code update order, such as git (being the distributed version control system of an open source) order, svn (subversion, the version control system of an open source code) order.The code update file can be code update Mail or code update configuration file need if the code update file is code update mail through poll machine System access mailbox server, to obtain code update mail;If the code update file is code update configuration file, It can be transmitted by http protocol, to directly acquire.
Step S102: according to user identifier and generation indicated by preset user right list, the code update file Code more newer command, determines that code update order indicated by the code update file can be called.Wherein, the user right It include the user identifier and the more newer command of corresponding executable code for possessing the user of code update permission in list.By the generation The user identifier that code updates file is compared with the user identifier of user right list;Exist when in the user right list In the case where the user identifier of the code update file, by the code update order of the code update file and the user The more newer command of the corresponding executable code of user identifier described in permissions list is compared;When the code update order and institute When stating executable code more newer command matching, the code update order of the code update file can be called;When the generation Code more newer command and the executable code more newer command mismatch when, then the code update file code update order It can not be called.
Step S103: calling the code update order, to carry out code update by executing the code update order. In the case where the code update order of the code update file can be called, code update order is called, to update generation The code update order is executed under the path of code, completion code updates.Wherein, the path of the more fresh code is more fresh code In the storage address of code server, the code server, that is, intra-company's store code server.
Fig. 2 is the main flow schematic diagram of code update method according to an embodiment of the invention.As shown in Fig. 2, this hair The code update method of a bright embodiment, mainly includes the following steps:
Step S201: server accesses mailbox server by polling mechanism, to obtain code update mail.Wherein, institute It states code update mail and mailbox server, including user (i.e. sender) title, postal is sent to by mailbox client by user Case address and code update order.The mailbox servers such as the mailbox server, such as Sina, 163 need to open third party and award Power connects the opening address of mailbox server, by mailbox client to realize the connection of mailbox client and mailbox server. Server in embodiment is Windows server, according to prefixed time interval, such as 10 seconds, 5 seconds etc., accesses postal Case server, judges whether mailbox server has received code update mail, if code update mail is had received, with variable Form save sender email address.The realization process of poll may is that every five seconds clock obtains once not from mailbox server Read mail, it is therefore an objective to detect whether new mail, and judge whether new mail includes code update order, if there is new mail And including code update order in new mail, then using the new mail as code update mail;If without new mail or newly It does not include code update order in mail, then Windows server continues to obtain from mailbox server after sleeping 5 seconds, 5 seconds Unread mail is taken, code update mail is judged whether it is.
Step S202: server is according to preset user right list, the user identifier of the code update mail and generation Code more newer command, judges whether code update order indicated by the code update mail can be called, if can be by It calls, thens follow the steps S203;If cannot be called, terminate this process.In embodiment, if cannot be called, Can not have the prompt information of this renewal authority to corresponding user feedback.In order to guarantee the safety of code update, Windows Save user right list in server, the user right list includes user's name, corresponding email address and right The executable code answered more newer command, it is specific as shown in table 1.
1 user right list of table
User's name Email address Executable code more newer command
Zhang San zhangsan@sina.com git pull
Li Si lisi@sina.com git commit
King five wangwu@163.com git add
Wherein, the git pull order in table 1 is fetched the update of some branch of distance host, then is divided with local specifying Branch merges.It is common to use format are as follows:
Git pull<name of remote host><remote branch name>:<local branch's name>
Git commit order, will be in the caching of locally modified content submission.It is common can be with using format are as follows:
Git commit-m ' XXX ', XXX indicate the content of modification.
File content is added to index (modification is added to working area) by git add order.Substantially format is used are as follows:
Git add<path>,<path>it can be file and be also possible to catalogue, indicate that by modification (do not include having deleted text Part) or newly add the information of file and be added in index database.
List 1 is merely illustrative, and executable code more newer command can be git order and/or svn order.It is preferred one In embodiment, since email address can be used as unique user identifier, therefore the user's name in user right list can be saved Slightly, email address and the more newer command of corresponding executable code are only stored.Correspondingly, the user name in user right list Title can be used as unique user identifier, therefore the email address in user right list can be omitted, and only store user's name With the more newer command of corresponding executable code.
The email address of Windows server acquisition code update mail and code update order, the mailbox that will acquire Location is compared with the email address of the user right list, if in the user right list there are the mailbox Code update order executable code more newer command corresponding with the email address is then compared, if described by location Code update order matches with the executable code more newer command, then illustrates the code update life of the code update mail Order can be called;If there is no in the email address or the user right list in the user right list There are the email address but code update order executable code more newer command corresponding with the email address mismatches, Then illustrate that the code update order of the code update mail cannot be called.For example, Windows server has been got The three code update mails sent, if the code update order in the code update mail has git pull printed words, Illustrate that the code update order of the code update mail can be called;If the code update order in the code update mail With git commit printed words, then illustrate that the code update order of the code update mail cannot be called.
In a preferred embodiment, the code update order can write exactly in mail matter topics and/or message body, Mail matter topics region and/or message body region are retrieved, if containing code update order in above-mentioned zone, obtains the code More newer command, and executable code more newer command corresponding with the email address is compared.
Step S203: server opens subprocess and calls the code update order, to hold under the path of more fresh code The row code update order.Wherein, the more fresh code is to be pushed to code clothes after developer is updated original code The code of business device.Windows server opens a subprocess using Python, calls code update using the subprocess Order, executes the code update order, and monitor returning the result for subprocess under the path of more fresh code.For example, executing git Pull order, the order can compare local branch code with the newest code of corresponding remote branch with the presence or absence of difference, such as Fruit has differences, then incremental code can be updated.It may be comprising in being returned the result after executing git pull order (Already up-to-date) is updated, wrong (error) is updated, updates the keywords such as failure (fail), judges the return As a result it whether there is Already up-to-date in, if it does, illustrating that code update is completed, and long-range branch and local The code of respective branches is consistent, without incremental code;If there is keywords such as error, fail, illustrate that code update is different Often.Wherein, the part that the incremental code has differences for the code of long-range branch code and local respective branches.
Step S204: server receives returning the result after the code update order is finished, and mail is called to send Described return the result is pushed to user by program.For example, for executing git pull order, if it is described return the result in deposit In Already up-to-date keyword, then illustrate that code update finishes, returned the result described in preservation in the form of variable, is adjusted Program is sent with mail, will return the result and feed back to user (sender).If Already up- is not present in the keyword To-date is then illustrated code update exception, is saved and returned the result in the form of variable, will returned the result and feed back to user's (outbox People), inform user's update abnormal.Wherein, mail matter topics can be " Windows server update finishes notice ", and addressee is artificial The sender saved in step S201, Mail Contents are described return the result.
Below by taking mailbox server is Sina's mailbox server as an example, the code update method of the embodiment of the present invention is carried out It further illustrates.
Firstly, the code of code server is updated, specifically: it is deployed with Web service in Windows server cluster, when After developer develops the new function for completing Web service, newly-increased code is pushed to by git push order by long-range code In server.In the step, developer develops the client that program uses and needs to install git client.Pass through git push The address git for the code server for being pushed to newly-increased code is ordered, which is URL (Uniform Resource Locator, uniform resource locator) address, such as https: //github.com/xxx/xxx.git.
Later, the code of Windows server cluster is updated, specifically: developer sends an envelope mail to Sina's postal Case, the theme of mail are git pull;After sending successfully, Windows server can detect an envelope unread mail, and obtaining should Sender, email address and the code update order of unread mail, pass through the email address of the first variable save sender;Judgement Whether sender and code update order meet the requirement of user right list, when sender and code update order meet user When the requirement of permissions list, the subprocess that Windows server opens a Python calls git pull order, newly-increased Git pull order is executed under the path (i.e. the address git) of code, and monitors the return value of subprocess, passes through the second variable save Return value;After git pull order is finished, using return value as the text of feedback mail, it is sent to the sender's of preservation In email address.
Fig. 3 is the main flow schematic diagram of code update method according to another embodiment of the present invention.As shown in figure 3, this The code update method for inventing another embodiment, mainly includes the following steps
Step S301: server obtains code update configuration file, parses the more new configuration file and obtains user identifier With code update order.Wherein, the code update configuration file is defined by developer, including user identifier and code update Order.In embodiment, user identifier is user's name, the code update configuration file can be sent in the form of mail Windows server can also be sent directly to Windows server by http protocol.
Step S302: server is according to preset user right list, the user identifier of the code update configuration file With code update order, judge whether the code update order of the code update configuration file can be called, if can be with It is called, then follow the steps S303;If cannot be called, terminate this process.In the embodiment, the user right column Table includes the 1st column that user's name is noted as in table 1 and the 3rd column for being noted as executable code more newer command.By user Mark is compared with the user's name of the user right list, if there are user marks in the user right list Know, is then compared code update order executable code more newer command corresponding with the user identifier, if described Code update order matches with the executable code more newer command, then illustrates the code of the code update configuration file more Newer command can be called;If there is no the user identifiers or the user right to arrange in the user right list In table there are the user identifier but code update order executable code more newer command corresponding with the user identifier not Match, then illustrates that the code update order of the code update configuration file cannot be called.For example, Windows server obtains A more new configuration file is got, user identifier is Zhang San, has git pull printed words in code update order, then explanation should The code update order of code update configuration file can be called;If code update order has git commit printed words, Then illustrate that the code update order of the code update configuration file cannot be called.
Step S303: server opens subprocess and calls the code update order, to hold under the path of more fresh code The row code update order.The specific implementation process of the step is identical as step S203.
Step S304: server receives returning the result after the code update order is finished, by updating result Described return the result is pushed to user by configuration file.Wherein, it is returned the result described in being saved in the update result configuration file. For example, for executing git pull order, if it is described return the result in there are Already up-to-date keyword, Illustrate that code update finishes, described return the result is saved in update result configuration file in the form of variable;If described Already up-to-date is not present in keyword, then illustrates code update exception, is tied the return in the form of variable Fruit, which saves, to be updated in result configuration file.In embodiment, the update result configuration file can be sent in the form of mail To Windows server, Windows server can also be sent directly to by http protocol.
It includes user identifier and code update that code update method through the embodiment of the present invention, which can be seen that by obtaining, The code update file of order determines the code update order that can be called, call later the code update order with into Line code updates, and can directly update the code of server, without human intervention, time saving and energy saving;User will be used for code update Mail be sent to mailbox server, enable the server to by poll access mailbox server mechanism obtain new mail, User and server are bridged, the code of server is directly updated, promotes code update efficiency;Pre-set user permission column Table avoids the user of not permission from updating the code of server, protects to find out the code update file for meeting user right list Demonstrate,prove the safety of code update;Returning the result of being finished of code update order is pushed into user, user is facilitated to know generation The success or failure situation that code updates.
Fig. 4 is the schematic diagram of the main modular of code update device according to an embodiment of the present invention.As shown in figure 4, this hair The code update device 400 of bright embodiment, specifically includes that
Module 401 is obtained, for obtaining code update file, wherein the code update file indicates user identifier With code update order.The code update order, such as git order, svn order.The code update file can be generation Code more new mail or code update configuration file need to pass through if the code update file is code update mail Polling mechanism accesses mailbox server, to obtain code update mail;If the code update file is code update configuration File can then be transmitted by http protocol, to directly acquire.
Determining module 402 is marked for the user according to indicated by preset user right list, the code update file Knowledge and code update order, determine that code update order indicated by the code update file can be called.Wherein, the use It include the user identifier and the more newer command of corresponding executable code for possessing the user of code update permission in the permissions list of family.It will The user identifier of the code update file is compared with the user identifier of user right list;When the user right list It is middle there are in the case where the user identifier of the code update file, by the code update order of the code update file and institute The more newer command of the corresponding executable code of user identifier described in user right list is stated to be compared;When the code update is ordered Enable with the executable code more newer command matches when, the code update order of the code update file can be called;When When the code update order and the executable code more newer command mismatch, then the code update file code more Newer command can not be called.
Update module 403, for calling the code update order, to carry out generation by executing the code update order Code updates.In the case where the code update order of the code update file can be called, call code update order, with The code update order is executed under the path of more fresh code, completion code updates.Wherein, the path of the more fresh code is more Storage address of the fresh code in code server, the code server, that is, intra-company's store code server.
In addition, the code update device 400 of the embodiment of the present invention can also include: pushing module (being not shown in Fig. 4), it should Module is used to receive returning the result after executing the code update order, pushes away described return the result in such a way that mail is sent It send to user.
Fig. 5 is the schematic diagram of the main modular of code update system according to an embodiment of the present invention.As shown in figure 5, this hair The code update system 500 of bright embodiment includes: client 501, mailbox server 502,503 (i.e. code of Windows server Updating device 400) and code server 504.Developer is by the mailbox client installed in client 501 to mailbox service Device 502 sends new mail, and code server 504 is arrived in more fresh code push (push) by client 501.Mailbox service Device 502 receives the new mail that developer sends.Windows server 503 is judged in mailbox server 502 by polling mechanism Whether new mail is received, it, will when being had received in new mail and the new mail in mailbox server 502 includes code update order The new mail is as code update mail;Later according to the user identifier and code in user right list, code update mail More newer command, judges whether the code update order in code update mail can be called;When code update mail code more When newer command can be called, code update order is called, to execute order under the path of more fresh code, order is received and executes After return the result;By the text for returning the result and sending as mail, it is sent to the client 501 of developer.
From the above, it can be seen that by obtaining the code update file including user identifier and code update order, It determines the code update order that can be called, calls the code update order to carry out code update later, it can be direct The code of server is updated, it is without human intervention, time saving and energy saving;The mail for being used for code update is sent to mailbox service by user Device enables the server to obtain new mail by the mechanism that poll accesses mailbox server, user and server bridge is picked up Come, directly update the code of server, promotes code update efficiency;Pre-set user permissions list meets user right to find out The code update file of list avoids the user of not permission from updating the code of server, guarantees the safety of code update;It will What code update order was finished, which return the result, pushes to user, and user is facilitated to know the success or failure situation of code update.
Fig. 6 is shown can be using the code update method of the embodiment of the present invention or the exemplary system of code update device Framework 600.
As shown in fig. 6, system architecture 600 may include terminal device 601,602,603, network 604 and server 605. Network 604 between terminal device 601,602,603 and server 605 to provide the medium of communication link.Network 604 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 601,602,603 and be interacted by network 604 with server 605, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 601,602,603 The application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 601,602,603 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 605 can be to provide the server of various services, such as utilize terminal device 601,602,603 to user Code update mail generated provides the back-stage management server supported.Back-stage management server can be to the code received More new mail carries out the processing such as analyzing, and (such as meeting renewal authority rule) calls the code update postal based on the analysis results Code update order in part.
It should be noted that code update method provided by the embodiment of the present application is generally executed by server 605, accordingly Ground, code update device are generally positioned in server 605.
It should be understood that the number of terminal device, network and server in Fig. 6 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
According to an embodiment of the invention, the present invention also provides a kind of electronic equipment and a kind of computer-readable medium.
Electronic equipment of the invention includes: one or more processors;Storage device, for storing one or more journeys Sequence, when one or more of programs are executed by one or more of processors, so that one or more of processors are real A kind of code update method of the existing embodiment of the present invention.
Computer-readable medium of the invention is stored thereon with computer program, real when described program is executed by processor A kind of code update method of the existing embodiment of the present invention.
Below with reference to Fig. 7, it illustrates the computer systems 700 being suitable for realize the electronic equipment of the embodiment of the present invention Structural schematic diagram.Electronic equipment shown in Fig. 7 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and Execute various movements appropriate and processing.In RAM 703, also it is stored with computer system 700 and operates required various programs And data.CPU 701, ROM 702 and RAM 703 are connected with each other by bus 704.Input/output (I/O) interface 705 It is connected to bus 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, disclosed embodiment, the process of key step figure description above may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable Computer program on medium, the computer program include the program code for executing method shown in key step figure.? In such embodiment, which can be downloaded and installed from network by communications portion 709, and/or from can Medium 711 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 701, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet It includes and obtains module, determining module and update module.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself, for example, obtaining module is also described as " obtaining the module of code update file ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes: to obtain code update file, wherein the code update file indicates user identifier and code update life It enables;According to user identifier and code update order indicated by preset user right list, the code update file, determine Code update order indicated by the code update file can be called;The code update order is called, is executed with passing through The code update order carries out code update.
From the above, it can be seen that by obtaining the code update file including user identifier and code update order, It determines the code update order that can be called, calls the code update order to carry out code update later, it can be direct The code of server is updated, it is without human intervention, time saving and energy saving;The mail for being used for code update is sent to mailbox service by user Device enables the server to obtain new mail by the mechanism that poll accesses mailbox server, user and server bridge is picked up Come, directly update the code of server, promotes code update efficiency;Pre-set user permissions list meets user right to find out The code update file of list avoids the user of not permission from updating the code of server, guarantees the safety of code update;It will What code update order was finished, which return the result, pushes to user, and user is facilitated to know the success or failure situation of code update.
Method provided by the embodiment of the present invention can be performed in the said goods, has the corresponding functional module of execution method and has Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present invention.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (10)

1. a kind of code update method characterized by comprising
Obtain code update file, wherein the code update file indicates user identifier and code update order;
According to user identifier and code update order indicated by preset user right list, the code update file, really Code update order indicated by the fixed code update file can be called;
The code update order is called, to carry out code update by executing the code update order.
2. the method according to claim 1, wherein the acquisition code update file, comprising:
According to prefixed time interval, poll accesses mailbox server;
When detecting new mail, judge whether the new mail indicates the code update order;
When indicating the code update order in the new mail, using the new mail as the code update mail, The new mail transmits the artificial user identifier.
3. the method according to claim 1, wherein described according to preset user right list, the code User identifier and code update order indicated by file are updated, determines that code update indicated by the code update file is ordered Order can be called, comprising:
User included by user identifier indicated by the code update file and the preset user right list is marked Knowledge is compared;
In the case where the preset user right list includes user identifier indicated by the code update file, by institute It is corresponding with user identifier described in the preset user right list to state code update order indicated by code update file Executable code more newer command be compared;
The code update order indicated by the update file and the executable code be in the case that more newer command matches, Code update order indicated by the code update file can be called.
4. according to claim 1 to 3 described in any item methods, which is characterized in that the method also includes: receive execute institute Described return the result is pushed to user in such a way that mail is sent by returning the result after stating code update order.
5. a kind of code update device characterized by comprising
Module is obtained, for obtaining code update file, wherein the code update file indicates user identifier and code more Newer command;
Determining module, for user identifier and generation according to indicated by preset user right list, the code update file Code more newer command, determines that code update order indicated by the code update file can be called;
Update module, for calling the code update order, to carry out code update by executing the code update order.
6. device according to claim 5, which is characterized in that the acquisition module is also used to:
According to prefixed time interval, poll accesses mailbox server;
When detecting new mail, judge whether the new mail indicates the code update order;And
When indicating the code update order in the new mail, using the new mail as the code update mail, The new mail transmits the artificial user identifier.
7. device according to claim 5, which is characterized in that the determining module is also used to:
User included by user identifier indicated by the code update file and the preset user right list is marked Knowledge is compared;
In the case where the preset user right list includes user identifier indicated by the code update file, by institute It is corresponding with user identifier described in the preset user right list to state code update order indicated by code update file Executable code more newer command be compared;And
The code update order indicated by the update file and the executable code be in the case that more newer command matches, Code update order indicated by the code update file can be called.
8. according to described in any item devices of claim 5 to 7, which is characterized in that described device further include: pushing module, For receiving returning the result after executing the code update order, described return the result is pushed in such a way that mail is sent User.
9. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1-4.
10. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor The method as described in any in claim 1-4 is realized when row.
CN201810762250.7A 2018-07-12 2018-07-12 Code updating method and device Active CN108984197B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810762250.7A CN108984197B (en) 2018-07-12 2018-07-12 Code updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810762250.7A CN108984197B (en) 2018-07-12 2018-07-12 Code updating method and device

Publications (2)

Publication Number Publication Date
CN108984197A true CN108984197A (en) 2018-12-11
CN108984197B CN108984197B (en) 2022-08-12

Family

ID=64537842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810762250.7A Active CN108984197B (en) 2018-07-12 2018-07-12 Code updating method and device

Country Status (1)

Country Link
CN (1) CN108984197B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111045725A (en) * 2019-12-16 2020-04-21 广州唯品会信息科技有限公司 Control method, device and storage medium of code management system
CN112559001A (en) * 2019-09-26 2021-03-26 北京京东振世信息技术有限公司 Method and device for updating application
CN113595962A (en) * 2020-04-30 2021-11-02 华为技术有限公司 Safety control method and device and safety control equipment
CN113900680A (en) * 2020-07-06 2022-01-07 中国移动通信集团重庆有限公司 Code management method and device and computing equipment

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098313A (en) * 2006-06-30 2008-01-02 华为技术有限公司 Mail transmitting method and system
CN101727337A (en) * 2008-10-24 2010-06-09 鸿富锦精密工业(深圳)有限公司 Electronic device with automatic software updating function and method
US20130339498A1 (en) * 2008-03-14 2013-12-19 William J. Johnson System and Method for Application Context Location Based Configuration Suggestions
CN103581256A (en) * 2012-08-02 2014-02-12 阿里巴巴集团控股有限公司 Method, device and system for publishing information to website
CN104239756A (en) * 2013-06-19 2014-12-24 深圳市莫廷影像技术有限公司 Administrator right updating method and device
CN104461578A (en) * 2014-12-26 2015-03-25 广州唯品会信息科技有限公司 Automatic code merging method and system
US20160266889A1 (en) * 2015-03-13 2016-09-15 Kony, Inc. Providing updates for natively rendered mobile applications
CN106250548A (en) * 2016-08-12 2016-12-21 福建中金在线信息科技有限公司 A kind of code update method
CN107493198A (en) * 2017-08-29 2017-12-19 北纬通信科技南京有限责任公司 Honeycomb game packaging system and SDK cut-in methods based on SDK accesses
CN107579865A (en) * 2017-10-18 2018-01-12 北京奇虎科技有限公司 Right management method, the apparatus and system of distributed code server
CN107886008A (en) * 2016-09-30 2018-04-06 北京京东尚科信息技术有限公司 File management method and system
CN108255502A (en) * 2016-12-27 2018-07-06 杭州海康威视数字技术股份有限公司 A kind of update in library, upload, management method, device and base management system

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098313A (en) * 2006-06-30 2008-01-02 华为技术有限公司 Mail transmitting method and system
US20130339498A1 (en) * 2008-03-14 2013-12-19 William J. Johnson System and Method for Application Context Location Based Configuration Suggestions
CN101727337A (en) * 2008-10-24 2010-06-09 鸿富锦精密工业(深圳)有限公司 Electronic device with automatic software updating function and method
CN103581256A (en) * 2012-08-02 2014-02-12 阿里巴巴集团控股有限公司 Method, device and system for publishing information to website
CN104239756A (en) * 2013-06-19 2014-12-24 深圳市莫廷影像技术有限公司 Administrator right updating method and device
CN104461578A (en) * 2014-12-26 2015-03-25 广州唯品会信息科技有限公司 Automatic code merging method and system
US20160266889A1 (en) * 2015-03-13 2016-09-15 Kony, Inc. Providing updates for natively rendered mobile applications
CN106250548A (en) * 2016-08-12 2016-12-21 福建中金在线信息科技有限公司 A kind of code update method
CN107886008A (en) * 2016-09-30 2018-04-06 北京京东尚科信息技术有限公司 File management method and system
CN108255502A (en) * 2016-12-27 2018-07-06 杭州海康威视数字技术股份有限公司 A kind of update in library, upload, management method, device and base management system
CN107493198A (en) * 2017-08-29 2017-12-19 北纬通信科技南京有限责任公司 Honeycomb game packaging system and SDK cut-in methods based on SDK accesses
CN107579865A (en) * 2017-10-18 2018-01-12 北京奇虎科技有限公司 Right management method, the apparatus and system of distributed code server

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
谭鑫等: "代码文件贡献组成模式的分析", 《软件学报》, no. 08, 13 March 2018 (2018-03-13), pages 111 - 121 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112559001A (en) * 2019-09-26 2021-03-26 北京京东振世信息技术有限公司 Method and device for updating application
CN112559001B (en) * 2019-09-26 2023-09-26 北京京东振世信息技术有限公司 Method and device for updating application
CN111045725A (en) * 2019-12-16 2020-04-21 广州唯品会信息科技有限公司 Control method, device and storage medium of code management system
CN111045725B (en) * 2019-12-16 2023-08-18 广州唯品会信息科技有限公司 Control method and device of code management system and storage medium
CN113595962A (en) * 2020-04-30 2021-11-02 华为技术有限公司 Safety control method and device and safety control equipment
CN113900680A (en) * 2020-07-06 2022-01-07 中国移动通信集团重庆有限公司 Code management method and device and computing equipment

Also Published As

Publication number Publication date
CN108984197B (en) 2022-08-12

Similar Documents

Publication Publication Date Title
CN108984197A (en) A kind of code update method and device
CN107357914B (en) Information processing method and device
CN110019211A (en) The methods, devices and systems of association index
CN107844324A (en) Customer terminal webpage redirects treating method and apparatus
CN109766082A (en) The method and apparatus that the application program page jumps
CN109905286A (en) A kind of method and system of monitoring device operating status
CN109656744A (en) The method and apparatus for realizing data check and injection are explained based on Java
CN110134427A (en) A kind of method and apparatus generating code file
CN110895603A (en) Multi-system account information integration method and device
CN110471848A (en) A kind of method and apparatus of dynamic returned packet
CN109918191A (en) A kind of method and apparatus of the anti-frequency of service request
CN110321252A (en) A kind of method and apparatus of craft services scheduling of resource
CN110070394A (en) Data processing method, system, medium and calculating equipment
CN109005208A (en) Method and apparatus for pushed information
CN110083457A (en) A kind of data capture method, device and data analysing method, device
CN109840534A (en) The method and apparatus of processing event
CN109981546A (en) The method and apparatus for obtaining the far call relationship between application module
CN110097303A (en) A kind of method and apparatus of order management
CN110389976A (en) A kind of dispatching method and device of multi-interface data
CN109218125A (en) A kind of method and system of heartbeat data interaction
CN108989157A (en) Method, apparatus for smart machine control
CN108985805A (en) A kind of method and apparatus that selectivity executes push task
CN111045928A (en) Interface data testing method, device, terminal and storage medium
CN110493291A (en) A kind of method and apparatus handling HTTP request
CN113762674B (en) Order distribution method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant before: Jingdong Digital Technology Holding Co.,Ltd.

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address after: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant after: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.

Address before: 101111 Room 221, 2nd Floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone

Applicant before: BEIJING JINGDONG FINANCIAL TECHNOLOGY HOLDING Co.,Ltd.

GR01 Patent grant
GR01 Patent grant