CN109088929A - For sending the method and device of information - Google Patents

For sending the method and device of information Download PDF

Info

Publication number
CN109088929A
CN109088929A CN201810902735.1A CN201810902735A CN109088929A CN 109088929 A CN109088929 A CN 109088929A CN 201810902735 A CN201810902735 A CN 201810902735A CN 109088929 A CN109088929 A CN 109088929A
Authority
CN
China
Prior art keywords
information
server
configuration file
data processing
heartbeat message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810902735.1A
Other languages
Chinese (zh)
Other versions
CN109088929B (en
Inventor
吴金霖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810902735.1A priority Critical patent/CN109088929B/en
Publication of CN109088929A publication Critical patent/CN109088929A/en
Application granted granted Critical
Publication of CN109088929B publication Critical patent/CN109088929B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the present application discloses the method and device for sending information.One specific embodiment of this method includes: to obtain the status information and data processing of information of at least one server, wherein above-mentioned data processing of information is used to characterize the total data treating capacity received the unit time;By status information and data processing information architecture configuration file, above-mentioned configuration file is used to indicate the data processing amount of server;The version number of above-mentioned configuration file is set, and above-mentioned version number is sent at least one above-mentioned server.The embodiment enables to server to obtain newest configuration file according to version number, adjusts the data processing amount of each server in time, improves the utilization rate and data-handling efficiency of server.

Description

For sending the method and device of information
Technical field
The invention relates to field of computer technology, and in particular to for sending the method and device of information.
Background technique
Distributed system has generally comprised multiple servers.It is distributed for the data processing amount of balanced each server System can handle task to server allocation data in several ways, so that each server balancedly receives simultaneously as far as possible Handle data processing task.
Summary of the invention
The embodiment of the present application proposes the method and device for sending information.
In a first aspect, the embodiment of the present application provides a kind of method for sending information, it is applied to include at least one The distributed system of server, this method comprises: the status information and data processing of information of at least one server are obtained, In, above-mentioned data processing of information is used to characterize the total data treating capacity received the unit time;At status information and data Information architecture configuration file is managed, above-mentioned configuration file is used to indicate the data processing amount of server;Above-mentioned configuration file is set Version number, and above-mentioned version number is sent at least one above-mentioned server.
In some embodiments, the status information and data processing of information of above-mentioned at least one server of acquisition, comprising: connect The heartbeat message that at least one server is sent is received, the status information of at least one above-mentioned server is determined according to heartbeat message, Wherein, heartbeat message is sent according to the frequency of setting, and status information includes normal or failure.
In some embodiments, the above-mentioned status information that at least one above-mentioned server is determined according to heartbeat message, comprising: It is less than the quantity of server at least one above-mentioned server in response to the quantity of the heartbeat message received, determination is not sent The server of heartbeat message, and state detecting information is sent to no server for sending heartbeat message, wherein above-mentioned state inspection Measurement information is used to indicate detection without the status information of the server of transmission heartbeat message;Heartbeat is not sent in response to receiving The feedback information of the above-mentioned state detecting information of the correspondence that the server of information is sent, will return the shape of the server of feedback information State information is set as normal.
In some embodiments, the above-mentioned status information that at least one above-mentioned server is determined according to heartbeat message, comprising: The feedback information for the above-mentioned state detecting information of correspondence that the server of heartbeat message is sent is not sent in response to being not received by, Failure is set by the status information of no server for returning to feedback information.
In some embodiments, above by status information and data processing information architecture configuration file, comprising: determine shape State information is the quantity information of normal server;Above-mentioned quantity information and above-mentioned data processing of information are packaged into configuration text Part.
In some embodiments, the above method further include: above-mentioned configuration file is sent to file memory.
Second aspect, the embodiment of the present application provide a kind of method for synchronizing information, are applied to include at least one The distributed system of server, this method comprises: configuration file in version number and memory in response to received configuration file Version number is identical, and the quantity information and data processing of information for including according to configuration file determine local data treating capacity;According to upper Local data treating capacity is stated to handle the data received
In some embodiments, the above method further include: match in the version number and memory in response to received configuration file The version number for setting file is not identical, obtains configuration text corresponding with the version number of above-mentioned received configuration file from file memory Part, and the configuration file is saved to local memory.
In some embodiments, the above method further include: in response to receiving state detecting information, return to corresponding states inspection The feedback information of measurement information.
The third aspect, the embodiment of the present application provide a kind of for sending the device of information, are applied to include at least one The distributed system of server, the device include: information acquisition unit, are configured to obtain the state letter of at least one server Breath and data processing of information, wherein above-mentioned data processing of information is used to characterize the total data treating capacity received the unit time;Match File construction unit is set, is configured to through status information and data processing information architecture configuration file, above-mentioned configuration file is used In the data processing amount of instruction server;Information transmitting unit is configured to be arranged the version number of above-mentioned configuration file, and will be upper It states version number and is sent at least one above-mentioned server.
In some embodiments, above- mentioned information acquiring unit includes: acquisition of information subelement, is configured to receive at least one The heartbeat message that a server is sent determines the status information of at least one above-mentioned server according to heartbeat message, wherein heartbeat Information is sent according to the frequency of setting, and status information includes normal or failure.
In some embodiments, it includes: state detecting information sending module that above- mentioned information, which obtain subelement, in response to receiving To heartbeat message quantity be less than at least one above-mentioned server in server quantity, be configured to determine and do not send the heart The server of hop-information, and state detecting information is sent to no server for sending heartbeat message, wherein above-mentioned state-detection Information is used to indicate detection without the status information of the server of transmission heartbeat message;First state information modified module, response In the feedback information for receiving the above-mentioned state detecting information of correspondence that the server for not sending heartbeat message is sent, it is configured to Set normal for the status information for returning the server of feedback information.
In some embodiments, it includes: the second status information modified module that above- mentioned information, which obtain subelement, in response to not having Receive the feedback information for not sending the above-mentioned state detecting information of correspondence that the server of heartbeat message is sent, be configured to by The status information for not returning to the server of feedback information is set as failure.
In some embodiments, above-mentioned configuration file construction unit includes: that quantity information determines subelement, is configured to really Determine the quantity information that status information is normal server;Configuration file constructs subelement, is configured to above-mentioned quantity information Configuration file is packaged into above-mentioned data processing of information.
In some embodiments, above-mentioned apparatus further include: configuration file transmission unit is configured to above-mentioned configuration file It is sent to file memory.
Fourth aspect, the embodiment of the present application provide a kind of device for synchronizing information, are applied to include at least one The distributed system of server, which includes: local data treating capacity determination unit, in response to the version of received configuration file This number identical as the version number of configuration file in memory, is configured to the quantity information for including according to configuration file and data processing Information determines local data treating capacity;Data processing unit is configured to according to above-mentioned local data treating capacity to receiving Data are handled.
In some embodiments, above-mentioned apparatus further include: configuration file acquiring unit, in response to received configuration file Version number is not identical as the version number of configuration file in memory, is configured to obtain and above-mentioned received configuration from file memory The corresponding configuration file of the version number of file, and the configuration file is saved to memory.
In some embodiments, above-mentioned apparatus further include: feedback information transmission unit, in response to receiving state-detection letter Breath, is configured to return the feedback information of corresponding states detection information.
5th aspect, the embodiment of the present application provide a kind of electronic equipment, comprising: one or more processors;Memory, One or more programs are stored thereon with, when said one or multiple programs are executed by said one or multiple processors, are made It obtains said one or multiple processors executes the method for being used to send information of above-mentioned first aspect or being used for together for second aspect The method for walking information.
6th aspect, the embodiment of the present application provide a kind of computer-readable medium, are stored thereon with computer program, Be characterized in that, the program realized when being executed by processor above-mentioned first aspect for sending the method or second aspect of information Method for synchronizing information.
It is provided by the embodiments of the present application for sending the method and device of information, first the status information of acquisition server and Data processing of information;Then pass through status information and data processing information architecture configuration file;The version of configuration file is finally set This number, and above-mentioned version number is sent to server.This method enables to server to obtain newest configuration according to version number File adjusts the data processing amount of each server in time, improves the utilization rate and data-handling efficiency of server.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the application can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for sending information of the application;
Fig. 3 is the flow chart according to one embodiment of the method for synchronizing information of the application;
Fig. 4 is the schematic diagram according to an application scenarios of the method for sending information of the application;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for sending information of the application;
Fig. 6 is the structural schematic diagram according to one embodiment of the device for synchronizing information of the application;
Fig. 7 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of the embodiment of the present application.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can the method for sending information using the embodiment of the present application or the device for sending information Exemplary system architecture 100.
As shown in Figure 1, system architecture 100 may include system server 101, network 102 and server 103,104, 105,106.Network 102 between system server 101 and server 103,104,105,106 to provide Jie of communication link Matter.Network 102 may include various connection types, such as wired, wireless communication link or fiber optic cables etc..
System server 101 is interacted by network 102 with server 103,104,105,106, to receive or send message Deng.Various data handling utilities can be installed on system server 101, for example, count application, statistics application, information are received and are answered With, information sending application, detection information generate application etc..
System server 101 can be hardware, be also possible to software.When system server 101 is hardware, tool can be There are the various electronic equipments of display screen and data processing, including but not limited to tablet computer, pocket computer on knee and platform Formula computer etc..When system server 101 is software, may be mounted in above-mentioned cited electronic equipment.It can be with It is implemented as multiple softwares or software module (such as providing Distributed Services), single software or software mould also may be implemented into Block is not specifically limited herein.
Server 103,104,105,106 can be to provide the server of various services, such as carry out to received data The data processing server of processing.Data processing server can be according to the configuration file that system server 101 generates to reception To data carry out the processing such as analyzing.
It should be noted that for sending the method for information generally by system server provided by the embodiment of the present application 101 execute, and correspondingly, the device for sending information is generally positioned in system server 101.
It should be noted that server can be hardware, it is also possible to software.When server is hardware, may be implemented At the distributed server cluster that multiple servers form, individual server also may be implemented into.It, can when server is software To be implemented as multiple softwares or software module (such as providing Distributed Services), single software or software also may be implemented into Module is not specifically limited herein.
It should be understood that the number of system server, network and server in Fig. 1 is only schematical.According to realization It needs, can have any number of system server, network and server.
With continued reference to Fig. 2, the process of one embodiment of the method for sending information according to the application is shown 200.The method for being used to send information is applied to the distributed system comprising at least one server, comprising the following steps:
Step 201, the status information and data processing of information of at least one server are obtained.
In the present embodiment, for sending the executing subject (such as system server 101 shown in FIG. 1) of the method for information The status information and number of server 103,104,105,106 can be obtained by wired connection mode or radio connection According to processing information.Wherein, data processing of information can be the information to be processed that distributed system receives.In general, data processing Information can be used for characterizing the total data treating capacity received the unit time.It should be pointed out that above-mentioned radio connection can To include but is not limited to 3G/4G connection, WiFi connection, bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra Wideband) connection and other currently known or exploitation in the future radio connections.
In general, the data processing amount of distributed system is continually changing at any time.Although can be as far as possible balancedly to every Platform server allocation data handle task, but due to the association attributes of data processing task (such as can be data processing content, Data processing rank etc.), cause the data processing amount of each data processing task itself different.Therefore, it is actually allocated to each The data processing amount of server still has very big difference, causes data that cannot be handled in time, data processing it is inefficient.
For this purpose, the executing subject of the application can obtain the status information of at least one server of distributed system first And data processing of information.Wherein, status information is used to characterize the working condition of corresponding server.Data processing of information can be used In the total data treating capacity that the characterization unit time receives.For example, distributed system, which receives 10 users, handles task.Its In, having 5 users to handle task includes 1 data processing amount, and in addition 5 users handle task and contain 2 data processing amounts. Then the total data treating capacity of distributed system is 15.According to the actual situation, data processing of information can also be other data shapes Formula is specific depending on actual needs.
In some optional implementations of the present embodiment, the status information sum number of above-mentioned at least one server of acquisition May include: to receive the heartbeat message sent of at least one server according to processing information, according to heartbeat message determine it is above-mentioned at least The status information of one server.
In practice, for the working condition of timely monitoring server 103,104,105,106, server 103,104,105, 106 time cycles for needing to be spaced setting sent heartbeat message to executing subject.Heartbeat message to executing subject for showing to take Device 103,104,105,106 be engaged in the state worked normally.Wherein, heartbeat message is sent according to the frequency of setting, state letter Breath may include normal or failure.After obtaining heartbeat message, executing subject is assured that server 103,104,105,106 Status information.In practice, heartbeat message and data processing of information can be obtained according to the identical time cycle, to realize to state The synchronization process of information and data processing of information.
It is above-mentioned that at least one above-mentioned service is determined according to heartbeat message in some optional implementations of the present embodiment The status information of device, may comprise steps of:
The first step is less than the number of server at least one above-mentioned server in response to the quantity of the heartbeat message received Amount determines the server without sending heartbeat message, and sends state detecting information to no server for sending heartbeat message.
When the heartbeat quantity that executing subject receives is identical as the quantity of Services in Distributed System device, illustrate whole Server is all in normal operating conditions.When the quantity for the heartbeat message that executing subject receives is less than the quantity of server, Illustrate the case where presence server does not send heartbeat message.Executing subject can determine which takes according to the source of heartbeat message Business device has sent heartbeat message, which server does not send heartbeat message.And it is sent out to no server for sending heartbeat message Send state detecting information.Wherein, above-mentioned state detecting information is used to indicate detection without the shape of the server of transmission heartbeat message State information.In general, state detecting information can be realized by instructions such as ping.
Second step, in response to receiving the above-mentioned state detecting information of correspondence for not sending the server of heartbeat message and sending Feedback information, set normal for the status information for returning the server of feedback information.
When the normal work of server 103,104,105,106, but heartbeat is not sent to executing subject for some reason When information, after server 103,104,105,106 receives state detecting information, feedback information can be returned to executing subject. For example, server 103,104,105,106 can return to " 200 ", when state detecting information is that ping is instructed to show to service Device 103,104,105,106 is in normal operating conditions.At this point, executing subject can be confirmed that those return the clothes of feedback information The real work state of business device is normal.
It is above-mentioned that at least one above-mentioned service is determined according to heartbeat message in some optional implementations of the present embodiment The status information of device may include: that not send the correspondence that the server of heartbeat message is sent above-mentioned in response to being not received by The status information of no server for returning to feedback information is set failure by the feedback information of state detecting information.
When server 103,104,105,106 is in malfunction, usually heartbeat message will not be sent to executing subject, State detecting information will not be received, or even if having received state detecting information, also be returned without normal direction executing subject anti- Feedforward information.At this point, the state for the server that those can not returned to feedback information by executing subject is set as failure.
Step 202, pass through status information and data processing information architecture configuration file.
After executing subject obtains status information and data processing of information, can by status information and data processing of information come Construct configuration file.Wherein, above-mentioned configuration file can serve to indicate that the data processing amount of server.
In some optional implementations of the present embodiment, match above by status information and data processing information architecture File is set, may comprise steps of:
The first step determines that status information is the quantity information of normal server.
201 description through the above steps, executing subject can determine all servers in normal operating conditions Quantity information.
Above-mentioned quantity information and above-mentioned data processing of information are packaged into configuration file by second step.
In order to by data processing of information it is balanced as far as possible distribute to server, executing subject can be by quantity information and above-mentioned Data processing of information is packaged into configuration file.
Step 203, the version number of above-mentioned configuration file is set, and above-mentioned version number is sent at least one above-mentioned service Device.
Seen from the above description, configuration file is corresponding with heartbeat message, periodicity having the same.Therefore configuration information can To there is multiple corresponding version numbers.Multiple configuration files can also embody distributed system and be handled according to the total data of corresponding time Amount adjusts the data processing amount of each server in time.Version number can be arranged for currently available configuration file in executing subject, To be different from previous configuration file.Later, version number can be sent to server by executing subject, and server can be according to connecing The version number received goes to obtain corresponding configuration file.
In some optional implementations of the present embodiment, the above method can also include: to send out above-mentioned configuration file It send to file memory.
File memory can be used to save configuration file.When executing subject generates configuration file, can will configure File is sent to file memory.Server can get the configuration file of corresponding version number from file memory, with timely Data processing amount is adjusted, the efficiency of data processing is improved.
With continued reference to Fig. 3, the process of one embodiment of the method for synchronizing information according to the application is shown 300.The method for being used for synchronizing information is applied to the distributed system comprising at least one server, comprising the following steps:
Step 301, identical as the version number of configuration file in memory in response to the version number of received configuration file, according to The quantity information and data processing of information that configuration file includes determine local data treating capacity.
In the present embodiment, for send the method for information executing subject (such as server shown in FIG. 1 103,104, 105,106) heartbeat message to system server 101 can be sent by wired connection mode or radio connection.Quantity Information can be used to indicate that the data of the server currently worked normally.It should be pointed out that above-mentioned radio connection can be with Including but not limited to 3G/4G connection, WiFi connection, bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra Wideband) connection and other currently known or exploitation in the future radio connections.
Under normal conditions, when the version number of the received configuration file of executing subject and version number's phase of configuration file in memory Meanwhile illustrating the total data treating capacity of server state at this time and distributed system there is no variations.Executing subject can be with The quantity information and data processing of information for the server for including according to configuration file determine local data treating capacity.For example, data Handling the corresponding data processing amount of information is X, and the quantity of the server of normal work is Y.Then executing subject can be calculated Local data treating capacity are as follows: X/Y.
Step 302, the data received are handled according to above-mentioned local data treating capacity.
After executing subject has determined local data treating capacity, can according to local data treating capacity to the data received into Row processing.For example, local data treating capacity is 100, illustrate to need to handle 100 information in the executing subject unit time.When holding When the information content to be processed that row main body receives is no more than 100, it can continue to and handle information to be processed.Work as executing subject When the information content to be processed received is more than 100, the information to be processed exceeded can not be handled.
In some optional implementations of the present embodiment, the above method can also include: in response to received configuration The version number of configuration file is not identical in the version number of file and memory, obtains and above-mentioned received configuration text from file memory The corresponding configuration file of the version number of part, and the configuration file is saved to local memory.
When the total data treating capacity of server state and distributed system changes.System server 101 can give birth to Executing subject is sent at the configuration file of information, and after executing subject sends heartbeat message.It is received when executing subject When the version number of configuration file is not identical in the version number of configuration file and memory, executing subject can be obtained from file memory Configuration file corresponding with the version number of received configuration file, and the configuration file is saved to the local of executing subject It deposits, so that executing subject can call configuration file from memory at any time, and data is handled according to configuration file.
In some optional implementations of the present embodiment, the above method can also include: in response to receiving state Detection information returns to the feedback information of corresponding states detection information.
When executing subject for some reason not to system server 101 send heartbeat message when, system server 101 State detecting information can be sent to executing subject, with the true working condition of query execution main body.At this point, executing subject can be with The feedback information of corresponding states detection information is returned to, to show that executing subject is in normal work shape to system server 101 State.
With continued reference to the signal that Fig. 4, Fig. 4 are according to the application scenarios of the method for sending information of the present embodiment Figure.In the application scenarios of Fig. 4, in addition to system server 101, outside network 102 and server 103,104,105,106, may be used also To include file memory 107.System server 101 obtains the state of server 103,104,105,106 by network 102 The data processing of information that information and distributed system receive.Then, system server 101 passes through status information and data processing Information architecture configuration file, and the version number of configuration file is set, by network 102 by version number be sent to server 103, 104,105,106.Server 103,104,105,106 can download corresponding version number from file memory 107 by network 102 Configuration file, and according to configuration file carry out data processing.
The method provided by the above embodiment of the application obtains the status information and data processing of information of server first;So Pass through status information and data processing information architecture configuration file afterwards;The version number of configuration file is finally set, and by above-mentioned version This number is sent to server.This method enables to server to obtain newest configuration file according to version number, and adjustment is every in time The data processing amount of a server improves the utilization rate and data-handling efficiency of server.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, this application provides one kind for sending letter One embodiment of the device of breath, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which can specifically answer For in various electronic equipments.
As shown in figure 5, the device 500 for sending information of the present embodiment is applied to point comprising at least one server Cloth system may include: information acquisition unit 501, configuration file construction unit 502 and information transmitting unit 503.Wherein, Information acquisition unit 501 is configured to obtain the status information and data processing of information of at least one server, wherein above-mentioned number It is used to characterize the total data treating capacity that the unit time receives according to information is handled;Configuration file construction unit 502 is configured to lead to Status information and data processing information architecture configuration file are crossed, above-mentioned configuration file is used to indicate the data processing amount of server; Information transmitting unit 503 is configured to be arranged the version number of above-mentioned configuration file, and by above-mentioned version number be sent to it is above-mentioned at least One server.
In some optional implementations of the present embodiment, above- mentioned information acquiring unit 501 may include: acquisition of information Subelement (not shown) is configured to receive the heartbeat message that at least one server is sent, and is determined according to heartbeat message The status information of at least one above-mentioned server, wherein heartbeat message is sent according to the frequency of setting, and status information includes normal Or failure.
In some optional implementations of the present embodiment, it may include: state-detection that above- mentioned information, which obtain subelement, Information sending module (not shown) and first state information modified module (not shown).Wherein, state detecting information Sending module is less than the quantity of server at least one above-mentioned server, quilt in response to the quantity of the heartbeat message received It is configured to determine the server without sending heartbeat message, and sends state-detection letter to no server for sending heartbeat message Breath, wherein above-mentioned state detecting information is used to indicate detection without the status information of the server of transmission heartbeat message;First shape State information modified module, in response to receiving the above-mentioned state detecting information of correspondence for not sending the server of heartbeat message and sending Feedback information, be configured to set normal for the status information for returning the server of feedback information.
In some optional implementations of the present embodiment, it may include: the second state that above- mentioned information, which obtain subelement, Information modified module (not shown) is not sent in the correspondence that the server of heartbeat message is sent in response to being not received by The feedback information for stating state detecting information is configured to set event for the status information of the server without returning to feedback information Barrier.
In some optional implementations of the present embodiment, above-mentioned configuration file construction unit 502 may include: quantity Information determines subelement (not shown) and configuration file building subelement (not shown).Wherein, quantity information determines Subelement is configured to determine the quantity information that status information is normal server;Configuration file building subelement is configured to Above-mentioned quantity information and above-mentioned data processing of information are packaged into configuration file.
In some optional implementations of the present embodiment, the above-mentioned device 500 for sending information can also include: Configuration file transmission unit (not shown) is configured to above-mentioned configuration file being sent to file memory.
With further reference to Fig. 6, as the realization to method shown in above-mentioned each figure, this application provides one kind for synchronous letter One embodiment of the device of breath, the Installation practice is corresponding with embodiment of the method shown in Fig. 3, which can specifically answer For in various electronic equipments.
As shown in fig. 6, the device 600 for synchronizing information of the present embodiment is applied to point comprising at least one server Cloth system may include: local data treating capacity determination unit 601 and data processing unit 602.Wherein, at local data Reason amount determination unit 601, it is identical as the version number of configuration file in memory in response to the version number of received configuration file, matched It is set to the quantity information for including according to configuration file and data processing of information determines local data treating capacity;Data processing unit 602 are configured to handle the data received according to above-mentioned local data treating capacity.
In some optional implementations of the present embodiment, the device 600 for synchronizing information can also include: configuration File obtaining unit (not shown), the version number of configuration file in the version number and memory in response to received configuration file It is not identical, it is configured to obtain configuration file corresponding with the version number of above-mentioned received configuration file from file memory, and The configuration file is saved to local memory.
In some optional implementations of the present embodiment, the device 600 for synchronizing information can also include: feedback Information transmitting unit (not shown) is configured to return corresponding states detection letter in response to receiving state detecting information The feedback information of breath.
The present embodiment additionally provides a kind of electronic equipment, comprising: one or more processors;Memory is stored thereon with One or more programs, when said one or multiple programs are executed by said one or multiple processors, so that said one Or multiple processors execute the above-mentioned method for sending information or the method for synchronizing information.
The present embodiment additionally provides a kind of computer-readable medium, is stored thereon with computer program, and the program is processed Device realizes the above-mentioned method for sending information or the method for synchronizing information when executing.
Below with reference to Fig. 7, it illustrates the electronic equipments for being suitable for being used to realize the embodiment of the present application (for example, being in Fig. 1 Unite server 101) computer system 700 structural schematic diagram.Electronic equipment shown in Fig. 7 is only an example, is not answered Any restrictions are brought to the function and use scope of the embodiment of the present application.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and Execute various movements appropriate and processing.In RAM 703, also it is stored with system 700 and operates required various programs and data. CPU 701, ROM 702 and RAM 703 are connected with each other by bus 704.Input/output (I/O) interface 705 is also connected to always Line 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communications portion 709, and/or from detachable media 711 are mounted.When the computer program is executed by central processing unit (CPU) 701, limited in execution the present processes Above-mentioned function.
It should be noted that the above-mentioned computer-readable medium of the application can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In this application, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In application, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor packet Include information acquisition unit, configuration file construction unit and information transmitting unit.Wherein, the title of these units is under certain conditions The restriction to the unit itself is not constituted, for example, information transmitting unit is also described as " for matching to server transmission Set the unit of the version number of file ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be Included in device described in above-described embodiment;It is also possible to individualism, and without in the supplying device.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the device, so that should Device: the status information and data processing of information of at least one server are obtained, wherein above-mentioned data processing of information is for characterizing The total data treating capacity that unit time receives;Pass through status information and data processing information architecture configuration file, above-mentioned configuration File is used to indicate the data processing amount of server;The version number of above-mentioned configuration file is set, and above-mentioned version number is sent to At least one above-mentioned server.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (20)

1. a kind of method for sending information, applied to the distributed system comprising at least one server, comprising:
Obtain the status information and data processing of information of at least one server, wherein the data processing of information is for characterizing The total data treating capacity that unit time receives;
By status information and data processing information architecture configuration file, the configuration file is used to indicate at the data of server Reason amount;
The version number of the configuration file is set, and the version number is sent at least one described server.
2. according to the method described in claim 1, wherein, the status information and data processing for obtaining at least one server Information, comprising:
The heartbeat message that at least one server is sent is received, the state of at least one server is determined according to heartbeat message Information, wherein heartbeat message is sent according to the frequency of setting, and status information includes normal or failure.
3. according to the method described in claim 2, wherein, the shape that at least one server is determined according to heartbeat message State information, comprising:
It is less than the quantity of server at least one described server in response to the quantity of the heartbeat message received, determination does not have The server of heartbeat message is sent, and sends state detecting information to no server for sending heartbeat message, wherein the shape State detection information is used to indicate detection without the status information of the server of transmission heartbeat message;
The feedback information for the correspondence state detecting information that the server of heartbeat message is sent is not sent in response to receiving, Set normal for the status information for returning the server of feedback information.
4. according to the method described in claim 3, wherein, the shape that at least one server is determined according to heartbeat message State information, comprising:
The feedback for the correspondence state detecting information that the server of heartbeat message is sent is not sent in response to being not received by The status information of no server for returning to feedback information is set failure by information.
5. described to pass through status information and data processing information architecture configuration text according to the method described in claim 2, wherein Part, comprising:
Determine that status information is the quantity information of normal server;
The quantity information and the data processing of information are packaged into configuration file.
6. according to claim 1 to method described in 5 any one, wherein the method also includes:
The configuration file is sent to file memory.
7. a kind of method for synchronizing information, applied to the distributed system comprising at least one server, comprising:
It is identical as the version number of configuration file in memory in response to the version number of received configuration file, include according to configuration file Quantity information and data processing of information determine local data treating capacity;
The data received are handled according to the local data treating capacity.
8. according to the method described in claim 7, wherein, the method also includes:
The version number of configuration file is not identical in version number and memory in response to received configuration file, obtains from file memory Configuration file corresponding with the version number of the received configuration file is taken, and the configuration file is saved to local memory.
9. according to method described in claim 7 to 8 any one, wherein the method also includes:
In response to receiving state detecting information, the feedback information of corresponding states detection information is returned.
10. it is a kind of for sending the device of information, applied to the distributed system comprising at least one server, comprising:
Information acquisition unit is configured to obtain the status information and data processing of information of at least one server, wherein described Data processing of information is used to characterize the total data treating capacity received the unit time;
Configuration file construction unit is configured to through status information and data processing information architecture configuration file, the configuration File is used to indicate the data processing amount of server;
Information transmitting unit, is configured to be arranged the version number of the configuration file, and by the version number be sent to it is described extremely A few server.
11. device according to claim 10, wherein the information acquisition unit includes:
Acquisition of information subelement is configured to receive the heartbeat message that at least one server is sent, and is determined according to heartbeat message The status information of at least one server, wherein heartbeat message is sent according to the frequency of setting, and status information includes normal Or failure.
12. device according to claim 11, wherein the acquisition of information subelement includes:
State detecting information sending module is less than at least one described server in response to the quantity of the heartbeat message received The quantity of server is configured to determine the server for not sending heartbeat message, and the service to no transmission heartbeat message Device sends state detecting information, wherein the state detecting information is used to indicate detection without the server of transmission heartbeat message Status information;
First state information modified module, in response to receiving the correspondence shape for not sending the server of heartbeat message and sending The feedback information of state detection information is configured to set normal for the status information for returning the server of feedback information.
13. device according to claim 12, wherein the acquisition of information subelement includes:
Second status information modified module, in response to being not received by the correspondence institute for not sending the server of heartbeat message and sending The feedback information for stating state detecting information is configured to set event for the status information of the server without returning to feedback information Barrier.
14. device according to claim 11, wherein the configuration file construction unit includes:
Quantity information determines subelement, is configured to determine the quantity information that status information is normal server;
Configuration file constructs subelement, is configured to for the quantity information and the data processing of information being packaged into configuration text Part.
15. device described in 0 to 14 any one according to claim 1, wherein described device further include:
Configuration file transmission unit is configured to the configuration file being sent to file memory.
16. a kind of device for synchronizing information, applied to the distributed system comprising at least one server, comprising:
Local data treating capacity determination unit, the version of configuration file in the version number and memory in response to received configuration file Number identical, the quantity information and data processing of information for being configured to include according to configuration file determine local data treating capacity;
Data processing unit is configured to handle the data received according to the local data treating capacity.
17. device according to claim 16, wherein described device further include:
Configuration file acquiring unit, in response to version number's not phase of version number and the configuration file in memory of received configuration file Together, it is configured to obtain configuration file corresponding with the version number of the received configuration file from file memory, and should Configuration file is saved to local memory.
18. device described in 6 to 17 any one according to claim 1, wherein described device further include:
Feedback information transmission unit is configured to return corresponding states detection information in response to receiving state detecting information Feedback information.
19. a kind of electronic equipment, comprising:
One or more processors;
Memory is stored thereon with one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors Any method in any method or claim 7 to 9 in perform claim requirement 1 to 6.
20. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that the program is executed by processor Method as described in Shi Shixian is any in the method or claim 7 to 9 as described in any in claim 1 to 6.
CN201810902735.1A 2018-08-09 2018-08-09 Method and device for sending information Active CN109088929B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810902735.1A CN109088929B (en) 2018-08-09 2018-08-09 Method and device for sending information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810902735.1A CN109088929B (en) 2018-08-09 2018-08-09 Method and device for sending information

Publications (2)

Publication Number Publication Date
CN109088929A true CN109088929A (en) 2018-12-25
CN109088929B CN109088929B (en) 2021-07-30

Family

ID=64834405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810902735.1A Active CN109088929B (en) 2018-08-09 2018-08-09 Method and device for sending information

Country Status (1)

Country Link
CN (1) CN109088929B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687846A (en) * 2021-06-30 2021-11-23 北京百度网讯科技有限公司 Method, apparatus, device and readable storage medium for processing data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105007336A (en) * 2015-08-14 2015-10-28 深圳市云舒网络技术有限公司 Load balancing method and load balancing system of server
CN106059825A (en) * 2016-07-08 2016-10-26 福建天晴数码有限公司 Distributed system and configuration method
CN106445529A (en) * 2016-09-27 2017-02-22 乐视控股(北京)有限公司 Backup method and system for configuration information of continuous integration server
US20170337275A1 (en) * 2016-05-17 2017-11-23 International Business Machines Corporation Allocating computing resources
CN108337275A (en) * 2017-01-19 2018-07-27 百度在线网络技术(北京)有限公司 Task distribution method, device and equipment for Distributor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105007336A (en) * 2015-08-14 2015-10-28 深圳市云舒网络技术有限公司 Load balancing method and load balancing system of server
US20170337275A1 (en) * 2016-05-17 2017-11-23 International Business Machines Corporation Allocating computing resources
CN106059825A (en) * 2016-07-08 2016-10-26 福建天晴数码有限公司 Distributed system and configuration method
CN106445529A (en) * 2016-09-27 2017-02-22 乐视控股(北京)有限公司 Backup method and system for configuration information of continuous integration server
CN108337275A (en) * 2017-01-19 2018-07-27 百度在线网络技术(北京)有限公司 Task distribution method, device and equipment for Distributor

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113687846A (en) * 2021-06-30 2021-11-23 北京百度网讯科技有限公司 Method, apparatus, device and readable storage medium for processing data
CN113687846B (en) * 2021-06-30 2023-07-18 北京百度网讯科技有限公司 Method, apparatus, device and readable storage medium for processing data

Also Published As

Publication number Publication date
CN109088929B (en) 2021-07-30

Similar Documents

Publication Publication Date Title
CN110310034A (en) A kind of service orchestration applied to SaaS, business flow processing method and apparatus
CN108958992A (en) test method and device
CN109408205A (en) Method for scheduling task and device based on hadoop cluster
CN108733380A (en) Using dispositions method and device
CN108846753A (en) Method and apparatus for handling data
CN109684188A (en) Test method and device
CN103257852B (en) The method and apparatus that a kind of development environment of distribution application system is built
CN109815105A (en) Applied program testing method and device based on Btrace
CN109995801A (en) A kind of method for message transmission and device
CN109388626A (en) Method and apparatus for being numbered to traffic assignments
CN109815107A (en) The method and apparatus of automatic test
CN108776692A (en) Method and apparatus for handling information
CN107329834A (en) Method and apparatus for performing calculating task
CN110377440A (en) Information processing method and device
CN108933695A (en) Method and apparatus for handling information
CN110007936A (en) Data processing method and device
CN109656799A (en) Test method and device
CN109240802A (en) request processing method and device
CN109818994A (en) Information processing method and device for agent side
CN109218041A (en) Request processing method and device for server system
CN109814957A (en) A kind of label addition method and device for IOS system
CN110059064A (en) Journal file processing method, device and computer readable storage medium
CN109088929A (en) For sending the method and device of information
CN109885564A (en) Method and apparatus for sending information
CN107678965A (en) It is automatically integrating method of testing and system, service terminal, memory

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