CN116048845B - Data processing method and device, storage medium and electronic equipment - Google Patents
Data processing method and device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN116048845B CN116048845B CN202310133985.4A CN202310133985A CN116048845B CN 116048845 B CN116048845 B CN 116048845B CN 202310133985 A CN202310133985 A CN 202310133985A CN 116048845 B CN116048845 B CN 116048845B
- Authority
- CN
- China
- Prior art keywords
- data
- processing process
- thread
- communication port
- calculation result
- 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.)
- Active
Links
- 238000003860 storage Methods 0.000 title claims abstract description 24
- 238000003672 processing method Methods 0.000 title abstract description 9
- 238000000034 method Methods 0.000 claims abstract description 284
- 238000012545 processing Methods 0.000 claims abstract description 233
- 230000008569 process Effects 0.000 claims abstract description 204
- 238000004364 calculation method Methods 0.000 claims abstract description 168
- 230000006854 communication Effects 0.000 claims abstract description 154
- 238000004891 communication Methods 0.000 claims description 42
- 238000004590 computer program Methods 0.000 claims description 15
- 238000012163 sequencing technique Methods 0.000 claims description 4
- 230000000903 blocking effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 15
- 230000006870 function Effects 0.000 description 10
- 238000004088 simulation Methods 0.000 description 10
- 230000006872 improvement Effects 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000003287 optical effect Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 239000010979 ruby Substances 0.000 description 2
- 229910001750 ruby Inorganic materials 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000011157 data evaluation Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 238000013178 mathematical model Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 229920001296 polysiloxane Polymers 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/541—Interprogram communication via adapters, e.g. between incompatible applications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- Devices For Executing Special Programs (AREA)
Abstract
The specification discloses a data processing method, a data processing device, a storage medium and electronic equipment. The data processing method comprises the following steps: determining a first processing process corresponding to a first computer programming language and a second processing process corresponding to a second computer programming language, determining at least one calculation thread through the second processing process, calculating data to be processed through each calculation thread to obtain a target calculation result, sending a message corresponding to the target calculation result to a first virtual communication port corresponding to the first processing process through a second virtual communication port corresponding to the second processing process, wherein the data format of the data carried by the message is a data format which can be processed by both the first computer programming language and the second computer programming language, analyzing the message through the first processing process to obtain the target calculation result, and performing data processing on the target calculation result.
Description
Technical Field
The present disclosure relates to the field of data communications technologies, and in particular, to a data processing method, an apparatus, a storage medium, and an electronic device.
Background
Along with the development of simulation technology, the method for performing simulation calculation on data through simulation software starts to replace the traditional method for performing simulation on data generated by physical behaviors through an actual physical model one by one, simulation efficiency is greatly improved due to the fact that the simulation software is arranged, meanwhile, simulation cost is reduced, and a user can quickly change parameters through a visual operation interface to perform data analysis, evaluation and other works on the spot.
In the simulation calculation process of simulation software, a large number of data processing processes are usually involved, and different data processing processes often need a matched computer programming language to complete. For example, the computer programming language corresponding to the process of computing data is typically the C language, while the computer programming language corresponding to the process of processing business logic is typically the Java programming language.
In the actual data processing process, a large amount of data needs to be transmitted between the processes corresponding to different computer programming languages, and the current method needs Java language processes to call a dynamic connection library of a C language process, so that the C language process is packaged into a local method of the Java process, and the local method is used for completing the operation originally carried out by the C language process.
In the above process, the C language process needs to be packaged into a local method of the Java process, and then the data to be processed is calculated, which tends to reduce the data transmission efficiency in different processes, and seriously slows down the speed of the whole data processing process.
Therefore, how to increase the data transmission speed between processes corresponding to different computer programming languages is a problem to be solved.
Disclosure of Invention
The present disclosure provides a data processing method, apparatus, storage medium, and electronic device, so as to partially solve the foregoing problems in the prior art.
The technical scheme adopted in the specification is as follows:
The present specification provides a method of data processing, comprising:
determining a first processing process corresponding to a first computer programming language and a second processing process corresponding to a second computer programming language when a designated application program is operated;
Determining at least one calculation thread aiming at data to be processed through the second processing process, and calculating the data to be processed through each calculation thread after receiving the data to be processed to obtain a target calculation result;
Transmitting a message corresponding to the target calculation result to a first virtual communication port corresponding to the first processing process through a second virtual communication port corresponding to the second processing process, wherein the data format of the data carried by the message is a data format which can be processed by both the first computer programming language and the second computer programming language;
And analyzing the message through the first processing process to obtain the target calculation result, and performing data processing on the target calculation result.
Optionally, the first virtual communication port and the second virtual communication port are Socket communication ports matched with each other.
Optionally, before determining at least one computing thread for the data to be processed by the second processing procedure, the method further comprises:
Starting a preset first virtual communication port corresponding to the first processing process;
And starting the second processing process through the first processing process.
Optionally, the first computer programming language is used for processing business logic, and the second computer programming language is used for calculating data;
The first computer programming language includes: a Java programming language, said second computer programming language comprising: and C language.
Optionally, the second processing process is started through the first processing process, which specifically includes:
Starting the second processing process through the first processing process, and determining the number of computing threads aiming at the data to be processed;
determining, by the second processing procedure, at least one computing thread for the data to be processed, including:
and determining at least one computing thread aiming at the data to be processed according to the number of the computing threads through the second processing process.
Optionally, the first processing process and the second processing process run in the same terminal device;
the method for determining the number of the computing threads aiming at the data to be processed specifically comprises the following steps:
and determining the number of the calculation threads according to the configuration information corresponding to the terminal equipment.
Optionally, determining at least one computing thread for the data to be processed specifically includes:
acquiring a thread number corresponding to the at least one computing thread;
dividing the data to be processed according to the thread numbers, and determining the data range of the data to be processed, which is required to be calculated by each calculation thread.
Optionally, calculating the data to be processed through each calculation thread to obtain a target calculation result, which specifically includes:
sending the calculation result corresponding to each calculation thread and the thread number to a receiving sub-process in the second processing process;
And according to the thread numbers of the calculation results corresponding to the calculation threads received by the receiving subprocess, sequencing and combining the calculation results corresponding to the calculation threads to obtain the target calculation result.
Optionally, sending the calculation result and the thread number corresponding to each calculation thread to a receiving sub-process in the second processing process, which specifically includes:
Judging whether the number of the calculated threads reaches a preset threshold value, if so, sending a calculation result corresponding to the calculated threads and a thread number to a receiving sub-process in the second processing process;
and calculating the data which are not calculated by the rest calculation threads.
Optionally, the sending, by the second virtual communication port corresponding to the second processing process, the message corresponding to the target calculation result to the first virtual communication port corresponding to the first processing process specifically includes:
And judging whether communication connection exists between a receiving subprocess in the second processing process and the second virtual communication port, and if not, establishing communication connection between the receiving subprocess and the second virtual communication port through a communication file descriptor corresponding to the second virtual communication port.
Optionally, before the message corresponding to the target calculation result is sent to the first virtual communication port corresponding to the first processing process through the second virtual communication port corresponding to the second processing process, the method further includes:
Setting the first virtual communication port in the first processing process, setting the second virtual communication port in the second processing process, and creating a communication file;
Binding the communication address and the blocking information corresponding to the communication file with the first virtual communication port, so that the second virtual communication port sends the target calculation result to the first virtual communication port through the communication file after the second virtual communication port is connected with the communication address.
Optionally, analyzing, by the first processing process, the message to obtain the target calculation result, which specifically includes:
Determining the length of the message according to the data before the designated bit number of the message corresponding to the target calculation result through the first processing process, and judging whether all the messages are received according to the data of the designated bit number;
if all the messages are determined to be received, reading byte information with specified length according to the message length, and obtaining the target calculation result according to the read byte information.
Optionally, the method further comprises:
judging whether the first processing process acquires the target calculation result or not;
if yes, closing the first virtual communication port.
Optionally, the method further comprises:
And displaying the processing result corresponding to the target calculation result at the front end of the application program.
The present specification provides an apparatus for data processing, comprising:
The determining module is used for determining a first processing process corresponding to the first computer programming language and a second processing process corresponding to the second computer programming language when the appointed application program is operated;
The computing module is used for determining at least one computing thread aiming at the data to be processed through the second processing process, and computing the data to be processed through each computing thread after receiving the data to be processed to obtain a target computing result;
The sending module is used for sending the message corresponding to the target calculation result to the first virtual communication port corresponding to the first processing process through the second virtual communication port corresponding to the second processing process, wherein the data format of the data carried by the message is a data format which can be processed by both the first computer programming language and the second computer programming language;
and the processing module analyzes the message through the first processing process to obtain the target calculation result and processes the data of the target calculation result.
The present specification provides a computer readable storage medium storing a computer program which when executed by a processor performs the method of data processing described above.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a method of data processing as described above when executing the program.
The above-mentioned at least one technical scheme that this specification adopted can reach following beneficial effect:
In the data processing method provided in the present specification, a terminal device determines a first processing process corresponding to a first computer programming language and a second processing process corresponding to a second computer programming language, determines at least one calculation thread through the second processing process, calculates data to be processed through each calculation thread to obtain a target calculation result, and sends a message corresponding to the target calculation result to a first virtual communication port corresponding to the first processing process through a second virtual communication port corresponding to the second processing process, wherein a data format of data carried by the message is a data format which can be processed by both the first computer programming language and the second computer programming language, analyzes the message through the first processing process to obtain the target calculation result, and performs data processing on the target calculation result.
According to the method, in the scheme, the second processing process can perform parallel calculation on the data to be processed through the plurality of calculation threads, and send the target calculation result to the first virtual communication port corresponding to the first processing process through the second virtual communication port, and then data transmission between processing processes corresponding to two different computer programming languages is completed through the second virtual communication port and the first virtual communication port.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification, illustrate and explain the exemplary embodiments of the present specification and their description, are not intended to limit the specification unduly. In the drawings:
FIG. 1 is a flow chart of a method of data processing provided in the present specification;
Fig. 2 is a schematic diagram of a communication process between a Socket server and a Socket client provided in the present specification;
FIG. 3 is a schematic diagram of an overall process of data processing provided in the present specification;
FIG. 4 is a schematic diagram of an apparatus for data processing provided herein;
fig. 5 is a schematic diagram of an electronic device corresponding to fig. 1 provided in the present specification.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present specification more apparent, the technical solutions of the present specification will be clearly and completely described below with reference to specific embodiments of the present specification and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present specification. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a flow chart of a method for data processing provided in the present specification, including the following steps:
S101: and determining a first processing process corresponding to the first computer programming language and a second processing process corresponding to the second computer programming language when the appointed application program is operated.
The simulation software greatly improves the simulation calculation efficiency and reduces the simulation calculation cost. The simulation software can provide rich virtual components such as power supply, resistor, inductor, pulley, moment of inertia and the like. The module state at any moment can be observed and data can be obtained through simply setting the virtual element parameters and the simulation time.
In order to simulate the state of any time module more accurately and rapidly, algorithm optimization needs to be performed in core links such as modeling, solver and the like. Modeling refers to abstracting an actual physical element into a mathematical model, for example, abstracting a waveform of a step signal into a step function, abstracting an alternating current into a sine waveform with adjustable frequency phase amplitude, and the like. The solver may simulate the state of the module at any time, such as current, voltage, speed, displacement, etc. The module state at any time can be known through continuous iteration. Finally, the data processing is completed through the algorithm of the simulation software, such as voltage/current-time waveform, speed/displacement-time waveform and the like according to the calculation result of the data.
Because different computer programming languages have different characteristics and advantages and disadvantages, different types of processing processes need to use the computer programming languages matched with the different types of processing processes to process data, so that the processing efficiency can be maximized, and a large amount of data needs to be calculated and transmitted between the processing processes corresponding to the different computer programming languages in the process of actually processing the data by the simulation software.
Based on the above, the present disclosure provides a data processing method, which realizes data transmission between each process by using virtual communication ports corresponding to the process in different computer programming languages, so as to effectively improve the overall efficiency of data processing.
When the terminal equipment needs to determine to run the appointed application program, a first processing process corresponding to a first computer programming language and a second processing process corresponding to a second computer programming language are needed, wherein the first computer programming language is used for processing business logic, such as transmitting a calculation task, processing a calculation result of the rear end of the application program into data for displaying at the front end of the application program and storing the data, and the second computer programming language is used for calculating the data. The above-mentioned specific application program may be a software program for performing simulation calculation on data, or may be other software programs for performing statistics on data or modeling by using data, which is not particularly limited in this specification.
In this specification, the first computer programming language may be Java programming language, but may be other computer programming languages such as python, ruby, PHP, etc.
The second computer programming language may be a C language, but may be other computer programming languages such as a c++ language and a c#, as well.
It should be noted that, the first processing process and the second processing process may be executed in the same terminal device, and in this specification, the execution body of the method for implementing data processing may be the terminal device (such as a notebook computer, a desktop computer, etc.), and of course, may also be a server.
S102: and determining at least one calculation thread aiming at the data to be processed through the second processing process, and calculating the data to be processed through each calculation thread after receiving the data to be processed to obtain a target calculation result.
When executing the data processing task, the terminal device may set a virtual communication port in a first processing process as a first virtual communication port, and set a virtual communication port in a second processing process as a second virtual communication port for different processing processes, and create a communication file.
In this specification, the virtual communication port may be a Socket port, the first virtual communication port and the second virtual communication port are two communication ports matched with each other of the same Socket, the first virtual communication port is used for receiving data, the second virtual communication port is used for sending data, and the communication file may be a Socket communication file, so that the first processing process may be used as a Socket server, and the second processing process may be used as a Socket client. The two are transmitted in the form of messages. In order to facilitate understanding, the present disclosure further provides a schematic communication process between the Socket server and the Socket client, as shown in fig. 2.
Fig. 2 is a schematic diagram of a communication process between a Socket server and a Socket client provided in the present specification.
The terminal equipment creates a Socket port corresponding to a Socket server (Java language processing process) and binds a communication address, monitors data in the data processing process, and receives a target calculation result from a storage queue after monitoring that the data is transmitted to the Socket port.
The method comprises the steps that a Socket port corresponding to a Socket client (C language processing process) is created by a terminal device, communication connection is established between the terminal device and the Socket port of a Socket server, and a target calculation result is sent to a storage queue of the Socket port of the Socket server through the Socket port of the Socket client.
Of course, the virtual communication port may be another communication port, which is not specifically limited in the present specification.
When the second virtual communication port sends data to the first virtual communication port, the communication address can be connected first, and then the data (target calculation result) is sent to the first virtual communication port in the form of a message through the communication file.
When data processing is performed on the data to be processed, the first processing process may first open the first virtual communication port to monitor the second virtual communication port and obtain a data packet sent by the second virtual communication port.
After the first virtual communication port is opened, the first processing process can start the second processing process in a command line mode, in addition, the first processing process can also determine the number of calculation threads aiming at the data to be processed according to configuration information corresponding to the terminal equipment, such as the CPU core number, the processing waiting time, the CPU time duty ratio and the like, and the number of calculation threads is issued to the second processing process, so that the second processing process is designated by the first processing process to calculate the data to be processed.
The second processing process can determine the thread number corresponding to each computing thread according to the number of the computing threads designated by the first processing process, and then divide the data to be processed according to the thread number, so as to determine the data range of the data to be processed, which is required to be calculated by each computing thread.
And then the second processing process can parallelly calculate the data to be processed in the data range which is responsible for calculation of each calculation thread through each calculation thread to obtain a calculation result corresponding to each calculation thread, and send the calculation result corresponding to each calculation thread and the thread number to a receiving subprocess in the second processing process.
The receiving subprocess can sequence and combine the calculation results corresponding to the calculation threads according to the thread numbers of the calculation results corresponding to the calculation threads, so as to obtain the target calculation results.
It should be noted that, since each computing thread corresponds to a thread number, and different computing threads have respective corresponding computing results, the thread number corresponding to each computing thread may be equal to the thread number corresponding to the computing result of the computing thread.
In this process, the terminal device may determine whether the number of the computing threads that complete the computation reaches a preset threshold, if so, send the computing result and the thread number corresponding to the computing threads that complete the computation to the receiving sub-process in the second processing process, and then continue to compute the data that is not complete in computation through the remaining computing threads. Thus, when the data is processed to a certain scale, the completed calculation result is sent to the receiving subprocess, and the subsequent data is continuously processed after the completion of the sending. The preset threshold may be set according to actual situations, which is not specifically limited in the present specification.
S104: and sending the message corresponding to the target calculation result to the first virtual communication port corresponding to the first processing process through the second virtual communication port corresponding to the second processing process, wherein the data format of the data carried by the message is a data format which can be processed by both the first computer programming language and the second computer programming language.
S105: and analyzing the message through the first processing process to obtain the target calculation result, and performing data processing on the target calculation result.
After the receiving sub-process receives the calculation results of all the calculation threads, the terminal device may first determine whether a local communication connection has been established between the receiving sub-process and the second virtual communication port, and if not, may establish a communication connection between the receiving sub-process and the second virtual communication port through a file descriptor (such as a Sock file descriptor) corresponding to the second virtual communication port.
And then the receiving subprocess can send the message corresponding to the target calculation result to the communication file through the second virtual communication port, and transmit the message of the calculation result to the first virtual communication port through the communication file.
It should be noted that, since the data is transferred between the first virtual communication port and the second virtual communication port in the form of a message, the data transferred by the message is the most original data stream, and the data format of the data stream is a data format common to the first computer programming language and the second computer programming language, and both the first computer programming language and the second computer programming language can process the data.
The first processing process may acquire the message from the first virtual communication port, parse the message to acquire a target calculation result, and then the first processing process may process the target calculation result to store the processing result and display the processing result at the front end of the application program.
Specifically, the first processing process may determine the length of the message according to the target calculation result corresponding to the data before the designated bit number of the message, determine whether all batches of messages are received according to the data of the designated bit number, if yes, read byte information of the designated length according to the length of the message, and obtain the target calculation result according to the read byte information, where the designated bit number may be the 9 th bit of the message.
For example, for the message 000008231100, bits 1 to 8 may record the length of the current message, bits 9 may record the batch of the current message, bits 10 to 12 may record the total batch of the message, and bits 12 may record the specific content of the target calculation result at a later time.
In addition, the first processing process may determine whether the first processing process obtains a target calculation result, that is, obtains all calculation results corresponding to the data to be processed, and if so, closes the first virtual communication port.
For ease of understanding, the present description provides an overall process schematic of data processing, as shown in fig. 3.
Fig. 3 is a schematic diagram of an overall process of data processing provided in the present specification.
The Java language processing process is a first processing process, the C language processing process is a second processing process, the Java language processing process can firstly start the first virtual communication port, then start the C language processing process through a command line, and the number of calculation threads for carrying out parallel calculation on data to be processed is specified.
The C language processing process can acquire the data to be processed and the thread numbers thereof, determine the data range corresponding to each thread number, calculate the data to be processed through each calculation thread, send the calculation result to the receiving subprocess, and the receiving subprocess orders and reorganizes each calculation result according to the thread numbers to obtain the target calculation result. And then the C language processing process can open the second virtual communication port, and send the target calculation result to the first virtual communication port in the form of a message through the second virtual communication port.
The Java language processing process can receive the target calculation result through the first virtual communication port, close the first virtual communication port after receiving all calculation results of the data to be processed, and finish the data processing process after completing the processing of the target calculation result.
In this specification, the above data processing method may be applied to a data processing scenario in which circuit data (such as current, voltage or resistance) is simulated and calculated, for example, a user may build an RLC oscillating circuit diagram in simulation software, after the user performs a solving operation on the oscillating circuit in the simulation software, a java language processing process (a first processing process) may transfer a solving calculation task to a C language processing process (a second processing process), the C language processing process may perform parallel calculation on the data and calculate a target calculation result, and then transfer the data to a first virtual communication port through a second virtual communication port, and after the java language processing process acquires the target calculation result from the first virtual communication port, the target calculation result may be processed into data that can be displayed to the user at the front end of an application program (simulation software), and then the processed data is stored and displayed at the front end of the application program.
According to the method, in the scheme, the second processing process can perform parallel calculation on the data to be processed through the plurality of calculation threads, and send the target calculation result to the first virtual communication port corresponding to the first processing process through the second virtual communication port, and then data transmission between processing processes corresponding to two different computer programming languages is completed through the second virtual communication port and the first virtual communication port.
The foregoing describes one or more methods for performing data processing according to the present disclosure, and provides a corresponding apparatus for data processing according to the same concept, as shown in fig. 4.
Fig. 4 is a schematic diagram of an apparatus for data processing provided in the present specification, including:
a determining module 401, configured to determine a first processing procedure corresponding to a first computer programming language and a second processing procedure corresponding to a second computer programming language when the specified application program is running;
The computing module 402 is configured to determine at least one computing thread for data to be processed through the second processing procedure, and after receiving the data to be processed, compute the data to be processed through each computing thread to obtain a target computing result;
a sending module 403, configured to send, through a second virtual communication port corresponding to the second processing process, a packet corresponding to the target calculation result to a first virtual communication port corresponding to the first processing process, where a data format of data carried by the packet is a data format that can be processed by both the first computer programming language and the second computer programming language;
And the processing module 404 is configured to parse the message through the first processing procedure to obtain the target calculation result, and perform data processing on the target calculation result.
Optionally, the first virtual communication port and the second virtual communication port are Socket communication ports matched with each other.
Optionally, before determining at least one computing thread for the data to be processed through the second processing process, the computing module 402 is further configured to open a first virtual communication port corresponding to the preset first processing process; and starting the second processing process through the first processing process.
Optionally, the first computer programming language is used for processing business logic, and the second computer programming language is used for calculating data; the first computer programming language includes: a Java programming language, said second computer programming language comprising: and C language.
Optionally, the computing module 402 is specifically configured to start the second processing process through the first processing process, and determine the number of computing threads for the data to be processed;
the computing module 402 is specifically configured to determine, according to the number of computing threads, at least one computing thread for the data to be processed through the second processing process.
Optionally, the first processing process and the second processing process run in the same terminal device;
the calculating module 402 is specifically configured to determine the number of the calculating threads according to the configuration information corresponding to the terminal device.
Optionally, the computing module 402 is specifically configured to obtain a thread number corresponding to the at least one computing thread; dividing the data to be processed according to the thread numbers, and determining the data range of the data to be processed, which is required to be calculated by each calculation thread.
Optionally, the computing module 402 is specifically configured to send a computing result and a thread number corresponding to each computing thread to a receiving sub-process in the second processing process; and according to the thread numbers of the calculation results corresponding to the calculation threads received by the receiving subprocess, sequencing and combining the calculation results corresponding to the calculation threads to obtain the target calculation result.
Optionally, the calculating module 402 is specifically configured to determine whether the number of the calculated threads reaches a preset threshold, if yes, send a calculation result corresponding to the calculated threads and a thread number to a receiving sub-process in the second processing process; and calculating the data which are not calculated by the rest calculation threads.
Optionally, the sending module 403 is specifically configured to determine whether a communication connection exists between a receiving sub-process in the second processing process and the second virtual communication port, and if not, establish a communication connection between the receiving sub-process and the second virtual communication port through a communication file descriptor corresponding to the second virtual communication port.
Optionally, before sending the message corresponding to the target calculation result to the first virtual communication port corresponding to the first processing process through the second virtual communication port corresponding to the second processing process, the sending module 403 is specifically configured to set the first virtual communication port in the first processing process, set the second virtual communication port in the second processing process, and create a communication file; binding the communication address and the blocking information corresponding to the communication file with the first virtual communication port, so that the second virtual communication port sends the target calculation result to the first virtual communication port through the communication file after the second virtual communication port is connected with the communication address.
Optionally, the processing module 404 is specifically configured to determine, according to the first processing procedure, a length of the message according to the data before the specified bit of the message corresponding to the target calculation result, and determine whether all the messages are received according to the data of the specified bit;
if all the messages are determined to be received, reading byte information with specified length according to the message length, and obtaining the target calculation result according to the read byte information.
Optionally, the processing module 404 is further configured to determine whether the first processing process obtains the target calculation result; if yes, closing the first virtual communication port.
Optionally, the processing module 404 is further configured to display a processing result corresponding to the target calculation result at the front end of the application program.
The present specification also provides a computer readable storage medium storing a computer program operable to perform a method of data processing as provided in figure 1 above.
The present specification also provides a schematic structural diagram of an electronic device corresponding to fig. 1 shown in fig. 5. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile storage, as illustrated in fig. 5, although other hardware required by other services may be included. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs to implement the method of data processing described above with respect to fig. 1. Of course, other implementations, such as logic devices or combinations of hardware and software, are not excluded from the present description, that is, the execution subject of the following processing flows is not limited to each logic unit, but may be hardware or logic devices.
Improvements to one technology can clearly distinguish between improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) and software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable GATE ARRAY, FPGA)) is an integrated circuit whose logic functions are determined by user programming of the device. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented with "logic compiler (logic compiler)" software, which is similar to the software compiler used in program development and writing, and the original code before being compiled is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but HDL is not just one, but a plurality of kinds, such as ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language), and VHDL (Very-High-SPEED INTEGRATED Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application SPECIFIC INTEGRATED Circuits (ASICs), programmable logic controllers, and embedded microcontrollers, examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present specification.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present description is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the present specification may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to this specification will become apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of the present description, are intended to be included within the scope of the claims of the present description.
Claims (15)
1. A method of data processing, comprising:
determining a first processing process corresponding to a first computer programming language and a second processing process corresponding to a second computer programming language when a designated application program is operated;
Determining at least one calculation thread aiming at data to be processed through the second processing process, and calculating the data to be processed through each calculation thread after receiving the data to be processed to obtain a target calculation result, wherein a thread number corresponding to the at least one calculation thread is obtained; dividing the data to be processed according to the thread numbers, determining the data range of the data to be processed, which is required to be calculated by each calculation thread, and sending the calculation result corresponding to each calculation thread and the thread number to a receiving subprocess in the second processing process; according to the thread numbers of the calculation results corresponding to the calculation threads received by the receiving subprocesses, sequencing and combining the calculation results corresponding to the calculation threads to obtain the target calculation result, wherein the thread numbers are determined by the second processing process based on the number of the calculation threads specified by the first processing process, and the number of the calculation threads is determined by the first processing process according to the configuration information corresponding to the terminal equipment;
Transmitting a message corresponding to the target calculation result to a first virtual communication port corresponding to the first processing process through a second virtual communication port corresponding to the second processing process, wherein the data format of the data carried by the message is a data format which can be processed by both the first computer programming language and the second computer programming language;
And analyzing the message through the first processing process to obtain the target calculation result, and performing data processing on the target calculation result.
2. The method of claim 1, wherein the first virtual communication port and the second virtual communication port are Socket communication ports that match each other.
3. The method of claim 1, wherein prior to determining at least one computing thread for data to be processed by the second processing process, the method further comprises:
Starting a preset first virtual communication port corresponding to the first processing process;
And starting the second processing process through the first processing process.
4. The method of claim 1, wherein the first computer programming language is used to process business logic and the second computer programming language is used to calculate data;
The first computer programming language includes: a Java programming language, said second computer programming language comprising: and C language.
5. A method according to claim 3, wherein starting the second process by the first process comprises:
Starting the second processing process through the first processing process, and determining the number of computing threads aiming at the data to be processed;
determining, by the second processing procedure, at least one computing thread for the data to be processed, including:
and determining at least one computing thread aiming at the data to be processed according to the number of the computing threads through the second processing process.
6. The method of claim 5, wherein the first process and the second process run in the same terminal device;
the method for determining the number of the computing threads aiming at the data to be processed specifically comprises the following steps:
and determining the number of the calculation threads according to the configuration information corresponding to the terminal equipment.
7. The method of claim 1, wherein sending the calculation result and the thread number corresponding to each calculation thread to the receiving sub-process in the second processing process specifically comprises:
Judging whether the number of the calculated threads reaches a preset threshold value, if so, sending a calculation result corresponding to the calculated threads and a thread number to a receiving sub-process in the second processing process;
and calculating the data which are not calculated by the rest calculation threads.
8. The method of claim 1, wherein the sending, by the second virtual communication port corresponding to the second processing process, the message corresponding to the target calculation result to the first virtual communication port corresponding to the first processing process specifically includes:
And judging whether communication connection exists between a receiving subprocess in the second processing process and the second virtual communication port, and if not, establishing communication connection between the receiving subprocess and the second virtual communication port through a communication file descriptor corresponding to the second virtual communication port.
9. The method of claim 1, wherein before sending the message corresponding to the target calculation result to the first virtual communication port corresponding to the first processing process through the second virtual communication port corresponding to the second processing process, the method further comprises:
Setting the first virtual communication port in the first processing process, setting the second virtual communication port in the second processing process, and creating a communication file;
Binding the communication address and the blocking information corresponding to the communication file with the first virtual communication port, so that the second virtual communication port sends the target calculation result to the first virtual communication port through the communication file after the second virtual communication port is connected with the communication address.
10. The method of claim 1, wherein the parsing, by the first processing procedure, the message to obtain the target calculation result specifically includes:
Determining the length of the message according to the data before the designated bit number of the message corresponding to the target calculation result through the first processing process, and judging whether all the messages are received according to the data of the designated bit number;
if all the messages are determined to be received, reading byte information with specified length according to the message length, and obtaining the target calculation result according to the read byte information.
11. The method of claim 1, wherein the method further comprises:
judging whether the first processing process acquires the target calculation result or not;
if yes, closing the first virtual communication port.
12. The method of claim 1, wherein the method further comprises:
And displaying the processing result corresponding to the target calculation result at the front end of the application program.
13. An apparatus for data processing, comprising:
The determining module is used for determining a first processing process corresponding to the first computer programming language and a second processing process corresponding to the second computer programming language when the appointed application program is operated;
The computing module is used for determining at least one computing thread aiming at data to be processed through the second processing process, and computing the data to be processed through each computing thread after receiving the data to be processed to obtain a target computing result, wherein a thread number corresponding to the at least one computing thread is obtained; dividing the data to be processed according to the thread numbers, determining the data range of the data to be processed, which is required to be calculated by each calculation thread, and sending the calculation result corresponding to each calculation thread and the thread number to a receiving subprocess in the second processing process; according to the thread numbers of the calculation results corresponding to the calculation threads received by the receiving subprocesses, sequencing and combining the calculation results corresponding to the calculation threads to obtain the target calculation result, wherein the thread numbers are determined by the second processing process based on the number of the calculation threads specified by the first processing process, and the number of the calculation threads is determined by the first processing process according to the configuration information corresponding to the terminal equipment;
The sending module is used for sending the message corresponding to the target calculation result to the first virtual communication port corresponding to the first processing process through the second virtual communication port corresponding to the second processing process, wherein the data format of the data carried by the message is a data format which can be processed by both the first computer programming language and the second computer programming language;
and the processing module analyzes the message through the first processing process to obtain the target calculation result and processes the data of the target calculation result.
14. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-12.
15. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1-12 when executing the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310133985.4A CN116048845B (en) | 2023-02-07 | 2023-02-07 | Data processing method and device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310133985.4A CN116048845B (en) | 2023-02-07 | 2023-02-07 | Data processing method and device, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116048845A CN116048845A (en) | 2023-05-02 |
CN116048845B true CN116048845B (en) | 2024-07-26 |
Family
ID=86121959
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310133985.4A Active CN116048845B (en) | 2023-02-07 | 2023-02-07 | Data processing method and device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116048845B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109117282A (en) * | 2018-07-16 | 2019-01-01 | 阿里巴巴集团控股有限公司 | A kind of data transmission method, communication part, apparatus and system |
CN111176626A (en) * | 2019-08-05 | 2020-05-19 | 腾讯科技(深圳)有限公司 | Cross-programming-language code calling method and device, medium and equipment |
CN113934407A (en) * | 2021-12-08 | 2022-01-14 | 阿里云计算有限公司 | Method, device, medium and computing equipment for calling interfaces among different language codes |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070106998A1 (en) * | 2005-10-27 | 2007-05-10 | Zeldin Paul E | Mobility system and method for messaging and inter-process communication |
CN107562516A (en) * | 2017-08-07 | 2018-01-09 | 北京金山安全管理系统技术有限公司 | Multithread processing method and device, storage medium and processor |
CN110888674B (en) * | 2019-11-28 | 2022-08-09 | 支付宝(杭州)信息技术有限公司 | Method and device for executing security calculation in Python virtual machine |
-
2023
- 2023-02-07 CN CN202310133985.4A patent/CN116048845B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109117282A (en) * | 2018-07-16 | 2019-01-01 | 阿里巴巴集团控股有限公司 | A kind of data transmission method, communication part, apparatus and system |
CN111176626A (en) * | 2019-08-05 | 2020-05-19 | 腾讯科技(深圳)有限公司 | Cross-programming-language code calling method and device, medium and equipment |
CN113934407A (en) * | 2021-12-08 | 2022-01-14 | 阿里云计算有限公司 | Method, device, medium and computing equipment for calling interfaces among different language codes |
Also Published As
Publication number | Publication date |
---|---|
CN116048845A (en) | 2023-05-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107679700A (en) | Business flow processing method, apparatus and server | |
JP7048738B2 (en) | Virtual card opening method and system, payment system, and card issuing system | |
CN109214632A (en) | A kind of risk control method and equipment | |
CN110750437B (en) | Equipment debugging method, device, equipment and system | |
CN109271587A (en) | A kind of page generation method and device | |
CN107203465A (en) | System interface method of testing and device | |
CN107102950A (en) | A kind of applied program testing method and device | |
CN111158756A (en) | Method and apparatus for processing information | |
WO2023217118A1 (en) | Code test method and apparatus, and test case generation method and apparatus | |
CN110633959A (en) | Method, device, equipment and medium for creating approval task based on graph structure | |
CN107562496A (en) | A kind of method and device of page configuration and page presentation | |
CN109345221A (en) | The checking method and device of resource circulation | |
WO2024198748A1 (en) | Data processing method and system, chip, and terminal | |
CN113454607B (en) | Debugging method, device and system-on-chip | |
CN116048845B (en) | Data processing method and device, storage medium and electronic equipment | |
CN107908552A (en) | A kind of test method based on link, device and equipment | |
CN107769987B (en) | Message forwarding performance evaluation method and device | |
CN109815116A (en) | A kind of method for testing software and equipment platform and computer readable storage medium | |
CN110022351A (en) | A kind for the treatment of method and apparatus of service request | |
JP7559226B2 (en) | Control of technical systems using computing units for artificial intelligence | |
CN110825461A (en) | Data processing method and device | |
CN113271259B (en) | Flow control system, method, device and equipment | |
CN111832714B (en) | Operation method and device | |
CN109977024A (en) | The cpu chip emulator for supporting NVM to download in real time | |
CN109271269A (en) | A kind of processing method, device and equipment that application sudden strain of a muscle is moved back |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |