CN111711669A - Data uploading method and device, server and storage medium - Google Patents

Data uploading method and device, server and storage medium Download PDF

Info

Publication number
CN111711669A
CN111711669A CN202010471694.2A CN202010471694A CN111711669A CN 111711669 A CN111711669 A CN 111711669A CN 202010471694 A CN202010471694 A CN 202010471694A CN 111711669 A CN111711669 A CN 111711669A
Authority
CN
China
Prior art keywords
thread
file
data file
analysis
data
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
CN202010471694.2A
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 Shunda Technology Co ltd
Original Assignee
Beijing Shunda 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 Shunda Technology Co ltd filed Critical Beijing Shunda Technology Co ltd
Priority to CN202010471694.2A priority Critical patent/CN111711669A/en
Publication of CN111711669A publication Critical patent/CN111711669A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a data uploading method, a data uploading device, a server and a storage medium, and the method comprises the following steps: acquiring a request of a terminal for uploading a data file; starting a main thread of file processing according to the request; starting a file analysis thread for analyzing the data file by using the main thread, and moving the data file to the file analysis thread; analyzing the data file by using a file analysis thread, and sending first analysis state information to the terminal so as to display the analysis state of the data file at the terminal; and when the data file is analyzed by the file analysis thread, sending second analysis state information to the main thread, and sending the analysis result of the data file to the main thread. According to the method, a thread is added on the basis of a main thread for processing the original data file, the data file is processed on the newly added thread, the original main thread is not influenced, the stability of the original main thread is improved, the false death condition of the original data file processing thread during data file processing is avoided, and the user experience is improved.

Description

Data uploading method and device, server and storage medium
Technical Field
The present application relates to the field of data uploading, and in particular, to a data uploading method, apparatus, server, and storage medium.
Background
When a user uploads a data file, the front end directly uploads the data file to a server, and the data file is analyzed by the server; the server can process a large amount of data files, so that abnormal alarm can occur, and the service stability of the server is seriously influenced. When the front end performs pre-check, if the data file is large, the time for analyzing the front end is too long, which causes a false death situation on the front end page and affects user experience.
Disclosure of Invention
The embodiment of the application provides a data uploading method, a data uploading device, a server and a storage medium, and aims to solve the problems that when data are uploaded in the prior art, a main thread is always occupied by a data file, other operations cannot be performed, and due to the fact that data are too large, a false death situation easily occurs.
In a first aspect, the present application provides a data uploading method, which is applied to a server, and the method includes:
acquiring a request of a terminal for uploading a data file;
starting a main thread of file processing according to the request;
starting a file analysis thread for analyzing the data file by using the main thread, and moving the data file to the file analysis thread;
analyzing the data file by using the file analysis thread, and sending first analysis state information to the terminal so as to display the analysis state of the data file at the terminal;
and when the data file is analyzed by the file analysis thread, sending second analysis state information to the main thread, and sending the analysis result of the data file to the main thread.
Further, the data uploading method according to claim 1, wherein the parsing the data file by using the file parsing thread includes:
acquiring a preset data file check rule;
and analyzing the data file according to the preset data file verification rule.
Further, the method further comprises: and the main thread judges whether to upload the data file or not according to the analysis result.
Further, the determining, by the main thread, whether to upload the data file according to the analysis result includes:
judging whether the data file is successfully analyzed according to the analysis result;
and if the data file is successfully analyzed, uploading the data file.
Further, the file analysis thread is a webworker thread, and the data file is a table file.
Further, the parsing the data file by using the file parsing thread and sending first parsing state information to a terminal to display the parsing state of the data file at the terminal includes:
and analyzing the table file by using the webworker thread, and sending first analysis state information to a terminal so as to display the analysis state of the table file at the terminal.
Further, the first analysis state information is: in the analysis; and the first analysis information displays the analysis state of the current data file.
Furthermore, the file analysis thread is a multi-thread file analysis thread, and the data file is analyzed in the multi-thread file analysis thread.
In a second aspect, the present application provides a data uploading apparatus, the apparatus comprising:
the acquisition module is used for acquiring a request of a terminal for uploading a data file;
the first starting module is used for starting a main thread of file processing according to the request;
the second starting module is used for starting a file analysis thread for analyzing the data file by using the main thread and moving the data file to the file analysis thread;
the first sending module is used for analyzing the data file by using the file analysis thread and sending first analysis state information to the terminal so as to display the analysis state of the data file on the terminal;
and the second sending module is used for sending second analysis state information to the main thread when the data file is analyzed by the file analysis thread, and sending the analysis result of the data file to the main thread.
In a third aspect, the present application further provides a server, including:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the data upload method of any of the above.
In a fourth aspect, the present application also provides a computer readable storage medium, where the computer program is loaded by a processor to perform the steps in the data uploading method as described in any one of the above.
The embodiment of the application provides a data uploading method, and the data file is migrated to a newly-added thread by adding a thread on the basis of a main thread for processing the original data file, so that the processing of the data file is performed on the newly-added thread, the operation of the original processing thread is not influenced, the stability of the original processing thread is improved, the condition that the original data file processing thread is falsely died when the data file is processed is avoided, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of a scenario of a host monitoring system according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of an embodiment of a data uploading method according to an embodiment of the present application;
fig. 3 is a schematic diagram of an embodiment of a data uploading apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a server according to an embodiment of the present application.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience of description and for simplicity of description, and do not indicate or imply that the referenced device or element must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be considered as limiting the present application. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
In this application, the word "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes are not set forth in detail in order to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
Embodiments of the present application provide a data uploading method, an apparatus, a server, and a storage medium, which are described below.
As shown in fig. 1, a schematic view of a scenario of a host monitoring system according to an embodiment of the present application is provided, where the host monitoring system may include a plurality of hosts 100 and a server 200, the hosts 100 and the server 20 are connected through a network, and a host monitoring apparatus, such as the server in fig. 1, is integrated in the server 200, and the hosts 100 may access the server 200.
In the embodiment of the invention, the server 200 is mainly used for acquiring a request of a terminal for uploading a data file; starting a main thread of file processing according to the request; starting a file analysis thread for analyzing the data file by using the main thread, and moving the data file to the file analysis thread; analyzing the data file by using a file analysis thread, and sending first analysis state information to the terminal so as to display the analysis state of the data file at the terminal; and when the data file is analyzed by the file analysis thread, sending second analysis state information to the main thread, and sending the analysis result of the data file to the main thread.
In this embodiment of the present invention, the server 200 may be an independent server, or may be a server network or a server cluster composed of servers, for example, the server 200 described in this embodiment of the present invention includes, but is not limited to, a computer, a network host, a single network server, a plurality of network server sets, or a cloud server composed of a plurality of servers. Among them, the Cloud server is constituted by a large number of computers or web servers based on Cloud Computing (Cloud Computing). In the embodiment of the present invention, the server and the host may implement communication through any communication manner, including but not limited to mobile communication based on the third Generation Partnership Project (3 GPP), Long Term Evolution (LTE), Worldwide Interoperability for Microwave Access (WiMAX), or computer network communication based on the TCP/IP Protocol Suite (TCP/IP), User Datagram Protocol (UDP) Protocol, and the like.
It will be appreciated that the host 100 used in embodiments of the present invention may be a device that includes both receiving and transmitting hardware, i.e., a device having receiving and transmitting hardware capable of performing two-way communications over a two-way communications link. Such a host may include: a cellular or other communication device having a single line display or a multi-line display or a cellular or other communication device without a multi-line display. The host 100 may specifically be a desktop terminal or a mobile terminal, and the host 100 may also specifically be one of a mobile phone, a tablet computer, a notebook computer, and the like.
Those skilled in the art will appreciate that the application environment shown in fig. 1 is only one application scenario related to the present invention, and does not constitute a limitation to the application scenario of the present invention, and that other application environments may further include more or less servers than those shown in fig. 1, or a network connection relationship of servers, for example, only 1 server and 2 hosts are shown in fig. 1, and it will be understood that the host monitoring system may further include one or more other servers, or/and one or more hosts connected to a server network, and is not limited herein.
In addition, as shown in fig. 1, the host monitoring system may further include a memory 300 for storing data, such as host data, for example, host status data during host operation.
It should be noted that the scenario diagram of the host monitoring system shown in fig. 1 is merely an example, and the host monitoring system and the scenario described in the embodiment of the present invention are for more clearly illustrating the technical solution of the embodiment of the present invention, and do not form a limitation on the technical solution provided in the embodiment of the present invention.
In the prior art, when a terminal needs to upload a data file, a main thread in a server processes the data file, converts the data file to be uploaded into a format that can be processed by the server, or screens out the data file from a huge data file. That is, the main thread in the server processes the data file, and in the data uploading method in the prior art, when the main thread in the server processes the data file, the server cannot be used to perform other operations or process other data files, which causes resource waste, and the server may generate abnormal alarm conditions due to processing of a large amount of files, which affects the stability of the server and also affects the user experience.
The embodiment of the application provides a data uploading method, which is applied to a server and can comprise the following steps: acquiring a request of a terminal for uploading a data file; starting a main thread of file processing according to the request; starting a file analysis thread for analyzing the data file according to the main thread, and moving the data file to the file analysis thread; analyzing the data file by using a file analysis thread, and sending a first analysis state to the terminal so as to display the analysis state of the data file at the terminal; and when the data file is analyzed by the file analysis thread, sending second analysis information to the main thread, and sending the analysis result of the data file to the main thread. Referring to fig. 2, fig. 2 is a schematic flowchart illustrating an embodiment of a data uploading method according to an embodiment of the present application, where the method includes:
21. and acquiring a request of the terminal for uploading the data file.
22. And starting a main thread of file processing according to the request.
The data uploading method provided by the embodiment of the application is applied to a server, when a terminal needs to upload data, a request for uploading a data file is sent to the server, and the server receives and agrees with the request and then uploads the data file. And after the terminal sends a request for uploading the data file to the server, the server starts a main thread for processing the data file according to the request, and the data file is uploaded only after being processed.
23. And starting a file analysis thread for analyzing the data file by using the main thread, and moving the data file to the file analysis thread.
24. And analyzing the data file by using the file analysis thread, and sending first analysis information to the terminal so as to display the analysis state of the data file at the terminal.
25. And after the data file is analyzed by the file analysis thread, sending second analysis state information to the main thread, and sending the analysis result of the data file to the main thread.
According to the data uploading method, the thread is added on the basis of the main thread for processing the original data file, the data file is migrated to the newly added thread, the data file is processed on the newly added thread, the operation of the original processing thread is not affected, the stability of the original processing thread is improved, the condition that the original data file processing thread is falsely dead when the data file is processed is avoided, and the user experience is improved.
In the embodiment of the application, a file analysis thread capable of processing the data file is added on the basis of the existing main thread for processing the data file. When a program is started, a process is created by an Operating System (OS), and at the same time, a Thread runs immediately, the Thread is usually called a Main Thread (Main Thread) of the program, because the Thread is executed when the program starts, and if you need to create a Thread again, the created Thread is a sub-Thread of the Main Thread. Each process has at least one main thread. In the embodiment of the present application, the main thread is an existing thread that processes a data file, and the main thread may process the data file before uploading the data file, and then upload the data file.
In the embodiment of the present application, if the data file is uploaded, the terminal first sends a request for uploading the data file to the server, and after the server receives the request for uploading the data file, the server starts a main thread for processing the data file according to the request. According to the method and the device, on the basis of the main thread, a file analysis thread for processing the data file is added, so that the original single-thread processing process is changed into a multi-thread processing process. The multithreading is not that a plurality of threads are processed in parallel, but a main thread is provided to process a main direction chain of the whole program task, and the chain is provided with a plurality of branches like branches, so that the main thread is used for processing main tasks, and the fine threads are used for processing time-consuming and labor-consuming tasks, so that the interface looks smoother.
In the embodiment of the application, the main thread is the whole process of uploading the data file, and the sub-thread can process the data file and move the process of processing the data file to the newly added file analysis thread, so that the problem that a large amount of time is wasted on the main thread to influence other operations by using the main thread is avoided.
Therefore, after the main thread is started, the main thread starts a file analysis thread for analyzing the data file, that is, the process of processing the data file is moved to the newly added file analysis thread instead of the original main thread.
Specifically, when the main thread starts an analysis thread for analyzing the data file, the main thread also moves the data file to be uploaded to the file analysis thread, so that the data file is processed on the newly added file analysis thread.
After the data file is moved to the newly added file parsing thread, in some embodiments of the present application, parsing the data file using the file parsing thread may include: acquiring a preset data file check rule; and analyzing the data file according to a preset data file check rule.
Specifically, the preset data file check rule is a rule for processing the data file, the check rule can be stored in the server, and when the data file needs to be processed, the server side sends the rule to the file analysis thread so that the file analysis thread can analyze the data file.
In the embodiment of the application, the preset data file verification rule can be customized artificially aiming at different data files and different requirements. For example, for an excel file to be uploaded, when the excel file is processed, the content in a specific table in the table file does not meet the specification, and then the content that does not meet the specification can be processed. Specifically, the content that does not meet the specification may be deleted, or the required information may be screened from the content that does not meet the specification and uploaded. Meanwhile, for different types of files, such as word files or excel files, the preset data file verification rules can be different.
It should be noted that the preset data file verification rule may be manually set according to actual requirements, and the preset data file verification rule may be stored in the server, and when needed, the preset data file verification rule is called by the server.
In the embodiment of the application, the newly added file analysis thread analyzes the data file to be uploaded, after the analysis is completed, the file analysis thread generates an analysis result corresponding to the data file and sends the analysis result to the main thread, and the main thread can judge whether to upload the data file according to the analysis result.
Specifically, the main thread can judge whether the data file is successfully analyzed or not or whether the data file is completely analyzed according to the analysis result, and if the data file is successfully analyzed or the data file is completely analyzed, the main thread uploads the data file.
It should be noted that, after the newly added file parsing thread finishes parsing the data file and obtains a parsing result, if the parsing result obtained by the main thread is that the data file is successfully parsed or the data file is completely parsed, the main thread may also obtain the data file sent by the file parsing process. Because the data file is moved to the newly added file analysis process before the data file is analyzed, the main thread judges that the data file needs to be uploaded according to the analysis result, and then the file analysis thread sends the data file to the main thread, and the main thread uploads the data file.
In the embodiment of the application, when the file analysis thread analyzes the data file, the file analysis thread generates first analysis state information and sends the first analysis state information to the terminal; the first analysis state information displays the analysis state of the current data file. And after the terminal receives the first analysis state information, the terminal can display the first analysis state information so as to display the analysis state of the current data file.
Specifically, the first analysis information may be: in the analysis. I.e. representing the current state as: the file analysis thread is not yet completely analyzing the data file in the process of analyzing the data file. Therefore, when the user uploads the data at the terminal, the user can intuitively feel that the server is analyzing the data. And the analysis of the data file is carried out on the newly added file analysis process, so that the main thread can be used for carrying out other operations without influencing the main thread.
In other embodiments of the present application, after the file parsing thread completes parsing the data file, the file parsing thread generates second parsing status information and sends the second parsing status information to the main thread. Wherein the second parsing status information may be: the analysis is finished; meanwhile, the analysis result is also sent to the main thread, and the analysis result can be: check success/check failure.
In a specific embodiment of the present application, the newly added file parsing thread may be a webworker thread, and the data file to be uploaded may be a table file, that is, an excel file. The main thread may be a Javascript thread, where the Javascript thread is a single-thread processing process, and when the single thread executes a program, program paths taken by the single thread are arranged in a continuous sequence, and the former must be processed, and the latter will be executed.
If only the main thread is provided, namely only the Javascript thread, the data file can be uploaded only when the data file is analyzed completely because the Javascript thread is processed by a single thread. If the data file is large, the Javascript thread wastes a long time when analyzing the data file, which may cause a server to be falsely dead. In the embodiment of the application, a webworker thread is newly added on the basis of the Javascript thread, so that the original single-thread processing process is changed into a multi-thread processing process.
Specifically, the analyzing the data file by using the file analysis thread, and sending the first analysis state information to the terminal, so as to display the analysis state of the data file at the terminal, may be: and analyzing the form file by using a webworker thread, and sending first analysis state information to the terminal so as to display the analysis state of the form file at the terminal.
In the above embodiment, when the data file needs to be uploaded, the terminal sends a request for uploading the data file to the server, and the server starts the Javascript thread for uploading the file according to the received request. Due to the fact that the webworker thread is added, the Javascript thread starts the webworker thread, the data file is moved to the webworker thread, and the data file is analyzed through the webworker thread. In the analysis process of the data file, the webworker thread generates first analysis state information and sends the first analysis state information to the terminal, wherein the first analysis state information is as follows: in the analysis. After receiving the first analysis state information, the terminal can display the first analysis state information, so that an operator can intuitively feel that the data file is being analyzed and uploaded by the current server.
Specifically, the terminal may show the specific content of "in analysis" to remind the operator that the form file is in analysis at this time. Because the table file is analyzed on the webworker thread instead of the Javascript thread, namely the main thread for uploading the data file, the Javascript thread can be continuously utilized to perform other operations, and the table file analyzing process performed on the webworker thread does not influence other operations on the Javascript thread.
When the data file is analyzed, the webworker thread can send second analysis state information to the main thread, namely the webworker thread sends the specific content of 'analysis completed' to the Javascript thread, and the webworker thread also sends the analysis result to the Javascript thread. And after receiving the second analysis state information, the Javascript thread can also display the second analysis state information at the terminal to remind an operator that the analysis of the data file is finished at the moment.
And after the Javascript thread receives the analysis result, the Javascript thread judges whether to upload the data file according to the analysis result. If the analysis result is: if the verification is successful, the Javascript thread can upload the form file; if the analysis result is: and if the verification fails, the problem occurs in the process of analyzing the data file by the webworker thread, and the form file cannot be uploaded.
It should be noted that, in the embodiment of the present application, the main thread may be another thread outside the Javascript thread, and the newly added file parsing thread may also be another thread outside the webworker thread, which is not limited herein.
In other embodiments of the present application, the newly added file parsing thread may be a multi-threaded file parsing thread, and the data file may be parsed in the multi-threaded file parsing thread. Namely, the newly added file analysis thread is a multi-thread file analysis thread, so that when the data file is analyzed in the newly added file analysis thread, the analysis speed is higher, and the time required for analyzing the data file is further reduced.
The present application also provides a data uploading apparatus, as shown in fig. 3, the apparatus may include:
and the obtaining module 301, wherein the obtaining module 301 is used for requesting the lake region terminal to upload the data file.
A first starting module 302, wherein the first starting module 302 is used for starting a main thread of file processing according to a request.
A second starting module 303, where the second starting module 303 is configured to start a file parsing thread for parsing the data file by using the main thread, and move the data file to the file parsing thread.
A first sending module 304, wherein the first sending module 304 is configured to parse the data file by using the file parsing thread, and send the first parsing status information to the terminal, so as to display the parsing status of the data file at the terminal.
And a second sending module 305, where the second sending module 305 is configured to send second parsing status information to the main thread when parsing of the data file by the file parsing module is completed, and send a parsing result of the data file to the main thread.
The application provides a data uploading device, on the basis of the main thread of original data file processing, increase a thread, migrate the data file to the thread that increases newly for the processing to the data file is gone on newly-increased thread, can not influence the operation of original processing thread like this, improves the stability of original processing thread, avoids the false death condition of original data file processing thread appearance when handling the data file, improves user experience.
In some embodiments of the present application, the first sending module 304 may be specifically configured to: acquiring a preset data file check rule; and analyzing the data file according to a preset data file check rule.
The present application further provides a server, which integrates any one of the data uploading devices provided in the embodiments of the present application, as shown in fig. 4, which shows a schematic structural diagram of the server related to the embodiments of the present application, specifically:
the server may include components such as a processor 401 of one or more processing cores, memory 402 of one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that the server architecture shown in FIG. 4 is not meant to be limiting, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
Wherein:
the processor 401 is a control center of the server, connects various parts of the entire server using various interfaces and lines, and performs various functions of the server and processes data by running or executing software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the server. Optionally, processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401.
The memory 402 may be used to store software programs and modules, and the processor 401 executes various functional applications and data processing by operating the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the server, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 access to the memory 402.
The server further includes a power supply 403 for supplying power to each component, and preferably, the power supply 403 may be logically connected to the processor 401 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The power supply 403 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The server may also include an input unit 404, the input unit 404 being operable to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the server may further include a display unit and the like, which will not be described in detail herein. Specifically, in this embodiment, the processor 401 in the server loads the executable file corresponding to the process of one or more application programs into the memory 402 according to the following instructions, and the processor 401 runs the application program stored in the memory 402, thereby implementing various functions as follows:
acquiring a request of a terminal for uploading a data file; starting a main thread of file processing according to the request; starting a file analysis thread for analyzing the data file according to the main thread, and moving the data file to the file analysis thread; analyzing the data file by using a file analysis thread, and sending a first analysis state to the terminal so as to display the analysis state of the data file at the terminal; and when the data file is analyzed by the file analysis thread, sending second analysis information to the main thread, and sending the analysis result of the data file to the main thread.
The present application also provides a computer-readable storage medium, which may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like. The storage medium stores a computer program, and the computer program is loaded by the processor to execute the steps of any one of the data uploading methods provided by the embodiments of the present application. For example, the computer program may be loaded by a processor to perform the steps of:
acquiring a request of a terminal for uploading a data file; starting a main thread of file processing according to the request; starting a file analysis thread for analyzing the data file according to the main thread, and moving the data file to the file analysis thread; analyzing the data file by using a file analysis thread, and sending a first analysis state to the terminal so as to display the analysis state of the data file at the terminal; and when the data file is analyzed by the file analysis thread, sending second analysis information to the main thread, and sending the analysis result of the data file to the main thread.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed descriptions of other embodiments, and are not described herein again.
In a specific implementation, each unit or structure may be implemented as an independent entity, or may be combined arbitrarily to be implemented as one or several entities, and the specific implementation of each unit or structure may refer to the foregoing method embodiment, which is not described herein again.
The data uploading method, the data uploading device, the server and the storage medium provided by the embodiments of the present application are described in detail above, and a specific example is applied in the present application to explain the principles and embodiments of the present application, and the description of the above embodiments is only used to help understand the method and the core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (11)

1. A data uploading method is applied to a server, and the method comprises the following steps:
acquiring a request of a terminal for uploading a data file;
starting a main thread of file processing according to the request;
starting a file analysis thread for analyzing the data file by using the main thread, and moving the data file to the file analysis thread;
analyzing the data file by using the file analysis thread, and sending first analysis state information to the terminal so as to display the analysis state of the data file at the terminal;
and when the data file is analyzed by the file analysis thread, sending second analysis state information to the main thread, and sending the analysis result of the data file to the main thread.
2. The data uploading method according to claim 1, wherein the parsing the data file by using the file parsing thread includes:
acquiring a preset data file check rule;
and analyzing the data file according to the preset data file verification rule.
3. The data uploading method according to claim 1, further comprising: and the main thread judges whether to upload the data file or not according to the analysis result.
4. The data uploading method according to claim 3, wherein the main thread determining whether to upload the data file according to the parsing result comprises:
judging whether the data file is successfully analyzed according to the analysis result;
and if the data file is successfully analyzed, uploading the data file.
5. The data uploading method according to claim 1, wherein the file parsing thread is a webworker thread, and the data file is a table file.
6. The data uploading method according to claim 5, wherein the parsing the data file by using the file parsing thread and sending first parsing status information to a terminal so as to display the parsing status of the data file at the terminal comprises:
and analyzing the table file by using the webworker thread, and sending first analysis state information to a terminal so as to display the analysis state of the table file at the terminal.
7. The data uploading method according to claim 1, wherein the first parsing status information is: in the analysis; and the first analysis information displays the analysis state of the current data file.
8. The data uploading method according to claim 1, wherein the file parsing thread is a multi-threaded file parsing thread, and the data file is parsed in the multi-threaded file parsing thread.
9. An apparatus for uploading data, the apparatus comprising:
the acquisition module is used for acquiring a request of a terminal for uploading a data file;
the first starting module is used for starting a main thread of file processing according to the request;
the second starting module is used for starting a file analysis thread for analyzing the data file by using the main thread and moving the data file to the file analysis thread;
the first sending module is used for analyzing the data file by using the file analysis thread and sending first analysis state information to the terminal so as to display the analysis state of the data file on the terminal;
and the drop sending module is used for sending second analysis state information to the main thread when the data file is analyzed by the file analysis thread, and sending an analysis result of the data file to the main thread.
10. A server, characterized in that the server comprises:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the data upload method of any of claims 1 to 8.
11. A computer-readable storage medium, having stored thereon a computer program which is loaded by a processor to perform the steps of the data uploading method of any of claims 1 to 8.
CN202010471694.2A 2020-05-29 2020-05-29 Data uploading method and device, server and storage medium Pending CN111711669A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010471694.2A CN111711669A (en) 2020-05-29 2020-05-29 Data uploading method and device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010471694.2A CN111711669A (en) 2020-05-29 2020-05-29 Data uploading method and device, server and storage medium

Publications (1)

Publication Number Publication Date
CN111711669A true CN111711669A (en) 2020-09-25

Family

ID=72538512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010471694.2A Pending CN111711669A (en) 2020-05-29 2020-05-29 Data uploading method and device, server and storage medium

Country Status (1)

Country Link
CN (1) CN111711669A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383636A (en) * 2020-11-20 2021-02-19 浙江百应科技有限公司 PC (personal computer) end file uploading method based on web worker
CN112711406A (en) * 2020-12-30 2021-04-27 西安精密机械研究所 LabVIEW-based test flow editing and analyzing and thread interaction method
CN114157566A (en) * 2021-11-08 2022-03-08 中信科移动通信技术股份有限公司 Base station performance file analysis method and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030182408A1 (en) * 2002-02-15 2003-09-25 Qinglong Hu Load test system for a server and method of use
CN104714835A (en) * 2013-12-16 2015-06-17 中国移动通信集团公司 Data access processing method and device
CN106326016A (en) * 2016-07-28 2017-01-11 武汉票据交易中心有限公司 Multi-thread event dispatching method and system
CN107743137A (en) * 2016-09-27 2018-02-27 腾讯科技(深圳)有限公司 A kind of file uploading method and device
CN110442819A (en) * 2019-07-24 2019-11-12 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and terminal
CN110765113A (en) * 2019-09-04 2020-02-07 深圳壹账通智能科技有限公司 Big data processing optimization method and device, terminal and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030182408A1 (en) * 2002-02-15 2003-09-25 Qinglong Hu Load test system for a server and method of use
CN104714835A (en) * 2013-12-16 2015-06-17 中国移动通信集团公司 Data access processing method and device
CN106326016A (en) * 2016-07-28 2017-01-11 武汉票据交易中心有限公司 Multi-thread event dispatching method and system
CN107743137A (en) * 2016-09-27 2018-02-27 腾讯科技(深圳)有限公司 A kind of file uploading method and device
CN110442819A (en) * 2019-07-24 2019-11-12 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and terminal
CN110765113A (en) * 2019-09-04 2020-02-07 深圳壹账通智能科技有限公司 Big data processing optimization method and device, terminal and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383636A (en) * 2020-11-20 2021-02-19 浙江百应科技有限公司 PC (personal computer) end file uploading method based on web worker
CN112711406A (en) * 2020-12-30 2021-04-27 西安精密机械研究所 LabVIEW-based test flow editing and analyzing and thread interaction method
CN114157566A (en) * 2021-11-08 2022-03-08 中信科移动通信技术股份有限公司 Base station performance file analysis method and system
CN114157566B (en) * 2021-11-08 2023-09-08 中信科移动通信技术股份有限公司 Base station performance file analysis method and system

Similar Documents

Publication Publication Date Title
CN111711669A (en) Data uploading method and device, server and storage medium
US20230334930A1 (en) Consensus method and apparatus for blockchain, server and storage medium
CN111158891B (en) Analysis task processing method and device based on Flink technology and storage medium
EP4080419A1 (en) Model training method and apparatus
CN107743137B (en) File uploading method and device
US11954396B2 (en) Screen projection status determining method and apparatus
CN111193633A (en) Method and device for detecting abnormal network connection
CN113535541A (en) Test method, test device, storage medium and computer equipment
CN113014608B (en) Flow distribution control method and device, electronic equipment and storage medium
US20160226719A1 (en) Network based virtual collaborative problem solving space
CN114221985A (en) Device control method, device, electronic device and computer-readable storage medium
CN115277599B (en) Reflow method and device under current limiting scene, computer equipment and storage medium
CN115221060A (en) Case generation method, device and equipment based on associated field and storage medium
US11294704B2 (en) Monitoring and reporting performance of online services using a monitoring service native to the online service
CN113157475A (en) Log processing method and device, storage medium and electronic equipment
US20230081515A1 (en) Method, device and system for interactive contouring of medical image, and storage medium
CN115904685A (en) Display card resource allocation method and device and readable storage medium
CN117033084B (en) Virtual machine backup method and device, electronic equipment and storage medium
CN115914376A (en) Internet of things data processing method, device, equipment and computer readable storage medium
CN115242685A (en) Playback test method, device and equipment based on incidence matrix and storage medium
CN118277221A (en) System abnormal data acquisition method and device, electronic equipment and storage medium
CN114491180A (en) Traffic management data flow direction analysis method and device, computer equipment and storage medium
CN115510839A (en) Service data configuration method, device, equipment and storage medium
CN118260265A (en) Cluster migration method, device, computer equipment and storage medium
CN115530851A (en) Exposure and drawing control method and system, computer equipment and readable 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200925