CN109753479A - A kind of data distributing method and device, equipment, medium - Google Patents

A kind of data distributing method and device, equipment, medium Download PDF

Info

Publication number
CN109753479A
CN109753479A CN201811628680.6A CN201811628680A CN109753479A CN 109753479 A CN109753479 A CN 109753479A CN 201811628680 A CN201811628680 A CN 201811628680A CN 109753479 A CN109753479 A CN 109753479A
Authority
CN
China
Prior art keywords
team
data
joining
round
virtual processor
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
CN201811628680.6A
Other languages
Chinese (zh)
Other versions
CN109753479B (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.)
Hangzhou DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech Technologies 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 Hangzhou DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201811628680.6A priority Critical patent/CN109753479B/en
Publication of CN109753479A publication Critical patent/CN109753479A/en
Application granted granted Critical
Publication of CN109753479B publication Critical patent/CN109753479B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Multi Processors (AREA)
  • Hardware Redundancy (AREA)

Abstract

The application provides a kind of data distributing method and device, equipment, medium.It is built with the round-robin queue by predistribution memory for data distributing, the memory of predistribution is divided into multiple segments, so that data correspondingly join the team by piecemeal, this method is included at least: obtaining the interface of joining the team of round-robin queue;By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are joined the team from interface of joining the team;Another lock independently of the spin lock is utilized to complete data distributing by the dequeuing data in the second virtual processor control loop queue by going out team's thread.Using embodiments herein, it joins the team and team can be respectively using mutually independent different locks and different virtual processor out, it joins the team thread and team's thread is decoupling out, queuing memory is divided into multiple segments and not go out team according to size of joining the team, dequeue data facilitates piecemeal to parse, these improvement help to improve the reliability and efficiency that configuration data issues.

Description

A kind of data distributing method and device, equipment, medium
Technical field
This application involves technical field of the computer network, in particular to a kind of data distributing method and device, equipment, Jie Matter.
Background technique
With the development of network technology, high concurrent, it is high handle up, low delay has become the important finger of performance of network equipments Mark, field programmable gate array (Field-Programmable Gate Array, FPGA) is compared to traditional central processing unit (Central Processing Unit, CPU), processing message relative performance is efficient, still, matches in processing equipment very complicated It is again short to set aspect.
Currently, the side of " FPGA+CPU " can be used in terms of hardware structure in order to play the respective advantage of FPGA and CPU The characteristics of case, the characteristics of on the one hand can use FPGA enhance product performance, on the other hand can use CPU processing storage is various Then configuration data calls directly driving interface, interconnect quickly (Peripheral Component by external components Interconnect Express, PCIE) channel down distributing configuration data is to FPGA, and still, when amount of configuration data is larger, FPGA can It can receive in time, so that there are the risks that configuration data is lost, and it is relatively low to issue efficiency.
Based on this, a kind of configuration data issuance scheme more functions reliably and efficiently is needed.
Summary of the invention
In view of this, the application provides a kind of data distributing method and device, equipment, medium, with more functions reliably and efficiently Ground down distributing configuration data.
Specifically, the application is achieved by the following technical solution:
A kind of data distributing method, is built with the round-robin queue by predistribution memory for data distributing, and described pre- point The memory matched is divided into multiple segments, so that data correspondingly join the team by piecemeal, which comprises
Obtain the interface of joining the team of the round-robin queue;
By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are entered from the interface of joining the team Team;
By going out team's thread using another lock independently of the spin lock, passes through the second virtual processor and control the circulation Dequeuing data in queue completes data distributing.
A kind of data distributing device, is built with the round-robin queue by predistribution memory for data distributing, and described pre- point The memory matched is divided into multiple segments, so that data correspondingly join the team by piecemeal, described device includes:
Module is obtained, the interface of joining the team of the round-robin queue is obtained;
First control module, by thread of joining the team using spin lock, by the first virtual processor control data to be issued from The interface of joining the team is joined the team;
Second control module passes through the second virtual processing by going out team's thread using another lock independently of the spin lock Device controls the dequeuing data in the round-robin queue, completes data distributing.
A kind of data distributing equipment, is built with the round-robin queue by predistribution memory for data distributing, and described pre- point The memory matched is divided into multiple segments, so that data correspondingly join the team by piecemeal, the equipment includes:
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one A processor executes so that at least one described processor can:
Obtain the interface of joining the team of the round-robin queue;
By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are entered from the interface of joining the team Team;
By going out team's thread using another lock independently of the spin lock, passes through the second virtual processor and control the circulation Dequeuing data in queue completes data distributing.
A kind of data distributing nonvolatile computer storage media, is stored with computer executable instructions, is built with and is used for The round-robin queue by predistribution memory of data distributing, the memory of the predistribution are divided into multiple segments, so that data are corresponding Ground piecemeal is joined the team, the computer executable instructions setting are as follows:
Obtain the interface of joining the team of the round-robin queue;
By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are entered from the interface of joining the team Team;
By going out team's thread using another lock independently of the spin lock, passes through the second virtual processor and control the circulation Dequeuing data in queue completes data distributing.
By the above technical solution provided by the present application as it can be seen that joining the team and team can be respectively using mutually independent different locks out With different virtual processors, the thread and team's thread is decoupling out of joining the team, queuing memory is divided into multiple segments and makes not according to entering Team's size goes out team and is possibly realized, and dequeue data facilitates piecemeal to parse, these improvement help to improve configuration data issue it is reliable Property and efficiency.
Detailed description of the invention
Fig. 1 be that some embodiments of the present application provide it is a kind of be round-robin queue's predistribution memory segmentation schematic diagram;
Fig. 2 is a kind of flow diagram for data distributing method that some embodiments of the present application provide;
Fig. 3 is that one kind for providing of some embodiments of the present application is joined the team flow diagram;
Fig. 4 is that one kind that some embodiments of the present application provide goes out team's flow diagram;
Fig. 5 is a kind of structural schematic diagram for data distributing device corresponding to Fig. 2 that some embodiments of the present application provide;
Fig. 6 is a kind of structural schematic diagram for data distributing equipment corresponding to Fig. 2 that some embodiments of the present application provide.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the application.
It is only to be not intended to be limiting the application merely for for the purpose of describing particular embodiments in term used in this application. It is also intended in the application and the "an" of singular used in the attached claims, " described " and "the" including majority Form, unless the context clearly indicates other meaning.It is also understood that term "and/or" used herein refers to and wraps It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application A little information should not necessarily be limited by these terms.These terms are only used to for same type of information being distinguished from each other out.For example, not departing from In the case where the application range, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depending on context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determination ".
For the problems in background technique, this application provides data distributing schemes, can be used for CPU functions reliably and efficiently One or more FPGA down distributing configuration data is given, even if still being able to obtain preferable effect when amount of configuration data is larger. The application is based on queue and goes out enqueue operations, Lai Shixian data distributing accordingly.The scheme of the application is carried out below detailed Explanation.
For in terms of the functional structure, scheme can be divided into two parts, and respectively data join the team part and data go out office Point.For in terms of the data structure, the queue being based on is a round-robin queue by predistribution memory, which can be with It is split using similar array form, the segment for being divided into multiple length same or different one section of fixed memory, such as This, can support that small block data dispersion joins the team and (enters round-robin queue), and chunk data polymerize team (coming out out of round-robin queue), Help to improve data transmission performance.
By taking the memory of predistribution is divided into the identical segment of multiple length as an example, some embodiments of the present application are provided A kind of memory segmentation schematic diagram for round-robin queue's predistribution, as shown in Figure 1.
In Fig. 1, assigned memory total size (that is, queue total length) is 8MB, can be divided into 32768 long Spend identical segment, each segment is 256B, when joining the team, can be joined the team with the data block of 256B, and out team when, can polymerize more The data block of a 256B goes out team together.
Fig. 2 is a kind of flow diagram for data distributing method that some embodiments of the present application provide.In the process, For equipment angle, it specifically such as may include calculating equipment that executing subject, which may include that one or more calculates equipment, On CPU, for program angle, executing subject correspondingly may include run on these calculate equipment on multiple processes or Person's thread specifically such as at least may include that join the team thread and one go out team's thread.Step of the application to the process in Fig. 2 Rapid execution sequence and without limitation, can have execution sequencing, can also execute parallel.
Process in Fig. 2 may comprise steps of:
S201: the interface of joining the team of the round-robin queue is obtained.
In some embodiments of the present application, enqueue operations and dequeue operation can respectively using independent different threads into Row control, to improve efficiency.
S202: by thread of joining the team using spin lock, data to be issued is controlled by the first virtual processor and are joined the team from described Interface is joined the team.
In some embodiments of the present application, data to be issued may include the configuration data of FPGA to be handed down to.Spin Lock is joined the team data for protecting, and is prevented because of error in data caused by concurrent, raising reliability.Spin lock will not cause caller to be slept Sleep, if spin lock is kept by other execution unit, caller just always circulation see whether the keeper of spin lock Lock is released, to help to execute enqueue operations in time, reduces meaningless waiting.
In some embodiments of the present application, before enqueue operations, it can treat issuing data and analyzed, for example, system Count size and data type etc., can based on the analysis results, treat issue data carry out piecemeal join the team, for example, by identical The data of data type are divided in as far as possible in the same data block, and multiple small data are divided in the same data block, etc. Deng to help more efficiently to join the team.Analysis result can be also used for: if data at least partly to be issued are due to joining the team unsuccessfully And lose, then corresponding loss information can be generated based on the analysis results, is used for orientation problem or retransmission data, to help In the reliability for improving data distributing.Losing information such as includes packet loss statistics and detailed log, and record has the data of loss Type and size etc..
S203: by going out team's thread using another lock independently of the spin lock, pass through the second virtual processor and control institute The dequeuing data in round-robin queue is stated, data distributing is completed.
In some embodiments of the present application, the thread and when team's thread is respectively guaranteed using independent different locks out of joining the team Sequence.Moreover, it joins the team thread and team's thread respectively uses different virtual processors out.For example, thread of joining the team can call The virtual processor of application program executes enqueue operations, and team's thread can call the virtual processing of its dedicated real-time high consumption out Device executes dequeue operation.
It should be noted that enqueue operations and dequeue operation are not necessarily lasting progress, it is also possible to what discontinuity carried out.
By the method for Fig. 1, joins the team and team can use mutually independent different locks and different virtual processors respectively out, It joins the team thread and team's thread is decoupling out, queuing memory is divided into that multiple segments not go out that team becomes according to size of joining the team can Can, dequeue data facilitates piecemeal to parse, these improvement help to improve the reliability and efficiency that configuration data issues.
Method based on Fig. 1, some embodiments of the present application additionally provide some specific embodiments of this method, and Expansion scheme is illustrated below.
In some embodiments of the present application, in the case where the operation of team's thread discontinuity out, it is possible in round-robin queue Current spatial is insufficient, and team's thread is not currently executing dequeue operation out, in this case, in order not to delay the behaviour that joins the team Make, can be sent out by cross-thread contact of joining the team or actively execute dequeue operation, for example, thread of joining the team can be scheduled by calling Team's function out realizes dequeue operation by going out the execution of team's function.The first virtual processing is passed through for step S102 based on this Device controls when joining the team wait issue data from the interface of joining the team, and can also be performed: judging to determine that current spatial is in round-robin queue No deficiency, however, it is determined that it is insufficient, then it can be gone out by thread of joining the team by the data in the first virtual processor control loop queue Team.
Further, however, it is determined that current spatial is insufficient in round-robin queue, controls the circulation by the first virtual processor When dequeuing data in queue, it can also be performed: judging whether the dequeue operation that group thread is controlled currently is executing;If It is then to be immediately performed by the enqueue operations that thread of joining the team is controlled;Otherwise, go out team behaviour what is controlled by the first virtual processor It is interior at this stage into the stage for not discharging the first virtual processor after executing, it is primary or more by the first virtual processor Secondary trial executes enqueue operations.In this way, joining the team with facilitating data efficient, the utilization rate of round-robin queue is improved.
In some embodiments of the present application, the first virtual processor can apply house dog mechanism, in this case, It within the above-mentioned stage for not discharging the first virtual processor, can also be performed: joining the team if the first virtual processor is attempted to execute The number of operation failure is more than given threshold, then can lose at least part data to be joined the team, and execute dog feeding operation, with Prevent the first virtual processor from can not dispatch for a long time and causing to bark and restart.It is of course also possible to these data are not lost actively, But wait always, until can join the team.
According to explanation above, more intuitively, some embodiments of the present application additionally provide a kind of joining the team for configuration data Flow diagram, as shown in Figure 3.
Process in Fig. 3 can be executed by joining the team thread by the first virtual processor, which may include following step It is rapid: to obtain configuration data to be issued;The size and type of configuration data are analyzed;When executing enqueue operations, first sentence Whether disconnected queue space is currently enough;If so, terminating this process to queue by replicated setup data;Otherwise, pass through First virtual processor actively executes dequeue operation;When actively executing dequeue operation by the first virtual processor, judge Whether team's thread is currently carrying out dequeue operation;If so, into the loitering phase for not discharging the first virtual processor, accordingly Ground, which increases, waits number, judges to wait number, if number is waited to be less than given threshold, continues to attempt to execute enqueue operations, If waiting number is more than given threshold, at least partly configuration data is abandoned, counts packet loss type and number, and send alarm Log terminates this process;Otherwise, it continues to attempt to execute enqueue operations.
The scheme of office out point is further explained below.
In some embodiments of the present application, a special high consumption thread can star in terms of team out to carry out queue prison Control, if there is data just to execute dequeue operation in time in queue, no data, which goes out team's thread, to sleep, as long as team will add out out Team's lock, due to, using independent different locks, helping to reduce enqueue operations and dequeue operation is mutual from enqueue operations Between influence.
In some embodiments of the present application, for step S103, dequeuing data in control loop queue specifically can be with If including: currently to have data in round-robin queue, according to each segmentation of the memory of predistribution, judge the data length whether Not less than the total length of setting quantity segmentation, setting quantity is greater than 1, if so, controlling the setting quantity section length Dequeuing data.In this way, realizing multiple data blocks joined the team polymerize team, dequeuing efficiency is improved.
It, out can basis when team for the scene of CPU down distributing configuration data to FPGA in some embodiments of the present application The quantity for currently needing the FPGA of down distributing configuration data, does the processing that data copy team, and this have the advantage that reduce phase It joins the team number with data, but it is also possible to which there are problems: even if certain configuration data is the privately owned number for being specific to specified FPGA According to the private data is still distributed to each FPGA, to not only influence data distributing efficiency, is also unfavorable for protecting data-privacy Property.For this problem, it can further improve, for example, analyzing when can go out team the data in queue, if large stretch of connect Continuous data are private datas, then the private data is only issued to specified FPGA, FPGA can be waited to confirm when issuing after data Whether issued data are received, if FPGA does not return to confirmation signal at the appointed time, team's thread can attempt weight out Identical data are newly issued, and record expired times, if expired times already exceed given threshold, can be unlocked at this time simultaneously The FPGA of alarm log and record time-out is sent, it, can if repeating to issue to receive confirmation signal no more than given threshold To think team's success out, can unlock at this time.
Analysis based on the preceding paragraph completes data distributing for step S103, for example may include: the number for judging team Whether comprising specifying the data of FPGA in;If so, and included data row length be greater than setting length, then by the institute The data for including only are handed down to specified FPGA;Otherwise, the data of team out are replicated, and is handed down to is currently able to issue respectively Whole FPGA.
According to explanation above, more intuitively, some embodiments of the present application additionally provide a kind of team out of configuration data Flow diagram, as shown in Figure 4.
Process in Fig. 4 can be executed by going out team's thread by the second virtual processor, which may include following step Rapid: dequeue operation starts;Judge whether there are data in queue;If it is not, then going out the sleep of team's thread, terminate this process;If so, Then judge data length, if data length be less than setting length (queue segment be greater than 1 integral multiple, if queue segment be 256B, Then this sets length as the integral multiple of 256B, it is assumed that is 1MB), then data all go out team, if data length is not less than setting length Degree, then select 1MB dequeuing data;Dequeue data is analyzed;Based on the analysis results, if without the number of FPGA is continuously specified According to, then replicate data, and to the whole FPGA down distributing configuration datas needed to configure, terminate this process;It is continuously specified if having The data of FPGA, then to specified FPGA down distributing configuration data;After sending, waits FPGA to determine and receive, if receiving successfully, recognize It is completed to go out team, terminates this process, if reception failure, record the frequency of failure, and judge whether the frequency of failure is more than to set Determine threshold value, issued if not exceeded, then reattempting to, if being more than, send alarm log, it is believed that goes out team and complete, terminate this Process.
Based on same thinking, some embodiments of the present application additionally provide the corresponding device of the above method, equipment and non- Volatile computer storage medium.
Fig. 5 is a kind of structural schematic diagram for data distributing device corresponding to Fig. 2 that some embodiments of the present application provide, Dashed rectangle indicates optional module, is built with the round-robin queue by predistribution memory for data distributing, the predistribution Memory be divided into multiple segments, so that data correspondingly join the team by piecemeal, described device includes:
Module 501 is obtained, the interface of joining the team of the round-robin queue is obtained;
First control module 502 controls data to be issued by the first virtual processor by thread of joining the team using spin lock It joins the team from the interface of joining the team;
Second control module 503 passes through the second virtual place by going out team's thread using another lock independently of the spin lock Reason device controls the dequeuing data in the round-robin queue, completes data distributing.
Optionally, first control module 502 controls data to be issued by the first virtual processor and joins the team from described When interface is joined the team, also execute:
If it is determined that current spatial is insufficient in the round-robin queue, then by the thread of joining the team, pass through the described first virtual place Reason device controls the dequeuing data in the round-robin queue.
Optionally, however, it is determined that current spatial is insufficient in the round-robin queue, and first control module 502 passes through described the When one virtual processor controls the dequeuing data in the round-robin queue, also execute:
Whether the judgement dequeue operation that team's thread is controlled described out is currently executing;
If so, being immediately performed by the enqueue operations that the thread of joining the team is controlled;
Otherwise, after the dequeue operation that is controlled by first virtual processor executes, into not discharging described first It is the stage of virtual processor, interior at this stage, execution enqueue operations once or are repeatedly attempted by first virtual processor.
Optionally, first virtual processor applies house dog mechanism;
Within the stage for not discharging first virtual processor, first control module 502 is also executed:
If first virtual processor is attempted to execute the number of enqueue operations failure to be more than given threshold, lose at least A part data to be joined the team, and execute dog feeding operation.
Optionally, described device further include:
Analysis module 504 utilizes spin lock by thread of joining the team described, controls number to be issued by the first virtual processor According to before joining the team from the interface of joining the team, the size and type of the data to be issued are counted, if so as at least partly The data to be issued are lost due to joining the team failure, then generate it is corresponding lose information, be used for orientation problem or number of retransmissions According to.
Optionally, second control module 503 controls the dequeuing data in the round-robin queue, specifically includes:
If currently having data in second control module 503 round-robin queue, according to the memory of the predistribution Each segmentation, judge whether the length of the data is not less than the total length of the setting quantity segmentation, the setting number Amount is greater than 1;
If so, the dequeuing data of the control setting quantity section length.
Optionally, second control module 503 completes data distributing, specifically includes:
Whether second control module 503 is judged in the data of team comprising specifying on-site programmable gate array FPGA Data;
If so, and included data row length be greater than setting length, then the data for being included only are handed down to institute Specified FPGA;
Otherwise, the data of the team out are replicated, and is handed down to the whole FPGA for being currently able to issue respectively.
Fig. 6 is a kind of structural schematic diagram for data distributing equipment corresponding to Fig. 2 that some embodiments of the present application provide, It is built with the round-robin queue by predistribution memory for data distributing, the memory of the predistribution is divided into multiple segments, with Just data correspondingly join the team by piecemeal, and the equipment includes:
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one A processor executes so that at least one described processor can:
Obtain the interface of joining the team of the round-robin queue;
By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are entered from the interface of joining the team Team;
By going out team's thread using another lock independently of the spin lock, passes through the second virtual processor and control the circulation Dequeuing data in queue completes data distributing.
A kind of data distributing non-volatile computer corresponding to Fig. 2 that some embodiments of the present application provide, which stores, to be situated between Matter is stored with computer executable instructions, is built with the round-robin queue by predistribution memory for data distributing, and described pre- point The memory matched is divided into multiple segments, so that data correspondingly join the team by piecemeal, the computer executable instructions setting are as follows:
Obtain the interface of joining the team of the round-robin queue;
By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are entered from the interface of joining the team Team;
By going out team's thread using another lock independently of the spin lock, passes through the second virtual processor and control the circulation Dequeuing data in queue completes data distributing.
Various embodiments are described in a progressive manner in the application, same and similar part between each embodiment It may refer to each other, each embodiment focuses on the differences from other embodiments.Especially for device, set For standby and media embodiment, since it is substantially similar to the method embodiment, so be described relatively simple, related place referring to The part of embodiment of the method illustrates.
Device, equipment and medium provided by the embodiments of the present application and method be it is one-to-one, therefore, device, equipment and The advantageous effects that medium also has corresponding method similar, due to above to the advantageous effects of method into Go detailed description, therefore, the advantageous effects of which is not described herein again device, equipment and medium.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member It is physically separated with being or may not be, component shown as a unit may or may not be physics list Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs In some or all of the modules realize the purpose of application scheme.Those of ordinary skill in the art are not paying creative labor In the case where dynamic, it can understand and implement.
The foregoing is merely the preferred embodiments of the application, not to limit the application, all essences in the application Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the application protection.

Claims (16)

1. a kind of data distributing method, which is characterized in that it is built with the round-robin queue by predistribution memory for data distributing, The memory of the predistribution is divided into multiple segments, so that data correspondingly join the team by piecemeal, which comprises
Obtain the interface of joining the team of the round-robin queue;
By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are joined the team from the interface of joining the team;
By going out team's thread using another lock independently of the spin lock, passes through the second virtual processor and control the round-robin queue Interior dequeuing data completes data distributing.
2. the method according to claim 1, wherein first virtual processor that passes through controls data to be issued When joining the team from the interface of joining the team, the method also includes:
If it is determined that current spatial is insufficient in the round-robin queue, then by the thread of joining the team, pass through first virtual processor Control the dequeuing data in the round-robin queue.
3. according to the method described in claim 2, it is characterized in that, however, it is determined that current spatial is insufficient in the round-robin queue, institute It states when controlling the dequeuing data in the round-robin queue by first virtual processor, the method also includes:
Whether the judgement dequeue operation that team's thread is controlled described out is currently executing;
If so, being immediately performed by the enqueue operations that the thread of joining the team is controlled;
Otherwise, virtual into not discharging described first after the dequeue operation controlled by first virtual processor executes It is the stage of processor, interior at this stage, execution enqueue operations once or are repeatedly attempted by first virtual processor.
4. according to the method described in claim 3, it is characterized in that, first virtual processor applies house dog mechanism;
Within the stage for not discharging first virtual processor, the method also includes:
If first virtual processor is attempted to execute the number of enqueue operations failure to be more than given threshold, at least one is lost Divide data to be joined the team, and executes dog feeding operation.
5. passing through the first void the method according to claim 1, wherein described utilize spin lock by thread of joining the team Quasi- processor controls before data to be issued join the team from the interface of joining the team, the method also includes:
The size and type of the data to be issued are counted, if so that at least partly described data to be issued are due to joining the team Fail and lose, then generates corresponding loss information, be used for orientation problem or retransmission data.
6. the method according to claim 1, wherein the dequeuing data in the control round-robin queue, tool Body includes:
If currently there are data in the round-robin queue, according to each segmentation of the memory of the predistribution, the data are judged Length whether be not less than the total length of the setting quantity segmentation, the setting quantity is greater than 1;
If so, the dequeuing data of the control setting quantity section length.
7. according to the method described in claim 6, it is characterized in that, the completion data distributing, specifically includes:
Whether judge in the data of team comprising specifying the data of on-site programmable gate array FPGA;
If so, and the data row length that is included be greater than setting length, then the data for being included only are handed down to specified FPGA;
Otherwise, the data of the team out are replicated, and is handed down to the whole FPGA for being currently able to issue respectively.
8. a kind of data distributing device, which is characterized in that it is built with the round-robin queue by predistribution memory for data distributing, The memory of the predistribution is divided into multiple segments, so that data correspondingly join the team by piecemeal, described device includes:
Module is obtained, the interface of joining the team of the round-robin queue is obtained;
First control module controls data to be issued from described by the first virtual processor by thread of joining the team using spin lock Interface of joining the team is joined the team;
Second control module passes through the second virtual processor control by going out team's thread using another lock independently of the spin lock The dequeuing data in the round-robin queue is made, data distributing is completed.
9. device according to claim 8, which is characterized in that first control module passes through the first virtual processor control It makes when joining the team wait issue data from the interface of joining the team, also executes:
If it is determined that current spatial is insufficient in the round-robin queue, then by the thread of joining the team, pass through first virtual processor Control the dequeuing data in the round-robin queue.
10. device according to claim 9, which is characterized in that if it is determined that current spatial is insufficient in the round-robin queue, institute When stating the first control module and controlling the dequeuing data in the round-robin queue by first virtual processor, also execute:
Whether the judgement dequeue operation that team's thread is controlled described out is currently executing;
If so, being immediately performed by the enqueue operations that the thread of joining the team is controlled;
Otherwise, virtual into not discharging described first after the dequeue operation controlled by first virtual processor executes It is the stage of processor, interior at this stage, execution enqueue operations once or are repeatedly attempted by first virtual processor.
11. device according to claim 10, which is characterized in that first virtual processor applies house dog machine System;
Within the stage for not discharging first virtual processor, first control module is also executed:
If first virtual processor is attempted to execute the number of enqueue operations failure to be more than given threshold, at least one is lost Divide data to be joined the team, and executes dog feeding operation.
12. device according to claim 8, which is characterized in that described device further include:
Analysis module utilizes spin lock by thread of joining the team described, controls data to be issued from institute by the first virtual processor State before interface of joining the team joins the team, the size and type of the data to be issued counted, if so as to it is at least partly described to Data are issued to lose due to joining the team failure, then generate it is corresponding lose information, be used for orientation problem or retransmission data.
13. device according to claim 8, which is characterized in that second control module controls in the round-robin queue Dequeuing data, specifically include:
If currently having data in the second control module round-robin queue, according to each point of the memory of the predistribution Section, judges whether the length of the data is not less than the total length of the setting quantity segmentation, and the setting quantity is greater than 1;
If so, the dequeuing data of the control setting quantity section length.
14. device according to claim 13, which is characterized in that second control module completes data distributing, specifically Include:
Whether second control module is judged in the data of team comprising specifying the data of on-site programmable gate array FPGA;
If so, and the data row length that is included be greater than setting length, then the data for being included only are handed down to specified FPGA;
Otherwise, the data of the team out are replicated, and is handed down to the whole FPGA for being currently able to issue respectively.
15. a kind of data distributing equipment, which is characterized in that be built with the circulation team by predistribution memory for data distributing Column, the memory of the predistribution are divided into multiple segments, so that data correspondingly join the team by piecemeal, the equipment includes:
At least one processor;And
The memory being connect at least one described processor communication;Wherein,
The memory is stored with the instruction that can be executed by least one described processor, and described instruction is by described at least one Manage device execute so that at least one described processor can:
Obtain the interface of joining the team of the round-robin queue;
By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are joined the team from the interface of joining the team;
By going out team's thread using another lock independently of the spin lock, passes through the second virtual processor and control the round-robin queue Interior dequeuing data completes data distributing.
16. a kind of data distributing nonvolatile computer storage media, is stored with computer executable instructions, which is characterized in that It is built with the round-robin queue by predistribution memory for data distributing, the memory of the predistribution is divided into multiple segments, with Just data correspondingly join the team by piecemeal, the computer executable instructions setting are as follows:
Obtain the interface of joining the team of the round-robin queue;
By thread of joining the team using spin lock, data to be issued are controlled by the first virtual processor and are joined the team from the interface of joining the team;
By going out team's thread using another lock independently of the spin lock, passes through the second virtual processor and control the round-robin queue Interior dequeuing data completes data distributing.
CN201811628680.6A 2018-12-28 2018-12-28 Data issuing method, device, equipment and medium Active CN109753479B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811628680.6A CN109753479B (en) 2018-12-28 2018-12-28 Data issuing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811628680.6A CN109753479B (en) 2018-12-28 2018-12-28 Data issuing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN109753479A true CN109753479A (en) 2019-05-14
CN109753479B CN109753479B (en) 2021-05-25

Family

ID=66404272

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811628680.6A Active CN109753479B (en) 2018-12-28 2018-12-28 Data issuing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN109753479B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732448A (en) * 2021-01-18 2021-04-30 国汽智控(北京)科技有限公司 Memory space allocation method and device and computer equipment
CN113411392A (en) * 2021-06-16 2021-09-17 中移(杭州)信息技术有限公司 Resource issuing method, device, equipment and computer program product

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853149A (en) * 2009-03-31 2010-10-06 张力 Method and device for processing single-producer/single-consumer queue in multi-core system
CN102591843A (en) * 2011-12-30 2012-07-18 中国科学技术大学苏州研究院 Inter-core communication method for multi-core processor
CN103530130A (en) * 2013-10-28 2014-01-22 迈普通信技术股份有限公司 Method and equipment for implementing multiple-input and multiple-output queues
US8848723B2 (en) * 2010-05-18 2014-09-30 Lsi Corporation Scheduling hierarchy in a traffic manager of a network processor
CN104158685A (en) * 2014-08-20 2014-11-19 深圳市顺恒利科技工程有限公司 Method and device for apparatus information integration and linkage
CN105824780A (en) * 2016-04-01 2016-08-03 浪潮电子信息产业股份有限公司 Parallel development method based on single machine and multiple FPGA
CN106648933A (en) * 2016-12-26 2017-05-10 北京奇虎科技有限公司 Consuming method and device of message queue
CN107122457A (en) * 2017-04-26 2017-09-01 努比亚技术有限公司 Record the method and its device, computer-readable medium of networks congestion control data
CN108632171A (en) * 2017-09-07 2018-10-09 北京视联动力国际信息技术有限公司 A kind of data processing method and device based on regarding networking
CN108733344A (en) * 2018-05-28 2018-11-02 深圳市道通智能航空技术有限公司 Data read-write method, device and circle queue
CN108848006A (en) * 2018-08-24 2018-11-20 杭州迪普科技股份有限公司 A kind of monitoring method and device of port status

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101853149A (en) * 2009-03-31 2010-10-06 张力 Method and device for processing single-producer/single-consumer queue in multi-core system
US8848723B2 (en) * 2010-05-18 2014-09-30 Lsi Corporation Scheduling hierarchy in a traffic manager of a network processor
CN102591843A (en) * 2011-12-30 2012-07-18 中国科学技术大学苏州研究院 Inter-core communication method for multi-core processor
CN103530130A (en) * 2013-10-28 2014-01-22 迈普通信技术股份有限公司 Method and equipment for implementing multiple-input and multiple-output queues
CN104158685A (en) * 2014-08-20 2014-11-19 深圳市顺恒利科技工程有限公司 Method and device for apparatus information integration and linkage
CN105824780A (en) * 2016-04-01 2016-08-03 浪潮电子信息产业股份有限公司 Parallel development method based on single machine and multiple FPGA
CN106648933A (en) * 2016-12-26 2017-05-10 北京奇虎科技有限公司 Consuming method and device of message queue
CN107122457A (en) * 2017-04-26 2017-09-01 努比亚技术有限公司 Record the method and its device, computer-readable medium of networks congestion control data
CN108632171A (en) * 2017-09-07 2018-10-09 北京视联动力国际信息技术有限公司 A kind of data processing method and device based on regarding networking
CN108733344A (en) * 2018-05-28 2018-11-02 深圳市道通智能航空技术有限公司 Data read-write method, device and circle queue
CN108848006A (en) * 2018-08-24 2018-11-20 杭州迪普科技股份有限公司 A kind of monitoring method and device of port status

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
钟承群: "基于CPU/GPU异构并行计算的OTN仿真验证***的研究与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732448A (en) * 2021-01-18 2021-04-30 国汽智控(北京)科技有限公司 Memory space allocation method and device and computer equipment
CN113411392A (en) * 2021-06-16 2021-09-17 中移(杭州)信息技术有限公司 Resource issuing method, device, equipment and computer program product
CN113411392B (en) * 2021-06-16 2022-05-10 中移(杭州)信息技术有限公司 Resource issuing method, device, equipment and computer program product

Also Published As

Publication number Publication date
CN109753479B (en) 2021-05-25

Similar Documents

Publication Publication Date Title
CN111010394B (en) Block chain multi-chain management method and device
CN107465548A (en) The dispositions method and device of code
CN105893126A (en) Task scheduling method and device
CN109542831A (en) Airborne platform multi-core virtual multidomain treat-ment system
CN105573850B (en) Multi-process exchange method, system and server
WO2014187412A1 (en) Method and apparatus for controlling message processing thread
CN109753479A (en) A kind of data distributing method and device, equipment, medium
CN110297661B (en) Parallel computing method, system and medium based on AMP framework DSP operating system
CN109300217A (en) Queuing management method, computer storage medium, queuing server and system
US11711256B2 (en) Autonomous server agents
Sun et al. Republic: Data multicast meets hybrid rack-level interconnections in data center
CN111045797A (en) Task scheduling execution method, related device and medium
CN104298565B (en) A kind of method and device of initiating port
CN110177146A (en) A kind of non-obstruction Restful communication means, device and equipment based on asynchronous event driven
Zhao et al. Joint reducer placement and coflow bandwidth scheduling for computing clusters
CN111722944A (en) NIO-based AIRT-ROS communication method and system
CN102902574B (en) Cooperative processing method and device of multiple information flow nodes
CN108259611A (en) Cluster docker management methods, device, system and readable storage medium storing program for executing
US20040049535A1 (en) System and method for a distributed shell in a Java environment
CN102231126A (en) Method and system for implementing inter-core backup in multi-core processor
CN109412970B (en) Data transfer system, data transfer method, electronic device, and storage medium
CN106371923A (en) Method and device for processing task
US9189266B2 (en) Responding to a timeout of a message in a parallel computer
CN105264499B (en) Message treatment method, device and reception core in a kind of shared queue
CN109586965A (en) A kind of network interface card RSS method of automatic configuration, device, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant