CN107357740A - One kind serializing device method of automatic configuration, device and distributed cache system - Google Patents

One kind serializing device method of automatic configuration, device and distributed cache system Download PDF

Info

Publication number
CN107357740A
CN107357740A CN201710541631.8A CN201710541631A CN107357740A CN 107357740 A CN107357740 A CN 107357740A CN 201710541631 A CN201710541631 A CN 201710541631A CN 107357740 A CN107357740 A CN 107357740A
Authority
CN
China
Prior art keywords
serializing
class
serialized
serializing device
matched
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
CN201710541631.8A
Other languages
Chinese (zh)
Other versions
CN107357740B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201710541631.8A priority Critical patent/CN107357740B/en
Publication of CN107357740A publication Critical patent/CN107357740A/en
Application granted granted Critical
Publication of CN107357740B publication Critical patent/CN107357740B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0813Multiuser, multiprocessor or multiprocessing cache systems with a network or matrix configuration

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses one kind serializing device method of automatic configuration, device and distributed cache system.The serializing device method of automatic configuration that the application provides, the information for the serializing device for being encapsulated in communication terminal in advance is obtained first;Judged whether according to default sampling parameter to need the class statistic sampling for treating serializing when whether the number of the serializing device with wait the class serialized matching is more than one;If so, then carrying out performance statistics to the serializing device of matching, and the serializing device of a matching is configured for class to be serialized according to the first rule.Using the method for the present invention, can automatically geo-statistic it is different with assessment serializing device one period of past resource consumption situation, historical statistical information and system present load will be used for reference during the serializing of following new class, it is automatic to select a current optimal serializing device for class to be serialized.

Description

One kind serializing device method of automatic configuration, device and distributed cache system
Technical field
The present invention relates to field of computer technology, more particularly to a kind of serializing device method of automatic configuration, device and distribution Formula caching system.
Background technology
Class (class) is the reflection of entity in a computer in real world or the thinking world, it by data and this Operation in a little data is packaged together.Object is the example of class.
In oriented object development, the across a network transmission of object/class will necessarily be related to by being communicated between multimachine, this When need that object/class sequence chemical conversion byte stream first is transferred into receiving terminal, then byte stream unserializing is reduced in receiving terminal In pairs as.Serializing and unserializing are to consume the calculating operation of CPU time, and the binary stream after serializing is in machine Storage and transmission over networks will consume machine internal memory and network bandwidth.In large scale system, if the serializing of object/class It is very frequent with unserializing operation, then CPU or network bandwidth may be consumed in large quantities, and this may influence entering for regular traffic OK.Therefore, developer is needed to need the object/class serialized to select suitable serial device to complete serializing and antitone sequence Change, but either the serializing device of developer oneself exploitation or use third party serialize device, all can not be in system operation The actual effect of serializing device is known before, even if by the simulation test before online implementing, also can not clearly go out sequence respectively Change consumption of the device for CPU and bandwidth, because other modules also consume these resources at the same time in system.
In current software system development, the choosing of class serializing device in solution system is mainly carried out in a manner of iteration evolution Select.That is, by the simulation test before reaching the standard grade, and system load monitoring after reaching the standard grade carrys out the bottleneck of hypothetical system, when confirming bottle After neck, do when serializing device and targetedly optimize again, typical optimization method is exactly to use instead more to save CPU or network bandwidth Serialize device.
The inventors found that:The major defect of prior art is not in time and not directly perceived, it is necessary to more Development and maintenance cost.Because the distribution and improvement of problem be in system operation for a period of time, and performance go wrong when Hou Caihui is triggered, and has serious hysteresis quality.Positioning means after performance issue appearance are because other in serializing and software systems Module mutually mixes, just not enough directly and accurate, it is necessary to which experienced developer spends in the data that external analysis counts on Reason and solution can just be found by comparing more time series analysis.
The content of the invention
In order to solve the above-mentioned technical problem, there is provided a kind of automatic scheme for choosing the serializing device optimized, according to this hair Bright one side, this application provides one kind to serialize device method of automatic configuration, including:
Obtain the information for the serializing device for being encapsulated in communication terminal in advance;
Whether the number for the serializing device for judging to match with class to be serialized according to the information of the serializing device is more In one;If so, then:
Judged whether to need the class statistic sampling for treating serializing according to default sampling parameter;
If so, then carrying out performance statistics to the serializing device of matching, and configured according to the first rule for class to be serialized The serializing device of one matching.
According to another aspect of the present invention, there is provided one kind serializing device automatically configures device, including:
First acquisition module, it is encapsulated in the information of the serializing device of communication terminal in advance for obtaining;
First judge module, for judging the sequence to match with class to be serialized according to the information of the serializing device Whether the number for changing device is more than one;
Second judge module, it is whether more than one for the number in the serializing device to match with class to be serialized When, judged whether to need the class statistic sampling for treating serializing according to default sampling parameter;
Statistical module, for when needing to treat the class statistic sampling of serializing, performance to be carried out to the serializing device of matching Statistics;
First configuration module, for being to treat sequence according to the first rule when needing to treat the class statistic sampling of serializing The class of change configures the serializing device of a matching;
Second acquisition module, for when the class statistic sampling of serializing need not be treated, obtaining the serializing device Historical performance statistical result.
In summary, the serializing device method of automatic configuration that the application provides, obtain be encapsulated in communication terminal in advance first Serializing device information;The number for the serializing device for judging to match with class to be serialized according to the information of the serializing device Whether mesh is more than one;If so, then:Judged whether to need the class statistic sampling for treating serializing according to default sampling parameter; If so, then carrying out performance statistics to the serializing device of matching, and a matching is configured for class to be serialized according to the first rule Serializing device.Using the method for the present invention, user only need by the serializing of class and unserializing by present invention provide that Interface interchange, it becomes possible to which the automatic geo-statistic device that serializes different with assessment will be in the resource consumption situation in one period of past, future Historical statistical information and system present load will be used for reference during the serializing of new class, it is automatic to select one to work as class to be serialized Preceding optimal serializing device.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art and advantage, below will be to implementing The required accompanying drawing used is briefly described in example or description of the prior art, it should be apparent that, drawings in the following description are only Only it is some embodiments of the present invention, for those of ordinary skill in the art, on the premise of not paying creative work, Other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is the hardware configuration frame of the terminal of serializing device method of automatic configuration according to embodiments of the present invention Figure;
Fig. 2 is the structured flowchart of serializing device method of automatic configuration according to embodiments of the present invention;
Fig. 3 is class figure according to embodiments of the present invention;
Fig. 4 is another structured flowchart of serializing device method of automatic configuration according to embodiments of the present invention;
Fig. 5 is step S202 according to embodiments of the present invention flow chart;
Fig. 6 is step S205 according to embodiments of the present invention flow chart;
Fig. 7 is step S208 according to embodiments of the present invention flow chart;
Fig. 8 is step S208 according to embodiments of the present invention another flow chart;
Fig. 9 is step S208 according to embodiments of the present invention another flow chart;
Figure 10 is the structured flowchart of device according to embodiments of the present invention;
Figure 11 is the structured flowchart of the first judge module according to embodiments of the present invention;
Figure 12 is the structured flowchart of statistical module according to embodiments of the present invention;
Figure 13 is the structured flowchart of the second configuration module according to embodiments of the present invention;
Figure 14 is the structured flowchart of terminal according to embodiments of the present invention.
Embodiment
In order that those skilled in the art more fully understand the present invention program, below in conjunction with the embodiment of the present invention Accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, rather than whole embodiments.Based on the embodiment in the present invention, ordinary skill people The every other embodiment that member is obtained under the premise of creative work is not made, it should all belong to the model that the present invention protects Enclose.
It should be noted that term " first " in description and claims of this specification and above-mentioned accompanying drawing, " Two " etc. be for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so use Data can exchange in the appropriate case, so as to embodiments of the invention described herein can with except illustrating herein or Order beyond those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment Those steps or unit clearly listed, but may include not list clearly or for these processes, method, product Or the intrinsic other steps of equipment or unit.
According to embodiments of the present invention, there is provided it is a kind of serialize device method of automatic configuration embodiment, it is necessary to explanation, It can be performed the step of the flow of accompanying drawing illustrates in the computer system of such as one group computer executable instructions, and And although showing logical order in flow charts, in some cases, can be with different from order execution institute herein The step of showing or describing.
The embodiment of the method that the embodiment of the present application one is provided can be in mobile terminal, terminal or similar fortune Calculate and performed in device.Exemplified by running on computer terminals, Fig. 1 is that serializing device according to embodiments of the present invention automatically configures The hardware block diagram of the terminal of method.As shown in figure 1, terminal 100 can include one or more (in figure Only showing one) (processor 102 can include but is not limited to Micro-processor MCV or PLD FPGA to processor 102 Deng processing unit), the memory 104 for data storage and the transmitting device 106 for communication function.This area is general Logical technical staff is appreciated that the structure shown in Fig. 1 is only to illustrate, and it does not cause to limit to the structure of above-mentioned electronic installation. For example, terminal 100 may also include than shown in Fig. 1 more either less components or with different from shown in Fig. 1 Configuration.
Memory 104 can be used for the software program and module of storage application software, such as the sequence in the embodiment of the present invention Change programmed instruction/module corresponding to device method of automatic configuration, processor 102 is stored in the software in memory 104 by operation Program and module, so as to perform various function application and data processing, that is, realize the above-mentioned serializing device side of automatically configuring Method.Memory 104 may include high speed random access memory, may also include nonvolatile memory, as one or more magnetic is deposited Storage device, flash memory or other non-volatile solid state memories.In some instances, memory 104 can further comprise relatively In the remotely located memory of processor 102, these remote memories can pass through network connection to terminal 100.On The example for stating network includes but is not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Transmitting device 106 is used to data are received or sent via a network.Above-mentioned network instantiation may include The wireless network that the communication providerses of terminal 100 provide.In an example, transmitting device 106 includes a network Adapter (Network Interface Controller, referred to as NIC), it can be connected by base station with other network equipments So as to be communicated with internet.In an example, transmitting device 106 can be radio frequency (Radio Frequency, letter Referred to as RF) module, it is used to wirelessly be communicated with internet.
Under above-mentioned running environment, this application provides serializing device method of automatic configuration as shown in Figure 2.This method can So that applied in intelligent terminal, by the computing device in intelligent terminal, intelligent terminal can be intelligent hand Machine, tablet personal computer etc..At least one application program is installed, the embodiment of the present invention is not limited using journey in intelligent terminal The species of sequence, can be system class application program, or software class application program.
Fig. 2 is the flow chart of serializing device method of automatic configuration according to embodiments of the present invention.As shown in Fig. 2 the sequence A kind of optional scheme for changing device method of automatic configuration comprises the following steps:
S201, obtain the information for the serializing device for being encapsulated in communication terminal in advance.
The present invention program be can apply in distributed caching service system, and transmission is serialized but it is also suitable for other needs Or the exploitation scene of a large amount of object datas of storage, including various network services and data storage service.
The present invention program can be not only used for multi-machine surroundings, it can also be used to stand-alone environment.
At least one serializing device is encapsulated firstly the need of in communication terminal.Encapsulating the detailed process of serializing device can be:
The third party for realizing or choosing for developer user oneself serializes device, and developer user need to be according to UML in Fig. 3 The mode of class figure, BaseSerializer four abstract methods are inherited and realized, are realized with init (byte)/close () The initialization and resource release of device are serialized, is realized with serialize (Object) and deserialize (byte []) method The internal interface of serializing and unserializing calls, and only in this way just can guarantee that the process of serializing and unserializing is all abided by completely Keep the service logic of user itself.
For other kinds of serializing device, can directly encapsulate.
After serializing device encapsulation is completed, it is also necessary to register.
The purpose of serializing device registration is to illustrate have which serializing device can use in system, and every kind of serializing device is able to The object of which interface type is serialized, and unique id is distributed for these serializing devices.
The information of the serializing device includes the log-on message of serializing device, serializes the log-on message of device each sequence The mark of class name corresponding to rowization device and each serializing device.Wherein, the mark for serializing device can be numbering or ID.
After the log-on message for serializing device is arranged respectively on multiple different communication terminals, between each communication terminal just It can correctly be communicated, realize serializing coding and unserializing decoding.
Specifically, in interface definition, the registration for serializing device is the SerializerFactory#init in Fig. 3 (String) these work are completed in, the parameter of this interface is the path of a configuration file.
Serializing device log-on message embodied by configuration file, configuration file define it is every kind of serializing device class name and User is unique id of its distribution, and after having these information, SerializerFactory cans are created correspondingly by specifying id Serializing device.The set of serializing device is represented in the present invention with the numeral of a byte length, can represent [0,255] altogether 256 kinds of serializing devices, meet to be actually needed enough.Certainly, this is only example, and the present invention is literary for the ID for serializing device Part length is not limited.
What is obtained in step S201 is encapsulated in registration of the information including serializing device of the serializing device of communication terminal in advance Information, i.e., each class corresponding to serializing device and serializing device identify.
S202, the number for the serializing device for judging to match with class to be serialized according to the information of the serializing device are It is no more than one;If so, step S203 is then performed, if it is not, then performing step S204.
In an optional embodiment, as shown in figure 5, step S202 can include:
S401, judge class to be serialized with being encapsulated in the sequence of communication terminal in advance according to the information of the serializing device Change whether device matches;If so, step S402 is then performed, if it is not, then terminating.
Wherein, in step S401, can according to it is described serializing device log-on message judge class to be serialized with advance Whether the serializing device for being encapsulated in communication terminal matches, if mismatching, can determine that as abnormal input, end.If matching, holds Row step S402.
S402, judges and whether the number of class to be serialized matches serializing device is more than one.
Due to class is serialized and unserializing during, identical class tends to match multiple serializings Device, therefore, it is necessary to first judge and serializing that class to be serialized matches before serializing device is chosen for class to be serialized Whether the number of device is more than one.
It can include specifically, whether the number for the serializing device for judging to match with class to be serialized is more than one: According to log-on message, the serializing device registered on communication terminals is obtained, judges each serializing device whether with treating sequence respectively Whether the class of change matches.
S203, judged whether to need the class statistic sampling for treating serializing according to default sampling parameter.If so, then perform Step S205, S206.
In an optional scheme, as shown in figure 4, also including after step S203:If it is not, then perform step S207.
It is relatively time-consuming process due to serializing and counting for above-mentioned steps S203, and is not necessarily to each Secondary user object serializing all counts, it is only necessary to intermittently does the performance that random statistical sampling is obtained with serializing device Report.Whether default sampling parameter is used to describing class to be serialized sampling and sample frequency.Specifically, if being treated for some The class of serializing, default sampling number threshold value is reached to its number of samples, has possessed highly stable, ripe monitoring Data, then it need not be continued to sample.Sampling parameter can be set automatically by system, can also be set by the user.Sampling ginseng Number can include sample frequency, sampling number threshold value.
S204, the serializing device to match for class configuration to be serialized.
When the class serialized only has the serializing to match a device, then direct is that class to be serialized matches the sequence Rowization device.
S205, performance statistics is carried out to the serializing device of matching.
In step S205, performance statistics is carried out to the serializing device of each matching respectively, obtains the property of each serializing device Energy.
It is an object of the present invention to solve serialisation scheme nonadjustable problem after code on-line, reduce network transmission and take Bandwidth, disk storage space-consuming and CPU use it is time-consuming.And the process of performance statistics can disturb main flow, therefore, this Shen Special statistics thread please be set serialize the performance statistics of device, so as to be not take up the time of main flow and resource.
As a kind of preferable scheme, as shown in fig. 6, step S205 may comprise steps of:
S501, class to be serialized is sent to statistics thread with the serializing device matched.
S502, class to be matched is serialized according to the serializing device each matched respectively for statistics thread and antitone sequence Change.
S503, statistics thread obtain the performance indications of each serializing device, the performance indications include CPU take and Serialize the length of result.
And because the ageing requirement of statistic processes is not very high, in order to not clashed with main flow, the statistics Class to be matched is serialized according to the serializing device each matched respectively for thread and unserializing, including:
Thread is counted by the way of asynchronous execution, class to be matched is carried out according to the serializing device each matched respectively Serializing and unserializing.
Certainly, alternatively, the statistics thread is respectively according to the serializing device each matched to be matched Class serialized and unserializing, including:
Thread is counted by the way of concurrently performing, class to be matched is carried out according to the serializing device each matched respectively Serializing and unserializing.
Alternatively, the statistics thread is multiple sequence of multiple statistics thread composition thread pools to matching Change device and carry out performance statistics.Multiple statistics threads carry out performance statistics to the serializing device of matching using asynchronous system and avoid master The obstruction of thread, simultaneously as not having resource contention between different serializing devices, so in the relatively sufficient situation of system resource Under can concurrently carry out, simultaneously as statistical work is intermittently to carry out, therefore the completion of statistical work has hysteresis also will not Influence final result.
After performance indications of the thread to obtaining each serializing device are counted, the performance for storing each serializing device refers to Mark.It can be stored in single database, communication terminal can also be stored in.
S206, the serializing device of a matching is configured for class to be serialized according to the first rule.
By class to be serialized be multiple, and not yet complete for such statistics to the serializing device of matching It is kind, therefore, the serializing device of a matching can be configured for class to be serialized according to the default first rule.First rule Can be then first serialized in device that one or matching are randomly selected in the serializing device of multiple matchings.
S207, obtain the historical performance statistical result of the serializing device.
When the class statistic sampling of serializing need not be treated, illustrate such statistical result for already having abundance, can Configuration is optimized to treat the class of serializing according to statistical result.First, seek to obtain the historical performance system of serializing device Count result.
In specific application scenarios, serializing the historical performance statistical result of device includes two aspects:
1. the statistical indicator of class rank:
There is the CPU time respectively for every species class and serialize the statistics of result:
(1) serializes device serializer, shows the serializing device belonging to index;
(2) averages mean, that is, the average value of nearest n data of the device on CPU time or serializing result, n are serialized For positive integer.
(3) standard deviations std, the standard deviation of nearest n data of the serializing device on CPU time or serializing result.
(4) .last n records, n nearest data, it is the byte stream length that CPU is time-consuming or serializes.
2. serialize the statistical indicator of device
Can also there is CPU respectively for each serializing device serializer and serialize the statistics of result:
(1) averages mean, the table name serializing device is in the nearest n data on CPU time or serializing result Average value.
(2) standard deviations std, the standard deviation of nearest n data of the serializing device on CPU time or serializing result.
(3) .last n records, n nearest data, it is the byte stream length that CPU is time-consuming or serializes.
In an optional scheme, after step S207, in addition to:S208, according to the historical performance statistical result and The present load of system is the current optimal serializing device of class configuration to be serialized.
After the historical performance statistical result of serializing device is obtained, system current load information is obtained, is gone through according to described The present load of history performance statistics result and system is the current optimal serializing device of class configuration to be serialized.
In an optional scheme, as shown in fig. 7, step S208 includes:
S601, judges whether statistical sample number related to class to be serialized in the historical performance statistical result is more than Default threshold value;If so, step S602 is then performed, if it is not, then performing step S206.
If specifically, for class to be serialized, the statistical sample number in historical performance statistical result is then not enough to very little Foundation as registration serializing device.
S602, the present load according to the historical performance statistical result and system are that class configuration to be serialized is current most Excellent serializing device.
, can when being more than default threshold value to the statistical sample number related wait the class serialized in historical performance statistical result Using the present load according to historical performance statistical result and system as the current optimal serializing device of class configuration to be serialized.
Can be that class currently to be serialized chooses the best sequence of a history on the basis of having sufficient statistical result Change device, this serializing device is a selection optimal under current system load.
As shown in Figure 8:In a specific application scenarios, in step S208 according to the historical performance statistical result and The present load of system is the current optimal serializing device of class configuration to be serialized, and is comprised the following steps:
S701, the CPU for obtaining each serializing device take and serialized result;The serializing result includes byte stream Length.
S702, the present load of system is obtained, judge that the present load of system is more than default 3rd threshold value;If so, then S703 is performed, if it is not, then performing S704.
S703, obtain CPU and take minimum serializing device as the current optimal serializing device of class to be serialized.
S704, the most short serializing device of byte stream is obtained as the current optimal serializing device of class to be serialized.
Using S701-S704 technical scheme, if developer provides two kinds of different serializing devices for some class, point It is not dominant on CPU and serializing result, then our cans select CPU to take less sequence when system CPU is busy Change device to serialize the object type, then select to serialize the shorter serializing device of postbyte stream when grid IO is busy.
In an optional embodiment, in order to respect preference of the user to serializing device, as shown in figure 9, step S602 It may comprise steps of:
S801, obtaining influences small serializing device on current system load.
Principle is paid the utmost attention to based on system load, the serializing device of all matchings is big according to being influenceed on current system load It is small to sort from small to large;Obtaining influences small serializing device, that is, the serializing device to rank the first on current system load.
S802, judges whether the serializing device of matching is less than default difference according to the difference influenceed on current system load Threshold value;If so, step S803 is performed, if it is not, performing step S804.
Specifically, in step S802, the serializing devices of all matchings is obtained first according to being influenceed on current system load Difference, judges whether difference is less than default discrepancy threshold.
S803, obtains the selection preference to serializing device of user, and one is selected most according to the selection Preferences of user Meet the serializing device of user preference.
Wherein, in step S803, a serializing for best suiting user preference is selected according to the selection Preferences of user Device includes:
Judge whether the serializing device of the matching meets the selection preference of user, if so, it is inclined then to meet that user chooses A good serializing device is as the current optimal serializing device of class to be serialized;If it is not, obtain to current system load shadow Small serializing device is rung as the current optimal serializing device of class to be serialized.
S804, obtaining influences small serializing device on current system load as the current optimal sequence of class to be serialized Change device.
Class is serialized and unserializing during because one species may be simultaneously present different serializings The serializing byte stream of device, to ensure the receiving terminal of communication terminal can correctly identify it is any serializing device, the present invention Serializing device serializing result in include the mark and start context of corresponding serializing device.
Below with a specific application scenarios explanation:The present invention has done a point packaging in ultimate sequence result. Content of the byte stream head plus 1 byte of result is serialized, first 4 bits are used for the volume for describing corresponding serializing device Number, rear 4 bits are used for the start context for describing the serializing device, are operated in BaseSerializer#packing above Completed in (byte, byte []) method.After the byte stream that receiving terminal receives after packing, BaseSerializer# will be called Unpacking (byte []) method, corresponding serializing device numbering and version number are obtained, is then passed through The serializing device of SerializerFactory#getSerializer (byte) method generation response, and incoming corresponding version Numbering.Certainly, in other application scenarios, can serializing result other positions increase to serialize device mark and The explanation of start context, can also be according to need to serializing the byte length of the mark of device and the explanation of start context for description Set, the present invention does not limit.
The present invention realizes the real-time monitoring of serializing effect, and the ability according to system load dynamic adjustment, and This long term monitoring result, can be with the configuration parameter (including sampling parameter) of Adjusted Option, to solidify after system stable operation The serializing device that each type uses.After device solidification is serialized, this programme, can be direct with regard to no longer being counted to the object The serializing device direct sequence favored using optimal or user, it can just reach the optimal of system in terms of now serializing and match somebody with somebody Put.
In summary, the serializing device method of automatic configuration that the application provides, obtain be encapsulated in communication terminal in advance first Serializing device information;The number for the serializing device for judging to match with class to be serialized according to the information of the serializing device Whether mesh is more than one;If so, then:Judged whether to need the class statistic sampling for treating serializing according to default sampling parameter; If so, then carrying out performance statistics to the serializing device of matching, and a matching is configured for class to be serialized according to the first rule Serializing device;If it is not, then:Obtain the historical performance statistical result of the serializing device;Counted and tied according to the historical performance The present load of fruit and system is the current optimal serializing device of class configuration to be serialized.Using the method for the present invention, user Only need by the serializing of class and unserializing by present invention provide that interface interchange, it becomes possible to automatic geo-statistic and assess not Historical statistical information will be used for reference with resource consumption situation of the serializing device in one period of past, during the serializing of following new class It is automatic to select a current optimal serializing device for class to be serialized with system present load.
As shown in Figure 10, the embodiment of the present invention additionally provides a kind of serializing device and automatically configures device, and described device includes:
First acquisition module 901, it is encapsulated in the information of the serializing device of communication terminal in advance for obtaining.Available for performing Above-mentioned steps S201.
First judge module 902, for judging what is matched with class to be serialized according to the information of the serializing device Whether the number for serializing device is more than one;Available for execution step S202.
Second judge module 903, for whether being more than one in the number of the serializing device to match with class to be serialized When individual, judged whether to need the class statistic sampling for treating serializing according to default sampling parameter;Available for performing above-mentioned steps S203。
Statistical module 904, for when needing to treat the class statistic sampling of serializing, to the serializing device progressive of matching Can statistics;Available for execution above-mentioned steps S205.
First configuration module 905, for being to treat sequence according to the first rule when needing to treat the class statistic sampling of serializing The class of rowization configures the serializing device of a matching;Available for execution above-mentioned steps S206.
In an optional embodiment, in addition to the second acquisition module 906, for the class of serializing need not to be treated During statistic sampling, the historical performance statistical result of the serializing device is obtained;Available for execution above-mentioned steps S207.
Second configuration module 907, for when the class statistic sampling of serializing need not be treated, according to the historical performance The present load of statistical result and system is the current optimal serializing device of class configuration to be serialized.Available for performing above-mentioned step Rapid S208.
In an optional embodiment, as shown in figure 11, first judge module 902 includes:
First judging unit 9021, for judging class to be serialized and encapsulation in advance according to the information of the serializing device Whether matched in the serializing device of communication terminal.
Second judging unit 9022, for class to be serialized be in advance encapsulated in communication terminal serializing device whether During matching, judge and whether the number of class to be serialized matches serializing device is more than one.
In an optional embodiment, as shown in figure 12, the statistical module 904 includes:
Transmitting element 9041, for class to be serialized to be sent to statistic unit with the serializing device matched;
Statistic unit 9042, for class to be matched serialize according to the serializing device each matched respectively and instead Serializing, obtains the performance indications of each serializing device, and the performance indications include the length that CPU takes and serializes result Degree.
In an optional embodiment, the statistic unit 9042 includes:
Asynchronous execution subelement 90421, for the serializing device that by the way of asynchronous execution, basis each matches respectively Class to be matched is serialized and unserializing.
It is parallel to perform subelement 90422, for the serializing device that by the way of concurrently performing, basis each matches respectively Class to be matched is serialized and unserializing.
In an optional embodiment, as shown in figure 13, second configuration module 906 includes:
3rd judging unit 9061, for judging system related to class to be serialized in the historical performance statistical result Whether meter sample number is more than default threshold value;
Dispensing unit 9062, for related to class to be serialized statistical sample in the historical performance statistical result When number is more than default threshold value, the present load according to the historical performance statistical result and system is class configuration to be serialized Current optimal serializing device.
The embodiment of the present invention additionally provides a kind of distributed cache system, including multiple communication terminals, each communication terminal Including above-mentioned device.
The embodiment of the present invention additionally provides a kind of storage medium.In the present embodiment, above-mentioned storage medium can be used for protecting Above-described embodiment is deposited to be used to realize the program code performed by method of testing.
Alternatively, in the present embodiment, above-mentioned storage medium can be located in multiple network equipments of computer network At least one network equipment.
Alternatively, in the present embodiment, storage medium is arranged to the program code that storage is used to perform following steps:
Obtain the information for the serializing device for being encapsulated in communication terminal in advance;
Whether the number for the serializing device for judging to match with class to be serialized according to the information of the serializing device is more In one;If so, then:
Judged whether to need the class statistic sampling for treating serializing according to default sampling parameter;
If so, then carrying out performance statistics to the serializing device of matching, and configured according to the first rule for class to be serialized The serializing device of one matching;If it is not, then:
Obtain the historical performance statistical result of the serializing device;
Present load according to the historical performance statistical result and system is that class configuration to be serialized is current optimal Serialize device.
Alternatively, storage medium is also configured to the program code that storage is used to perform following steps:
Judge class to be serialized with being encapsulated in the serializing device of communication terminal in advance according to the information of the serializing device Whether match;
If so, then:
Judge and whether the number of class to be serialized matches serializing device is more than one.
Alternatively, storage medium is also configured to the program code that storage is used to perform following steps:
Class to be serialized is sent to statistics thread with the serializing device matched;
Class to be matched is serialized according to the serializing device each matched respectively for statistics thread and unserializing;
The performance indications that thread obtains each serializing device are counted, the performance indications are taken including CPU and sequence Change the length of result.
Alternatively, storage medium is also configured to the program code that storage is used to perform following steps:
Thread is counted by the way of asynchronous execution, class to be matched is carried out according to the serializing device each matched respectively Serializing and unserializing.
Alternatively, storage medium is also configured to the program code that storage is used to perform following steps:
Thread is counted by the way of concurrently performing, class to be matched is carried out according to the serializing device each matched respectively Serializing and unserializing.
Alternatively, storage medium is also configured to the program code that storage is used to perform following steps:
It is default to judge whether statistical sample number related to class to be serialized in the historical performance statistical result is more than Threshold value;
If so, then:
Present load according to the historical performance statistical result and system is that class configuration to be serialized is current optimal Serialize device.
Alternatively, in the present embodiment, above-mentioned storage medium can include but is not limited to:USB flash disk, read-only storage (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or CD etc. is various can be with the medium of store program codes.
Embodiments of the invention also provide a kind of terminal, and the terminal can be in terminal group Any one computer terminal.Alternatively, in the present embodiment, above computer terminal can also replace with mobile terminal Deng terminal device.
Alternatively, in the present embodiment, above computer terminal can be located in multiple network equipments of computer network At least one network equipment.
Alternatively, Figure 14 is the structured flowchart of terminal according to embodiments of the present invention.As shown in figure 14, the calculating Machine terminal A can include:One or more (one is only shown in figure) processor 161, memory 163 and transmitting devices 165。
Wherein, memory 163 can be used for storage software program and module, such as the short text classification in the embodiment of the present invention Method and apparatus corresponding to programmed instruction/module, processor 161 is stored in software program in memory 163 by operation And module, so as to perform various function application and data processing, that is, realize above-mentioned short text classification.Memory 163 can Including high speed random access memory, nonvolatile memory can also be included, as one or more magnetic storage device, flash memory, Or other non-volatile solid state memories.In some instances, memory 163 can further comprise relative to processor 161 Remotely located memory, these remote memories can pass through network connection to terminal A.The example bag of above-mentioned network Include but be not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Above-mentioned transmitting device 165 is used to data are received or sent via a network.Above-mentioned network instantiation It may include cable network and wireless network.In an example, transmitting device 165 includes a network adapter, and it can pass through Netting twine is connected with other network equipments with router so as to be communicated with internet or LAN.In an example, pass Defeated device 165 is radio-frequency module, and it is used to wirelessly be communicated with internet.
Wherein, specifically, memory 163 is used for information, the Yi Jiying for storing deliberate action condition and default access user Use program.
Processor 161 can call the information and application program that memory 163 stores by transmitting device, following to perform Step:
Optionally, above-mentioned processor 161 can also carry out the program code of following steps:
Obtain the information for the serializing device for being encapsulated in communication terminal in advance;
Whether the number for the serializing device for judging to match with class to be serialized according to the information of the serializing device is more In one;If so, then:
Judged whether to need the class statistic sampling for treating serializing according to default sampling parameter;
If so, then carrying out performance statistics to the serializing device of matching, and configured according to the first rule for class to be serialized The serializing device of one matching;If it is not, then:
Obtain the historical performance statistical result of the serializing device;
Present load according to the historical performance statistical result and system is that class configuration to be serialized is current optimal Serialize device.
Alternatively, the specific example in the present embodiment may be referred to the example described in above-described embodiment, the present embodiment It will not be repeated here.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
If the integrated unit in above-described embodiment is realized in the form of SFU software functional unit and is used as independent product Sale or in use, the storage medium that above computer can be read can be stored in.Based on such understanding, skill of the invention The part or all or part of the technical scheme that art scheme substantially contributes to prior art in other words can be with soft The form of part product is embodied, and the computer software product is stored in storage medium, including some instructions are causing one Platform or multiple stage computers equipment (can be personal computer, server or network equipment etc.) perform each embodiment institute of the present invention State all or part of step of method.
In the above embodiment of the present invention, the description to each embodiment all emphasizes particularly on different fields, and does not have in some embodiment The part of detailed description, it may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed client, can be by others side Formula is realized.Wherein, device embodiment described above is only schematical, such as the division of the unit, and only one Kind of division of logic function, can there is an other dividing mode when actually realizing, for example, multiple units or component can combine or Another system is desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or discussed it is mutual it Between coupling or direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or module Connect, can be electrical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
Described above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (15)

1. one kind serializing device method of automatic configuration, it is characterised in that including:
Obtain the information for the serializing device for being encapsulated in communication terminal in advance;
Whether the number for the serializing device for judging to match with class to be serialized according to the information of the serializing device is more than one It is individual;If so, then:
Judged whether to need the class statistic sampling for treating serializing according to default sampling parameter;
If so, then carrying out performance statistics to the serializing device of matching, and one is configured for class to be serialized according to the first rule The serializing device of matching.
2. according to the method for claim 1, it is characterised in that judge whether to need to treat sequence according to default sampling parameter After the class statistic sampling of rowization, in addition to:If it is not, then:
Obtain the historical performance statistical result of the serializing device;
Present load according to the historical performance statistical result and system is the current optimal sequence of class configuration to be serialized Change device.
3. according to the method for claim 1, it is characterised in that the information according to the serializing device judges and treats sequence Whether the number for the serializing device that the class of rowization matches is more than one, including:
According to the information of the serializing device judge class to be serialized be in advance encapsulated in communication terminal serializing device whether Matching;
If so, then:
Judge and whether the number of class to be serialized matches serializing device is more than one.
4. according to the method for claim 1, it is characterised in that the serializing device of described pair of matching carries out performance statistics, bag Include:
Class to be serialized is sent to statistics thread with the serializing device matched;
Class to be matched is serialized according to the serializing device each matched respectively for statistics thread and unserializing;
The performance indications that thread obtains each serializing device are counted, the performance indications include CPU and take and serialize knot The length of fruit.
5. according to the method for claim 3, it is characterised in that the statistics thread is respectively according to the serializing each matched Class to be matched is serialized device and unserializing, including:
Thread is counted by the way of asynchronous execution, sequence is carried out to class to be matched according to the serializing device each matched respectively Change and unserializing.
6. according to the method for claim 3, it is characterised in that the statistics thread is respectively according to the serializing each matched Class to be matched is serialized device and unserializing, including:
Thread is counted by the way of concurrently performing, sequence is carried out to class to be matched according to the serializing device each matched respectively Change and unserializing.
7. according to the method for claim 2, it is characterised in that described according to the historical performance statistical result and system Present load is the current optimal serializing device of class configuration to be serialized, including:
Judge whether statistical sample number related to class to be serialized in the historical performance statistical result is more than default threshold Value;
If so, then:
Present load according to the historical performance statistical result and system is the current optimal sequence of class configuration to be serialized Change device.
8. one kind serializing device automatically configures device, it is characterised in that including:
First acquisition module, it is encapsulated in the information of the serializing device of communication terminal in advance for obtaining;
First judge module, for judging the serializing device to match with class to be serialized according to the information of the serializing device Number it is whether more than one;
Second judge module, for match wait the class serialized serializing device number it is whether more than one when, root Judge whether to need the class statistic sampling for treating serializing according to default sampling parameter;
Statistical module, for when needing to treat the class statistic sampling of serializing, performance statistics to be carried out to the serializing device of matching;
First configuration module, for when needing to treat the class statistic sampling of serializing, waiting to serialize according to the first rule Class configures the serializing device of a matching.
9. device according to claim 8, it is characterised in that also include:
Second acquisition module, for when the class statistic sampling of serializing need not be treated, obtaining the history of the serializing device Performance statistics result;
Second configuration module, for when the class statistic sampling of serializing need not be treated, being counted and being tied according to the historical performance The present load of fruit and system is the current optimal serializing device of class configuration to be serialized.
10. device according to claim 8, it is characterised in that first judge module includes:
First judging unit, for judging that class to be serialized communicates eventually with being encapsulated in advance according to the information of the serializing device Whether the serializing device at end matches;
Second judging unit, for when whether the class serialized matches with being encapsulated in the serializing device of communication terminal in advance, Judge and whether the number of class to be serialized matches serializing device is more than one.
11. device according to claim 8, it is characterised in that the statistical module includes:
Transmitting element, for class to be serialized to be sent to statistic unit with the serializing device matched;
Statistic unit, for being serialized respectively according to the serializing device that each matches to class to be matched and unserializing, The performance indications of each serializing device are obtained, the performance indications include the length that CPU takes and serializes result.
12. device according to claim 11, it is characterised in that the statistic unit includes:
Asynchronous execution subelement, for by the way of asynchronous execution, the serializing device that basis each matches respectively to be to be matched Class serialized and unserializing.
13. device according to claim 11, it is characterised in that the statistic unit includes:
It is parallel to perform subelement, for by the way of concurrently performing, the serializing device that basis each matches respectively to be to be matched Class serialized and unserializing.
14. device according to claim 9, it is characterised in that second configuration module includes:
3rd judging unit, for judging statistical sample number related to class to be serialized in the historical performance statistical result Whether default threshold value is more than;
Dispensing unit, it is more than for related to class to be serialized statistical sample number in the historical performance statistical result pre- If threshold value when, the present load according to the historical performance statistical result and system is that class configuration to be serialized is current optimal Serializing device.
15. a kind of distributed cache system, it is characterised in that including multiple communication terminals, each communication terminal will including right Seek any described device in 8-14.
CN201710541631.8A 2017-07-05 2017-07-05 A kind of serializing device method of automatic configuration, device and distributed cache system Active CN107357740B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710541631.8A CN107357740B (en) 2017-07-05 2017-07-05 A kind of serializing device method of automatic configuration, device and distributed cache system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710541631.8A CN107357740B (en) 2017-07-05 2017-07-05 A kind of serializing device method of automatic configuration, device and distributed cache system

Publications (2)

Publication Number Publication Date
CN107357740A true CN107357740A (en) 2017-11-17
CN107357740B CN107357740B (en) 2018-08-03

Family

ID=60293212

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710541631.8A Active CN107357740B (en) 2017-07-05 2017-07-05 A kind of serializing device method of automatic configuration, device and distributed cache system

Country Status (1)

Country Link
CN (1) CN107357740B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362451A (en) * 2019-07-17 2019-10-22 北京小米移动软件有限公司 A kind of monitoring method, device and medium
CN111273962A (en) * 2020-02-14 2020-06-12 腾讯科技(深圳)有限公司 Configuration management method, device, computer readable storage medium and computer equipment
CN111931200A (en) * 2020-07-13 2020-11-13 车智互联(北京)科技有限公司 Data serialization method, mobile terminal and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102043657A (en) * 2011-02-01 2011-05-04 苏州同元软控信息技术有限公司 File serialization method of model library of physical modeling language Modelica
WO2012067805A2 (en) * 2010-11-18 2012-05-24 Microsoft Corporation Scalable chunk store for data deduplication
US20120317337A1 (en) * 2011-06-09 2012-12-13 Microsoft Corporation Managing data placement on flash-based storage by use
CN105512271A (en) * 2015-12-03 2016-04-20 小米科技有限责任公司 UV counting method and device for real-time analysis system and server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012067805A2 (en) * 2010-11-18 2012-05-24 Microsoft Corporation Scalable chunk store for data deduplication
CN102043657A (en) * 2011-02-01 2011-05-04 苏州同元软控信息技术有限公司 File serialization method of model library of physical modeling language Modelica
US20120317337A1 (en) * 2011-06-09 2012-12-13 Microsoft Corporation Managing data placement on flash-based storage by use
CN105512271A (en) * 2015-12-03 2016-04-20 小米科技有限责任公司 UV counting method and device for real-time analysis system and server

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362451A (en) * 2019-07-17 2019-10-22 北京小米移动软件有限公司 A kind of monitoring method, device and medium
CN110362451B (en) * 2019-07-17 2023-09-26 北京小米移动软件有限公司 Monitoring method, device and medium
CN111273962A (en) * 2020-02-14 2020-06-12 腾讯科技(深圳)有限公司 Configuration management method, device, computer readable storage medium and computer equipment
CN111273962B (en) * 2020-02-14 2022-02-18 腾讯科技(深圳)有限公司 Configuration management method, device, computer readable storage medium and computer equipment
CN111931200A (en) * 2020-07-13 2020-11-13 车智互联(北京)科技有限公司 Data serialization method, mobile terminal and readable storage medium
CN111931200B (en) * 2020-07-13 2024-02-23 车智互联(北京)科技有限公司 Data serialization method, mobile terminal and readable storage medium

Also Published As

Publication number Publication date
CN107357740B (en) 2018-08-03

Similar Documents

Publication Publication Date Title
CN104253820B (en) software defined network safety control system and control method
CN107809331A (en) The method and apparatus for identifying abnormal flow
CN107357740B (en) A kind of serializing device method of automatic configuration, device and distributed cache system
CN108234247B (en) Method and system for detecting network quality
CN113037786A (en) Intelligent computing power scheduling method, device and system
CN110401720A (en) Information processing method, device, system, application server and medium
CN103346980B (en) A kind of business scheduling method, device and the network equipment
CN111628941A (en) Network traffic classification processing method, device, equipment and medium
CN107870948A (en) Method for scheduling task and device
CN105281946B (en) Method and apparatus for flexible and efficient analysis in a network switch
CN103312566A (en) Message port congestion detection method and device
CN107392020A (en) Database manipulation analysis method, device, computing device and computer-readable storage medium
CN108123834A (en) Log analysis system based on big data platform
CN104202328B (en) A kind of method, configuration module and the subscription end of subscription GOOSE/SMV messages
CN107832149A (en) A kind of Receive side Scaling circuits for polycaryon processor Dynamic Packet management
CN107666401A (en) A kind of configuration information obtaining method and terminal
CN108322524A (en) A kind of load-balancing device session keeps test method and device
CN115665218B (en) Remote control method and system for Internet of things equipment and related equipment
CN116795752A (en) Interface communication method, device and server
CN111315026A (en) Channel selection method, device, gateway and computer readable storage medium
CN104378256A (en) FPGA-based performance test data stream scheduling method and device
CN105744552B (en) A kind of wireless network idle message processing unit and method
CN111385273A (en) Internet of things business process identification method and device, electronic equipment and medium
CN116151601A (en) Stream service modeling method, device, platform, electronic equipment and storage medium
CN107205028A (en) A kind of classification of service method and device

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