CN107357740B - A kind of serializing device method of automatic configuration, device and distributed cache system - Google Patents
A kind of serializing device method of automatic configuration, device and distributed cache system Download PDFInfo
- Publication number
- CN107357740B CN107357740B CN201710541631.8A CN201710541631A CN107357740B CN 107357740 B CN107357740 B CN 107357740B CN 201710541631 A CN201710541631 A CN 201710541631A CN 107357740 B CN107357740 B CN 107357740B
- Authority
- CN
- China
- Prior art keywords
- serializing
- class
- serialized
- matched
- serializing device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0806—Multiuser, multiprocessor or multiprocessing cache systems
- G06F12/0813—Multiuser, multiprocessor or multiprocessing cache systems with a network or matrix configuration
Abstract
The invention discloses a kind of serializing device method of automatic configuration, device and distributed cache systems.Serializing device method of automatic configuration provided by the present application obtains the information for the serializing device for being encapsulated in communication terminal in advance first;Judge whether according to preset sampling parameter to need to treat the class statistic sampling of serializing when whether more than one with the number of the serializing device to match wait the class serialized;If so, carrying out performance statistics to matched serializing device, and it is that class to be serialized configures a matched serializing device according to the first rule.Method using the present invention, can automatic geo-statistic it is different with assessment serialize device one period of past resource consumption situation, historical statistical information and system present load will be used for reference when the serializing of the following new class, it is automatic to select a current optimal serializing device for class to be serialized.
Description
Technical field
The present invention relates to a kind of field of computer technology more particularly to serializing device method of automatic configuration, device and distributions
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 that will necessarily be related to object/class is communicated between multimachine, this
When need that object/class sequence chemical conversion byte stream is first transferred to receiving terminal, then byte stream unserializing is restored 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 memory and network bandwidth.In large scale system, if the serializing of object/class
With unserializing operate it is very frequent, then may consume CPU or network bandwidth in large quantities, this may influence regular traffic into
Row.Therefore, developer needs the object/class serialized for needs to select suitable serial device to complete serializing and antitone sequence
Change, however either the serializing device of developer oneself exploitation or use third party serialize device, it all can not be in system operation
The actual effect of serializing device is known before, even if by can not clearly go out sequence respectively if simulation test before online implementing
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
It selects.System load monitoring that is, by the simulation test before reaching the standard grade, and after reaching the standard grade carrys out the bottleneck of hypothetical system, when confirming bottle
It after neck, does when serializing device and targetedly optimizes 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 intuitive, is needed more
Development and maintenance cost.Because the distribution and improvement of problem be 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 of other in serializing and software systems
Module mutually mixes, just not enough directly and accurate in the data that external analysis counts on, and experienced developer is needed to spend
More time analysis can just find reason and solution.
Invention content
In order to solve the above-mentioned technical problem, a kind of scheme for the serializing device that automatic selection optimizes is provided, according to this hair
Bright one side, this application provides a kind of serializing device method of automatic configuration, including:
Obtain the information for the serializing device for being encapsulated in communication terminal in advance;
Judge whether the number for serializing device to match with class to be serialized is more according to the information of the serializing device
In one;If so,:
Judge whether to need to treat the class statistic sampling of serializing according to preset sampling parameter;
If so, carrying out performance statistics to matched serializing device, and it is that class to be serialized configures according to the first rule
One matched serializing device.
According to another aspect of the present invention, it provides a kind of serializing device and automatically configures device, including:
First acquisition module, the information for obtaining the serializing device for being encapsulated in communication terminal in advance;
First judgment 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 judgment module, it is whether more than one for the number in the serializing device to match with class to be serialized
When, judge whether the class statistic sampling for needing to treat serializing according to preset sampling parameter;
Statistical module, for when needing to treat the class statistic sampling of serializing, performance to be carried out to matched serializing device
Statistics;
First configuration module, for being to wait for sequence according to the first rule when needing to treat the class statistic sampling of serializing
The class of change configures a matched serializing device;
Second acquisition module, in the class statistic sampling that need not treat serializing, obtaining the serializing device
Historical performance statistical result.
In conclusion serializing device method of automatic configuration provided by the present application, obtains be encapsulated in communication terminal in advance first
Serializing device information;According to the number for the serializing device that the information of the serializing device judges to match with class to be serialized
Whether mesh is more than one;If so,:Judge whether to need to treat the class statistic sampling of serializing according to preset sampling parameter;
If so, carrying out performance statistics to matched serializing device, and it is that class to be serialized configures a matching according to the first rule
Serializing device.Method using the present invention, user only need the serializing of class and unserializing is defined through the invention
Interface calls, it will be able to which automatic geo-statistic serializing device 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 when the serializing of new class, it is automatic to work as class selection one to be serialized
Preceding optimal serializing device.
Description of the drawings
It in order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology and advantage, below will be to implementing
Example or attached drawing needed to be used in the description of the prior art are briefly described, it should be apparent that, the accompanying drawings in the following description is only
Only it is some embodiments of the present invention, for those of ordinary skill in the art, without creative efforts,
It can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is the hardware configuration frame of the terminal of serializing device method of automatic configuration according to the ... of the embodiment of the present invention
Figure;
Fig. 2 is the structure diagram of serializing device method of automatic configuration according to the ... of the embodiment of the present invention;
Fig. 3 is class figure according to the ... of the embodiment of the present invention;
Fig. 4 is another structure diagram of serializing device method of automatic configuration according to the ... of the embodiment of the present invention;
Fig. 5 is the flow chart of step S202 according to the ... of the embodiment of the present invention;
Fig. 6 is the flow chart of step S205 according to the ... of the embodiment of the present invention;
Fig. 7 is the flow chart of step S208 according to the ... of the embodiment of the present invention;
Fig. 8 is another flow chart of step S208 according to the ... of the embodiment of the present invention;
Fig. 9 is the another flow chart of step S208 according to the ... of the embodiment of the present invention;
Figure 10 is the structure diagram of device according to the ... of the embodiment of the present invention;
Figure 11 is the structure diagram of the first judgment module according to the ... of the embodiment of the present invention;
Figure 12 is the structure diagram of statistical module according to the ... of the embodiment of the present invention;
Figure 13 is the structure diagram of the second configuration module according to the ... of the embodiment of the present invention;
Figure 14 is the structure diagram of terminal according to the ... of the embodiment of the present invention.
Specific implementation mode
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The every other embodiment that member is obtained without making creative work should all belong to the model that the present invention protects
It encloses.
It should be noted that term " first " in description and claims of this specification and above-mentioned attached drawing, "
Two " etc. be for distinguishing similar object, without being used to describe specific sequence or precedence.It should be appreciated that using in this way
Data can be interchanged in the appropriate case, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " comprising " and " having " and their any deformation, it is intended that cover
It includes to be not necessarily limited to for example, containing the process of series of steps or unit, method, system, product or equipment to cover non-exclusive
Those of clearly list step or unit, but may include not listing clearly or for these processes, method, product
Or the other steps or unit that equipment is intrinsic.
According to embodiments of the present invention, a kind of embodiment of serializing device method of automatic configuration is provided, it should be noted that
Step shown in the flowchart of the accompanying drawings can execute in the computer system of such as a group of computer-executable instructions, and
It, in some cases, can be to execute institute different from sequence herein and although logical order is shown in flow charts
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
It calculates and is executed in device.For running on computer terminals, Fig. 1 is that serializing device according to the ... of the embodiment of the present invention automatically configures
The hardware block diagram of the terminal of method.As shown in Figure 1, terminal 100 may include one or more (in figure
Only showing one) (processor 102 can include but is not limited to Micro-processor MCV or programmable logic device FPGA to processor 102
Deng processing unit), memory 104 for storing data and for the transmitting device 106 of communication function.This field is general
Logical technical staff is appreciated that structure shown in FIG. 1 is only to illustrate, and does not cause to limit to the structure of above-mentioned electronic device.
For example, terminal 100 may also include more either less components than shown in Fig. 1 or have different from shown in Fig. 1
Configuration.
Memory 104 can be used for storing the software program and module of application software, such as the sequence in the embodiment of the present invention
Change the corresponding program instruction/module of device method of automatic configuration, processor 102 is stored in the software in memory 104 by operation
Program and module realize the above-mentioned serializing device side of automatically configuring to perform various functions application and data processing
Method.Memory 104 may include high speed random access memory, may also include nonvolatile memory, as one or more magnetism 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 not limited to internet, intranet, LAN, mobile radio communication and combinations thereof.
Transmitting device 106 is used to receive via a network or transmission data.Above-mentioned network specific example may include
The wireless network that the communication providers of terminal 100 provide.In an example, transmitting device 106 includes a network
Adapter (Network Interface Controller, referred to as NIC), 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
To be applied in intelligent terminal, executed by the processor in intelligent terminal, intelligent terminal can be intelligent hand
Machine, tablet computer etc..At least one application program is installed, the embodiment of the present invention, which does not limit, applies journey in intelligent terminal
The type 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 the ... of the embodiment of the present invention.As shown in Fig. 2, the sequence
A kind of optional scheme for changing device method of automatic configuration includes the following steps:
S201 obtains the information for the serializing device for being encapsulated in communication terminal in advance.
The present invention program can be applied 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 is inherited and is realized four abstract methods of BaseSerializer, realized with init (byte)/close ()
Initialization and the resource release for serializing device, are 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 available in system, each 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 serializing the log-on message of device, serializes the log-on message of device each sequence
The mark of the corresponding class name of rowization device and each serializing device.Wherein, the mark for serializing device can be number or ID.
After the log-on message for serializing device being arranged respectively on multiple and 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 each serializing device class name and
User is unique id of its distribution, and after having these information, SerializerFactory can create correspondence by specified id
Serializing device.The set for serializing device in the present invention with the digital representation of a byte length can indicate [0,255] altogether
256 kinds of serializing devices meet actual needs enough.Certainly, this is only example, and the present invention is literary for the ID for serializing device
Part length is not limited.
The information of the serializing device for being encapsulated in communication terminal in advance obtained in step S201 includes serializing the registration of device
Information, i.e., each the corresponding class of serializing device and serializing device identify.
S202 judges that the number of the serializing device to match with class to be serialized is according to the information of the serializing device
It is no more than one;If so, S203 is thened follow the steps, if it is not, thening follow the steps S204.
In an alternative embodiment, as shown in figure 5, step S202 may include:
S401 judges class to be serialized and the sequence for being encapsulated in communication terminal in advance according to the information of the serializing device
Change whether device matches;If so, S402 is thened follow the steps, 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 in 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.
Since during carrying out serializing and unserializing to class, identical class tends to match multiple serializings
Therefore device before choosing serializing device for class to be serialized, needs the serializing first judged and class to be serialized matches
Whether the number of device is more than one.
Specifically, judging whether the number of the serializing device to match with class to be serialized is more than one and may include:
According to log-on message, obtain the serializing device registered on communication terminals, judge respectively each serializing device whether with wait for sequence
Whether the class of change matches.
S203 judges whether the class statistic sampling for needing to treat serializing according to preset sampling parameter.If so, executing
Step S205, S206.
In an optional scheme, as shown in figure 4, further including after step S203:If it is not, thening follow the steps S207.
It is relatively time-consuming process due to serializing and counting, and be not necessarily to each for above-mentioned steps S203
Secondary user object serializing all counts, it is only necessary to intermittently do the performance that random statistical sampling is obtained with serializing device
Report.Whether preset sampling parameter samples and sample frequency for describing class to be serialized.Specifically, if being waited for for some
The class of serializing has reached preset sampling number threshold value to its number of samples, has possessed highly stable, ripe monitoring
Data need not then continue to sample to it.Sampling parameter can automatically be set by system, can also be set by the user.Sampling ginseng
Number may include sample frequency, sampling number threshold value.
S204 configures the serializing device to match for class to be serialized.
When wait the class serialized, only there are one when the serializing device to match, be directly then that class to be serialized matches the sequence
Rowization device.
S205 carries out performance statistics to matched serializing device.
In step S205, performance statistics are carried out to each matched serializing device respectively, obtain the property of each serializing device
Energy.
It is an object of the present invention to solve the problems, such as that serialisation scheme is nonadjustable after code on-line, reduces network transmission and occupy
Bandwidth, disk storage occupied space and CPU be using taking.And the process of performance statistics can interfere main flow, and therefore, this Shen
Special statistics thread please be set to carry out the performance statistics of serializing device, to be not take up time and the resource of main flow.
As a preferred solution, as shown in fig. 6, step S205 may comprise steps of:
Class to be serialized and matched serializing device are sent to statistics thread by S501.
S502, statistics thread treat matched class according to each matched serializing device respectively and carry out serializing and antitone sequence
Change.
S503, statistics thread obtain the performance indicator of each serializing device, the performance indicator include CPU occupy and
Serialize the length of result.
And since the requirement of the timeliness of statistic processes is not very high, in order not to be clashed with main flow, the statistics
Thread treats matched class according to each matched serializing device respectively and carries out serializing and unserializing, including:
Thread is counted by the way of asynchronous execution, treating matched class according to each matched serializing device respectively carries out
Serializing and unserializing.
Certainly, alternatively, the statistics thread is respectively according to each matched serializing device to be matched
Class carry out serializing and unserializing, including:
Thread is counted by the way of concurrently executing, treating matched class according to each matched serializing device respectively carries out
Serializing and unserializing.
Alternatively, the statistics thread is multiple, and multiple statistics threads form thread pool to matched sequence
Change device and carries out performance statistics.Multiple statistics threads carry out performance statistics to matched serializing device using asynchronous system and avoid master
The obstruction of thread, simultaneously as not having resource contention between different serializing devices, so the situation relatively sufficient in system resource
Under can concurrently carry out, simultaneously as statistical work is intermittently to carry out, therefore the completion of statistical work has lag will not
Influence final result.
After counting performance indicator of the thread to obtaining each serializing device, the performance for storing each serializing device refers to
Mark.It can be stored in individual database, communication terminal can also be stored in.
S206 is that class to be serialized configures a matched serializing device according to the first rule.
Since class institute to be serialized is multiple, and not yet complete for such statistical data to matched serializing device
It is kind, can be that class to be serialized configures a matched serializing device according to preset first rule therefore.First rule
It can be then to randomly select one in multiple matched serializing devices, can also be first in matched serializing device.
S207 obtains the historical performance statistical result of the serializing device.
When the class statistic sampling of serializing need not be treated, illustrate that such already has sufficient statistical result, it can
Class to treat serializing according to statistical result optimizes configuration.First, seek to obtain the historical performance system of serializing device
Count result.
In specific application scenarios, the historical performance statistical result for serializing device includes two aspects:
1. the statistical indicator of class rank:
There is the CPU time respectively for every type class and serializes the statistics of result:
(1) serializes device serializer, shows the serializing device belonging to index;
(2) mean values mean serializes the average value of nearest n data of the device on CPU time or serializing result, n
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 are the byte stream length that CPU takes or serializes.
2. serializing the statistical indicator of device
Can also there be CPU respectively for each serializing device serializer and serialize the statistics of result:
(1) mean values 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 are the byte stream length that CPU takes or serializes.
In an optional scheme, after step S207, further include:S208, according to the historical performance statistical result and
The present load of system is the currently optimal serializing device of class configuration to be serialized.
After the historical performance statistical result for obtaining serializing device, system current load information is obtained, is gone through according to described
The present load of history performance statistics result and system is the currently optimal serializing device of class configuration to be serialized.
In an optional scheme, as shown in fig. 7, step S208 includes:
S601 judges whether be more than with the relevant statistical sample number of class to be serialized in the historical performance statistical result
Preset threshold value;If so, S602 is thened follow the steps, if it is not, thening follow the steps S206.
If specifically, for class to be serialized, the statistical sample number in historical performance statistical result is very little, then is not enough to
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.
It, can in historical performance statistical result and when the relevant statistical sample number of the class serialized is more than preset threshold value
To be the currently optimal serializing device of class configuration to be serialized according to the present load of historical performance statistical result and system.
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 serializes the selection that device is 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 currently optimal serializing device of class configuration to be serialized, and is included the following steps:
S701, the CPU for obtaining each serializing device is occupied and serializing result;The serializing result includes byte stream
Length.
S702 obtains the present load of system, judges that the present load of system is more than preset third threshold value;If so,
S703 is executed, if it is not, then executing S704.
S703 obtains CPU and occupies minimum serializing device as the current optimal serializing device of class to be serialized.
S704 obtains the shortest serializing device of byte stream as the current optimal serializing device of class to be serialized.
Using the technical solution of S701-S704, if developer provides two different serializing devices for some class, point
It is not dominant on CPU and serializing result, then we can select CPU to occupy less sequence when system CPU is busy
Change device to serialize the object type, the serializing device for then selecting serializing postbyte stream shorter when grid IO is busy.
In an alternative 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, acquisition influence current system load small serializing device.
Principle is paid the utmost attention to based on system load, all matched serializing devices are big according to being influenced on current system load
It is small to sort from small to large;Acquisition influences current system load small serializing device, that is, the serializing device to rank the first.
S802, judges whether matched serializing device is less than preset difference according to the difference influenced on current system load
Threshold value;If so, step S803 is executed, if it is not, executing step S804.
Specifically, in step S802, all matched serializing devices are obtained first according to being influenced on current system load
Difference, judges whether difference is less than preset discrepancy threshold.
S803, obtain user to serialize device selection preference, according to the selection Preferences of user select one most
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 matched serializing device meets the selection preference of user, is chosen partially if so, user will be met
A good serializing device is as the current optimal serializing device of class to be serialized;If it is not, obtaining to current system load shadow
Small serializing device is rung as the current optimal serializing device of class to be serialized.
S804, obtain influences small serializing device as the current optimal sequence of class to be serialized to current system load
Change device.
During carrying out serializing and unserializing to class, 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
The serializing device serializing result in comprising it is corresponding serializing device mark and start context.
Below with a specific application scenarios explanation:The present invention has done a point packaging in ultimate sequence result.
The byte stream head for serializing result adds the content of 1 byte, and 4 bits of head are used to describe the volume of corresponding serializing device
Number, rear 4 bits are used to describe the start context of the serializing device, are operated in BaseSerializer#packing above
It is completed in (byte, byte []) method.After the byte stream that receiving terminal receives after being packaged, BaseSerializer# will be called
Unpacking (byte []) method obtains corresponding serializing device number and version number, then passes through
SerializerFactory#getSerializer (byte) method generates the serializing device of response, and is passed to corresponding version
Number.Certainly, in other application scenarios, can serializing result other positions increase to serialize device mark and
The explanation of start context, being used to describe can also be according to need to serializing the byte length of the mark of device and the explanation of start context
It sets, the present invention does not limit.
The present invention realizes the real-time monitoring of serializing effect, and according to the ability of system load dynamic adjustment, and
This long term monitoring, can be with the configuration parameter (including sampling parameter) of Adjusted Option, to cure as a result, after system stable operation
The serializing device that each type uses.After serializing device solidification, 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 can reach the optimal of system in terms of serializing at this time and match
It sets.
In conclusion serializing device method of automatic configuration provided by the present application, obtains be encapsulated in communication terminal in advance first
Serializing device information;According to the number for the serializing device that the information of the serializing device judges to match with class to be serialized
Whether mesh is more than one;If so,:Judge whether to need to treat the class statistic sampling of serializing according to preset sampling parameter;
If so, carrying out performance statistics to matched serializing device, and it is that class to be serialized configures a matching according to the first rule
Serializing device;If it is not, then:Obtain the historical performance statistical result of the serializing device;It is counted and is tied according to the historical performance
The present load of fruit and system is the currently optimal serializing device of class configuration to be serialized.Method using the present invention, user
Only need by the serializing of class and unserializing through the invention as defined in interface call, it will be able to automatic geo-statistic and assessment are not
With resource consumption situation of the serializing device in one period of past, when serializing of the following new class, will use for reference historical statistical information
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, the information for obtaining the serializing device for being encapsulated in communication terminal in advance.It can be used for executing
Above-mentioned steps S201.
First judgment module 902, for what is matched with class to be serialized according to the information judgement of the serializing device
Whether the number for serializing device is more than one;It can be used for executing step S202.
Whether the second judgment module 903 is more than one for the number in the serializing device to match with class to be serialized
When a, judge whether the class statistic sampling for needing to treat serializing according to preset sampling parameter;It can be used for executing above-mentioned steps
S203。
Statistical module 904, for when needing to treat the class statistic sampling of serializing, to matched serializing device progressive
It can statistics;It can be used for executing above-mentioned steps S205.
First configuration module 905, for being to wait for sequence according to the first rule when needing to treat the class statistic sampling of serializing
The class of rowization configures a matched serializing device;It can be used for executing above-mentioned steps S206.
In an alternative embodiment, further include the second acquisition module 906, in the class that need not treat serializing
When statistic sampling, the historical performance statistical result of the serializing device is obtained;It can be used for executing above-mentioned steps S207.
Second configuration module 907, in the class statistic sampling that need not treat serializing, according to the historical performance
The present load of statistical result and system is the currently optimal serializing device of class configuration to be serialized.It can be used for executing above-mentioned step
Rapid S208.
In an alternative embodiment, as shown in figure 11, first judgment 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 judgment unit 9022, for class to be serialized be in advance encapsulated in communication terminal serializing device whether
When matching, judges and whether the number of class to be serialized matches serializing device is more than one.
In an alternative embodiment, as shown in figure 12, the statistical module 904 includes:
Transmission unit 9041, for class to be serialized and matched serializing device to be sent to statistic unit;
Statistic unit 9042 carries out serializing and instead for treating matched class according to each matched serializing device respectively
Serializing, obtains the performance indicator of each serializing device, and the performance indicator includes the length of CPU occupancy and serializing result
Degree.
In an alternative embodiment, the statistic unit 9042 includes:
Asynchronous execution subelement 90421 is used for by the way of asynchronous execution, respectively according to each matched serializing device
It treats matched class and carries out serializing and unserializing.
It is parallel to execute subelement 90422, for using concurrently executing by the way of, respectively according to each matched serializing device
It treats matched class and carries out serializing and unserializing.
In an alternative embodiment, as shown in figure 13, second configuration module 906 includes:
Third judging unit 9061, for judging the relevant system of class in the historical performance statistical result and to be serialized
Count whether sample number is more than preset threshold value;
Dispensing unit 9062, in the historical performance statistical result with the relevant statistical sample of class to be serialized
When number is more than preset threshold value, the present load according to the historical performance statistical result and system is that class to be serialized configures
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 for realizing the program code performed by test method.
Optionally, in the present embodiment, above-mentioned storage medium can be located in multiple network equipments of computer network
At least one network equipment.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps:
Obtain the information for the serializing device for being encapsulated in communication terminal in advance;
Judge whether the number for serializing device to match with class to be serialized is more according to the information of the serializing device
In one;If so,:
Judge whether to need to treat the class statistic sampling of serializing according to preset sampling parameter;
If so, carrying out performance statistics to matched serializing device, and it is that class to be serialized configures according to the first rule
One matched serializing device;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.
Optionally, storage medium is also configured to store the program code for executing following steps:
Judge class to be serialized and the serializing device for being encapsulated in communication terminal in advance according to the information of the serializing device
Whether match;
If so,:
Judge and whether the number of class to be serialized matches serializing device is more than one.
Optionally, storage medium is also configured to store the program code for executing following steps:
Class to be serialized and matched serializing device are sent to statistics thread;
Statistics thread treats matched class according to each matched serializing device respectively and carries out serializing and unserializing;
The performance indicator that thread obtains each serializing device is counted, the performance indicator includes CPU occupancy and sequence
Change the length of result.
Optionally, storage medium is also configured to store the program code for executing following steps:
Thread is counted by the way of asynchronous execution, treating matched class according to each matched serializing device respectively carries out
Serializing and unserializing.
Optionally, storage medium is also configured to store the program code for executing following steps:
Thread is counted by the way of concurrently executing, treating matched class according to each matched serializing device respectively carries out
Serializing and unserializing.
Optionally, storage medium is also configured to store the program code for executing following steps:
Judge preset in the historical performance statistical result with whether the relevant statistical sample number of class to be serialized is more than
Threshold value;
If so,:
Present load according to the historical performance statistical result and system is that class configuration to be serialized is current optimal
Serialize device.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to:USB flash disk, read-only memory (ROM,
Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disc or
The various media that can store program code such as CD.
The embodiment of the present invention also provides a kind of terminal, which can be in terminal group
Any one computer terminal.Optionally, in the present embodiment, above computer terminal can also replace with mobile terminal
Equal terminal devices.
Optionally, in the present embodiment, above computer terminal can be located in multiple network equipments of computer network
At least one network equipment.
Optionally, Figure 14 is the structure diagram of terminal according to the ... of the embodiment of the present invention.As shown in figure 14, the calculating
Machine terminal A may include:One or more (one is only shown in figure) processors 161, memory 163 and transmitting device
165。
Wherein, memory 163 can be used for storing software program and module, such as the short text classification in the embodiment of the present invention
The corresponding program instruction/module of method and apparatus, processor 161 is stored in software program in memory 163 by operation
And module realizes above-mentioned short text classification to perform various functions application and data processing.Memory 163 can
Can also include nonvolatile memory including high speed random access memory, 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 packet 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 receive via a network or transmission data.Above-mentioned network specific example
It may include cable network and wireless network.In an example, transmitting device 165 includes a network adapter, can be passed through
Cable is connected to be communicated with internet or LAN with other network equipments with router.In an example, it passes
Defeated device 165 is radio-frequency module, is used to wirelessly be communicated with internet.
Wherein, specifically, memory 163 is used to store information, the Yi Jiying of 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 execute
Step:
Optionally, the program code of following steps can also be performed in above-mentioned processor 161:
Obtain the information for the serializing device for being encapsulated in communication terminal in advance;
Judge whether the number for serializing device to match with class to be serialized is more according to the information of the serializing device
In one;If so,:
Judge whether to need to treat the class statistic sampling of serializing according to preset sampling parameter;
If so, carrying out performance statistics to matched serializing device, and it is that class to be serialized configures according to the first rule
One matched serializing device;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.
Optionally, the specific example in the present embodiment can refer to the example described in above-described embodiment, the present embodiment
Details are not described herein.
The embodiments of the present invention are for illustration only, can 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 as independent product
Sale in use, can be stored in the storage medium that above computer can be read.Based on this understanding, skill of the invention
Substantially all or part of the part that contributes to existing technology or the technical solution can be with soft in other words for art scheme
The form of part product embodies, which is stored in a storage medium, including some instructions are used so that one
Platform or multiple stage computers equipment (can be personal computer, server or network equipment etc.) execute each embodiment institute of the present invention
State all or part of step of method.
In the above embodiment of the present invention, all emphasizes particularly on different fields to the description of each embodiment, do not have in some embodiment
The part of detailed description may refer to the associated description of other embodiment.
In several embodiments provided herein, it should be understood that disclosed client, it can be by others side
Formula is realized.Wherein, the apparatus embodiments described above are merely exemplary, for example, the unit division, only one
Kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component can combine or
It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it
Between coupling, direct-coupling or communication connection can be INDIRECT COUPLING or communication link by some interfaces, unit or module
It connects, can be electrical or other forms.
The unit illustrated as separating component may or may not be physically separated, aobvious as unit
The component shown may or may not be physical unit, you can be located at a place, or may be distributed over multiple
In network element.Some or all of unit therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, it can also
It is that each unit physically exists alone, it can also be during two or more units be integrated in one unit.Above-mentioned integrated list
The form that hardware had both may be used in member is realized, can also be realized in the form of SFU software functional unit.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (15)
1. a kind of serializing device method of automatic configuration, which is characterized in that including:
Obtain the information for the serializing device for being encapsulated in communication terminal in advance;
Judge whether the number of the serializing device to match with class to be serialized is more than one according to the information of the serializing device
It is a;If so,:
Judge whether to need to treat the class statistic sampling of serializing according to preset sampling parameter;
If so, carrying out performance statistics to matched serializing device, and it is that class to be serialized configures one according to the first rule
Matched serializing device.
2. according to the method described in claim 1, it is characterized in that, judging whether to need to treat sequence according to preset sampling parameter
After the class statistic sampling of rowization, further include: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 currently optimal sequence of class configuration to be serialized
Change device.
3. according to the method described in claim 1, it is characterized in that, the information according to the serializing device judges and waits for 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,:
Judge and whether the number of class to be serialized matches serializing device is more than one.
4. according to the method described in claim 1, it is characterized in that, described carry out performance statistics, packet to matched serializing device
It includes:
Class to be serialized and matched serializing device are sent to statistics thread;
Statistics thread treats matched class according to each matched serializing device respectively and carries out serializing and unserializing;
The performance indicator that thread obtains each serializing device is counted, the performance indicator includes CPU occupancy and serializing knot
The length of fruit.
5. according to the method described in claim 4, it is characterized in that, the statistics thread is respectively according to each matched serializing
Device treats matched class and carries out serializing and unserializing, including:
Thread is counted by the way of asynchronous execution, treating matched class according to each matched serializing device respectively carries out sequence
Change and unserializing.
6. according to the method described in claim 4, it is characterized in that, the statistics thread is respectively according to each matched serializing
Device treats matched class and carries out serializing and unserializing, including:
Thread is counted by the way of concurrently executing, treating matched class according to each matched serializing device respectively carries out sequence
Change and unserializing.
7. according to the method described in claim 2, it is characterized in that, described according to the historical performance statistical result and system
Present load is the currently optimal serializing device of class configuration to be serialized, including:
Judge whether be more than preset threshold with the relevant statistical sample number of class to be serialized in the historical performance statistical result
Value;
If so,:
Present load according to the historical performance statistical result and system is the currently optimal sequence of class configuration to be serialized
Change device.
8. a kind of serializing device automatically configures device, which is characterized in that including:
First acquisition module, the information for obtaining the serializing device for being encapsulated in communication terminal in advance;
First judgment 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 judgment module, for wait the class serialized match serializing device number it is whether more than one when, root
Judge whether to need to treat the class statistic sampling of serializing according to preset sampling parameter;
Statistical module, for when needing to treat the class statistic sampling of serializing, performance statistics to be carried out to matched serializing device;
First configuration module, for when needing to treat the class statistic sampling of serializing, waiting serializing according to the first rule
Class configures a matched serializing device.
9. device according to claim 8, which is characterized in that further include:
Second acquisition module, the history in the class statistic sampling that need not treat serializing, obtaining the serializing device
Performance statistics result;
Second configuration module, in the class statistic sampling that need not treat serializing, being counted and being tied according to the historical performance
The present load of fruit and system is the currently optimal serializing device of class configuration to be serialized.
10. device according to claim 8, which is characterized in that first judgment module includes:
First judging unit, for judging that class to be serialized communicates eventually with advance be encapsulated according to the information of the serializing device
Whether the serializing device at end matches;
Second judgment unit, for when whether the class serialized matches with the serializing device for being encapsulated in 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, which is characterized in that the statistical module includes:
Transmission unit, for class to be serialized and matched serializing device to be sent to statistic unit;
Statistic unit carries out serializing and unserializing for treating matched class according to each matched serializing device respectively,
The performance indicator of each serializing device is obtained, the performance indicator includes the length that CPU occupied and serialized result.
12. according to the devices described in claim 11, which is characterized in that the statistic unit includes:
Asynchronous execution subelement, for by the way of asynchronous execution, each matched serializing device of basis to be to be matched respectively
Class carry out serializing and unserializing.
13. according to the devices described in claim 11, which is characterized in that the statistic unit includes:
It is parallel to execute subelement, for by the way of concurrently executing, each matched serializing device of basis to be to be matched respectively
Class carry out serializing and unserializing.
14. device according to claim 9, which is characterized in that second configuration module includes:
Third judging unit, for judge in the historical performance statistical result with the relevant statistical sample number of class to be serialized
Whether preset threshold value is more than;
Dispensing unit, it is pre- for being more than with the relevant statistical sample number of class to be serialized in the historical performance statistical result
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, which is characterized in that including multiple communication terminals, each communication terminal includes that right is wanted
Seek any device in 8-14.
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 CN107357740A (en) | 2017-11-17 |
CN107357740B true 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) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110362451B (en) * | 2019-07-17 | 2023-09-26 | 北京小米移动软件有限公司 | Monitoring method, device and medium |
CN111273962B (en) * | 2020-02-14 | 2022-02-18 | 腾讯科技(深圳)有限公司 | Configuration management method, device, computer readable storage medium and computer equipment |
CN111931200B (en) * | 2020-07-13 | 2024-02-23 | 车智互联(北京)科技有限公司 | Data serialization method, mobile terminal and readable storage medium |
Citations (2)
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 |
CN105512271A (en) * | 2015-12-03 | 2016-04-20 | 小米科技有限责任公司 | UV counting method and device for real-time analysis system and server |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10394757B2 (en) * | 2010-11-18 | 2019-08-27 | Microsoft Technology Licensing, Llc | 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 |
-
2017
- 2017-07-05 CN CN201710541631.8A patent/CN107357740B/en active Active
Patent Citations (2)
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 |
CN105512271A (en) * | 2015-12-03 | 2016-04-20 | 小米科技有限责任公司 | UV counting method and device for real-time analysis system and server |
Also Published As
Publication number | Publication date |
---|---|
CN107357740A (en) | 2017-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106534333B (en) | A kind of two-way choice calculating discharging method based on MEC and MCC | |
KR101583325B1 (en) | Network interface apparatus and method for processing virtual packets | |
CN107357740B (en) | A kind of serializing device method of automatic configuration, device and distributed cache system | |
WO2020052605A1 (en) | Network slice selection method and device | |
CN103346980B (en) | A kind of business scheduling method, device and the network equipment | |
WO2018106609A1 (en) | Server load balancing method, apparatus, and server device | |
CN104683428B (en) | Network service processing method and device | |
CN110209549B (en) | Data processing method, related device, related equipment and system | |
US20170034063A1 (en) | Prioritization of network traffic in a distributed processing system | |
KR101639797B1 (en) | Network interface apparatus and method for processing virtual machine packets | |
CN111628941A (en) | Network traffic classification processing method, device, equipment and medium | |
CN108965239A (en) | Accelerate network security monitoring | |
CN106712992A (en) | Cloud management method and system | |
CN109246210A (en) | Internet of Things communication means and device | |
CN105281946B (en) | Method and apparatus for flexible and efficient analysis in a network switch | |
CN106997394A (en) | A kind of out of order arrival processing method and system of data | |
CN113438169A (en) | Data scheduling method, electronic equipment and storage medium | |
CN111315026B (en) | Channel selection method, device, gateway and computer readable storage medium | |
CN108460044A (en) | The treating method and apparatus of data | |
CN109639555B (en) | Link layer message generation method, link layer message generation device and terminal equipment | |
CN105744552A (en) | Wireless network air interface message processing apparatus and method | |
CN108259418A (en) | A kind of system and method for function trusteeship service | |
CN112019357B (en) | Network configuration method, device, equipment and system | |
KR20180134219A (en) | The method for processing virtual packets and apparatus therefore | |
CN105450488B (en) | A kind of data processing method and relevant apparatus |
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 |