CN110728009A - Simulation method, device and system - Google Patents

Simulation method, device and system Download PDF

Info

Publication number
CN110728009A
CN110728009A CN201810685011.6A CN201810685011A CN110728009A CN 110728009 A CN110728009 A CN 110728009A CN 201810685011 A CN201810685011 A CN 201810685011A CN 110728009 A CN110728009 A CN 110728009A
Authority
CN
China
Prior art keywords
simulation
algorithm program
software
operation result
http request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810685011.6A
Other languages
Chinese (zh)
Inventor
高志蓬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810685011.6A priority Critical patent/CN110728009A/en
Publication of CN110728009A publication Critical patent/CN110728009A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a simulation method, a simulation device and a simulation system, and relates to the technical field of computers. One embodiment of the method comprises: sending the operation parameters in the simulation process to an algorithm program through an http request; and obtaining an operation result obtained by the operation of the algorithm program according to the operation parameter through the http response so as to perform simulation. The implementation method can avoid the problems of complex configuration and the like caused by introducing a third party such as a database, and has the advantages of simple configuration, strong portability and the like; meanwhile, the blocking type simulation between the simulation software and the algorithm program can be realized, so that the simulation software can obtain the feedback of the algorithm program in time, thereby ensuring the running speed of the simulation software and the accuracy and the effectiveness of the simulation result.

Description

Simulation method, device and system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a simulation method, apparatus, and system.
Background
Simulation (Simulation), i.e., system modeling for different project systems, reproducing essential processes occurring in an actual system using models, and studying existing or designing systems by experiments on system models. For example: the logistics simulation is to perform system modeling on a logistics system, program a corresponding simulation program on an electronic computer, simulate the operation condition of the actual logistics system, and count and analyze the simulation result to guide the planning design and operation management of the actual logistics system. In the design process of the unmanned warehouse of the logistics system, the realization of the functions of order grouping, production scheduling, resource matching and the like all relate to a large number of professional algorithms, and algorithm programs all need to be simulated to simulate the realization process of the algorithms.
Generally, the language used by the simulation software is simple relative to a complex algorithm program, and therefore, certain functions of the complex algorithm cannot be realized. Fig. 1 is a schematic diagram of an implementation principle of a conventional system simulation. As shown in fig. 1, the technical solution of the existing system simulation is: the database is used as a medium, the simulation software continuously runs, the algorithm program synchronously runs, and the simulation software and the algorithm program realize data interaction of the simulation software and the algorithm program by continuously scanning the content of the database.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1. the algorithm program and the simulation software carry out data interaction through the database, the simulation clock always advances when the simulation software runs and does not stop waiting for the operation result of the algorithm program, so that the situation that the simulation result is inaccurate because the algorithm cannot give feedback in time when the subsequent simulation can be carried out only by the result of the algorithm program in the running process of the simulation software inevitably occurs;
2. for the situation in 1, although the running speed of the simulation software is reduced to be the same as or even lower than the running speed of the algorithm program, the situation can be relieved to a certain extent, but the simulation efficiency needs to be sacrificed, and the simulation result cannot be completely accurate, so that the balance between the running speed of the simulation software and the accuracy of the simulation result is difficult to achieve;
3. meanwhile, in the existing simulation process, an algorithm program, a database and simulation software need to be configured, and because the simulation software needs to link the database through ODBC (open database interconnection), the configuration is very complicated, the transportability is poor, the link is not stable enough, and a large amount of time is wasted due to repeated configuration.
Disclosure of Invention
In view of this, embodiments of the present invention provide a simulation method, apparatus, and system, which can avoid the problem of complicated configuration caused by introducing a third party such as a database, and have the advantages of simple configuration, strong portability, and the like; meanwhile, the blocking type simulation between the simulation software and the algorithm program can be realized, so that the simulation software can obtain the feedback of the algorithm program in time, thereby ensuring the running speed of the simulation software and the accuracy and the effectiveness of the simulation result.
To achieve the above object, according to an aspect of an embodiment of the present invention, a simulation method is provided.
A simulation method, comprising: sending the operation parameters in the simulation process to an algorithm program through an http request; and obtaining an operation result obtained by the algorithm program according to the operation parameter through http response so as to perform simulation.
Optionally, the method further comprises: after the operation parameters in the simulation process are sent to the algorithm program through an http request, the simulation is suspended; and after an operation result obtained by the algorithm program through operation according to the operation parameters is obtained through http response, continuing simulation according to the operation result.
Optionally, by setting the corresponding relationship between the simulation software and the algorithm program and the data transmission rule in advance, the algorithm program can receive and identify the http request of the simulation software.
Optionally, sending the operation parameter in the simulation process to the algorithm program through an http request includes: converting the operation parameters of the simulation process into character strings, and sending the character strings to the algorithm program through an http request; and obtaining an operation result obtained by the algorithm program operated according to the operation parameter through http response comprises: and receiving the character string generated by the algorithm program through http response, and converting the received character string into the operation result.
According to another aspect of the embodiments of the present invention, there is provided a simulation apparatus.
An emulation apparatus comprising: the data request module is used for sending the operation parameters in the simulation process to the algorithm program through an http request; and the result receiving module is used for acquiring an operation result obtained by the algorithm program through http response according to the operation parameter so as to perform simulation.
Optionally, the apparatus is further configured to: after the operation parameters in the simulation process are sent to the algorithm program through an http request, the simulation is suspended; and after an operation result obtained by the algorithm program through operation according to the operation parameters is obtained through http response, continuing simulation according to the operation result.
Optionally, by setting the corresponding relationship between the simulation software and the algorithm program and the data transmission rule in advance, the algorithm program can receive and identify the http request of the simulation software.
Optionally, the data request module is further configured to: converting the operation parameters of the simulation process into character strings, and sending the character strings to the algorithm program through an http request; and the result receiving module is further configured to: and receiving the character string generated by the algorithm program through http response, and converting the received character string into the operation result.
According to yet another aspect of an embodiment of the present invention, a simulation system is provided.
A simulation system comprises simulation software and an algorithm program, wherein the simulation software is used for sending operation parameters in a simulation process to the algorithm program through an http request; and obtaining an operation result returned by the algorithm program through http response to perform simulation; and the algorithm program is used for performing operation according to the operation parameters to obtain an operation result and returning the operation result to the simulation software.
According to yet another aspect of an embodiment of the present invention, there is provided an electronic device for simulation.
An electronic device for simulation, comprising: one or more processors; the storage device is used for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors realize the simulation method provided by the embodiment of the invention.
According to yet another aspect of embodiments of the present invention, a computer-readable medium is provided.
A computer-readable medium, on which a computer program is stored, which, when executed by a processor, implements the simulation method provided by an embodiment of the present invention.
One embodiment of the above invention has the following advantages or benefits: the operation parameters in the simulation process are sent to the algorithm program through the http request, and the operation result obtained by the algorithm program through the http response and operation according to the operation parameters is obtained for simulation, so that the direct data interaction between the simulation software and the algorithm program is realized, the problems of complicated configuration and the like caused by the introduction of a third party such as a database can be avoided, and the method has the advantages of simple configuration, strong transportability and the like; meanwhile, when the simulation software needs the result of the algorithm program to perform subsequent simulation, the simulation is suspended, and the simulation is continued again after the operation result of the algorithm program is obtained, so that the blocking type simulation between the simulation software and the algorithm program is realized, the simulation software can timely (relative to the simulation time, the simulation clock is stopped due to the simulation blocking) obtain the feedback of the algorithm program, the running speed of the simulation software is ensured, and the accuracy and the effectiveness of the simulation result are also ensured.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of an implementation principle of a conventional system simulation;
FIG. 2 is a schematic diagram of an implementation principle of system simulation according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of the main steps of a simulation method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of a data transmission process according to an embodiment of the present invention;
FIG. 5 is a simulation system architecture diagram of an embodiment of the present invention;
FIG. 6 is a schematic diagram of the main modules of an emulation apparatus according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
According to the existing simulation method, when the simulation software needs the result of the algorithm program to perform subsequent simulation, the algorithm program is called by the following method: firstly, simulation software writes state parameters of a system as operation parameters into a database, then an algorithm program performs operation according to the content of the database to obtain an operation result, the operation result is written into the database, and finally, the simulation software reads the operation result from the database again, so that one-time calling of the algorithm program is completed. From this process, it can be seen that the essence of the data interaction of the simulation software and the algorithm program is: when the simulation software encounters a complex problem which cannot be solved by the simulation software, an algorithm program is called to carry out operation solving according to the state parameters of the current system, and the obtained solution is used as parameters required by the subsequent simulation of the simulation software. However, the existing simulation method needs to use a database as an intermediary for data interaction between simulation software and an algorithm program, so that the defects of complex configuration, poor portability, unstable link and the like exist, and the existing simulation method still continues to operate the simulation software when the algorithm program is operated and solved, so that a large amount of data is lost, and the simulation result is inaccurate.
In order to solve the problems of inaccurate simulation result, fussy configuration, poor transportability and the like in the existing simulation method, the invention provides a simulation method, a device and a system, which can avoid the problems of complicated configuration and the like caused by introducing a third party such as a database by directly carrying out data interaction between simulation software and an algorithm program; meanwhile, when the simulation software needs the result of the algorithm program to perform subsequent simulation, the simulation is suspended, and the simulation is continued again after the operation result of the algorithm program is obtained, so that the blocking type simulation between the simulation software and the algorithm program is realized, the simulation software can timely obtain the feedback of the algorithm program, and the running speed of the simulation software is ensured, and the accuracy and the effectiveness of the simulation result are also ensured.
In one embodiment of the invention, when the simulation software runs to a certain moment and needs to call an algorithm program to perform operation solving, the simulation software can send operation parameters to the algorithm program through an http request, and then the simulation software can wait for the return of an operation result and continue a subsequent simulation process; the other simulation steps can be directly carried out without waiting for the return of the operation result, and the operation result returned by the algorithm program through http response is received before the expiration of the preset timer, namely, the simulation software can asynchronously process the operation result. Therefore, data interaction between the simulation software and the algorithm program can be directly carried out without depending on a third party such as a database, and the configuration and maintenance of the simulation system are simplified.
Fig. 2 is a schematic diagram of an implementation principle of system simulation according to an embodiment of the present invention. In another embodiment of the present invention, as shown in fig. 2, the simulation software needs to call an algorithm program to perform the operation solving when running to the simulation time T1. The time interval for the algorithm program to calculate and solve is from the actual time Ta to the actual time Tb, namely: and the running time T of the algorithm program is Tb-Ta. According to the embodiment of the invention, the simulation is in a blocking state in the time interval of the arithmetic program for arithmetic solution, so that the simulation time T2 of the simulation software is equal to T1 at the end of the arithmetic program operation, namely, the simulation is suspended. So as to ensure the accuracy of the simulation result. How to realize the simulated blocking is then the key of the present invention.
Fig. 3 is a schematic diagram of main steps of a simulation method according to an embodiment of the present invention. As shown in fig. 3, the simulation method according to the embodiment of the present invention mainly includes the following steps S301 and S302.
Step S301: sending the operation parameters in the simulation process to an algorithm program through an http request;
step S302: and obtaining an operation result obtained by the operation of the algorithm program according to the operation parameter through the http response so as to perform simulation.
Because the simulation software can send an http (hypertext transfer protocol) request when performing data interaction with the algorithm program, the http request can carry operation parameters of related data, and after sending the http request, the simulation software will continue to execute until receiving feedback, therefore, during the period from the time the simulation software sends the http request to the time the simulation software receives feedback, the simulation clock is stopped, that is: in a simulated blocking state. Meanwhile, the algorithm program is generally realized by Python or Java and other languages, and the http request can be received and recognized by simply setting the languages. Therefore, in the invention, the algorithm program can receive and identify the http request of the simulation software by setting the corresponding relation between the simulation software and the algorithm program and the data transmission rule in advance.
Specifically, an http interface can be developed in the algorithm program for receiving an http request of the simulation software, and information such as a domain name, an IP address and/or a port number of the simulation software is correspondingly associated with a network address, an IP address and/or a port number of the algorithm program to establish a corresponding relationship between the simulation software and the algorithm program, a data transmission rule is generated according to a transmission format, transmission content and the like agreed between the simulation software and the algorithm program, then the simulation software and the algorithm program are set according to the established corresponding relationship between the simulation software and the algorithm program and the generated data transmission rule, so that operation parameters corresponding to data required by various complex algorithms in the simulation process can be sent to the algorithm program through the http request, and after receiving an http response, an operation result obtained by the http response acquisition algorithm program according to the operation parameters is simulated, therefore, the algorithm program and the simulation software directly carry out data interaction.
In addition, after the operation parameters in the simulation process are sent to the algorithm program through the http request, the simulation software can also suspend the simulation until the http response is received, the operation result obtained by the algorithm program through operation according to the operation parameters is obtained through the http response, and the simulation software can continue the simulation. In this way, simulated blocking can be achieved by the nature of the http request.
According to the embodiment of the present invention, when data transmission is performed between the simulation software and the algorithm program, since the information included in the http request is a character string, and the data required by the simulation software for simulation is generally a numerical value, when the operation parameter in the simulation process is sent to the algorithm program through the http request in step S301, the operation parameter may specifically be: converting the operation parameters in the simulation process into character strings, and sending the character strings to an algorithm program through an http request; in addition, when the http response acquisition algorithm program calculates the obtained calculation result according to the calculation parameter in step S302, specifically, the calculation result may be: and responding to the character string generated by the receiving algorithm program through http, and converting the received character string into an operation result.
The process of data transmission between the simulation software and the algorithm program is described below with reference to fig. 4.
Fig. 4 is a schematic diagram of a data transmission process according to an embodiment of the present invention. As shown in fig. 4, in an embodiment of the present invention, when simulation software needs to call an algorithm program for simulation, first, the simulation software converts an operation parameter in a simulation process into a character string according to a data transmission rule, and then sends the character string to the algorithm program through an http request; after receiving the http request, the algorithm program analyzes the character string to obtain operation parameters of data required in the simulation process, wherein the operation parameters comprise current state parameters of the simulation system, simulation model information and the like, and carries out operation solving to obtain an operation result, and then returns the operation result to the simulation software in the form of the character string through http response; after receiving the http response returned by the algorithm program, the simulation software converts the character strings in the http response into operation results (such as numerical values), and uses the numerical values obtained after conversion as data required by simulation to continue the simulation.
The data transmission process of the present invention is described below in conjunction with a specific embodiment and compared to prior art implementations. Suppose that simulation software needs to calculate the power b of a (for example only, an actual business scenario may be a complex problem of route planning, model solution, etc.), but there is no tool in the simulation software to calculate, and therefore, an algorithm program needs to be called to perform calculation.
According to the technical scheme of the invention, firstly, simulation software converts operation parameters in a simulation process into character strings, wherein the operation parameters comprise current state parameters a and b of a simulation system and simulation model information, and the model is assumed to be' model 1: a isb"according to the data transmission rule agreed with the algorithm program, the character string converted from the operation parameter is, for example: "a, b, 1"; then, the converted character string "a, b, 1" is sent to the algorithm program by http request. After receiving the http request, the algorithm program firstly analyzes the character string in the http request to obtain the state parameters a and b and the model 1; then, the algorithm program will use a, b as the parameter to run the corresponding algorithm of model 1, and get the operation result; and then, returning the operation result to the simulation software in a character string form through an http response. After receiving the http response returned by the algorithm program, the simulation software converts the character string in the http response into an operation result (such as a numerical value), and takes the numerical value obtained after the conversion as a simulation resultData needed to continue the simulation. In this process, the simulation clock of the simulation software is stopped, i.e.: the simulation software is in a simulation blocking state, so that the accuracy and the effectiveness of data can be ensured.
According to the prior technical scheme, firstly, simulation software writes current state parameters a and b of a simulation system into a database; then, the algorithm program reads data from the database at fixed time intervals, and then calculates and writes the operation result of the b power of a into the database; after the current state parameters a and b of the simulation system are written into the database, the simulation software also continuously reads the database at fixed time intervals until the operation result written by the algorithm program is obtained. In the process, after the simulation software writes the current state parameters a and b of the simulation system into the database, the simulation is continuously running, and the simulation clock does not stop, so that a large amount of data is lost in the simulation system, and the simulation result is inaccurate.
It can be seen from the foregoing description that, by using the technical solution of the present invention, a blocking type simulation between simulation software and an algorithm program can be realized, and compared with the prior art, the simulation software can obtain the feedback of the algorithm program in time (with respect to simulation time, since a simulation clock is stopped due to simulation blocking), so that the accuracy and validity of data can be ensured, and the simulation speed does not need to be limited, thereby improving the simulation efficiency.
In addition, the invention also provides a simulation system which comprises simulation software and an algorithm program, wherein the simulation software is used for sending the operation parameters in the simulation process to the algorithm program through an http request; and obtaining an operation result returned by the algorithm program through http response to perform simulation; the algorithm program is used for performing operation according to the operation parameters to obtain an operation result and returning the operation result to the simulation software.
Wherein, the simulation software and the algorithm program included in the simulation system are not limited to one. For a simulation system with multiple simulation software and multiple algorithm programs, it may be deployed as shown in FIG. 5. FIG. 5 is a diagram of a simulation system architecture according to an embodiment of the present invention. As can be seen from fig. 5, a plurality of simulation software may be deployed on one or more simulation servers, specifically, in this embodiment, simulation 1 is deployed on simulation server 1, and simulation 2 and simulation 3 are deployed on simulation server 2. After the algorithm program is developed on a personal computer of an algorithm developer, the algorithm program can be intensively deployed on a Central Processing Unit (CPU), wherein the central processing unit refers to a server with strong single-core performance of the CPU. Likewise, the central nervous system is not limited to one. In this embodiment, a central neural machine is taken as an example to introduce a specific architecture of the simulation system.
On the central neural machine, different port services can be opened for different algorithm programs. For example: algorithm 1 corresponds to service 1 deployed on a central nervous machine, the central nervous machine opens a port 8080 for the service 1, and meanwhile, the simulation software sends an http request to the central nervous machine through the port 80, so that the algorithm 1 can obtain a call instruction of the simulation software to the algorithm 1 by monitoring the request received by http://127.0.0.1: 8080. Wherein 127.0.0.1 is an IP (internet protocol, protocol for interconnection between networks) address of the central host in the lan. In the description of the embodiment of the present invention, the IP address, the network address, the port number, the domain name, and the like are examples, which are not unique, and can be flexibly set according to the needs of practical applications, and the present invention is not limited to this. In the embodiment shown in fig. 5, algorithm 1, algorithm 2, and algorithm 3 correspond to service 1, service 2, and service 3 deployed on the central server, respectively, and the port number of the central server opened for service 1 is 8080, the port number opened for service 2 is 8081, and the port number opened for service 3 is 8082.
In the embodiment of the present invention, an Apache Http Server (Apache, which is a Web Server side software and is often used in a distributed system) is used to perform port forwarding, specifically: the corresponding relation between the port and the domain name of the simulation software is stored in Apache, meanwhile, the appointed domain name of the simulation software is bound with the IP of a central nervous machine in a hosts (a system file without an extension name is used for establishing a relevant 'database' between some commonly used website domain names and the corresponding IP addresses of the commonly used website domain names, when a user inputs a website needing to be logged in a browser, the system can automatically find the corresponding IP address from the hosts file at first) file of the simulation server, and the simulation server and the central nervous machine are arranged in the same local area network.
When the simulation server sends an http request to the central nervous machine, the Apache can forward the request to the specified port according to the domain name information corresponding to the received request. For example, assuming that simulation 1 is the simulation software corresponding to algorithm 1 and service 1, the domain names assigned to simulation 1 are: service (for example only). Then, when Apache receives the http request sent by emulation 1, according to the corresponding relationship between the pre-stored port and the domain name of the emulation software, the Apache can forward the request sent by the domain name to http://127.0.0.1:8080 for processing, thereby realizing the data interaction with algorithm 1.
Through the simulation system architecture shown in fig. 5, multi-algorithm synchronous simulation can be performed quickly and efficiently.
FIG. 6 is a schematic diagram of the main modules of an emulation apparatus according to an embodiment of the present invention. As shown in fig. 6, the simulation apparatus 600 according to the embodiment of the present invention mainly includes a data request module 601 and a result receiving module 602.
The data request module 601 is used for sending the operation parameters in the simulation process to the algorithm program through an http request;
the result receiving module 602 is configured to obtain an operation result obtained by an algorithm program according to the operation parameter through an http response for simulation.
The simulation apparatus 600 of the embodiment of the present invention may be further configured to:
after the operation parameters in the simulation process are sent to the algorithm program through an http request, the simulation is suspended;
and after the operation result obtained by the algorithm program according to the operation parameters is obtained through http response, continuing simulation according to the operation result.
According to the technical scheme of the invention, the corresponding relation between the simulation software and the algorithm program and the data transmission rule are preset, so that the algorithm program can receive and identify the http request of the simulation software.
According to the technical solution of the embodiment of the present invention, the data request module 601 may be further configured to:
converting the operation parameters in the simulation process into character strings, and sending the character strings to an algorithm program through an http request;
also, the result receiving module 602 may be further configured to:
and responding to the character string generated by the receiving algorithm program through http, and converting the received character string into an operation result.
According to the technical scheme of the embodiment of the invention, the operation parameters in the simulation process are sent to the algorithm program through the http request, and the operation result obtained by the algorithm program through operation according to the operation parameters is obtained through the http response to carry out simulation, so that the direct data interaction between the simulation software and the algorithm program is realized, the problems of complicated configuration and the like caused by the introduction of a third party such as a database can be avoided, and the method has the advantages of simple configuration, strong transportability and the like; meanwhile, when the simulation software needs the result of the algorithm program to perform subsequent simulation, the simulation is suspended, and the simulation is continued again after the operation result of the algorithm program is obtained, so that the blocking type simulation between the simulation software and the algorithm program is realized, the simulation software can timely (relative to the simulation time, the simulation clock is stopped due to the simulation blocking) obtain the feedback of the algorithm program, the running speed of the simulation software is ensured, and the accuracy and the effectiveness of the simulation result are also ensured.
FIG. 7 illustrates an exemplary system architecture 700 to which the simulation method or simulation apparatus of embodiments of the present invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. The terminal devices 701, 702, 703 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 701, 702, 703. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the simulation method provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the simulation apparatus is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device or server implementing an embodiment of the present invention. The terminal device or the server shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, and may be described as: a processor includes a data request module and a result reception module. The names of these units or modules do not in some cases constitute a limitation on the units or modules themselves, and for example, the data request module may also be described as a "module for sending the operation parameters in the simulation process to the algorithm program through http request".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: sending the operation parameters in the simulation process to an algorithm program through an http request; and obtaining an operation result obtained by the algorithm program according to the operation parameter through http response so as to perform simulation.
According to the technical scheme of the embodiment of the invention, the operation parameters in the simulation process are sent to the algorithm program through the http request, and the operation result obtained by the algorithm program through operation according to the operation parameters is obtained through the http response to carry out simulation, so that the direct data interaction between the simulation software and the algorithm program is realized, the problems of complicated configuration and the like caused by the introduction of a third party such as a database can be avoided, and the method has the advantages of simple configuration, strong transportability and the like; meanwhile, when the simulation software needs the result of the algorithm program to perform subsequent simulation, the simulation is suspended, and the simulation is continued again after the operation result of the algorithm program is obtained, so that the blocking type simulation between the simulation software and the algorithm program is realized, the simulation software can timely (relative to the simulation time, the simulation clock is stopped due to the simulation blocking) obtain the feedback of the algorithm program, the running speed of the simulation software is ensured, and the accuracy and the effectiveness of the simulation result are also ensured.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A simulation method, comprising:
sending the operation parameters in the simulation process to an algorithm program through an http request;
and obtaining an operation result obtained by the algorithm program according to the operation parameter through http response so as to perform simulation.
2. The simulation method of claim 1, further comprising:
after the operation parameters in the simulation process are sent to the algorithm program through an http request, the simulation is suspended;
and after an operation result obtained by the algorithm program through operation according to the operation parameters is obtained through http response, continuing simulation according to the operation result.
3. The simulation method according to claim 1 or 2, wherein the algorithm program is enabled to receive and recognize the http request of the simulation software by setting the corresponding relationship between the simulation software and the algorithm program and the data transmission rule in advance.
4. The simulation method according to claim 1 or 2,
sending the operation parameters in the simulation process to the algorithm program through an http request comprises the following steps:
converting the operation parameters of the simulation process into character strings, and sending the character strings to the algorithm program through an http request; and the number of the first and second electrodes,
obtaining an operation result obtained by the algorithm program through http response and operated according to the operation parameter, wherein the operation result comprises:
and receiving the character string generated by the algorithm program through http response, and converting the received character string into the operation result.
5. An emulation apparatus, comprising:
the data request module is used for sending the operation parameters in the simulation process to the algorithm program through an http request;
and the result receiving module is used for acquiring an operation result obtained by the algorithm program through http response according to the operation parameter so as to perform simulation.
6. The emulation apparatus of claim 5, wherein the apparatus is further configured to:
after the operation parameters in the simulation process are sent to the algorithm program through an http request, the simulation is suspended;
and after an operation result obtained by the algorithm program through operation according to the operation parameters is obtained through http response, continuing simulation according to the operation result.
7. The simulation apparatus according to claim 5 or 6, wherein the algorithm program is enabled to receive and recognize the http request of the simulation software by setting the corresponding relationship between the simulation software and the algorithm program and the data transmission rule in advance.
8. The emulation apparatus according to claim 5 or 6,
the data request module is further configured to:
converting the operation parameters of the simulation process into character strings, and sending the character strings to the algorithm program through an http request; and the number of the first and second electrodes,
the result receiving module is further configured to:
and receiving the character string generated by the algorithm program through http response, and converting the received character string into the operation result.
9. A simulation system, comprising: a simulation software and an algorithm program, wherein,
the simulation software is used for sending the operation parameters in the simulation process to the algorithm program through an http request; and obtaining an operation result returned by the algorithm program through http response to perform simulation;
and the algorithm program is used for performing operation according to the operation parameters to obtain an operation result and returning the operation result to the simulation software.
10. An electronic device for simulation, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-4.
CN201810685011.6A 2018-06-28 2018-06-28 Simulation method, device and system Pending CN110728009A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810685011.6A CN110728009A (en) 2018-06-28 2018-06-28 Simulation method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810685011.6A CN110728009A (en) 2018-06-28 2018-06-28 Simulation method, device and system

Publications (1)

Publication Number Publication Date
CN110728009A true CN110728009A (en) 2020-01-24

Family

ID=69216705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810685011.6A Pending CN110728009A (en) 2018-06-28 2018-06-28 Simulation method, device and system

Country Status (1)

Country Link
CN (1) CN110728009A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111539118A (en) * 2020-04-29 2020-08-14 昆明昆船物流信息产业有限公司 Simulation calculation method and computer program product of circular shuttle system

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030187631A1 (en) * 2002-03-29 2003-10-02 Fujitsu Limited Host-terminal emulation program, a relay program, a host-terminal emulation method, a communication program, a communication method, and a client computer
CN1750485A (en) * 2005-07-14 2006-03-22 牛伟 Network simulation detection system and method
CN101571860A (en) * 2008-04-29 2009-11-04 国际商业机器公司 Method and device for generating dynamic website as well as method and device for extracting structural data
CN104007974A (en) * 2014-05-30 2014-08-27 电子科技大学 System and method for online simulation and remote verification of robot applications
CN106897107A (en) * 2017-01-18 2017-06-27 华南理工大学 A kind of web teledatas calculating realizes system and method with emulation
CN107273618A (en) * 2017-06-20 2017-10-20 北京京东尚科信息技术有限公司 Method and apparatus for information transfer between simulation model
CN107295003A (en) * 2017-07-17 2017-10-24 联动优势科技有限公司 A kind of data transmission method, apparatus and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030187631A1 (en) * 2002-03-29 2003-10-02 Fujitsu Limited Host-terminal emulation program, a relay program, a host-terminal emulation method, a communication program, a communication method, and a client computer
CN1750485A (en) * 2005-07-14 2006-03-22 牛伟 Network simulation detection system and method
CN101571860A (en) * 2008-04-29 2009-11-04 国际商业机器公司 Method and device for generating dynamic website as well as method and device for extracting structural data
CN104007974A (en) * 2014-05-30 2014-08-27 电子科技大学 System and method for online simulation and remote verification of robot applications
CN106897107A (en) * 2017-01-18 2017-06-27 华南理工大学 A kind of web teledatas calculating realizes system and method with emulation
CN107273618A (en) * 2017-06-20 2017-10-20 北京京东尚科信息技术有限公司 Method and apparatus for information transfer between simulation model
CN107295003A (en) * 2017-07-17 2017-10-24 联动优势科技有限公司 A kind of data transmission method, apparatus and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张聪师, 王兵树, 马永光, 常喜茂: "基于Web的在线实时仿真支撑环境研究", 系统仿真学报, no. 04, pages 462 - 465 *
徐港 等: "远程结构仿真试验的设计与实现", 计算机工程与设计, vol. 27, no. 8, pages 1456 - 1467 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111539118A (en) * 2020-04-29 2020-08-14 昆明昆船物流信息产业有限公司 Simulation calculation method and computer program product of circular shuttle system

Similar Documents

Publication Publication Date Title
CN110019350B (en) Data query method and device based on configuration information
US10951552B2 (en) Generation of a chatbot interface for an application programming interface
US20190163524A1 (en) Method and apparatus for processing task in smart device
CN108334411A (en) Resource transfer method and device based on Redfish in a kind of BMC
CN112507005B (en) Method and device for processing message
CN110795147A (en) Interface protocol file management method and device
CN110321252B (en) Skill service resource scheduling method and device
US11502899B2 (en) Dynamic product installation based on user feedback
CN111125064A (en) Method and device for generating database mode definition statement
WO2022257604A1 (en) Method and apparatus for determining user tag
CN109753424B (en) AB test method and device
CN111984234A (en) Method and device for processing work order
CN110928594A (en) Service development method and platform
CN113190558A (en) Data processing method and system
CN110728009A (en) Simulation method, device and system
CN112068853A (en) Cross-project synchronous updating method and device
CN113282489B (en) Interface testing method and device
CN112306791B (en) Performance monitoring method and device
CN112131095B (en) Pressure testing method and device
CN113779018A (en) Data processing method and device
CN113760487A (en) Service processing method and device
CN111176982A (en) Test interface generation method and device
CN111062682B (en) Work order processing method and device
CN113760886B (en) Method, apparatus, device and computer readable medium for providing data service
CN115577200B (en) Page loading method, device, equipment 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