CN109639666B - Meteorological data file transmission method and device - Google Patents

Meteorological data file transmission method and device Download PDF

Info

Publication number
CN109639666B
CN109639666B CN201811494353.6A CN201811494353A CN109639666B CN 109639666 B CN109639666 B CN 109639666B CN 201811494353 A CN201811494353 A CN 201811494353A CN 109639666 B CN109639666 B CN 109639666B
Authority
CN
China
Prior art keywords
data file
target file
downloading
client
preset
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
Application number
CN201811494353.6A
Other languages
Chinese (zh)
Other versions
CN109639666A (en
Inventor
周永
雍正
李华
安德振
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sprixin Technology Co ltd
Original Assignee
Sprixin 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 Sprixin Technology Co ltd filed Critical Sprixin Technology Co ltd
Priority to CN201811494353.6A priority Critical patent/CN109639666B/en
Publication of CN109639666A publication Critical patent/CN109639666A/en
Application granted granted Critical
Publication of CN109639666B publication Critical patent/CN109639666B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • 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/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a meteorological data file transmission method and device. The meteorological data file transmission method comprises the following steps: receiving a meteorological data file downloading request sent by a client, and authenticating the client according to an https protocol header carried by the meteorological data file downloading request; if the authentication fails, judging whether the times of the authentication failure of the client in a preset time period reach the preset maximum times or not; if not, judging whether a preset forced downloading condition is met or not according to the current trial downloading times of the requested target file; if yes, allowing the client to download the target file; and if not, not allowing the client to download the target file. The meteorological data file transmission method and the meteorological data file transmission device provided by the embodiment of the invention realize the downloading of the meteorological data file based on the https protocol, and can improve the transmission safety of the meteorological data file.

Description

Meteorological data file transmission method and device
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a meteorological data file transmission method and a meteorological data file transmission device.
Background
With the rapid development of new energy projects, the power prediction technology is also continuously updated and iterated. And power prediction, namely predicting the power of the new energy power plant according to meteorological data. The meteorological data file is used for storing meteorological data. Therefore, long-term, stable and safe transmission of meteorological data files has been an area of great concern to power forecasting manufacturers.
In the prior art, a weather server downloads a weather data file from a numerical weather forecast server. Because the meteorological data is widely used in the fields of transportation, agriculture, daily life and the like, and has public attributes, the general public can acquire the meteorological data without specially considering the safety problem. Therefore, ftp and sftp are common transmission technologies currently used for downloading meteorological data files. During the transmission process of the meteorological data files, the meteorological data files can be downloaded and uploaded only by providing a user name and a password, and even more importantly, the meteorological data files needing to be downloaded can be checked by logging in a numerical weather forecast server through third-party software. The transmission mode greatly increases the risks of hacker attack on the numerical weather forecast server, tampering and deletion of the weather data file, greatly influences the accuracy of power prediction of the new energy power plant, and can not inform relevant personnel in time if the weather data file is downloaded successfully or not, so that the safety production of the new energy power plant is influenced.
Disclosure of Invention
In view of the problems in the prior art, embodiments of the present invention provide a method and an apparatus for transmitting meteorological data files, which overcome the above problems or at least partially solve the above problems.
In a first aspect, an embodiment of the present invention provides a method for transmitting a meteorological data file, including:
receiving a meteorological data file downloading request sent by a client, and authenticating the client according to an https protocol header carried by the meteorological data file downloading request;
if the authentication is not passed, judging whether the times of the authentication failure of the client in a preset time period reach a preset maximum time or not; if not, judging whether a preset forced downloading condition is met or not according to the current trial downloading times of the requested target file; if yes, allowing the client to download the target file; if not, not allowing the client to download the target file;
the format of the https protocol header is predefined; the https protocol header includes account authentication information, target file information, and the number of current attempts to download the target file.
In a second aspect, an embodiment of the present invention provides a method for transmitting a meteorological data file, including:
sending a weather data file downloading request to a server side, so that the server side carries out authentication according to an https protocol header carried by the weather data file downloading request, judging whether the number of times of authentication failure in a preset time period reaches a preset maximum number of times after the authentication failure, and replying a judgment result;
receiving the judgment result, if the judgment result is not reached, adding 1 to the total trial download frequency of the target file, taking the new total trial download frequency of the target file as the new current trial download frequency of the target file, and generating a new meteorological data file download request;
wherein the meteorological data file downloading request carries an https protocol header; the format of the https protocol header is predefined; the https protocol header includes account authentication information, target file information, and a current number of attempted downloads of the target file.
In a third aspect, an embodiment of the present invention provides a meteorological data file transmission apparatus, including:
the authentication module is used for receiving a meteorological data file downloading request sent by a client and authenticating the client according to an https protocol header carried by the meteorological data file downloading request;
the judging module is used for judging whether the times of the client end failing to pass the authentication in a preset time period reach a preset maximum time or not if the authentication fails; if not, judging whether a preset forced downloading condition is met or not according to the current trial downloading times of the requested target file; if yes, allowing the client to download the target file; if not, not allowing the client to download the target file;
the format of the https protocol header is predefined; the https protocol header includes account authentication information, target file information, and the number of current attempts to download the target file.
In a fourth aspect, an embodiment of the present invention provides a meteorological data file transmission apparatus, including:
the sending module is used for sending a weather data file downloading request to a server so that the server can carry out authentication according to an https protocol header carried by the weather data file downloading request, judging whether the number of times of authentication failure in a preset time period reaches a preset maximum number of times or not after the authentication failure, and replying a judgment result;
the receiving module is used for receiving the judgment result, if the judgment result is not reached, adding 1 to the total trial download frequency of the target file, taking the new total trial download frequency of the target file as the new current trial download frequency of the target file, and generating a new meteorological data file download request;
wherein the meteorological data file downloading request carries an https protocol header; the format of the https protocol header is predefined; the https protocol header includes account authentication information, target file information, and a current number of attempted downloads of the target file.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the meteorological data file transmission method provided by any one of the various possible implementations of the first aspect.
In a sixth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the meteorological data file transmission method provided in any one of the various possible implementations of the first aspect.
The meteorological data file transmission method and the meteorological data file transmission device provided by the embodiment of the invention realize the downloading of the meteorological data file based on the https protocol, determine whether the downloading is allowed according to whether the error authentication window overflow and the forced downloading condition are met, and can ensure the authenticity and integrity of the meteorological data file by combining the modern transmission technology and the corresponding safety strategy, so that the meteorological data file can be transmitted safely and stably, and the transmission safety of the meteorological data file can be improved. Furthermore, the power prediction progress can be mastered in real time, and the accuracy of the power prediction of the new energy power plant is guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart illustrating a method for transmitting a weather data file according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a method for transmitting a weather data file according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of a meteorological data file transmission apparatus provided according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of a meteorological data file transmission apparatus provided according to an embodiment of the present invention;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. The embodiments of the present invention, and all other embodiments obtained by a person of ordinary skill in the art without any inventive step, are within the scope of the present invention.
In order to overcome the above problems in the prior art, embodiments of the present invention provide a method and an apparatus for transmitting a weather data file, where the server and the client communicate (including data transmission) based on an https protocol, and a format of a protocol header (abbreviated as https protocol header) of the https protocol is defined in advance, so as to perform authentication according to the protocol header of the https protocol, thereby implementing secure transmission of the weather data file.
To facilitate an understanding of the various embodiments of the present invention, a power prediction system is described below.
The power prediction system may include three regions: the system comprises a meteorological data file transmission area, a first safety area and a second safety area. Unidirectional data transmission exists between the meteorological data file transmission area and the second safety area; there is data transfer between the first secure area and the second secure area.
The weather data file transmission area may include a weather server, a numerical weather forecast server, and a reverse isolation device. And the numerical weather forecast server is used for storing the weather data obtained by weather forecast in a form of a weather data file. And the weather server is used for loading and unloading the weather data file from the numerical weather forecast server. Data transmission between the weather server and the numerical weather forecast server may be performed through the Internet (Internet). The reverse isolation device, such as a gatekeeper, is used for reverse isolating the weather data file transmission area from the second security area, i.e. only allowing the second security area to obtain data from the weather data file transmission area, but not allowing the second security area to write data into the weather data file transmission area.
The devices in the first security zone can be connected through a private network, and the private network has higher security relative to the internet, so the first security zone can be called. The first security area may include an EMS (Energy Management System) database.
The devices in the second security zone can be connected through a private network, and the private network has higher security relative to the internet, so the second security zone can be called. The second safe zone may include a forecast system work machine, a forecast system backup machine, a data collection server, and a workstation. The prediction system standby machine, the data acquisition server and the workstation are respectively connected with the prediction system working machine. The prediction system working machine is connected with the reverse isolation device to obtain a meteorological data file; the prediction system worker obtains EMS data from an EMS database. And a firewall is further included between the first safety zone and the second safety zone, and particularly, the firewall is deployed between the prediction system working machine and the EMS database. The data collection server is used for storing other data required by power prediction besides the meteorological data and EMS data. And the user calls a prediction system working machine through the workstation to perform power prediction on the new energy power plant according to the meteorological data, the EMS data and other data. When the working machine of the prediction system can not normally carry out power prediction, the standby machine of the prediction system carries out power prediction.
The meteorological data file transmission in the embodiments of the invention refers to a process that a meteorological server carries meteorological data files up and down from a numerical weather forecast server. In the following examples, the server is an https server and an index value weather forecast server; the client is an https client and refers to a meteorological server.
Fig. 1 is a schematic flow chart of a meteorological data file transmission method according to an embodiment of the invention. As shown in fig. 1, a meteorological data file transmission method includes: step S101, receiving a meteorological data file downloading request sent by a client, and authenticating the client according to an https protocol header carried by the meteorological data file downloading request; the format of the https protocol header is predefined; the https protocol header includes account authentication information, target file information, and the number of current attempts to download the target file.
It should be noted that the main execution body of the meteorological data file transmission method provided by the embodiment of the present invention is a server.
It should be noted that, the format of the https protocol header on which communication (including data transmission) between the server and the client is based is customized in advance. The format of the custom https protocol header includes account Authentication information (Authentication), target file information (TargetFileInfo), and the number of current attempts to download the target file (AttemptTimes). The account authentication information, the target file information and the current number of attempts to download the target file are all variables.
The account authentication information refers to information for authenticating the client. Account authentication information may include a username, password, and other authentication information.
And the target file refers to the meteorological data file requested to be downloaded by the client. The object file information, which refers to information related to the object file, may include, but is not limited to, the name, size, MD5 value, etc. of the object file.
The number of current attempts to download the target file refers to the total number of times the client has requested the target file to be downloaded (this time containing the currently transmitted request for downloading the weather data file).
The http Protocol (Hypertext Transfer Protocol over Secure Socket Layer or Hypertext Transfer Protocol Secure) is an http channel targeted for security, and may be understood as a Secure version of http. Namely http, adding an SSL (Secure Socket Layer) Layer, the Secure basis of httpS is SSL, which relies on certificates to verify the identity of the server and encrypt the communication between the browser and the server. Therefore, compared with the communication based on the http protocol, the communication based on the https protocol is safer and more reliable.
The weather data file downloading request refers to a request sent by a client for downloading a target file from a server.
The weather data file downloading request and the response of the client to the weather data file downloading request both comprise https protocol headers.
After the server receives the download request of the weather data file, the account authentication information, the target file information and the current download attempt times of the target file can be obtained according to the https protocol header carried by the download request.
And after the account authentication information is obtained, authenticating the client according to the account authentication information.
Step S102, if the authentication fails, judging whether the times of the authentication failure of the client in a preset time period reach a preset maximum time; if not, judging whether a preset forced downloading condition is met or not according to the current trial downloading times of the requested target file; if yes, allowing the client to download the target file; and if not, not allowing the client to download the target file.
Specifically, if the authentication fails, that is, the authentication fails, it is determined whether the incorrect authentication window overflows.
The overflow of the false authentication window refers to that the number of times of the failed client authentication in the preset time period reaches the preset maximum number of times. For example, client a fails authentication 10000 times in 3 hours.
If the error authentication window does not overflow, namely the number of times that the client authentication fails does not reach the preset maximum number of times, continuously judging whether the preset forced downloading condition is met.
And the preset forced downloading condition is that whether the current attempted downloading frequency of the target file is a preset frequency or not. The preset number is a specific number.
For example, the preset number of times is 6, if the previous 5 times of downloading of a certain file fails, the 6 th time requests to download the file, and if the authentication fails and the number of times of failing does not reach the preset maximum number of times, the preset forced downloading condition is met; and if the previous 4 times of downloading of a certain file fail, requesting to download the file for the 5 th time, and if the authentication fails and the number of times of failure does not reach the preset maximum number, not meeting the preset forced downloading condition.
And if the preset forced downloading condition is met, the server side allows the client side to download the target file.
The forced downloading condition is preset to prevent the new energy power plant from missing the optimal downloading time due to authentication errors caused by some reasons, so that the new energy power plant can also download the meteorological data file under the condition, even if the data is stolen, only a small amount of data is needed, and the influence can be ignored.
If the preset forced downloading condition is not met, the server side does not allow the client side to download the target file, and informs the client side, and the client side can continuously try to download the target file because the error authentication window does not overflow.
It should be noted that the server also sends a download response to the client to notify the client of the result of determining whether the incorrect authentication window overflows.
The embodiment of the invention realizes the downloading of the meteorological data file based on the https protocol, determines whether to allow downloading according to whether the error authentication window overflow and forced downloading conditions are met, and can ensure the authenticity and integrity of the meteorological data file by combining the modern transmission technology and the corresponding safety strategy, safely and stably transmit the meteorological data file and improve the transmission safety of the meteorological data file. Furthermore, the power prediction progress can be mastered in real time, and the accuracy of the power prediction of the new energy power plant is guaranteed.
Based on the content of the foregoing embodiments, after determining whether the number of times that the authentication fails within the preset time period reaches the preset maximum number of times, the method further includes: and if so, rejecting all weather data file downloading requests of the client.
Specifically, if the error authentication window overflows, all weather data file downloading requests of the client are rejected.
And all the meteorological data file downloading requests of the client comprise the meteorological data file downloading request of the client at this time and the meteorological data file downloading requests of each time after this time.
The method can reject all weather data file downloading requests sent by the IP address in a mode of closing the IP address used by the client from the application layer, and realize rejection of all weather data file downloading requests of the client, but is not limited to the mode.
The application layer, which refers to the seventh layer of the seven-layer OSI model, directly provides services for application processes, and has the function of completing services required by a series of business processing while realizing the mutual communication of a plurality of system application processes. The https protocol belongs to the application layer protocol.
The embodiment of the invention can improve the safety of meteorological data file transmission by rejecting all meteorological data file downloading requests of the client under the condition that the error authentication window overflows.
Based on the content of the foregoing embodiments, after authenticating the client, the method further includes: if the authentication is passed, judging whether the target file exists according to the target file information; and if so, allowing the client to download the target file.
Specifically, if the client passes the authentication, it is determined whether the target file requested to be downloaded by the client exists in the server according to the target file information, that is, whether the target file exists (exists) in the server is determined.
And if the target file exists on the server, allowing the client to download the target file.
The embodiment of the invention realizes the downloading of the meteorological data file based on the https protocol, can ensure the authenticity and integrity of the meteorological data file, transmits safely and stably, and can improve the safety of meteorological data file transmission.
Based on the content of the foregoing embodiments, after determining whether the target file exists according to the target file information, the method further includes: and if the target file does not exist, sending a downloading response to the client to inform the client that the target file does not exist.
Specifically, the download response refers to a response of the client to the weather data file download request.
The https protocol header may also include a status code (StatusCode). The status code is used for describing the downloading status of the meteorological data file, and can be used for describing whether to resume transmission at a breakpoint, whether a target file exists, whether a password is wrong or not and the like. The state code is a variable.
Because the download response also carries the https protocol header, if the target file does not exist, the state code in the https protocol header carried by the download response can be modified to the state code in which the target file does not exist, and the download response is sent to the client. After receiving the download response, the client can know that the target file of the request does not exist according to the download response, and continue to request to download the target file in the subsequent requests.
It should be noted that the client download request is subject to the configuration of the time period. There are two basic types of meteorological data files: the first is a meteorological data file for short term power prediction, this kind of file is typically one a day; the second is a meteorological data file for ultra-short term power prediction, which is typically one every several minutes (e.g., one every 15 minutes). The downloading time period can be configured aiming at the meteorological data files, and the downloading time period can be configured to be one hour for the first meteorological data file; for the second type of meteorological data file, it may be configured to be the same as the generation interval of the file (e.g., 15 minutes). Because the meteorological data file is important to power prediction, and the server and the client do not know when the target file appears on the numerical weather forecast server, the client can continuously request to download the target file if the client knows that the target file requested at this time does not exist in the configured downloading time period; outside the configured downloading time period, if the client knows that the target file requested this time does not exist, the client does not request to download the target file any more, and when the next downloading time period comes, whether the weather data file requested to be downloaded at this time is a new target file or not is judged according to the information such as the name and/or the MD5 value of the weather data file requested to be downloaded at this time.
The embodiment of the invention ensures that the client side continuously initiates the downloading request of the target file in the configured downloading time period by judging whether the target file exists or not and informing the client side when the target file does not exist, thereby ensuring that the target file can be downloaded to a required meteorological data file more possibly.
FIG. 2 is a flowchart illustrating a method for transmitting a weather data file according to an embodiment of the present invention. Based on the content of the foregoing embodiments, as shown in fig. 2, a method for transmitting a meteorological data file is characterized by including: step S201, sending a weather data file downloading request to a server side, so that the server side carries out authentication according to an https protocol header carried by the weather data file downloading request, judging whether the number of times of authentication failure in a preset time period reaches a preset maximum number of times after the authentication failure, and replying a judgment result; wherein, the weather data file downloading request carries an https protocol header; the format of the https protocol header is predefined; the https protocol header includes account authentication information, target file information, and the number of current attempts to download the target file.
It should be noted that the main execution body of the meteorological data file transmission method provided by the embodiment of the present invention is a client.
And the server and the client communicate based on the https protocol.
When a client needs to download a certain meteorological data file, the meteorological data file is used as a target file, an https protocol header carried by a meteorological data file downloading request is generated according to a preset format of the https protocol header, a file downloading request is generated, and the meteorological data file downloading request is sent to a server.
After the server receives the download request of the weather data file, the account authentication information, the target file information and the current download attempt times of the target file can be obtained according to the https protocol header carried by the download request. And after the account authentication information is obtained, authenticating the client according to the account authentication information. If the authentication fails, judging whether the times of the client end failing to pass the authentication in the preset time period reach the preset maximum times, and informing the client end of the judgment result whether the error authentication window overflows or not through a download response sent to the client end.
And S202, receiving the judgment result, if the judgment result is not reached, adding 1 to the total trial download frequency of the target file, taking the new total trial download frequency of the target file as the new current trial download frequency of the target file, and generating a new meteorological data file download request.
After the client receives the judgment result, if the judgment result is not reached, the error authentication window is not overflowed, and the downloading instruction can be continuously initiated because the meteorological data file downloading request is not allowed. The specific process of continuing to initiate the downloading instruction may include: adding 1 to the current trial download times (AttemptTimes) of the target file to serve as the current trial download times (AttemptTimes) of the target file in the https protocol header carried by the next meteorological data file download request, generating the next meteorological data file download request, returning to the step of sending the meteorological data file download request, and requesting to download the target file again.
The embodiment of the invention realizes the downloading of the meteorological data file based on the https protocol, determines whether the downloading is allowed according to whether the error authentication window overflow is met, and can ensure the authenticity and integrity of the meteorological data file by combining the modern transmission technology and the corresponding safety strategy, safely and stably transmit the meteorological data file and improve the transmission safety of the meteorological data file. Furthermore, the power prediction progress can be mastered in real time, and the accuracy of the power prediction of the new energy power plant is guaranteed.
Based on the content of the foregoing embodiments, after receiving the determination result, the method further includes: and if the judgment result is achieved, notifying a preset worker.
Specifically, after the client receives the judgment result, if the judgment result is reached, it indicates that the error authentication window overflows, and an error occurs in a certain link in the meteorological data file transmission, and the error needs to be processed by a worker, so that the client can notify a predetermined worker by sending a short message, an instant messaging message, an email, and the like. The predetermined staff member can receive the notification through a terminal such as a mobile phone, a computer, or the like and perform processing in real time.
The embodiment of the invention informs the preset staff when the error authentication window overflows, so that the staff can technically eliminate and process the errors in the meteorological data file transmission, can inform the staff in real time and in time, can realize the real-time notification of the meteorological data file transmission service completion degree, and ensures the meteorological data file to be transmitted safely and stably.
FIG. 3 is a functional block diagram of a meteorological data file transmission apparatus according to an embodiment of the present invention. Based on the content of the above embodiments, as shown in fig. 3, the meteorological data file transmission apparatus includes an authentication module 301 and a determination module 302, wherein:
the authentication module 301 is configured to receive a weather data file download request sent by a client, and authenticate the client according to an https protocol header carried by the weather data file download request;
a determining module 302, configured to determine whether the number of times that the authentication fails within a preset time period reaches a preset maximum number of times if the authentication fails; if not, judging whether a preset forced downloading condition is met or not according to the current trial downloading times of the requested target file; if yes, allowing the client to download the target file; if not, the client is not allowed to download the target file;
the format of the https protocol header is predefined; the https protocol header includes account authentication information, target file information, and the number of current attempts to download the target file.
Specifically, after receiving a weather data file download request, the authentication module 301 may obtain account authentication information, target file information, and current download attempt times of the target file according to an https protocol header carried in the download request; and after the account authentication information is obtained, authenticating the client according to the account authentication information.
If the authentication fails, the determining module 302 determines whether the number of times that the client fails in the preset time period reaches a preset maximum number of times (i.e., whether the error authentication window overflows), if the error authentication window does not overflow, determines whether a preset forced download condition is satisfied according to the current number of attempted downloads of the target file, and if so, allows the client to download the target file; and if not, not allowing the client to download the target file.
The specific method and process for implementing the corresponding function by the sub-modules included in the meteorological data file transmission device are described in the embodiment of the meteorological data file transmission method on the server side, and are not described herein again.
The meteorological data file transmission device is used for the meteorological data file transmission method on the service side in each of the foregoing embodiments. Therefore, the description and definition in the transmission method of the service-side weather data file in the foregoing embodiments can be used for understanding the execution modules in the embodiments of the present invention.
The embodiment of the invention realizes the downloading of the meteorological data file based on the https protocol, determines whether to allow downloading according to whether the error authentication window overflow and forced downloading conditions are met, and can ensure the authenticity and integrity of the meteorological data file by combining the modern transmission technology and the corresponding safety strategy, safely and stably transmit the meteorological data file and improve the transmission safety of the meteorological data file. Furthermore, the power prediction progress can be mastered in real time, and the accuracy of the power prediction of the new energy power plant is guaranteed.
FIG. 4 is a functional block diagram of a meteorological data file transmission apparatus provided according to an embodiment of the present invention. Based on the content of the above embodiments, as shown in fig. 4, the meteorological data file transmission apparatus includes a sending module 401 and a receiving module 402, wherein:
the sending module 401 is configured to send a weather data file downloading request to the server, so that the server performs authentication according to an https protocol header carried by the weather data file downloading request, after the authentication fails, determines whether the number of times of the authentication failing in a preset time period reaches a preset maximum number of times, and replies a determination result;
a receiving module 402, configured to receive the determination result, add 1 to the total number of attempted downloads of the target file if the determination result is not reached, take the new total number of attempted downloads of the target file as the new current number of attempted downloads of the target file, and generate a new weather data file download request;
wherein, the weather data file downloading request carries an https protocol header; the format of the https protocol header is predefined; the https protocol header includes account authentication information, target file information, and the number of current attempts to download the target file.
Specifically, the sending module 401 sends a weather data file downloading request carrying an https protocol header to the server.
The receiving module 402 receives a determination result of whether the number of times of the authentication failure of the client in a preset time period reaches a preset maximum number of times when the authentication failure replied by the server fails, and continues to initiate a download instruction when it is known that the determination result is not reached.
The specific method and process for implementing the corresponding function by the sub-modules included in the meteorological data file transmission device are described in the embodiment of the meteorological data file transmission method at the client side, and are not described herein again.
The meteorological data file transmission apparatus is used for the client-side meteorological data file transmission method of the foregoing embodiments. Therefore, the description and definition in the client-side weather data file transmission method in the foregoing embodiments can be used for understanding the execution modules in the embodiments of the present invention.
The embodiment of the invention realizes the downloading of the meteorological data file based on the https protocol, determines whether the downloading is allowed according to whether the error authentication window overflow is met, and can ensure the authenticity and integrity of the meteorological data file by combining the modern transmission technology and the corresponding safety strategy, safely and stably transmit the meteorological data file and improve the transmission safety of the meteorological data file. Furthermore, the power prediction progress can be mastered in real time, and the accuracy of the power prediction of the new energy power plant is guaranteed.
Fig. 5 is a block diagram of an electronic device according to an embodiment of the present invention. Based on the content of the above embodiment, as shown in fig. 5, the electronic device may include: a processor (processor)501, a memory (memory)502, and a bus 503; the processor 501 and the memory 502 complete communication with each other through a bus 503; the processor 501 is used to invoke computer program instructions stored in the memory 502 and executable on the processor 501 to perform the methods provided by the various method embodiments described above, including for example: receiving a meteorological data file downloading request sent by a client, authenticating the client according to an https protocol header carried by the meteorological data file downloading request, if the authentication is not passed, judging whether the number of times of the authentication which is not passed by the client in a preset time period reaches a preset maximum number of times, if the authentication is not passed, judging whether a preset forced downloading condition is met according to the current trial downloading number of times of the requested target file, if the preset forced downloading condition is met, allowing the client to download the target file, and if the preset forced downloading condition is not met, not allowing the client to download the target file; or sending a weather data file downloading request to the server, so that the server authenticates according to an https protocol header carried by the weather data file downloading request, judges whether a preset forced downloading condition is met or not according to the current trial downloading frequency of the requested target file after the authentication fails, replies a judgment result, receives the judgment result, adds 1 to the total trial downloading frequency of the target file if the judgment result is not met, takes the new total trial downloading frequency of the target file as the new current trial downloading frequency of the target file, and generates a new weather data file downloading request.
Another embodiment of the present invention discloses a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the above-mentioned method embodiments, for example, including: receiving a meteorological data file downloading request sent by a client, authenticating the client according to an https protocol header carried by the meteorological data file downloading request, if the authentication is not passed, judging whether the number of times of the authentication which is not passed by the client in a preset time period reaches a preset maximum number of times, if the authentication is not passed, judging whether a preset forced downloading condition is met according to the current trial downloading number of times of the requested target file, if the preset forced downloading condition is met, allowing the client to download the target file, and if the preset forced downloading condition is not met, not allowing the client to download the target file; or sending a weather data file downloading request to the server, so that the server authenticates according to an https protocol header carried by the weather data file downloading request, judges whether a preset forced downloading condition is met or not according to the current trial downloading frequency of the requested target file after the authentication fails, replies a judgment result, receives the judgment result, adds 1 to the total trial downloading frequency of the target file if the judgment result is not met, takes the new total trial downloading frequency of the target file as the new current trial downloading frequency of the target file, and generates a new weather data file downloading request.
Furthermore, the logic instructions in the memory 502 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or make a contribution to the prior art, or may be implemented in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Another embodiment of the present invention provides a non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the methods provided by the above method embodiments, for example, including: receiving a meteorological data file downloading request sent by a client, authenticating the client according to an https protocol header carried by the meteorological data file downloading request, if the authentication is not passed, judging whether the number of times of the authentication which is not passed by the client in a preset time period reaches a preset maximum number of times, if the authentication is not passed, judging whether a preset forced downloading condition is met according to the current trial downloading number of times of the requested target file, if the preset forced downloading condition is met, allowing the client to download the target file, and if the preset forced downloading condition is not met, not allowing the client to download the target file; or sending a weather data file downloading request to the server, so that the server authenticates according to an https protocol header carried by the weather data file downloading request, judges whether a preset forced downloading condition is met or not according to the current trial downloading frequency of the requested target file after the authentication fails, replies a judgment result, receives the judgment result, adds 1 to the total trial downloading frequency of the target file if the judgment result is not met, takes the new total trial downloading frequency of the target file as the new current trial downloading frequency of the target file, and generates a new weather data file downloading request.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. It is understood that the above-described technical solutions may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method of the above-described embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A meteorological data file transmission method is characterized by comprising the following steps:
receiving a meteorological data file downloading request sent by a client, and authenticating the client according to an https protocol header carried by the meteorological data file downloading request;
if the authentication is not passed, judging whether the times of the authentication failure of the client in a preset time period reach a preset maximum time or not; if not, judging whether a preset forced downloading condition is met or not according to the current trial downloading times of the requested target file; if yes, allowing the client to download the target file; if not, not allowing the client to download the target file;
the format of the https protocol header is predefined; the https protocol header comprises account authentication information, target file information and the number of current attempts to download the target file;
the preset forced downloading condition is that whether the current attempted downloading frequency of the target file is a preset frequency or not, and the preset frequency is a specific numerical value.
2. The weather data file transmission method according to claim 1, wherein the determining whether the number of times that the client fails to authenticate within the preset time period reaches a preset maximum number of times further comprises:
and if so, rejecting all weather data file downloading requests of the client.
3. The weather data file transmission method according to claim 1 or 2, wherein the authenticating the client further comprises:
if the authentication is passed, judging whether the target file exists according to the target file information;
and if so, allowing the client to download the target file.
4. The weather data file transmission method according to claim 3, wherein the determining whether the target file exists according to the target file information further comprises:
and if the target file does not exist, sending a downloading response to the client to inform the client that the target file does not exist.
5. A meteorological data file transmission method is characterized by comprising the following steps:
sending a weather data file downloading request to a server side, so that the server side carries out authentication according to an https protocol header carried by the weather data file downloading request, judging whether the number of times of authentication failure in a preset time period reaches a preset maximum number of times after the authentication failure, and replying a judgment result;
receiving the judgment result, if the judgment result is not reached, adding 1 to the total trial download frequency of the target file, taking the new total trial download frequency of the target file as the new current trial download frequency of the target file, and generating a new meteorological data file download request;
wherein the meteorological data file downloading request carries an https protocol header; the format of the https protocol header is predefined; the https protocol header comprises account authentication information, target file information and the current attempted download times of the target file;
the preset forced downloading condition is that whether the current attempted downloading frequency of the target file is a preset frequency or not, and the preset frequency is a specific numerical value;
the server side judges whether the number of times that the client side fails in authentication in a preset time period reaches a preset maximum number of times; and if not, the server judges whether the preset forced downloading condition is met or not according to the current trial downloading times of the requested target file.
6. The weather data file transmission method according to claim 5, further comprising, after receiving the determination result:
and if the judgment result is achieved, notifying a preset worker.
7. A meteorological data file transmission apparatus, comprising:
the authentication module is used for receiving a meteorological data file downloading request sent by a client and authenticating the client according to an https protocol header carried by the meteorological data file downloading request;
the judging module is used for judging whether the times of the client end failing to pass the authentication in a preset time period reach a preset maximum time or not if the authentication fails; if not, judging whether a preset forced downloading condition is met or not according to the current trial downloading times of the requested target file; if yes, allowing the client to download the target file; if not, not allowing the client to download the target file;
the format of the https protocol header is predefined; the https protocol header comprises account authentication information, target file information and the number of current attempts to download the target file;
the preset forced downloading condition is that whether the current attempted downloading frequency of the target file is a preset frequency or not, and the preset frequency is a specific numerical value.
8. A meteorological data file transmission apparatus, comprising:
the sending module is used for sending a weather data file downloading request to a server so that the server can carry out authentication according to an https protocol header carried by the weather data file downloading request, judging whether the number of times of authentication failure in a preset time period reaches a preset maximum number of times or not after the authentication failure, and replying a judgment result;
the receiving module is used for receiving the judgment result, if the judgment result is not reached, adding 1 to the total trial download frequency of the target file, taking the new total trial download frequency of the target file as the new current trial download frequency of the target file, and generating a new meteorological data file download request;
wherein the meteorological data file downloading request carries an https protocol header; the format of the https protocol header is predefined; the https protocol header comprises account authentication information, target file information and the current attempted download times of the target file;
the preset forced downloading condition is that whether the current attempted downloading frequency of the target file is a preset frequency or not, and the preset frequency is a specific numerical value;
the server side judges whether the number of times that the client side fails in authentication in a preset time period reaches a preset maximum number of times; and if not, the server judges whether the preset forced downloading condition is met or not according to the current trial downloading times of the requested target file.
9. An electronic device, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 6.
10. A non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the method of any one of claims 1 to 6.
CN201811494353.6A 2018-12-07 2018-12-07 Meteorological data file transmission method and device Active CN109639666B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811494353.6A CN109639666B (en) 2018-12-07 2018-12-07 Meteorological data file transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811494353.6A CN109639666B (en) 2018-12-07 2018-12-07 Meteorological data file transmission method and device

Publications (2)

Publication Number Publication Date
CN109639666A CN109639666A (en) 2019-04-16
CN109639666B true CN109639666B (en) 2020-12-25

Family

ID=66071895

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811494353.6A Active CN109639666B (en) 2018-12-07 2018-12-07 Meteorological data file transmission method and device

Country Status (1)

Country Link
CN (1) CN109639666B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112087510B (en) * 2020-09-08 2022-10-28 中国工商银行股份有限公司 Request processing method, device, electronic equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693506A (en) * 2012-06-08 2012-09-26 北京惠银通联科技有限公司 Device and method for supporting operation of mobile traction business process
CN103052060A (en) * 2011-10-17 2013-04-17 联想(北京)有限公司 Method for improving information security of mobile terminal and mobile terminal
CN105897911A (en) * 2016-05-20 2016-08-24 广州优视网络科技有限公司 File downloading method and device and user terminal
CN106250192A (en) * 2016-08-04 2016-12-21 芯讯通无线科技(上海)有限公司 The method for upgrading software of host computer and system
CN106598661A (en) * 2016-12-08 2017-04-26 上海众人网络安全技术有限公司 Method and system for dynamically updating plug-in

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180101375A1 (en) * 2016-10-12 2018-04-12 Lenovo Enterprise Solutions (Singapore) Pte. Ltd. Data storage device initiation of firmware download during inactivity

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103052060A (en) * 2011-10-17 2013-04-17 联想(北京)有限公司 Method for improving information security of mobile terminal and mobile terminal
CN102693506A (en) * 2012-06-08 2012-09-26 北京惠银通联科技有限公司 Device and method for supporting operation of mobile traction business process
CN105897911A (en) * 2016-05-20 2016-08-24 广州优视网络科技有限公司 File downloading method and device and user terminal
CN106250192A (en) * 2016-08-04 2016-12-21 芯讯通无线科技(上海)有限公司 The method for upgrading software of host computer and system
CN106598661A (en) * 2016-12-08 2017-04-26 上海众人网络安全技术有限公司 Method and system for dynamically updating plug-in

Also Published As

Publication number Publication date
CN109639666A (en) 2019-04-16

Similar Documents

Publication Publication Date Title
US9654480B2 (en) Systems and methods for profiling client devices
CN104811433A (en) Distributed IoT (Internet of Things) solution scheme of C/S configuration
CN110365741A (en) A kind of connection method for building up and transfer server
CN104320767A (en) Short message verification system and method
CN112668913B (en) Network construction method, device, equipment and storage medium based on federal learning
CN106899642A (en) A kind of Internet of Things link management method and equipment
CN107317852A (en) Smart machine, communication system and the method extended based on MODBUS
CN104601541A (en) Data transmission method, server and user equipment
CN109639666B (en) Meteorological data file transmission method and device
CN110912907B (en) Attack protection method and device in SSL handshake phase
CN108400955A (en) A kind of means of defence and system of network attack
CN112087475B (en) Message pushing method and device for cloud platform component application and message server
US10515318B2 (en) Automated resolution of Wi-Fi connectivity issues over SMS
CN105812380A (en) Verification method and device
CN106912049B (en) Method for improving user authentication experience
CN115150162B (en) Root certificate updating method and device
CN111901298A (en) Method and device for determining cloud short message platform during SSLVPN authentication and electronic equipment
CN109348472B (en) OTA (over the air) upgrading method and system based on single-point pushing
CN107634969B (en) Data interaction method and device
CN111835504A (en) Identification code generation method and server
CN115633359A (en) PFCP session security detection method, device, electronic equipment and storage medium
CN110830420A (en) Method and system for verifying short message verification code
US20180013752A1 (en) Securing connections to unsecure internet resources
CN112804201B (en) Method and device for acquiring equipment information
CN112217659B (en) Method and system for adding client terminal equipment to SD-WAN system

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