CN107688538A - A kind of script execution, device and computing device - Google Patents

A kind of script execution, device and computing device Download PDF

Info

Publication number
CN107688538A
CN107688538A CN201710769075.XA CN201710769075A CN107688538A CN 107688538 A CN107688538 A CN 107688538A CN 201710769075 A CN201710769075 A CN 201710769075A CN 107688538 A CN107688538 A CN 107688538A
Authority
CN
China
Prior art keywords
script
unit
file
mark
script unit
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
CN201710769075.XA
Other languages
Chinese (zh)
Other versions
CN107688538B (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 Ruixiang Technology Co ltd
Original Assignee
Beijing Oneapm Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Oneapm Communication Technology Co Ltd filed Critical Beijing Oneapm Communication Technology Co Ltd
Priority to CN201710769075.XA priority Critical patent/CN107688538B/en
Publication of CN107688538A publication Critical patent/CN107688538A/en
Application granted granted Critical
Publication of CN107688538B publication Critical patent/CN107688538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a kind of script execution, device and computing device, the computing device communicates to connect with dispatch server and file server respectively, multiple script files are stored with file server, each script file is associated with unique script mark and included including multiple script units, this method:The script execute instruction that dispatch server issues is received, the script that script execute instruction includes pending script identifies;Obtained and the corresponding script file of script mark from file server;To the processing of script file Perform sequenceization;For script file after parsing serializing to obtain example script, example script includes multiple script unit examples corresponding with script unit;Processing is ranked up to each script unit to obtain the execution order of the script unit;For each script unit, according to the execution order of each script unit, according to the protocol-identifier and port-mark of the script unit, corresponding script unit example is performed using corresponding agreement.

Description

A kind of script execution, device and computing device
Technical field
The present invention relates to software test field, more particularly to a kind of script execution, device and computing device.
Background technology
At present, various softwares emerge in an endless stream in Internet market, and different business logical sum commercial use causes a software When transmitting data and message, different types of procotol can be used, in addition to relatively conventional HTTP/HTTPS agreements, also There are WebSocket agreements, MQTT agreements etc..It follows that when carrying out pressure test to such software, it is contemplated that client pair The demand of different type agreement, the mixed hair of various agreements can be related to, then occur above-mentioned multi-protocols it is mixed find as when, just need Pressure test corresponding to being carried out respectively to different agreements.
However, existing pressure test scheme typically uses http protocol to make requests on when performing test script Send, and have ignored other procotols.With the development and innovation of technology, more new agreements will be had later as pressure The instrument of test carries out the transmission of client request, in order to adapt to the test scene of the mixed hair of multi-protocols, improves under newly-increased agreement Quick function iteration, it is necessary to which a kind of new script carries into execution a plan to improve above-mentioned processing procedure.
The content of the invention
Therefore, the present invention provides the technical scheme that a kind of script performs, to try hard to solve or at least alleviate exist above The problem of.
According to an aspect of the present invention, there is provided a kind of script execution, suitable for being performed in computing device, the calculating Equipment communicates to connect with dispatch server and file server respectively, is stored with multiple script files in file server, each Script file is associated with unique script mark and including multiple script unit, and there is each script unit corresponding attribute to believe Breath, attribute information include protocol-identifier and port-mark, and this method comprises the following steps:First, dispatch server is received to issue Script execute instruction, the script of script execute instruction including pending script identifies;Acquisition and script from file server Script file corresponding to mark;To the processing of script file Perform sequenceization;The script file after serializing is parsed to obtain script Example, example script include multiple script unit examples corresponding with script unit;To each script unit be ranked up processing with Obtain the execution order of the script unit;For each script unit, according to the execution order of each script unit, according to the script The protocol-identifier and port-mark of unit, corresponding script unit example is performed using corresponding agreement.
Alternatively, in the script execution according to the present invention, the script file after serializing is parsed to obtain script The step of example, includes:Each script unit included by script file after serializing is parsed respectively;According to each pin The protocol-identifier and port-mark of this unit, the script unit is instantiated to generate corresponding script unit example;Combination is given birth to Into each script unit example to form example script corresponding with script file.
Alternatively, in the script execution according to the present invention, attribute information also includes index mark and reference identification, Processing is ranked up to each script unit to be included with obtaining the step of the execution order of the script unit:Identified according to index from small One minor sort is carried out to each script unit to big order;According to the order of reference identification from small to large to same index mark Each script unit known carries out two minor sorts, to obtain the execution order of the script unit.
Alternatively, in the script execution according to the present invention, computing device also connects with overtime control server communication Connect, according to the protocol-identifier and port-mark of the script unit, corresponding script unit example is performed using corresponding agreement The step of include:According to the protocol-identifier and port-mark of the script unit, request corresponding to corresponding protocol generation is utilized;Will The request is sent to overtime control server, and time-out is returned to indicate overtime control server behind default very first time interval State;Corresponding script unit example is sent this request to, the request is sent by the script unit example to obtain response The data of the request, then the overtime control instruction for cancelling the request is sent to overtime control service;If receiving timeout mode, After default second time interval, the request is re-transmitted to overtime control server and corresponding script unit example.
Alternatively, according to the present invention script execution in, agreement include http protocol, HTTPS agreements, One or more of WebSocket agreements, Socket agreements, MQTT agreements, Transmission Control Protocol and udp protocol.
According to a further aspect of the invention, there is provided a kind of script performs device, suitable for residing in computing device, the meter Calculate equipment to communicate to connect with dispatch server and file server respectively, be stored with multiple script files in file server, often Individual script file is associated with unique script mark and including multiple script unit, and there is each script unit corresponding attribute to believe Breath, attribute information include protocol-identifier and port-mark, and the device includes receiving module, acquisition module, serialization module, parsing Module, order module and execution module.Wherein, receiving module is suitable to receive the script execute instruction that dispatch server issues, pin The script that this execute instruction includes pending script identifies;Acquisition module is suitable to obtain from file server and script mark pair The script file answered;Serialization module is suitable to the processing of script file Perform sequenceization;After parsing module is suitable to parsing serializing Script file to obtain example script, example script includes multiple script unit examples corresponding with script unit;Sort mould Block is suitable to be ranked up each script unit processing to obtain the execution order of the script unit;Execution module is suitable to for each Script unit, according to the execution order of each script unit, according to the protocol-identifier and port-mark of the script unit, using corresponding Agreement perform corresponding script unit example.
According to a further aspect of the invention, there is provided a kind of computing device, including the script performs device according to the present invention.
According to a further aspect of the invention, there is provided a kind of computing device, including one or more processors, memory with And one or more programs, wherein one or more program storages in memory and are configured as by one or more processors Perform, one or more programs include being used for the instruction for performing the script execution according to the present invention.
According to a further aspect of the invention, a kind of computer-readable storage medium for storing one or more programs is also provided Matter, one or more programs include instruction, and instruction is when executed by a computing apparatus so that computing device is according to the present invention's Script execution.
The technical scheme performed according to the script of the present invention, serializing processing is first carried out to the script file got, then Parsed to obtain example script, the example script includes multiple script unit examples corresponding with script unit, to each pin This unit is ranked up processing to obtain the execution order of the script unit, for each script unit, according to each script unit Execution order, according to the protocol-identifier and port-mark of the script unit, corresponding script is performed using corresponding agreement Unit example.It is to included by script file when carrying out dissection process to the script file after serializing in such scheme Each script unit is parsed respectively, the protocol-identifier and port-mark further according to each script unit come instantiate with generate pair The script unit example answered, so that later use agreement corresponding with the agreement and port-mark of the script unit is corresponding to perform Script unit example, be easy to carry out pressure test to the client for being related to the mixed hair of multi-protocols, can adapt to more checkout areas Scape, and dynamic expansion can also be carried out when there is new agreement, function iteration is quickly realized, substantially increases newly-increased agreement The it is proposed speed of solution, further, in perform script unit example, also by time-out control unit come to perform when Between be controlled, avoid being not responding to request for a long time bringing script to perform and be absorbed in non-responsive state or be always maintained at execution state, Waste system resource.In addition, the execution order of each script unit is entered by the index mark and reference identification of the script unit The minor sort of row two and generate, ensure that the relevance and hierarchical relationship between each script unit.
Brief description of the drawings
In order to realize above-mentioned and related purpose, some illustrative sides are described herein in conjunction with following description and accompanying drawing Face, these aspects indicate the various modes that can put into practice principles disclosed herein, and all aspects and its equivalent aspect It is intended to fall under in the range of theme claimed.Read following detailed description in conjunction with the accompanying drawings, the disclosure it is above-mentioned And other purposes, feature and advantage will be apparent.Throughout the disclosure, identical reference generally refers to identical Part or element.
Fig. 1 shows the schematic diagram of script execution system 100 according to an embodiment of the invention;
Fig. 2 shows the structured flowchart of computing device 200 according to an embodiment of the invention;
Fig. 3 shows the flow chart of script execution 300 according to an embodiment of the invention;
Fig. 4 shows the schematic diagram of script execution system 400 according to still another embodiment of the invention;And
Fig. 5 shows the schematic diagram of script performs device 500 according to an embodiment of the invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
Fig. 1 shows the schematic diagram of script execution system 100 according to an embodiment of the invention.It should be pointed out that in Fig. 1 Script execution system 100 be only exemplary, in specific practice situation, can there is difference in script execution system 100 Computing device, dispatch server and the file server of quantity, the present invention are set to calculating included in script execution system 100 The quantity of standby, dispatch server and file server is not limited.Set as shown in figure 1, script execution system 100 includes calculating Standby 200, dispatch server 600 and file server 700.Wherein, computing device 200 respectively with dispatch server 600 and file Server 700 communicates to connect, and computing device 200 can be PC, but not limited to this.It is stored with file server 700 multiple Script file, each script file are associated with unique script mark and had including multiple script units, each script unit Corresponding attribute information, attribute information include protocol-identifier and port-mark.Specifically, dispatch server 600 can be to calculating Equipment 200 issues script execute instruction, and the script that the script execute instruction includes pending script identifies, and computing device 200 After receiving the script execute instruction that dispatch server 600 issues, obtained from file server 700 corresponding with script mark Script file, to the processing of script file Perform sequenceization, the script file after serializing is parsed to obtain example script, script reality Example includes multiple script unit examples corresponding with script unit, and processing is ranked up to each script unit to obtain the script list The execution order of member, for each script unit, according to the execution order of each script unit, according to the Protocol Standard of the script unit Knowledge and port-mark, corresponding script unit example is performed using corresponding agreement.
Fig. 2 is the structured flowchart of computing device 200 according to an embodiment of the invention.In basic configuration 202, Computing device 200 typically comprises system storage 206 and one or more processor 204.Memory bus 208 can be used In the communication between processor 204 and system storage 206.
Depending on desired configuration, processor 204 can be any kind of processing, include but is not limited to:Microprocessor (μ P), microcontroller (μ C), digital information processor (DSP) or any combination of them.Processor 204 can be included such as The cache of one or more rank of on-chip cache 210 and second level cache 212 etc, processor core 214 and register 216.The processor core 214 of example can include arithmetic and logical unit (ALU), floating-point unit (FPU), Digital signal processing core (DSP core) or any combination of them.The Memory Controller 218 of example can be with processor 204 are used together, or in some implementations, Memory Controller 218 can be an interior section of processor 204.
Depending on desired configuration, system storage 206 can be any type of memory, include but is not limited to:Easily The property lost memory (RAM), nonvolatile memory (ROM, flash memory etc.) or any combination of them.System stores Device 206 can include operating system 220, one or more program 222 and routine data 224.In some embodiments, Program 222 may be arranged to utilize the execute instruction of routine data 224 by one or more processors 204 on an operating system.
Computing device 200 can also include contributing to from various interface equipments (for example, output equipment 242, Peripheral Interface 244 and communication equipment 246) to basic configuration 202 via the communication of bus/interface controller 230 interface bus 240.Example Output equipment 242 include graphics processing unit 248 and audio treatment unit 250.They can be configured as contributing to via One or more A/V port 252 is communicated with the various external equipments of such as display or loudspeaker etc.Outside example If interface 244 can include serial interface controller 254 and parallel interface controller 256, they can be configured as contributing to Via one or more I/O port 258 and such as input equipment (for example, keyboard, mouse, pen, voice-input device, touch Input equipment) or the external equipment of other peripheral hardwares (such as printer, scanner etc.) etc communicated.The communication of example is set Standby 246 can include network controller 260, and it can be arranged to be easy to via one or more COM1 264 and one The communication that other individual or multiple computing devices 262 pass through network communication link.
Network communication link can be an example of communication media.Communication media can be generally presented as in such as carrier wave Or computer-readable instruction in the modulated data signal of other transmission mechanisms etc, data structure, program module, and can With including any information delivery media." modulated data signal " can such signal, one in its data set or more It is individual or it change can the mode of coding information in the signal carry out.As nonrestrictive example, communication media can be with Include the wire medium of such as cable network or private line network etc, and it is such as sound, radio frequency (RF), microwave, infrared (IR) the various wireless mediums or including other wireless mediums.Term computer-readable medium used herein can include depositing Both storage media and communication media.
Computing device 200 can be implemented as server, such as file server, database server, application program service Device and WEB server etc., a part for portable (or mobile) electronic equipment of small size, these electronic equipments can also be embodied as Can be such as cell phone, personal digital assistant (PDA), personal media player device, wireless network browsing apparatus, individual Helmet, application specific equipment or the mixing apparatus that any of the above function can be included.Computing device 200 can also be real It is now to include desktop computer and the personal computer of notebook computer configuration.In certain embodiments, the quilt of computing device 200 It is configured to perform the script execution 300 according to the present invention.Program 222 includes the script performs device 500 according to the present invention.
Fig. 3 shows the flow chart of script execution 300 according to an embodiment of the invention.Script execution 300 are suitable to perform in computing device (such as computing device 200 shown in Fig. 2).As shown in figure 3, method 300 starts from step S310.In step S310, the script execute instruction that dispatch server 600 issues is received, the script execute instruction includes waiting to hold The script mark traveled far and wide originally.According to one embodiment of present invention, wrapped in the script execute instruction that dispatch server 600 issues The script of the pending script included is identified as S1.
Then, step S320 is performed, is obtained and the corresponding script file of script mark from file server 700.According to One embodiment of the present of invention, is stored with 100 script files in file server 700, respectively A1, A2, A3 ..., A99 And A100, each script file are associated with unique script mark, be followed successively by S1, S2, S3 ..., S99 and S100, and each Script file includes multiple script units, and script unit has a corresponding attribute information, attribute information include protocol-identifier and Port-mark.In this embodiment, it is A1 to get with the corresponding script files of script mark S1, script file A1 example It is as follows:
<HttpTransactionConfig name=" affairs _ 1 " id=" 200 " pid=" 2 " index=" 1 " goon =" false ">
<clazz>HttpTransactionConfig</clazz>
<configs>
<HttpPageConfig name=" page _ 1 " id=" 201 " pid=" 200 " index=" 1 " goon=" False " mainRequestId=" 202 ">
<clazz>HttpPageConfig</clazz>
<configs/>
<exeArea>2</exeArea>
<domain>10.128.106.20</domain>
<port>8081</port>
<protocol>http</protocol>
<path>/</path>
<method>GET</method>
<fileArgConfigs/>
……
</HttpTransactionConfig>
<SocketConnectConfig name=" socket connect_1 " id=" 18 " pid=" 46 " index =" 0 " goon=" false ">
<clazz>SocketConnectConfig</clazz>
<configs/>
<exeArea>2</exeArea>
<protocol>tcp</protocol>
<domain>10.128.106.20</domain>
<port>8088</port>
……
</SocketConnectConfig>
For script file A1, altogether including 3 script units, it was found from script argument " name " and " id ", this 3 pin The title of this unit is followed successively by " affairs _ 1 ", " page _ 1 " and " socket connect_1 ", unit marks are followed successively by 200,201 and 18, this 3 script units are designated as B11, B12 and B13 respectively.For script unit B 11 and B12, from correlation "< protocol>http</protocol>" and "<port>8081</port>" sentence understand, script unit B 11 and B12 agreement Http is identified as, port-mark 8081, it is http protocol to show agreement corresponding to script unit B 11 and B12, and to script list For first B13, from correlation "<protocol>tcp</protocol>" and "<port>8088</port>" sentence understand, pin The protocol-identifier of this unit B 13 is tcp, and port-mark 8088, it is Transmission Control Protocol to show agreement corresponding to script unit B 13.Need It is noted that the structure of script file is fixed, except the situation that protocol-identifier is http, corresponding to other protocol-identifiers Agreement when being extended, be all to increase pin under " configs " under script argument " HttpTransactionConfig " This unit, it is convenient to expand the new type of content for script by using the script format of labeling.
Next, step S330 is performed, to the processing of script file Perform sequenceization.According to one embodiment of present invention, Script file A1 is serialized to generate a hash data structure, it is corresponding executable real to be searched during subsequent execution script Example.On the specific algorithm of above-mentioned serializing processing, the present invention is not intended to limit, and these realize corresponding lookup and the calculation of associated storage Method for understand the present invention program technical staff for can be readily apparent that, and also protection scope of the present invention it It is interior, do not repeated herein.
In step S340, the script file after parsing serializing to obtain example script, example script include it is multiple with Script unit example corresponding to script unit.According to one embodiment of present invention, serializing can be parsed in the following manner Script file afterwards is to obtain example script.First, each script unit included by the script file after serializing is distinguished Parsed, further according to the protocol-identifier and port-mark of each script unit, instantiate the script unit to generate corresponding pin This unit example, finally each script unit example for being generated of combination is to form example script corresponding with script file.At this In embodiment, script unit B 11, B12 and the B13 included by the script file A1 after serializing are parsed respectively, root According to script unit B 11 and B12 protocol-identifier http and port-mark 8081, according to corresponding agreement, i.e. http protocol example Change this 2 script units to generate corresponding script unit example, obtain script unit corresponding to script unit B 11 and B12 and show Example is C11 and C12 respectively, and according to the protocol-identifier tcp and port-mark 8088 of script unit B 13, according to corresponding agreement, I.e. Transmission Control Protocol instantiation script unit B 13 finally combines generated script list with script unit example C13 corresponding to generation Meta-instance C11, C12 and C13 are designated as D1 to be formed at example script corresponding to script file A1, by the example script.
After the dissection process of script file is completed, into step S350, processing is ranked up to each script unit to obtain Take the execution order of the script unit.According to one embodiment of present invention, attribute information also includes index mark and quotes mark Know, processing can be ranked up to each script unit in accordance with the following methods to obtain the execution order of the script unit.First, press One minor sort is carried out to each script unit according to the order of index mark from small to large, then, according to reference identification from small to large Order carries out two minor sorts to each script unit identified with same index, to obtain the execution order of the script unit. In the embodiment, script argument " index " and " pid " represent index mark and reference identification respectively, then from script file A1 Content understand that the index of script unit B 11, B12 and B13 mark is respectively 1,1 and 0, first according to index mark from small to large Order to script unit B 11, B12 and B13 carry out a minor sort, now the execution order of this 3 script units is with script list First B1 is first place, and script unit B 12 and B13 execution order is identical, and then according still further to reference identification to same index The script unit B 11 and B12 of mark carry out two minor sorts, and script unit B 11 and B12 reference identification is respectively 2 and 200, can Know that the execution order of this 2 script units is followed successively by script unit B 11 and B12, can finally obtain script unit B 11, B12 and B13 Execution order be followed successively by script unit B 13, B11 and B12.
After the execution order of each script unit of script file is determined, step S360 is performed, for each script Unit, according to the execution order of each script unit, according to the protocol-identifier and port-mark of the script unit, utilize corresponding association Discuss to perform corresponding script unit example.Wherein, agreement include http protocol, HTTPS agreements, WebSocket agreements, One or more of Socket agreements, MQTT agreements, Transmission Control Protocol and udp protocol.Fig. 4 is shown according to the another of the present invention The schematic diagram of the script execution system 400 of individual embodiment.As shown in figure 4, script execution system 400 include computing device 200, Dispatch server 600, file server 700 and overtime control server 800.Wherein, computing device 200 removes and dispatch server 600 and file server 700 communicate to connect outer, also communicated to connect with overtime control server 800, then it is pending to each Script unit, corresponding script unit example can be performed by following method.First, according to the protocol-identifier of the script unit And port-mark, using request corresponding to corresponding protocol generation, then send this request to time-out.Server 800 is controlled, To indicate that overtime control server 800 returns to timeout mode behind default very first time interval, send this request to simultaneously Corresponding script unit example, the request is sent by the script unit example to obtain and responds the data of the request, then to super Time control uniform business sends the overtime control instruction for cancelling the request, if receiving timeout mode, between default second time Every rear, the request is re-transmitted to overtime control server 800 and corresponding script unit example.For convenience of description, to hold Illustrated exemplified by script unit example C11 corresponding to this unit B of traveling far and wide 11.In this embodiment, the association of script unit B 11 Assess a bid for tender knowledge and port-mark is http and 8081 respectively, then understand that agreement corresponding to the script unit be http protocol, so as to first Using http protocol generation and 11 corresponding HTTP request of script unit B, and from above-mentioned script file A1 "<method> GET</method>" sentence understand, the type of the HTTP request is GET types.Next, the HTTP request is sent to time-out Server 800 is controlled, any data processing can't be carried out in overtime control server 800, simply at very first time interval Timeout mode is returned afterwards to prompt script to perform time-out, and above-mentioned timeout mode will return to the call back function pre-set In.While the HTTP request is sent to overtime control server 800, the HTTP request can be also sent to corresponding script Unit example C11, herein, script unit example C11 are interpreted as the client for sending HTTP request.And then pass through this Client sends the HTTP request to obtain the data of the response HTTP request.
In fact, computing device 200 also communicates to connect with test server (not shown in Fig. 4), the test server is used In receiving request corresponding with agreement, such as above-mentioned HTTP request, responded according to the request to generate test result, and Computing device 200 is returned to using test result as the data of respond request, more precisely returns to and sends the request Client, then cancelled and should asked so that call back function is sent to overtime control server 800 to call back function by the client feedback The overtime control instruction asked.Therefore, receive test server as client in script unit example C11 and respond what it sent After the data of HTTP request, mandatum cassatorium is sent to overtime control server 800 based on call back function, cancels the HTTP request pair The overtime control answered, mitigate the pressure of overtime control server 800, avoid the wasting of resources.If it should be noted that receive super When state, then after the second time interval, the request is re-transmitted to overtime control server 800 and corresponding script unit Example, on the one hand monitors timeout mode again using overtime control server 800, on the other hand indicates that corresponding script unit shows Example continues to initiate the request to obtain response data, so as to re-execute script.Certainly, if timeout mode reception number is excessive, The request is then no longer resend to overtime control server 800 and corresponding script unit example, but records script error So that problem is investigated in later stage debugging, prevent from largely sending futile requests and performing wrong script causing unnecessary system resource Consumed with time cost.
Fig. 5 shows the schematic diagram of script performs device 500 according to an embodiment of the invention.As shown in figure 4, script Performs device 500 includes receiving module 510, acquisition module 520, serialization module 530, parsing module 540, order module 550 With execution module 560.
Receiving module 510 is suitable to receive the script execute instruction that dispatch server 600 issues, and script execute instruction includes treating The script mark of perform script.The detail of the execution aforesaid operations of receiving module 510 can be found in the step in method 300 S310, do not repeated herein.
Acquisition module 520 is connected with receiving module 510, corresponding with script mark suitable for being obtained from file server 700 Script file, script file is associated with unique script mark and including multiple script unit, each script unit with pair The attribute information answered, attribute information include protocol-identifier and port-mark.Acquisition module 520 performs the detail of aforesaid operations Reference can be made to the step S320 in method 300, is not repeated herein.
Serialization module 530 is connected with acquisition module 520, suitable for the processing of script file Perform sequenceization.Serialize mould The detail of the execution aforesaid operations of block 530 can be found in the step S330 in method 300, not repeated herein.
Parsing module 540 and the sequence of serialization module 530, the script file after being serialized suitable for parsing are real to obtain script Example, example script include multiple script unit examples corresponding with script unit.Parsing module 540 is further adapted for serializing Each script unit included by script file afterwards is parsed respectively;Marked according to the protocol-identifier of each script unit and port Know, instantiate the script unit to generate corresponding script unit example;Each script unit example for being generated is combined to be formed Example script corresponding with script file.The detail of the execution aforesaid operations of parsing module 540 can be found in the step in method 300 Rapid S340, is not repeated herein.
Order module 550 is connected with serialization module 530, is handled suitable for being ranked up to each script unit to obtain the pin The execution order of this unit.Attribute information also includes index mark and reference identification, order module 550 are further adapted for according to rope The order that tendering knows from small to large carries out a minor sort to each script unit;According to the order of reference identification from small to large to Each script unit of same index mark carries out two minor sorts, to obtain the execution order of the script unit.Order module 550 is held The detail of row aforesaid operations can be found in the step S350 in method 300, not repeated herein.
Execution module 560 is connected with parsing module 540 and order module 550 respectively, suitable for for each script unit, pressing According to the execution order of each script unit, according to the protocol-identifier and port-mark of the script unit, held using corresponding agreement The corresponding script unit example of row.Wherein, agreement includes http protocol, HTTPS agreements, WebSocket agreements, Socket associations One or more in view, MQTT agreements, Transmission Control Protocol and udp protocol.Computing device 200 also with overtime control server 800 Communication connection, execution module 560 are further adapted for protocol-identifier and port-mark according to the script unit, utilize corresponding association Asked corresponding to view generation;Overtime control server 800 is sent this request to, to indicate overtime control server 800 pre- If the very first time return to timeout mode behind interval;Send this request in corresponding script unit example, pass through the script Unit example sends the request and responds the data of the request to obtain, rear sent to overtime control service cancel the super of the request When control instruction;When receiving timeout mode, after default second time interval, the request is re-transmitted to overtime control Control server 800 and corresponding script unit example.The detail that execution module 560 performs aforesaid operations can be found in method Step S360 in 300, is not repeated herein.
The existing software sent to being related to various protocols mixing is carried out in the scheme of pressure test, in perform script, Typically use http protocol and sent to make requests on, have ignored other procotols, and script format be not easy to expand with Increase protocol-dependent script unit newly.The technical scheme that script according to embodiments of the present invention performs, to the script text got Part first carries out serializing processing, then is parsed to obtain example script, and the example script includes multiple corresponding with script unit Script unit example, to each script unit be ranked up processing to obtain the execution order of the script unit, for each pin This unit, according to the execution order of each script unit, according to the protocol-identifier and port-mark of the script unit, using corresponding Agreement performs corresponding script unit example.In such scheme, when carrying out dissection process to the script file after serializing, It is that each script unit included by script file is parsed respectively, protocol-identifier and port further according to each script unit Identify to instantiate with script unit example corresponding to generation, so as to the agreement and port-mark of later use and the script unit Corresponding agreement performs corresponding script unit example, is easy to carry out pressure test to the client for being related to the mixed hair of multi-protocols, More test scenes are can adapt to, and dynamic expansion can also be carried out when there is new agreement, quickly realize that function changes In generation, the proposition speed of newly-increased protocol solutions is substantially increased, further, in perform script unit example, also passed through Time-out control unit come to perform the time be controlled, avoid for a long time be not responding to request bring script perform be absorbed in without response shape State is always maintained at execution state, wastes system resource.In addition, the execution order of each script unit is by the script unit Index mark and reference identification carry out two minor sorts and generated, and ensure that the relevance between each script unit is closed with level System.
B8. the device as described in B6 or 7, the attribute information also include index mark and reference identification, the sequence mould Block is further adapted for:
One minor sort is carried out to each script unit according to the order of the index mark from small to large;
Each script unit identified with same index is carried out according to the order of the reference identification from small to large secondary Sequence, to obtain the execution order of the script unit.
B9. the device as any one of B6-8, the computing device are also connected with overtime control server communication, institute Execution module is stated to be further adapted for:
According to the protocol-identifier and port-mark of the script unit, request corresponding to corresponding protocol generation is utilized;
The overtime control server is sent this request to, to indicate the overtime control server default first Timeout mode is returned after time interval;
Send this request in corresponding script unit example, the request is sent to obtain by the script unit example Respond the data of the request, it is rear to the overtime control service send cancel the request overtime control instruct;
When receiving the timeout mode, after default second time interval, the request is re-transmitted to described Overtime control server and corresponding script unit example.
B10. the device as any one of B6-9, the agreement include http protocol, HTTPS agreements, WebSocket One or more in agreement, Socket agreements, MQTT agreements, Transmission Control Protocol and udp protocol.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, knot is not been shown in detail Structure and technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield are than the feature more features that is expressly recited in each claim.More precisely, as following As claims reflect, inventive aspect is all features less than single embodiment disclosed above.Therefore, abide by Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself Separate embodiments as the present invention.
Those skilled in the art should be understood the module or unit or group of the equipment in example disclosed herein Between can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned at and the equipment in the example In different one or more equipment.Module in aforementioned exemplary can be combined as a module or be segmented into addition multiple Submodule.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or group between be combined into one between module or unit or group, and can be divided into addition multiple submodule or subelement or Between subgroup.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed One of meaning mode can use in any combination.
In addition, be described as herein can be by the processor of computer system or by performing for some in the embodiment The method or the combination of method element that other devices of the function are implemented.Therefore, have and be used to implement methods described or method The processor of the necessary instruction of element forms the device for implementing this method or method element.In addition, device embodiment Element described in this is the example of following device:The device is used to implement as in order to performed by implementing the element of the purpose of the invention Function.
Various technologies described herein can combine hardware or software, or combinations thereof is realized together.So as to the present invention Method and apparatus, or some aspects of the process and apparatus of the present invention or part can take embedded tangible media, such as soft The form of program code (instructing) in disk, CD-ROM, hard disk drive or other any machine readable storage mediums, Wherein when program is loaded into the machine of such as computer etc, and is performed by the machine, the machine becomes to put into practice this hair Bright equipment.
In the case where program code performs on programmable computers, computing device generally comprises processor, processor Readable storage medium (including volatibility and nonvolatile memory and/or memory element), at least one input unit, and extremely A few output device.Wherein, memory is arranged to store program codes;Processor is arranged to according to the memory Instruction in the described program code of middle storage, perform the script execution of the present invention.
By way of example and not limitation, computer-readable medium includes computer-readable storage medium and communication media.Calculate Machine computer-readable recording medium includes computer-readable storage medium and communication media.Computer-readable storage medium storage such as computer-readable instruction, The information such as data structure, program module or other data.Communication media is typically modulated with carrier wave or other transmission mechanisms etc. Data-signal processed passes to embody computer-readable instruction, data structure, program module or other data including any information Pass medium.Any combination above is also included within the scope of computer-readable medium.
As used in this, unless specifically stated so, come using ordinal number " first ", " second ", " the 3rd " etc. Description plain objects are merely representative of the different instances for being related to similar object, and are not intended to imply that the object being so described must Must have the time it is upper, spatially, in terms of sequence or given order in any other manner.
Although describing the present invention according to the embodiment of limited quantity, above description, the art are benefited from It is interior it is clear for the skilled person that in the scope of the present invention thus described, it can be envisaged that other embodiments.Additionally, it should be noted that The language that is used in this specification primarily to readable and teaching purpose and select, rather than in order to explain or limit Determine subject of the present invention and select.Therefore, in the case of without departing from the scope and spirit of the appended claims, for this Many modifications and changes will be apparent from for the those of ordinary skill of technical field.For the scope of the present invention, to this The done disclosure of invention is illustrative and not restrictive, and it is intended that the scope of the present invention be defined by the claims appended hereto.

Claims (10)

1. a kind of script execution, suitable for being performed in computing device, the computing device respectively with dispatch server and text Part server communication connects, and is stored with multiple script files in the file server, each script file is associated with uniquely Script identifies and including multiple script unit, and each script unit has corresponding attribute information, and the attribute information includes association Assess a bid for tender knowledge and port-mark, methods described include:
The script execute instruction that the dispatch server issues is received, the script execute instruction includes the script of pending script Mark;
Obtained and the corresponding script file of script mark from the file server;
To script file Perform sequenceization processing;
To obtain example script, the example script includes multiple corresponding with script unit script file after parsing serializing Script unit example;
Processing is ranked up to each script unit to obtain the execution order of the script unit;
For each script unit, according to the execution order of each script unit, according to the protocol-identifier of the script unit and port Mark, corresponding script unit example is performed using corresponding agreement.
2. the method as described in claim 1, the step of script file after the parsing serializing is to obtain example script, wraps Include:
Each script unit included by script file after serializing is parsed respectively;
According to the protocol-identifier and port-mark of each script unit, it is real to generate corresponding script unit to instantiate the script unit Example;
Each script unit example for being generated is combined to form example script corresponding with the script file.
3. method as claimed in claim 1 or 2, the attribute information also includes index mark and reference identification, described to each Script unit is ranked up processing to be included with obtaining the step of the execution order of the script unit:
One minor sort is carried out to each script unit according to the order of the index mark from small to large;
Two minor sorts are carried out to each script unit identified with same index according to the order of the reference identification from small to large, To obtain the execution order of the script unit.
4. such as the method any one of claim 1-3, the computing device is also connected with overtime control server communication, The protocol-identifier and port-mark according to the script unit, corresponding script unit example is performed using corresponding agreement The step of include:
According to the protocol-identifier and port-mark of the script unit, request corresponding to corresponding protocol generation is utilized;
The overtime control server is sent this request to, to indicate the overtime control server in the default very first time Timeout mode is returned behind interval;
Corresponding script unit example is sent this request to, sending the request by the script unit example should to obtain response The data of request, then the overtime control instruction for cancelling the request is sent to the overtime control service;
If receiving the timeout mode, after default second time interval, the request is re-transmitted to the time-out Control server and corresponding script unit example.
5. such as the method any one of claim 1-4, the agreement include http protocol, HTTPS agreements, One or more of WebSocket agreements, Socket agreements, MQTT agreements, Transmission Control Protocol and udp protocol.
6. a kind of script performs device, suitable for residing in computing device, the computing device respectively with dispatch server and text Part server communication connects, and is stored with multiple script files in the file server, each script file is associated with uniquely Script identifies and including multiple script unit, and each script unit has corresponding attribute information, and the attribute information includes association Assess a bid for tender knowledge and port-mark, described device include:
Receiving module, the script execute instruction issued suitable for receiving the dispatch server, the script execute instruction include treating The script mark of perform script;
Acquisition module, suitable for being obtained and the corresponding script file of script mark from the file server;
Serialization module, suitable for script file Perform sequenceization processing;
Parsing module, the script file after being serialized suitable for parsing to obtain example script, the example script include it is multiple with Script unit example corresponding to script unit;
Order module, handled suitable for being ranked up to each script unit to obtain the execution order of the script unit;
Execution module, suitable for for each script unit, according to the execution order of each script unit, according to the association of the script unit Assess a bid for tender knowledge and port-mark, corresponding script unit example is performed using corresponding agreement.
7. device as claimed in claim 6, the parsing module is further adapted for:
Each script unit included by script file after serializing is parsed respectively;
According to the protocol-identifier and port-mark of each script unit, it is real to generate corresponding script unit to instantiate the script unit Example;
Each script unit example for being generated is combined to form example script corresponding with the script file.
8. a kind of computing device, including script performs device as claimed in claims 6 or 7.
9. a kind of computing device, including:
One or more processors;
Memory;And
One or more programs, wherein one or more of program storages are in the memory and are configured as by described one Individual or multiple computing devices, one or more of programs include being used to perform in the method according to claim 1-5 Either method instruction.
10. a kind of computer-readable recording medium for storing one or more programs, one or more of programs include instruction, The instruction is when executed by a computing apparatus so that in method of the computing device according to claim 1-5 Either method.
CN201710769075.XA 2017-08-31 2017-08-31 Script execution method and device and computing equipment Active CN107688538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710769075.XA CN107688538B (en) 2017-08-31 2017-08-31 Script execution method and device and computing equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710769075.XA CN107688538B (en) 2017-08-31 2017-08-31 Script execution method and device and computing equipment

Publications (2)

Publication Number Publication Date
CN107688538A true CN107688538A (en) 2018-02-13
CN107688538B CN107688538B (en) 2020-11-06

Family

ID=61155828

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710769075.XA Active CN107688538B (en) 2017-08-31 2017-08-31 Script execution method and device and computing equipment

Country Status (1)

Country Link
CN (1) CN107688538B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108683521A (en) * 2018-04-20 2018-10-19 厦门爱陆通通信科技有限公司 A kind of device configuration management method based on serial link
CN109117246A (en) * 2018-07-06 2019-01-01 网宿科技股份有限公司 Server and its command executing method, control method
CN109697116A (en) * 2018-08-20 2019-04-30 平安普惠企业管理有限公司 Calamity is for drilling method, device, equipment and readable storage medium storing program for executing
CN111294250A (en) * 2018-12-07 2020-06-16 北京奇虎科技有限公司 Pressure testing method, device and system
CN111931200A (en) * 2020-07-13 2020-11-13 车智互联(北京)科技有限公司 Data serialization method, mobile terminal and readable storage medium
CN112416448A (en) * 2020-12-08 2021-02-26 北京中亦安图科技股份有限公司 Operating system information acquisition method and device
CN112565443A (en) * 2020-12-08 2021-03-26 中煤航测遥感集团有限公司 Internet of things data analysis method, device, equipment and storage medium
CN113901365A (en) * 2021-05-29 2022-01-07 长沙市到家悠享家政服务有限公司 Performance pressure measurement platform and method, electronic equipment and readable medium
CN114691238A (en) * 2022-03-30 2022-07-01 阿波罗智联(北京)科技有限公司 Script file execution method, device, equipment, storage medium and program product

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040133848A1 (en) * 2000-04-26 2004-07-08 Novarra, Inc. System and method for providing and displaying information content
CN101944033A (en) * 2009-07-09 2011-01-12 中兴通讯股份有限公司 Device and method for dynamically supporting multiple protocols in embedded system
CN105279090A (en) * 2015-11-17 2016-01-27 中国建设银行股份有限公司 Test script generating method and test script generating device applied in financial field

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040133848A1 (en) * 2000-04-26 2004-07-08 Novarra, Inc. System and method for providing and displaying information content
CN101944033A (en) * 2009-07-09 2011-01-12 中兴通讯股份有限公司 Device and method for dynamically supporting multiple protocols in embedded system
CN105279090A (en) * 2015-11-17 2016-01-27 中国建设银行股份有限公司 Test script generating method and test script generating device applied in financial field

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SDYY321: "tsung--开源多协议分布式压力测试工具", 《CSDN: HTTPS://BLOG.CSDN.NET/SDYY321/ARTICLE/DETAILS/8863892》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108683521A (en) * 2018-04-20 2018-10-19 厦门爱陆通通信科技有限公司 A kind of device configuration management method based on serial link
CN109117246A (en) * 2018-07-06 2019-01-01 网宿科技股份有限公司 Server and its command executing method, control method
CN109117246B (en) * 2018-07-06 2022-05-10 网宿科技股份有限公司 Server and command execution method and control method thereof
CN109697116A (en) * 2018-08-20 2019-04-30 平安普惠企业管理有限公司 Calamity is for drilling method, device, equipment and readable storage medium storing program for executing
CN111294250A (en) * 2018-12-07 2020-06-16 北京奇虎科技有限公司 Pressure testing method, device and system
CN111294250B (en) * 2018-12-07 2023-05-26 三六零科技集团有限公司 Pressure testing method, device and system
CN111931200A (en) * 2020-07-13 2020-11-13 车智互联(北京)科技有限公司 Data serialization method, mobile terminal and readable storage medium
CN111931200B (en) * 2020-07-13 2024-02-23 车智互联(北京)科技有限公司 Data serialization method, mobile terminal and readable storage medium
CN112416448A (en) * 2020-12-08 2021-02-26 北京中亦安图科技股份有限公司 Operating system information acquisition method and device
CN112565443A (en) * 2020-12-08 2021-03-26 中煤航测遥感集团有限公司 Internet of things data analysis method, device, equipment and storage medium
CN113901365A (en) * 2021-05-29 2022-01-07 长沙市到家悠享家政服务有限公司 Performance pressure measurement platform and method, electronic equipment and readable medium
CN114691238A (en) * 2022-03-30 2022-07-01 阿波罗智联(北京)科技有限公司 Script file execution method, device, equipment, storage medium and program product

Also Published As

Publication number Publication date
CN107688538B (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN107688538A (en) A kind of script execution, device and computing device
US10860398B2 (en) Adapting legacy endpoints to modern APIs
US10521280B2 (en) Event-driven serverless function orchestration
US9201701B2 (en) Method and apparatus for distributing computation closures
US8843646B2 (en) Multi-desktop interaction using nested remote desktop sessions
US9246914B2 (en) Method and apparatus for processing biometric information using distributed computation
KR102270749B1 (en) custom digital components
WO2020233369A1 (en) Method for improving software integration system on basis of simulated port, and related device
WO2020042884A1 (en) Data transmission method and system between internet-of-things devices, and electronic device
CN113505520A (en) Method, device and system for supporting heterogeneous federated learning
CN108900627B (en) Network request method, terminal device and storage medium
US9158657B2 (en) Architecture for remote access to content state
CN114239026A (en) Information desensitization conversion processing method, device, computer equipment and storage medium
CN107734050A (en) A kind of load machine distribution method, computing device and load machine distribution system
WO2019024275A1 (en) Page loading method, device and computer equipment
US11748292B2 (en) FPGA implementation of low latency architecture of XGBoost for inference and method therefor
CN115374207A (en) Service processing method and device, electronic equipment and computer readable storage medium
US20150032789A1 (en) Dynamic object oriented remote instantiation
CN107508705A (en) The resource tree constructing method and computing device of a kind of HTTP elements
CN109274758A (en) A kind of processing method and calculating equipment of request message
CN105704004B (en) Business data processing method and device
CN114356178B (en) Interactive content configuration method and device, terminal equipment and storage medium
CN116760717B (en) Communication path query method, device, electronic equipment and computer readable medium
EP4145317A1 (en) Specifying and testing open communication protocols
CN114237691A (en) Information processing method, information processing apparatus, server, and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20191211

Address after: 610000 No.11, 29th floor, building 3, No.88, Jitai 5th Road, hi tech Zone, Chengdu City, Sichuan Province

Applicant after: Sichuan Ruixiang Technology Co.,Ltd.

Address before: 100189, Beijing, Haidian District, 66 west side road, No. three or four, Zhongguancun Dongsheng science and Technology Park, building A-5

Applicant before: BEIJING ONEAPM Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230309

Address after: 100193 room 101-216, 2nd floor, building 4, East District, yard 10, northwest Wangdong Road, Haidian District, Beijing

Patentee after: Beijing Ruixiang Technology Co.,Ltd.

Address before: No. 11, 29/F, Building 3, No. 88, Jitai Fifth Road, High-tech Zone, Chengdu, Sichuan, 610000

Patentee before: Sichuan Ruixiang Technology Co.,Ltd.

TR01 Transfer of patent right