Game Masterpiece Inventory: Balance is the top priority

  In today’s world where new tactics are constantly being developed, it is almost impossible to maintain the perfect balance of the game. At the same time, patches will cause some bad consequences for the game, which is why most players insist that the old version is better balanced. Looking at the great games of the past, it is worth taking a look at the works that developers prioritize balance and make players happy.


  The originator of Civilization Series 4X


  The 4X concept system refers to a rather popular and mature system concept in PC strategy games: exploration, expansion and development, management and development, and conquest. Civilization is a typical representative work. It has a wide range of performance content, rich changes, and easy operation, making it an insurmountable peak for other game works. As the best round strategy game, its short game mode, standard game mode, and round epic mode all make it the most influential game. The influence of the 4X concept can be described as far-reaching, artificial intelligence has been greatly improved, and the peculiar combat style and gameplay have made the battle between computers and people more balanced!



Orion, the king of space


  Indeed, "King of Orion" has had a huge impact on our lives, and you may be addicted to it, to enjoy, to experience, to excite, to sigh. Relying on the player’s leadership ability, you must do everything in your power to survive. At the same time, build a powerful starfleet, defend, scout, conquer, and guerrilla warfare. Ships are the ultimate root of players. The mutual constraints of warships, galaxies, and tactics are the reason why players play for hours on end. Explore entire galaxies, explore planets, study technology trees, connect with new races, and go to war with those who are unwilling to cooperate. This delicate balance is everywhere.



Warcraft, who has the final say in balance


  The Warcraft series fully demonstrated the fun of "fighting with people". From then on, the real-time strategy networking mode laid a very good foundation for future strategy games, and competitive games also had a beginning. Every progress of "Humans and Orcs", "Tide of Darkness", "Dark Gate", "Rule of Chaos", and "Frozen Throne" has witnessed the correction of the balance of BLZ. The four major races are interlocked, and who has the final say in the battle between operation and technology?



Hero Invincible Online, where is the balance?


  "Heroes Online", which is also a strategy game, is full of a strong magical style. The army is composed of various orcs, rangers, dragons, etc., and the battle is also full of various gorgeous magic effects. When searching for treasures and gathering resources, you can experience the new balance design brought by multiple castle systems, magic systems, races, arms, hero attributes, etc. However, in team PK and competitive qualifying, Ubisoft has full support for the balance design of PVP, which may be a good start.



  Many classics were legends created by players. After countless revisions, the product was not just about speaking widely, but also about the pursuit of balance based on the game map, arms, heroes, magic, PK, etc. The right location, important position, competitiveness, and fun were all based on players!

Editor in charge: Hou Jian

The nominations for the 4th New Era Film Festival were announced, Wang Baoqiang, Huang Bo, Hu Ge, Dapeng, Yang Haoyu competed for the best actor

On December 10, the list of nominees for the Golden Flower Award of the 4th New Era International Film Festival of SAIC Volkswagen Voran Night was announced in Macau. "Poisonous Tongue Lawyer", "In the Octagonal Cage", "Wandering Earth 2", "Manjianghong" and "Cosmic Exploration Editorial Department" were nominated for Best Film. Wang Baoqiang, Huang Bo, Dapeng, Hu Ge and Yang Haoyu competed for Best Actor. Hui Yinghong, Haiqing, Tong Liya, Yan Ni and Aliya were shortlisted for Best Actress.

Dapeng ("Warm"), Gao Qunshu ("The Tip of the Knife"), Wu Weilun ("The Poisonous Tongue Lawyer"), Han Yan ("I Love You!") and Deng Chao and Yu Baimei ("Chinese Ping Pong: The Jedi Strike Back") were nominated for best director. Other awards also went to their respective awards. On December 20, the Golden Flower Awards ceremony will be held grandly at the Wynn Palace in Macau.

4Each film received5nominations  Who will win the best picture?

The Golden Mayflower Awards of this New Era International Film Festival are selected for domestic films screened in four places on both sides of the Taiwan Strait from September 1, 2022 to December 1, 2023, including a small number of domestic online films that have premiered on mainstream domestic video websites. In the past year or so, outstanding domestic films have been emerging, and 68 films have been shortlisted for nomination.

After careful selection by the jury, four films including "In the Octagonal Cage", "Poisonous Tongue Lawyer", "Warm" and "Vanishing Her" each received 5 nominations, leading the nomination list by a small margin. Five films including "Cosmic Exploration Editorial Department" "I Love You!" "Desperate", "Changsha Nightlife" and "Full River Red" each received 4 nominations. Films such as "Solid as a Rock" "So Many Years" and "The Eighth Suspect" each received 3 nominations, and several films such as "Fengshen First" and "Wandering Earth 2" received 1 to 2 nominations.

It can be seen that the films that have won multiple nominations for this year’s Golden Flower Awards are close in strength, and no one has an absolute lead. The competition for various awards, especially the best film, is particularly intense.

Among the five films nominated for Best Picture, "The Venomous Tongue Lawyer" makes people feel the charm of the script and lines, and the powerful appeal of the actors’ performances. The film won the box office championship of Hong Kong’s century-old film history Chinese film with a good reputation; "In the Octagonal Cage" is the return of Wang Baoqiang’s director who sharpened a sword for six years. Based on real events, it tells the story of children in Sichuan mountainous areas changing their destiny through fighting, focusing on disadvantaged groups, which is of great practical significance; "Wandering Earth 2" maintains the high level of the first film and represents the highest level of Chinese science fiction films; "Full River Red" reverses many times in a narrow space, which can be called the ultimate suspense narrative, and the ending can also bring emotional sublimation, which is touching; "Cosmic Exploration Editorial Department" is an absurd and humorous small and medium-cost earthy sci-fi film, which brings surprises to people.

Wang Baoqiang, Huang Bo and others competed for the best actor, Hui Yinghong Haiqing and others after chasing the movie

In the best actor competition, the five actors nominated Wang Baoqiang, Huang Bo, Dapeng, Hu Ge and Yang Haoyu are all superb acting stars. Wang Baoqiang played Xiang Tenghui, the owner of the battlefield, in "Octagonal Cage", in order to change the fate of children in the mountains to form a fighting club, which he well interpreted the kindness and persistence of this role; Huang Bo played Ding Lei, a street dance coach, in "Enthusiasm", portraying the role vividly and vividly, and also played his dancing expertise in the film; Dapeng played Chen Xinwen, the alleged offender on the run in "The Eighth Suspect", which is very different from his previous screen image, and his performance has won wide praise from the industry and the audience; Yang Haoyu’s Tang Zhijun in "Cosmic Exploration Editorial Department" is equally wonderful, and has previously been shortlisted for this year’s Golden Rooster Award for Best Actor; Hu Ge’s performance in "It’s Worth It" is also impressive, and the success of the idol Pi transforms into a powerful actor. It is not surprising that any of the above five male actors will eventually win the prize.

The five actresses nominated for Best Actress at this year’s Golden Flower Awards are also excellent. Hui Yinghong in "I Love You!" Li Huiru, a lonely and widowed woman who collects waste, has a love affair with the old man played by Ni Dahong. She portrays the subtle psychological and facial changes of the character vividly; Haiqing plays Zhang Guimei in "I Am a Mountain", whose appearance and even walking posture resemble the prototype character, showing the professionalism of an actor; Tong Liya plays the wife who suffered from her husband’s domestic violence in "I Passed the Storm", which well explains the helplessness and despair of the character; Yan Ni plays a middle-aged massage girl Jin Ximei in "The Final Truth", showing the strong role-building ability of an excellent actor; Alia also has a good performance in "Cosmic Exploration Editorial Department".

This year’s New Era Film Festival Golden Yanghua Awards also feature Best Supporting Actor, Best Supporting Actress, Most Breakthrough Actor, Most Breakthrough Actress, Most Potential Actor, Most Potential Actress, Best Comedian and many other actor categories, covering three generations of actors, old, middle-aged and young. The old actors are not old, the middle-aged actors are perfect, and the young actors are formidable. Together, they have made their own contributions to the prosperity and development of Chinese films and deserve more honors.

The competition for best director and screenplay is intense, and it is difficult to predict who will win

In a movie, the actors in front of the stage are important, but the directors and screenwriters behind the scenes are the soul of the whole movie. In recent years, excellent directors and screenwriters have been emerging in the Chinese film industry, so the competition for the best director and best screenplay of this Golden Mayflower Award is very fierce.

Among the five directors nominated for Best Director, Wu Weilun is a screenwriter. "The Venomous Tongue Lawyer" is the first film he directed. Through this film, he has shown strong directing ability and narrative ability, and is expected to become the future mainstay of the Hong Kong film industry. Han Yan in "I Love You!" As always, it shows his superb ability to shape characters and express emotions. As a young director, it is commendable to have such a stable directing standard. Although the box office of Deng Chao and Yu Baimei ("China Ping Pong’s Jedi Counterattack") is not good, it shows high artistic quality and is the best work of the two in recent years. Director Gao Qunshu’s "Tip of the Knife" has both the great drama tension and audio-visual impact of spy films in stories, characters and images, and the director’s distinct personal style and expression of beliefs, destiny, human nature and feelings for family and country. It is another masterpiece after "The Wind"; Dapeng’s "Warm" story is very burning and touching, and the street dance scenes are wonderful, showing his increasingly mature directing style.

The screenplay is the foundation of a drama. Among the screenwriters nominated for this year’s Golden Mayflower Awards, Chen Yu and Zhang Yimou ("Manjianhong") have collaborated many times in recent years to produce excellent works. They are veritable gold screenwriters and best partners. This time, it is reasonable to be nominated. The screenwriters of "Going All Out" and "Vanishing Her" have been able to set off a movie-watching boom this summer, and the screenwriters of the two films’ bid for the Olympic Games, Zhang Yifan, Xu Luoyang, Chen Sicheng and Gu Shuyi have played a great role. The excellent level of drama presented to the audience by the screenwriters of "Changan Thirty Thousand Miles" and "Enthusiasm" is also one of the key factors for the success of these two films.

The above-mentioned filmmakers who have been nominated for Best Director and Best Screenplay are currently the best in the Chinese film industry. They all demonstrate excellent director or screenwriting skills, making it difficult to give up. It is difficult to predict who will win the prize in the end.

The Golden Mayflower Award of the New Era International Film Festival was established in 2019. It is a film selection event held in Macau, China to promote the "Chinese Dream". It is jointly initiated and hosted by a number of mainstream media in Hong Kong and Macau, with strategic support from the China Entertainment Industry Research Institute, China Film Academy, and China Urban Research Institute.

The first New Era International Film Festival was launched in Macao in January 2019, selecting the top ten films, top ten directors, top ten actors, top ten actresses and top ten screenwriters in the 40 years of reform and opening up, and making a significant impact at home and abroad; the second New Era International Film Festival was held in Macao in October 2020, selecting the top ten film directors, top ten film screenwriters, top ten film actors, top ten film actresses and other awards since the 70th anniversary of the founding of New China; the third New Era International Film Festival was held in Macao in January 2022, publicly recognizing "100 film workers with outstanding contributions" and "100 high-quality films in 100 years". Xia Yan, Tian Han, Shao Yifu, Zou Wenhuai, Xie Jin, Yu Lan, Qin Yi, Tian Hua, Zhang Yimou, Chen Kaige, Xu Ke, Niu Ben, Jackie Chan, Andy Lau, Li Xuejian, Chen Daoming, Jiang Wen, Gong Li, Ge You, Jet Li, Wu Jing, Zhang Hanyu, Hui Yinghong, Zhang Ziyi and other old, middle and young filmmakers have all won the Golden Yanghua Award.

On the evening of December 20, the 4th New Era International Film Festival Golden Flower Awards will be held at the Wynn Palace in Macau. Who will win the awards? The mystery will be revealed at that time, let’s wait and see.

Sales of 64,900 BYD brand-new Qin/Qin EV listed.

Test drive experience:

  Previously, my colleagues Xu Cheng and Su Weiqi respectively test-drive BYD’s brand-new Qin He (|), and the following contents are excerpted from their articles "Home Experts Try BYD’s Brand-new Qin Fuel Automatic Edition" and "Pioneering Works Welcome to Test Drive BYD’s Brand-new Qin EV".

The new Qin:

BYD Qin 2019 1.5L automatic distinguished model

  With the light start of the vehicle, there is a tough steering force, which gives people a feeling of "communication" with the vehicle. The steering wheel wrapped in leather is a little too big, and it is thick and thick to hold, which makes people feel that it is simple and practical to get started.

BYD Qin 2019 1.5L automatic distinguished model

BYD Qin 2019 1.5L automatic distinguished model

  The noise suppression ability of this car at low speed is satisfactory. Close the window, turn on the stereo, and get stuck in the traffic. Even if your body is busy driving, at least your ears can relax for a while and don’t be so noisy. 

BYD Qin 2019 1.5L automatic distinguished model

  The adjustment of suspension is undoubtedly a comfortable orientation, which can hide small bumps and make big bumps linear. I don’t think I will be too upset if I am stuck in the city in this car. At medium and low speed, the whole feeling of this car is comfortable, relaxed and easy. This is also what I like about it, both inside and outside. Instead of looking like fighting and yelling, it is better to simply repair both inside and outside and move on calmly. It’s enough to find your own position and be yourself.

BYD Qin 2019 1.5L automatic distinguished model

BYD Qin 2019 1.5L automatic distinguished model

  To be honest, high speed is not the strong point of this car. After 80km/h, it will make people a little anxious. In the D-gear state, the engine will only maintain around 4000rpm despite the bold throttle, so it is necessary to wait patiently for the speedometer to go up a little bit. However, even if you drive to 120km/h, the vehicle will not give the driver the feeling of "drifting", which is already the highest speed limit of almost all domestic roads.

BYD Qin 2019 1.5L automatic distinguished model


The new Qin EV:

  Before the speed of 80km/h, fully press the switch to simulate the daily action of accelerating overtaking. Even in ECO mode, the new Qin EV can give the driver enough power output. After all, it is equipped with a single-speed gearbox with fixed gear ratio. The advantages of linear speed increase, direct power and no sense of frustration are pure electric vehicles. The new Qin EV has done a good job in this respect.

Home of the car

  Although the speed increase is linear and smooth enough, it can be found that the initial response of the switch is not very positive. Only when the switch is deeply stepped on, the dynamic response will be more direct and the power output will be displayed. Of course, the author thinks that this setting is more in line with Qin EV’s positioning as a pure household electric vehicle. Perhaps the engineer is considering urban commuting. If the switch is tripped at one point, I am afraid the traffic jam will be very uncomfortable.

Home of the car

  However, when the speed reaches 80km/h, you will feel that the acceleration force is not enough. I can tell you this-this is determined by the torque output characteristics of the motor. No matter how heavy the load is, the motor can achieve a constant peak output at low speed (in layman’s terms, it is the peak when it is shot), but at high speed, the torque output of the motor will gradually decrease, which is inevitable for the current motor.

Home of the car

  At this time, you may wish to switch the driving mode to SPORT, and then you can feel that Qin EV, like an injection of "adrenal hormone", has a lot of active power output, and the instantaneous power output is naturally greater than that in ECO mode, which is also the reason why SPORT mode does not save electricity.

Home of the car

  Every time a foot is accompanied by "floor electricity", you can hear the "whistling sound" from the high-speed rotation of the motor, which is as charming as the high-speed rotation sound of the fuel engine. Of course, this "whistling sound" will usually be filtered and isolated, and it will only be transmitted to the car after the switch is fully pressed.

Home of the car

  High-speed cornering is a "watershed" for most compact family cars, and the handling of a car can be felt more or less through high-speed cornering. Take Qin EV as an example, compared with its competitor, BAIC New Energy EU5, the author thinks that the roll control of the former will be better when cornering, and even when cornering at a higher speed, it will be more confident.

Home of the car

  The new Qin EV is the same as other BYD models, and has two gears of energy recovery (BYD officially calls it energy feedback), namely "standard feedback" and "greater feedback"; When the vehicle is adjusted to the "big feedback" gear, it will feel a certain drag when the electric switch pedal is completely released. The specific feeling can be understood as lightly stepping on one third of the brake pedal, but the drag feeling is not as abrupt and strong as Tesla’s single pedal mode. At least, the ride comfort will not be greatly affected, but it can help us control the speed to a certain extent. As long as the front vehicle does not suddenly brake, you basically don’t need to step on the brake pedal.

Home of the car

  If you are looking for ride comfort, it is suggested to adjust the energy recovery to the "standard" gear. At this time, releasing the accelerator pedal has a little drag force besides the rolling resistance of the wheels, just like the feeling of a fuel car braking lightly.

Home of the car

  It is worth mentioning that the energy feedback of the new Qin EV and even the new energy vehicles launched by BYD in recent years cannot be completely turned off. In other words, when the switch is completely released, there will be more or less dragging feeling. If you don’t like this feeling,I suggest you try to take a little switch to slide or follow the car at a constant speed.Don’t completely release the switch, and then you can see the current output power on the instantaneous output power on the left side of the dashboard. The pointer pointing to "0" means there is no energy recovery. Try it several times and remember the depth of pedaling, and you will get used to it.

Home of the car

  Like Qin Pro New Energy, when the new Qin EV is switched to P gear, the electronic handbrake will be pulled up in linkage; The electronic handbrake will be automatically released when the forward/reverse gear is engaged, which will help the driver simplify a step of pulling/releasing the brake.

  After a day’s road test drive, compared with the current Qin, the brand-new Qin EV has a "reborn" evolution. Whether it is NEDC cruising range, driving experience or chassis texture, it has reached a higher level, especially when driving at low speed. I will not hear obvious motor sound. I still give affirmation to Qin EV’s NVH performance.

New car background:

BYD Qin New Energy 2014 1.5T flagship model

The picture shows the 2014 Qin Dynasty.

  In 2008, BYD introduced the F3DM model with the first generation of dual-mode hybrid technology, which was also unveiled at the Geneva International Auto Show that year. In 2013, BYD introduced the second-generation dual-mode hybrid technology, and the first model equipped with this technology was BYD Qin. This car is also BYD’s first model to adopt the Dynasty series naming system. In 2018, the cumulative sales volume reached 57,952, which made a great contribution to BYD’s sales. What we see today is the second generation Qin, and whether it can surpass the previous generation remains to be tested by the market.

Competitors:

Changan Automobile Yidong 2019 Blue Whale Edition 280T GDI Automatic Speed Type

Geely Automobile Emgrand 2019 Leading Edition 1.5L CVT Luxury Country VI

The picture shows Chang ‘an Yidong and Geely Emgrand.

  The compact car market has always been a battleground for military strategists. In terms of sales volume, Changan Yidong, Geely Emgrand and other models have occupied a part of the market share, which is a big challenge for BYD Qin. Of course, not only the China brand, but also the overseas brands’ offensive is fierce, and the further price drop also makes the China brand compact car face the situation of "the jackal before". For Qin EV, BAIC New Energy EU5, Emgrand EV and Roewe Ei5 are old rivals, and a "fight" is inevitable. However, the recruits represented by Aion S of GAC New Energy cannot be ignored.

Editor’s comment:

BYD Qin 2019 1.5L automatic distinguished model

  Compared with the old Qin, the new Qin has undergone earth-shaking changes, and its competitiveness, born out of BYD’s all-engine power platform, has been significantly improved. Judging from the performance of the previous generation models, after the launch of Qin pro, the sales volume of Qin declined to some extent, which is also reasonable. After the replacement of Qin, it is expected that there will be a significant increase in sales. Of course, we can’t be too happy. The competition in the domestic compact car market is fierce. Not only China brands, but also overseas brands are grabbing market share. (Text/car home Zhang Xuelian)

Strengthening the cultural consciousness of film adaptation of online novels

  TV series The Longest Day In Chang’an stills information pictures

  [Ask and cut the net text]

  ● The cultural consciousness of online novels with the theme of ancient costumes in the process of film and television adaptation has broadened the space for their development. At the same time, the arrival of the "internet plus" era has also brought a new opportunity and challenge to the development of online literature.

  ● From online novels to film and television dramas, it belongs to "re-creation" and "re-creation". The value guidance and cultural atmosphere should not be a process of weakening, but should be a process of continuous improvement and strengthening, so that the value guidance is more in line with social value norms and the cultural atmosphere is fuller and more authentic.

  From its germination, prosperity to popularity, online novels with the theme of ancient costumes have always been inextricably linked with Chinese traditional culture. The mature development of online literature can not be separated from the influence and nourishment of traditional culture, from the ancient costume theme in the early days, to the hot travel novels later, and to the increasingly popular online novels with biographical costume themes recently. In recent years, some popular TV series adapted from online novels, such as Hougong Zhenhuan Biography, Ruyi’s Royal Love in the Palace, legend of miyue, nirvana in fire, Do you know if it should be green and fat, The Longest Day In Chang’an and Joy of Life, show the grand Chinese history, classic poems and songs, and traditional folk customs one by one, coupled with different types and styles of plays, personalized character design and subtle cultural connotation, showing Chinese tradition. The cultural consciousness in the process of film adaptation of online novels with the theme of ancient costume broadens the space for their development, and the arrival of the "internet plus" era also brings a new opportunity and challenge to the development of online literature.

  Let "overhead" land.

  In the initial stage of creation, online novels with the theme of ancient costume tend to adopt the writing style of "overhead" history, or construct the whole work in the mode of crossing time and space. This creative way far away from history has found a more reasonable solution in the process of film and television adaptation of online novels.

  Wu Xuelan’s Biography of Zhen Huan, an online writer, is the main representative of returning to historical film and television works from online novels with overhead history. In the original work, the author fictionalized a dynasty, telling the story of a bloody incident in the former imperial harem from the first year of Ganyuan to the thirty years of Ganyuan. In the film adaptation, he chose to land in the Yongzheng period of the Qing Dynasty, relying on the history of the Qing Dynasty, to show that familiar and unfamiliar court story.

  Joy of Life, an online novel, was originally a novel about crossing the theme. It tells the story of a dying patient in modern times, Fan Shen, who happened to cross the fictional country of Qingguo by chance and started a confusing adventure for the rest of his life, hence the name "Yunian Qing". In the process of film and television adaptation, the creator adopted the narrative mode of "play in play" to transform Fan Xian’s legendary experience of celebrating the country into the content of a novel written by Jasmine Zhang, a university student. This plot design not only conforms to the narrative logic of "crossing" the plot in the original work, but also complements the research idea of the protagonist Jasmine Zhang "analyzing the history of ancient literature with modern concepts", and better sews up the gap between the fiction of online literature and the official history, which makes a powerful exploration for the realistic return of novels with costume themes.

  In addition, the accurate positioning of historical events is also a new attempt in the film adaptation of online novels in recent years. The TV series "legend of miyue" directed by Zheng Xiaolong tells the ups and downs of the life story of Mi Yue, the first empress dowager in China history and a female politician of Qin State in the Warring States Period. Among them, allusions such as "Returning to Zhao in perfect condition", "encircling Wei to save Zhao" and "uniting Lian Heng" are accurately reproduced, and figures such as Zhang Yi, Qu Yuan and Huang Xie also appear in the Warring States Period, realizing a high degree of integration of biographies and historical facts. It can be seen that the landing of "overhead" history, the reversal through time and space, and the innovative interpretation of celebrity allusions have become an important path for the film adaptation of online novels, gradually guiding the audience to pay attention to, respect and reflect on history, and to understand and observe reality with a more rational and comprehensive eye.

  Let classical poetry "appear" vividly

  Five thousand years of Chinese traditional culture is extensive and profound, which has become the spiritual soil for the creation of online novels with the theme of ancient costumes. At the same time, online novels actively absorb and transmit the artistic essence of Chinese excellent traditional culture. The emerging network literature forms and excellent traditional culture join hands to explore new ways forward.

  In recent years, the film and television dramas adapted from online novels with the theme of ancient costumes have tried to integrate classical poetry and lyrics into film and television works, making a new attempt for the revival and dissemination of traditional poetry. At present, there are several types of reproduction methods of classic poems in popular dramas with costume themes adapted from online novels.

  First, the name of the play is vividly used in poetry and allusions. For example, the title of the TV series "Do you know if it should be green, fat, red and thin?" is taken from the words in the Song Dynasty poetess Li Qingzhao’s "Like a dream, it rained last night and the wind blew suddenly." When the novel was published, seven poems were also used as the titles of each volume, namely, "Begonia blooms in my hometown today, and only famous flowers are bitter and lonely", "I faded my makeup from plum powder and painted a new red begonia", "Begonia doesn’t hesitate to be rouge, and I don’t wait for the golden house to recommend Huatang", "I don’t know that flowers are more gorgeous until I am pale, and I am eager to love Begonia", "How can I make peaches and plums speak, and sleep with a new begonia?" The title of each volume revolves around "Haitang", which coincides with "green, fat, red and thin". At the same time, the style of writing is the same, and the cultural heritage of the whole work is added.

  Second, classic poems appear frequently in film and television works in the form of lines. For example, in "Biography of the Harem Zhen Huan", Zhen Xuan explained the origin of his maiden name to Yongzheng when he participated in the draft, and quoted the words "a beautiful waist" in Cai Shen’s "A Prune of Plums" in the Northern Song Dynasty, which coincided with Zhen Xuan’s charming appearance and cool temperament. At the same time, he also used Cai Shen’s words and quality to express his personal feelings to Zhen Xuan’s father Zhen Yuandao in the play. In addition, the characters in the play are lined with corresponding poems, which are closely related to the characters’ personalities and fates. For example, Shen Meizhuang chanted "I would rather hold the incense on the branches and die, than ever blow it down in the north wind" (Zheng Sixiao’s "Cold Chrysanthemum"), and An Lingrong sang "Don’t cherish the golden gowns, and advise you to cherish your youth. When flowers bloom, they must be folded straight, so don’t wait until there are no flowers and empty branches "(Yuefu poem" Goldilocks "), and the king of Guojun lamented on the night of Tanabata that" when the golden wind and the jade dew meet, they will overcome countless people "(Qin Guan’s" Queqiao Fairy ").

  The third is to take the allusions in the famous works as the core plot of the film and television drama. For example, the hit drama Joy of Life quoted the poem "Stay in Qing Yu" in A Dream of Red Mansions: "Stay in Qing Yu, stay in Qing Yu, and suddenly meet a benefactor; Lucky mother, lucky mother, accumulated yin gong. Don’t be like my cruel uncle and traitor who loves money and forgets flesh and blood! It is multiplication, division, addition and subtraction, and there is a sky on it! " Taking this as the plot of the drama, and then persuading people to uphold the idea of helping the poor and helping the poor, which is highly consistent with the theme of the drama. The diversified and flexible use of classic poetry in the film and television works adapted from online novels not only expands the communication path of traditional poetry, but also creates an immersive space field for the audience to understand the profound meaning of poetry, which is a novel and extensive way of communication.

  Let the "textual research fever" continue to heat up

  The popularity of film and television dramas on mass cultural consumption is relatively high, and excellent ancient costume works can become a powerful carrier of traditional cultural communication to some extent. The audience’s "textual research" on customs, costumes and etiquette in film and television dramas has given new narrative dimensions to the works with the theme of ancient costume to a certain extent, and also put forward higher and stricter requirements for the writing of online novels with the theme of ancient costume.

  Many details in the drama The Longest Day In Chang’an have caused a heated discussion among netizens. The drama focuses on depicting the prosperous scene of the Tang Dynasty, from the costumes and hair accessories, to the furnishings of daily life, and then to the scene setting of the times, all of which are exquisite and exquisite. In the play, Li Bi, played by Jackson Yee, has attracted everyone’s attention because of his lotus-crowned hair style with hair pins inserted from back to front. The audience carried out in-depth textual research and exploration around the production time and identity symbol of "Meridian Hairpin" and "Maoyou Hairpin". To some extent, this also increases the appreciation dimension of TV series.

  In addition, the "bad teacher" played by Lei Jiayin in the play wears the "round neck robe" and "six-in-one boots", and carries the accessories such as "tie rope", "arm shovel" and "smoke pill" with him, which truly reproduces the mixed style and characteristics of Hu and Han in the Tang Dynasty. In the play, women’s clothing accessories such as "flowers", "bun", "skirt" and "half-chest skirt" mostly echo the characters in famous paintings and poems. "One scoop of food and one drink" has become an important method to spread traditional culture.

  Do you know whether it should be green, fat, red and thin? nirvana in fire and other film and television dramas also reproduce Chinese traditional manners and customs exquisitely. When women meet each other every day, they ask each other "make-up safety" and perform "Wan Fu Li"; Men bow down and bow their hands; When the younger generation says hello to their elders, they will "cross their hands". These courtesies are numerous and varied, and they are also used in exquisite occasions. There are concrete explanations and graphic descriptions in works such as Shuo Wen Jie Zi, Tokyo Meng Hua Lu and Han Xizai’s Night Banquet.

  There are also studies and unique displays of traditional ingredients and pharmacology of traditional Chinese medicine in film and television dramas. For example, in Ruyi’s Royal Love in the Palace, the delicacies such as chicken soup with purple ginseng and snow, lotus root with bi Nuo, milk cake and dark fragrant soup are often mentioned, which are unique in color matching. Even when chopsticks are dropped, the instant when the chopsticks touch the "chopsticks pillow" is particularly attractive. These designs convey the charm of Chinese traditional culture to the audience and bring visual enjoyment. At the same time, the "homophonic" and "metaphor" of dish names have also become an important driving force for the development of drama plots.

  Another example is the interpretation of the efficacy of Rhizoma Smilacis Glabrae, Herba Scorzonepetae, Folium Perillae and Herba Hedyotidis Diffusae in "legend of miyue", which better integrates Chinese traditional culture and Chinese medicine, makes film and television dramas more pyrotechnic, and opens the pace for online literature to land in real life.

  It can be seen that the details of traditional folk customs in film and television dramas can better stimulate the audience’s viewing enthusiasm and psychological expectations. The upsurge of "textual research fever" reflects, to some extent, the desire and pursuit of cultural values by film and television consumption, and therefore film and television dramas have become more diverse and multidimensional, becoming an effective way to convey traditional culture.

  Let the creative concept always walk on the right path

  Under the background of media integration, the network provides more possibilities for the spread of literature, and network literature also has a broader spread space. In the process of film and television adaptation, online novels with the theme of ancient costume have more new ways to inherit and popularize Chinese traditional culture.

  The "little knowledge" pop-up window of "Do you know whether it should be green, fat, red and thin" broadcast on the video website timely and accurately explains the "knowledge points" in the series, and the design of real-time barrage, mini-theater and other links is novel and flexible, opening up a new position for the arrival of traditional culture to "new and new mankind".

  Weibo’s hot topic search, friends circle forwarding, promotion of post bars and related cultural activities on the client side have, to some extent, become new ways to spread traditional culture in film and television dramas. At the same time, the film and television drama adapted from online novels has gradually opened up the linkage with games and animation, realizing industrial integration, providing reference and experience for the cross-industry communication of film and television drama, and also providing the possibility for the cross-industry communication of "national style and Chinese rhyme".

  As some scholars have said, the correlation patterns between the literary value and market value of contemporary literary works are more and more diverse. The arrival of "internet plus" and the era of media integration has brought more possibilities for the spread of literature, art and culture, but it has also brought more tests and challenges. Writers of online novels need to uphold a firm cultural stand and cultural self-confidence, and spread and re-create Chinese traditional culture by removing the rough and the essence, discarding the dross and taking the essence. They should not introduce some pseudoscience, feudal ideas and metaphysical superstitions into their creation, which will lead to the loss of their creative ideas. From online novels to film and television dramas, it belongs to "re-creation" and "re-creation". The value guidance and cultural atmosphere should not be a process of weakening, but a process of continuous improvement and strengthening, so that the value guidance is more in line with social value norms and the cultural atmosphere is fuller and more authentic.

  Under the background of media integration, the film and television works adapted from online novels are more diverse in strategies and ways to spread traditional culture. The interaction of industries such as network, literature, film and television, games and animation will make new explorations for the future development of online literature and network culture. In the face of such a new situation, we need to be full of longing, but also need to be vigilant at all times.

  (Author: Ouyang Yifei, a lecturer at the School of Art and Design of Changzhou Institute of Technology, Dr. college of nanjing normal university, this article is a research project of philosophy and social sciences in Jiangsu universities "‘ Internet plus & rsquo; Film and television major in colleges and universities in the times ‘ Double span ’ Research on talent training mode "phased results)

Ministry of Industry and Information Technology: China’s new energy vehicle production and sales ranked first in the world for 8 consecutive years.

  Cctv newsOn the afternoon of March 1st, the State Council Press Office held a series of press conferences on the theme of "Opening by authoritative departments", introducing the situation of "accelerating new industrialization, strengthening and improving the real economy" and answering reporters’ questions.

  Xin Guobin, Vice Minister of the Ministry of Industry and Information Technology, said that in 2022, the production and sales of new energy vehicles in China reached 7.058 million and 6.887 million, up by 96.7% and 93.4% respectively, ranking first in the world for eight consecutive years. Since 2012, when China promulgated and implemented the Development Plan of Energy Saving and New Energy Vehicle Industry, the average annual compound growth rate of new energy vehicle sales reached 87%, and the cumulative promotion of new energy vehicles reached 15.96 million, nearly 16 million. China has become an important guiding force for the electrification transformation of the global automobile industry.

  This year, the new energy automobile industry will maintain a good development trend, and production and sales will achieve steady growth. The Ministry of Industry and Information Technology will focus on promoting the work from five aspects.

  First, we should strengthen overall planning. Further improve and perfect the coordinated promotion mechanism for the development of new energy automobile industry, and coordinate the overall work of electrification, networking and intelligent development. Focusing on technical research, popularization and application, infrastructure construction, etc., we will continue to cultivate independent brands with high innovation level, strong comprehensive ability and international competitiveness.

  The second is to support innovation breakthroughs. We will focus on supporting leading enterprises to play a leading role and accelerate the technical research and industrial application of new systems such as batteries, automotive chips and automotive operating systems. Start the pilot of intelligent networked vehicle access and road traffic, accelerate the technical application of 5G vehicle-road coordination, and promote the coordinated development of electrification and intelligent networked.

  The third is to further increase the promotion and application. We will carry out pilot projects for the comprehensive electrification of vehicles in public areas, and further improve the electrification level of vehicles in official vehicles, taxis, postal express delivery, sanitation and other fields. It is necessary to work with relevant departments to study and clarify the continuation policies such as tax reduction and exemption for new energy vehicles as soon as possible, and revise and issue the "double points" management method to stabilize market expectations.

  The fourth is to improve service support capabilities. It is necessary to speed up the development of domestic resources, stabilize international cooperation and supply, and ensure the supply and price stability of key raw materials. It is necessary to improve the recycling system, strengthen key technologies such as intelligent disassembly, and improve the recycling level of power batteries.

  The fifth is to promote open development. We will continue to implement opening-up measures in the automotive sector, give play to the role of multilateral and bilateral cooperation mechanisms, and support enterprises, research institutions and industry organizations to carry out exchanges and cooperation in the fields of trade and investment, technology research and development, and standard setting, so as to achieve win-win development.

Interview | Deng Chao took the heart to respond, "China Table Tennis" is going to counterattack?


Special feature of 1905 film network
On February 17th, the schedule was adjusted several times.

(hereinafter referred to as "China Table Tennis") finally meet with you.

As of press time, the box office has exceeded 72 million.

# China Ping-Pong Box Office # Related topics are listed in Weibo Hot Search.

"’The movie looks good’ is no longer the standard for going to see a movie.

The sense of ritual is becoming more and more important.

Mystery is becoming more and more important. "

Some netizens feel that,

As we all know, the topic of China Ping Pong is selected.

There is no "mystery" to some extent.

Even though the film Douban scored 7.0,

Created the best reputation with the director’s career.

At present, there is still a lot of room for improvement at the box office.

"Some people say that we are a persuasion group.

I hope the audience with this idea will come to see this movie. "

In the face of constant bad reviews of past works and even word-of-mouth overdraft,

Deng Chao responded on the occasion of the release.

Compared with previous creations,

He seems to be more attentive this time.

Some time ago,

"Deng Yu Group" took actor Liang Chao as a guest in China Film Report.

Dialogue movie channel host Roman, intern reporter He Junlin,

Talk about the film’s creation over a thousand days.

When my father was young, he was the champion of table tennis doubles in Chang ‘an County, Shaanxi Province.

Influenced by it,

Yu Baimei is also a big sports fan.

I have been looking forward to making an exciting sports movie.

So he directed China Ping-Pong,

It has also become his "dream of dreams."

The film tells the story that China men’s table tennis fell to the bottom in the 1990s.

The new coaching team has transformed them in all directions.

Help Guoping make a comeback at the 1995 Tianjin World Table Tennis Championships.

"An underrated coach,

A group of underdogs.

At the lowest point, the Jedi fought back. "

Deng Chao said frankly,

He can fully understand the characters in China Ping-Pong.

Because he and Yu Baimei have experienced failures,

I have been criticized by everyone and ridiculed by online groups.

How hard it is for the underdog to get things done,

He is very clear.

The story of Ping-pong’s counterattack against the Jedi made the two directors feel the same.

They want to make China Ping-Pong into their own style.

Deng Chao plays the head coach "Dai Minjia" in the movie.

He is not skilled.

Shi Zhihao and Li Nan, famous table tennis coaches, were invited to become "military advisers".

Practicing table tennis skills from scratch.

Although I am ready to "suffer".

But wait until the coach says, "Come on!"

He "abused" him for the first time in class for almost two hours.

This also made Deng Chao shout "I almost fainted!"

In particular, the character "Dai Minjia" is a "left-handed".

He is even more "headache" for this.

So make sure you get used to using your left hand?

The solution that Deng Chao came up with was,

Whether you eat or play ball,

Let colleagues around you keep a close eye on themselves,

Once he is found to be using his right hand,

You need to fine him.

The film took more than 1000 days from preparation to release.

The crew has always had 18 professional table tennis consultants "sitting in the array".

Under the guidance of all the masters,

The "dark war" between Yu Dao and Deng Dao can always offer jokes for everyone.

Liang Chao, who also plays the table tennis coach in the film, broke the news.

of course,

Deng Chao and the pair of "stooges" are indispensable sources of jokes for the crew.

In the scene where Deng Chao was kicked out of bed by Sun Li,

I only took it once and it passed.

Yu Baimei joked that,

This somewhat reflects the life experience of the couple.

I am just their "recorder".

"Sun Li is the best head of the family."

Speaking of his wife’s constant companionship and encouragement,

Deng Chao said emotionally,

Over the years,

I am especially grateful to Sun Li for her silent contribution.

"I think we made a good movie,

If measured by life,

It’s graduated. "

Assembled the painstaking efforts and efforts of the crew,

Deng Chao finally could not help but sigh,

I hope the film is dedicated to everyone who is not optimistic.

From 9-0 to 0-1! Salah lost, Liverpool lost to the relegation team and humiliated Manchester United by hook or by crook!

Liverpool, the Premier League giants, did not perform well at the beginning of this season, which once made fans fail to see their hope of winning the Champions League next season. Fortunately, with the deepening of the season, Liverpool gradually came out of the trough. In the last round, the Double Red Club wiped out the old enemy Manchester United 7-0 at home, climbing to the fifth place in the standings, only three points behind Tottenham in one game less, which can be said to have grasped the initiative in the battle for World War IV! This week, the 27th round of the Premier League started in full swing, and Liverpool went to the away game to challenge Bournemouth. During the first leg of the season, Liverpool beat their opponents 9-0 at home, which is why fans thought they could easily kill each other.After the game started, Liverpool took advantage of the scene, but it was too late to score. On the contrary, Bournemouth took advantage of a few offensive opportunities and Billing scored the only goal in the game. In the end, Bournemouth avenged Liverpool 1-0!

Although the opponent’s strength is not very strong, klopp didn’t let his guard down. After all, the Premier League has always been unpopular. In this game, Uncle Zha followed the 4-3-3 system, allison continued to play for the team, and Arnold, konate, Fan Dike and Robertson formed a four-back, Elliot, Fabinho and bajcetic sat in the midfield, while the front trident was Salah and Gack who scored twice in the last game.

After the referee blew the whistle at the start of the game, Liverpool kept the ball firmly under their feet and stormed towards Bournemouth’s goal. In the 5th minute, Liverpool got a right corner kick, Arnold drove the ball to the back, Fan Dike jumped high and headed the ball to the far corner. Bournemouth’s goalkeeper had given up, but it was cleared by the defender’s goal line.

However, two minutes later, Arnold made a fatal mistake in the midfield, which made Bournemouth hit back conveniently. Ouattara got a single-handed goal. Unfortunately, after passing allison, Liverpool missed the goal at a small angle, and scored in the 13th minute. Gakpo scored the goal after receiving the ball from his teammate in the restricted area. The referee immediately signaled offside and cancelled the goal.

In the 23rd minute, Bournemouth hit back again.Ouattara succeeded in offside on the right. After receiving a long pass from his teammates, he directly killed Liverpool’s restricted area. Then he made a cross from the bottom and found Billing who followed in the middle. The latter easily pushed and scored meritorious deeds, helping Bournemouth to take a 1-0 lead.

In the second half, klopp changed into jota, and wanted to continue to strengthen the team’s attack. In the 49th minute, Jota finished a threatening shot at the front of the restricted area, but the Bournemouth goalkeeper was in a very brave state, and he managed to save the ball to keep the goal clean.

In the 67th minute, Milner sent a cross from the right, and jota headed the goal. The ball hit the open arm of the Bournemouth defender and went out of the bottom line. After returning to VAR, the referee gave Liverpool a penalty.Unfortunately, Salah’s penalty kick was wide of the mark, and Bournemouth was lucky to hold the lead by one goal.

In the next 30 minutes, the backward Liverpool put a lot of pressure on Bournemouth’s goal, but it bombed indiscriminately and failed to knock on the opponent’s goal. In the end, it could only accept the result of losing 0-1. The Double Red Club bloodied Manchester United with 7 goals, and then lost to the relegation team 0-1. This is also the reason why many fans ridiculed after the game. Liverpool did everything to humiliate the old enemy Manchester United!

President china portrait photography society and his party visited Meitu Company for a discussion.

Recently, Mr. Yan Taichang, Chairman of china portrait photography society, Mr. Han Yuezhi, Vice Chairman of china portrait photography society and Chairman of Post-production Professional Committee, Mr. Liang Jiande, Vice Chairman of china portrait photography society and Chairman of Cosmetic Modeling Professional Committee, and their delegation visited Meitu Company for exchange and discussion. Also present at the visit and discussion were Xu Chunsheng, Chairman of Platinum Jue Travel Photography Culture Group Co., Ltd., and Pan Baofu, founder of Extraordinary 6+1 Photography Group. Zheng Minglie, Chairman of Wiener Digital Printing Art Industrial Park, He Songlin, Senior Vice President of Meitu Company, Chen Jianyi, Vice President of Products and Xu Qingquan, Head of Meitu Yunxiu, accompanied him to visit and attend the symposium.

In the exhibition hall of Meitu Company, Chairman Yan Taichang and his party learned about the development history, company strategy, corporate culture, product innovation, core technologies and honors of Meitu Company in detail, and experienced the software and hardware products of Meitu, such as Xiu Xiu, Beauty Camera, Wink, Meitu Skin, etc. On the spot, they paid attention to and recognized the innovative products and leading imaging technologies of Meitu Company. During the introduction of Meitu’s corporate strategy, Chairman Yan Taichang and his party learned deeply that at present, Meitu, based on its image core competence, digs more scenes at the C-end, while focusing on the B-end market with SaaS and related businesses as its main focus. Based on Meitu’s continuous investment in scientific and technological innovation, accumulated grasp of the public’s aesthetics over the years, and understanding of the needs of a large number of users, Meitu Yunxiu, a one-stop intelligent retouching solution for the commercial photography industry, is launched. In this regard, Mr. Yan Taichang said that the imaging technology mastered by Meitu can solve the technical problems existing in the portrait photography industry in a targeted manner, and help photographers, retouchers and enterprises to improve retouching efficiency with the help of artificial intelligence technology, and help the standardization construction and digital transformation of the industry.

At the symposium, the two sides had an in-depth sharing and exchange on the current situation, pain points and future development direction of portrait photography industry. With the consumption upgrade of portrait photography industry, all enterprises are facing new opportunities and challenges. Both sides said that since the formal strategic cooperation was reached, through multi-field and high-level in-depth cooperation, more and more photographers and enterprises actively embraced the digitalization of portrait photography, and jointly explored and developed the digital economy with Meitu Yunxiu. "Technology" and "digitalization" are the key words for the development of portrait photography industry. Focusing on china portrait photography society’s leading role in the industry, Meitu Yunxiu will give full play to its technical advantages in the field of imaging technology, actively promote the continuous deepening of cooperation between the two sides, focus on overcoming the shortcomings of the industry, rely on image AI technology, jointly promote the high-quality development of portrait photography industry, and serve high-quality post-retouching to help portrait photography. Help the upstream and downstream industries to realize all-round digital transformation and upgrading. The head photography brands and later brands who participated in this symposium all said that intelligent retouching technology can actually help enterprises reduce costs and improve efficiency, and imaging technology is playing an increasingly important role in portrait photography ecology. Therefore, we should work together to seize the opportunities of digital development, promote the development of new businesses in various fields of the industry, create new formats, explore new modes, and make greater contributions to the digital transformation of portrait photography.

The person in charge of Meitu Yunxiu said that as one of the important strategies of Meitu’s B-end layout, Meitu Yunxiu is committed to promoting the high-quality development of portrait photography industry and serving high-quality post-retouching. Relying on the continuous breakthrough and innovation of imaging technology, Meitu Yunxiu will launch the first multi-terminal adaptation mode in the industry, flexibly adapt to complex equipment and network environment, and provide better and more convenient intelligent retouching services for enterprises and retouchers, helping enterprises achieve cost reduction and efficiency increase.

Since the two sides reached a strategic cooperation in 2022, based on the multi-dimensional cooperation between online and offline, the two sides have achieved a lot. As a strategic partner of china portrait photography society, Meitu Yunxiu will give full play to its advantages in imaging technology and artificial intelligence, further deepen cooperation with china portrait photography society, promote the digital and intelligent development of portrait photography industry, and comprehensively help accelerate the development of digital economy of portrait photography industry in China.

I put the essence of Python coroutine Pa was clean!

This article is a large amount of information, from IO multiplexing, to use the generator, then async, await realization of the principle behind it, in simple terms, the analysis was very thorough, very hardcore!

Two days for personal reasons because it did not touch a long time to write a point of Python, which involves "coroutine" program, the last time out, it is Web framework tornado unique feature, now we have async, await keyword support . Thought about its implementation, reviews the evolution of these years, feel a little bit mean.

They are single-threaded, why the original code with the low efficiency of the async, await add some asynchronous library becomes higher efficiency?

They are single-threaded, why the original code with the low efficiency of the async, await add some asynchronous library becomes higher efficiency?

If you do Python-based network or Web development, this question has puzzled, this article attempts to give an answer.

Before beginning 0x00

Firstly, Not take you browse the source codeAnd then tell you the control to achieve the original code Python standard. Instead, we will set out from the real problems, think of solutions to the problem, step by step evolution path experience solutions, and most importantly, hoping to gain knowledge in a systematic upgrade process.

This article only provides an independent direction of thinking, does not follow the historical and current actual implementation details.

Secondly, you need to read this article familiar with Python, at least understand the concept generator generator of Python.

0x01 IO multiplexing

This is the key to performance. But we are here only to explain the concept, its implementation details is not the point, which we understand Python coroutine enough, as already know enough about, advances to 0x02.

First, you want to know all the network service program is a huge loop, your business logic can be called at some point in this cycle:

defhandler (request):

WHILETRUE:

# Get a new request

request=accept

# To get users to write business logic function according to the route map

Handler=GET_HANDLER (Request)

Handler (Request)

Imagine your Web service of a handler, after receiving a request requires a response to the results of API calls.

For the most traditional network applications, your API requests issued to wait for a response after this time the program stops running, even new requests have to get in after the end of the response. If you rely on an API request packet loss seriously, especially in response to slow it? That will be very low throughput applications.

Many traditional Web server using multi-threading technology to solve this problem: the run handler is placed on other threads, each dealing with a request, this does not affect the new thread blocks request to enter. This problem can be solved to some extent, but for larger systems concurrent, multithreaded scheduling will bring significant performance overhead.

IO multiplexing can be done to solve the problem without the use of threads, it is provided by the operating system kernel functions, we can say specifically for this type of scenario for us. Simply put, your program encounters network IO, tells the operating system to help you staring at, while the operating system gives you a way to make you can feel free to get what IO operation has been completed. like this:

# # 操作 系统 复 复 示 示 例 代代

# Register the ID and type of IO operations to the operating system IO

IO_REGISTER (IO_ID, IO_TYPE)

# Get completed IO operations

Events=IO_GET_FINISHED

For (IO_ID, IO_TYPE) INEvents:

IFIO_TYPE==Read:

Data=read_data (IO_ID)

Elifio_Type==Write:

Write_data (IO_ID, DATA)

Gring the IO multiplex logic into our server, probably like this:

Call_backs={}

Defhandler (REQ):

# do jobs here

DefCall_back (Result):

# Use the returned Result to complete the remaining work …

Call_backs [IO_ID]=CALL_BACK

# New cycle

WHILETRUE:

# Get the completed IO event

IFIO_TYPE==Read: # read

Data=read (IO_ID)

Call_back=call_backs [io_id]

Call_back (data)

Else:

# Other types of IO event processing

PASS

# Get a new request

Handler (Request)

Our Handler has returned immediately for the IO operation. At the same time, each iteration will perform a callback over the completed IO, the network request no longer blocks the entire server.

The pseudo code above is only for understanding, and the details are more complicated. Moreover, it is also possible to connect the new request to the IO event from the operating system to the monitor port.

If we split the cycle part with a call_backs dictionary to a separate module, we can get an EventLoop, which is the iOLOOP provided in the Python Standard Library Asynci.

0x02 with generator to eliminate Callback

He focuses on the Handler function written in our business, after having independent iOLOOP, it now becomes like this:

# 业 业 代 代 … …

# Need an API request

Print (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (API, CALL_BACK)

Here, performance problems have been resolved: We no longer need multi-threads to constantly accept new requests in the source, and don’t have to rely on the API response.

But we have also introduced a new problem. The original business logic code is now demolished. The code before requesting the API is still normal. The code after the request API can only be written in the callback function.

Here our business logic has only one API call. If there are multiple APIs, plus the call to Redis or MySQL (their essential is also a network request), the entire logic will be split, this is a burden on business development .

For some languages ??with anonymous functions (right is Java), it may also trigger a so-called "turning hell".

Next, we find way to solve this problem.

We can easily think that if the function can be suspended after running to the network IO operation, it will wake up at the breakpoint after completion.

If you are familiar with Python’s "Builder", you should find that it happens to have this feature:

Defexample:

Value=yield2

Print ("Get", Value)

ReturnValue

g=esample

# 启 启 生器, we will get 2

Got=G.send (NONE)

Print (got) # 2

TRY:

# Anti-start will display "get 4", which is our incoming value

Got=g.send (got * 2)

ExceptStopItemization ASE:

# Builder runs, will print (4), E.Value is the value of generator return

Print (E.Value)

There is Yield keyword in the function, and the call function will get a generator, and a key method for generator can interact with the generator.

G.send (none) runs the generator code until you encounter Yield, and return to the object, that is, 2, the generator code is stopped here until we perform G.send (got * 2) again, The 2 * 2 is also 4 to assign the value Value in front of Yield, and then continue to run the generator code.

Yield is like a door, you can send a thing from here, you can also take another thing.

If Send makes the generator to run until the next yield is over, the Send call will trigger a special exception STOPITERATION, which comes with a property Value, which is the value of the generator Return.

If we convert our Handler to a generator with Yield keyword, run it to The specific content of IO operationReturns, put the IO result back and restore the generator to run, then solve the problem of uncomfortable business code:

# 业 业 代 代 … …

# Need to execute an API request, directly put the IO request information yield

Result=yieldio_info

# Use the result returned by the API to complete the remaining work

Print (Result)

# This function is registered in iOLOOP, used to call back when there is a new request

Defon_Request (request):

Handler=GET_HANDLER (Request)

g=Handler (Request)

# 首 首 启 获得 获得 i 获得

IO_INFO=G.send (none)

g.send (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (IO_INFO, CALL_BACK)

The above example, the Handler code written by the user will not be dispersed into the callback, and the ON_Request function interacts with Callback and IOLOOP, but it will be implemented in the web framework, which is not visible to the user.

The above code is enough to give us inspiration of Callback destroyed with the builder, but there are two points:

  1. Only a network IO is initiated in business logic, but it is often more

  2. Business logic does not call other asynchronous functions (helping), but in practice, we tend to call other levels.

Let’s take a more complex example:

Among them, Request executes real IO, FUNC1, FUNC2 is only called. Obviously our code can only be written:

Deffunc1:

Ret=yieldfunc2 (re)

returnret

Deffunc2 (DATA):

ReturnResult

DEFREQUEST (URL):

# This simulation returns an IO operation, contains all information about the IO operation, where the string is simplified

Result=yield "IOJOB OF% S"% URL

ReturnResult

For Request, we expose the IO operation to the framework through Yield.

for Func1 and func2, calling request, clearly add Yield keywords Otherwise, the request call returns a generator and will not be paused and continue to perform subsequent logic obviously errors.

This is basically that we don’t write asynchronous code in the Tornado framework without Yield from, Aysnc, AWAIT.

To run the entire calling stack, the approximate process is as follows:

  1. Call FUNC1 to get the generator

  2. Call Send (None) Start it gets the result of request ("http://test.com/foo"), or generator object

  3. Send (none) Starts the generator generated by the request, gets the IO operation, registered by the frame to IOLOOP and specify a callback

  4. The Request Builder wakes up in the callback function after IO, and the generator will go to the return statement end

  5. Capture an exception to get the return value of the Request Builder, wake up the last layer of FUNC1, and get a FUNC2 generator

  6. Continue to execute …

Call FUNC1 to get the generator

Call Send (None) Start it gets the result of request ("http://test.com/foo"), or generator object

Send (none) Starts the generator generated by the request, gets the IO operation, registered by the frame to IOLOOP and specify a callback

The Request Builder wakes up in the callback function after IO, and the generator will go to the return statement end

Capture an exception to get the return value of the Request Builder, wake up the last layer of FUNC1, and get a FUNC2 generator

Continue to execute …

Friends who are familiar with the algorithm and data structure encounter such a traversal logic that will be returned, can be recursively used, because the recursive use generator can not do it, we can use the stack, in fact, this is the word "call stack" origin.

With the stack, we can Connect all generators connected in series in the entire call chain to a generatorFor its constant Send, you can continue to get all IO operation information and drive the call chain advancement, and the implementation method is as follows:

  1. The first generator is in the stack

  2. Call the Send, if you get the generator, you will enter the next round iteration

  3. I encountered IO to ask Yield, let the frame sign up to iOLOOP

  4. After the IO operation is completed, the cache result is forth, enter the next round iteration, the purpose is to restore the upper function using IO results.

  5. If a generator is running, you also need to restore the upper function to the upper function.

The first generator is in the stack

Call the Send, if you get the generator, you will enter the next round iteration

I encountered IO to ask Yield, let the frame sign up to iOLOOP

After the IO operation is completed, the cache result is forth, enter the next round iteration, the purpose is to restore the upper function using IO results.

If a generator is running, you also need to restore the upper function to the upper function.

If implemented, the code is not long but the amount of information is relatively large.

It turns the entire call chain to a generator, calling the send, to complete the IO in the chain, complete these IO, continue to push the logic execution in the calling chain until the overall logic ends:

DEFWrapper (GEN):

# The first layer calls the stack

Stack=stack

Stack.push (gen)

# Start a layer-by-layer call

WHILETRUE:

# Get the top elements of the stack

item=stack.peak

Result=none

IFisgenerator (item):

TRY:

# Try to get the next layer call and get it in the stack

Child=item.send (Result)

Stack.push (child)

# Result Restore to NONE

Result=none

# After entering the stack, enter the next loop directly, continue to explore down

Continue

# If you have an end, you will temporarily save the Result, the next step to make yourself out.

Result=E.Value

Else: # o o operation

# # I 操作 操作, Yield, Io will be woken up and temporarily saved after IO

Result=yieldItem

# 走 到 here, this layer has been completed, out of the stack, the next iteration will be a layer of calling chain

Stack.pop

# 没有有 上, the entire call chain is completed, return

Ifstack.empty:

Print ("finished")

ReturnResult

This may be the most complicated part. If you look hard, it is actually as long as you understand that for the call chain in the example above, it can achieve the effect as follows:

W=Wrapper (Func1)

# Will get "IOJOB of http://test.com/foo"

W.send (none)

# 上 上 ojob foo completed the result "bar" incompart, continue to run, get "IOJOB OF http://test.com/bar"

W.send ("bar")

# 上 上 i i b 完成 完成 传 传 传 传 入 入 入 入 入 入 入 入 入 入 入 入 入

W.send ("BARZ")

With this part, the frame will be added to the matching code:

# Maintain a list of ready lists, store all completed IO events, format is (Wrapper, Result)

Ready=

# After using the wrapper package, you can process IO by Send.

g=wrapper (func1)

# Take the start state directly as the result of NONE

Ready.Append ((g, none))

# Let the iOLOOP perform this function each cycle to handle the ready for IO

Ready.Append ((g, result))

# Traversing all already generators, advance it down

Forg, Result InselF.Ready:

# Use the Result to wake the builder and get the next IO operation

IO_JOB=G.send (Result)

# After the IO operation is complete, add the generator to the ready list, wait for the next round of processing.

ask_LOOP.GET_EVENT_LOOP.IO_CALL (

IO_JOB, LambdareSult: Ready.Append ((g, result)

Here, the core idea is to maintain a list of ready-to-read, and IOLOOP is overwhelmed, and the generator that promotes the ready state is run down, and the new IO operation is registered. After the IO is completed, the ready, after several rounds of Ioloop iteration A Handler will eventually be executed.

At this point, we use the generator to write to write business logic to run normally.

0x04 Improved Scalability

If you can read it here, Python’s scope is basically clear.

We have already achieved one Miniature sweeping frameworkThe realization details of the standard library look great here, but the specific ideas are consistent.

Our equilation framework has a restriction, we can only use IO to operate asynchronously, although in the world of network programming and web programming, the block is basically only IO operation, but there are some exceptions, such as I want the current operation Sleep for a few seconds. The use of time.sleep will make the entire thread to block, requiring special implementation. For example, some CPU-intensive operations can be asynchronously through multi-threaded asynchronous, so that another thread notification event has been completed and followed.

Therefore, it is best to decouple an open space with the network, so that the network IO is only one of the scenes, improves the scalability.

The Python official solution is to let the user hand to block the block code. As for the IOLOOP to register IO event or open a thread completely by yourself, and provide a standard "placeholder" FUTURE, indicating that his results wait for the future Yes, some prototypes are as follows:

ClassFuture:

# Set the result

Defset_Result (Result): Pass

# 获取 结果 结果

Defresult: Pass

# 表示 表示 This Future object is not already set up.

Defdone: Pass

# Set the callback function that should be executed when he is set, you can set multiple

Defadd_done_callback (Callback): Pass

Our slight change can support Future, making the scalability stronger. Network request functions for user code:

# 现在 r es es,, 生 生 器 器 器 器 器 器 器 器

#future is understood as a placeholder

Fut=future

Defcallback (Result):

# Assign the placeholder when the network IO completed the callback

Fut.set_Result (Result)

ask_LOOP.GET_EVENT_LOOP.IO_CALL (URL, CALLBACK)

Now, Request is no longer a generator, but directly returns Future.

And for the function of processing the ready list in the frame:

DEFCALLBACK (FUT):

#future is set to be placed in the ready list

Ready.Append ((g, fut.result))

Fut=g.send (Result)

Fut.add_done_callback (callback)

0x05 development and change

Many years ago, when using Tornado, probably only one Yield keyword is available, the sweeper wants to achieve, that is, this idea, even Yield keywords and return keywords can not appear in a function, you want to run after the generator Returns a value, you need to manually Raise an exception, although the effect is the same as Return now, but it is still very awkward, not elegant.

Later, there was Yield from expression. What can it do?

It is popular, it is done what the generator Wrapper is doing the above: Calling link through the stack, it is the syntax of the Wrapper logic.

With it, the same example you can write:

Deffunc1:

# Note Yield from

Ret=yieldFromRequest ("http://test.com/foo")

# Note Yield from

Ret=yieldfromfunc2 (re)

returnret

Deffunc2 (DATA):

# Note Yield from

Result=yieldfromRequest ("http://test.com/"+data)

ReturnResult

# 同 上 上 实 实 实 实 实 r

Then you no longer need the brainless Wrapper function:

g=func1

# Return the first request for Future

g.send (none)

# Continue to run, automatically enter FUNC2 and get the FUTURE inside it

G.send ("bar")

# Continue to run, complete the residual logic of the call chain, throw the stopiteration exception

G.send ("BARZ")

Yield from the entire call chain directly, it is already great, but it is used asynchronous programming or otherwise, and other languages ??have special-top Async, the AWAIT keyword, until the later version puts these content With dedicated Async, AWAIT keyword packaging, it is a more elegant look today.

0x06 summary and comparison

Overall, Python’s native and trip is achieved from two aspects:

  1. Based on IO multiplexing technology, the entire application is non-blocking on IO, achieving high efficiency

  2. Change the dispersed Callback code through the generator into synchronous code, reducing business writing difficulties

Based on IO multiplexing technology, the entire application is non-blocking on IO, achieving high efficiency

Change the dispersed Callback code through the generator into synchronous code, reducing business writing difficulties

There is a language of the object of the generator. Its IO fight is achieved, the evolution of the Java fight is basically exactly, the keyword is the same, and the Future class is the same than the promise.

However, it is different for this, which is different from this sweeping with the degree of GO-named GO, and does not explicitly based on the generator.

If the class ratio, you can implement the geventime of Python, which is the runtime, and Patch off the system calls to access your own Runtime, you come to the scheduling sweeper, gevent is focused on the network, based on network IO scheduling, relatively simple, The GO achieves perfect multi-core support, more complex and perfect, and creates a new CHANNEL new programming paradigm.

Author: Mao bean peanut

Getting Started: The Most Complete Zero-Basic Python Problem | Zero-Based 8 Months Python | Battle Project | Learning Python is this shortcut

Dry goods: crawling Douban short comment, movie "later we" | 38 years old NBA best player analysis | From Wanzhong to Word! Tang Dynasty 3 disappointment | Laughing to see the new Eti Dragon Slay Dollar | Running Question King | Make a massive Miss in Python Sketch | Disc, I am so fire, I use machine to learn to be a mini recommended system movie

Fun: Poultry Game | Nine Mao Hai | Beautiful Flower | Two-Article Python "Everyday Cool" game!

AI: Robot that will be poetry | Give the picture color | predictive income | Solver, I use the machine to learn to be a mini recommended system movie

Gadget: PDF to Word, easy to get forms and watermarks! | One button saves the HTML page as PDF! Goodbye PDF to extract charges! Use 90 lines of code to create the strongest PDF converter, Word, PPT, Excel, Markdown, HTML one-to-date conversion | Make a staple low-cost ticket prompt! | 60 lines of code made a voice wallpaper switch every day to see a little sister! |

Annual explosion case

  • 1). Lying! PDF to Word Use Python to easily get it!
  • 2) Learn Python is really fragrant! I made a website with 100 lines of code, helping people PS travel pictures, earn a chicken leg to eat
  • 3). The first broadcast over 100 million, hot all net, I analyzed the "Sister Taking Wind and Waves" and found these secrets
  • 4) 80 lines of code! Do a Dream in Python with Python
  • 5). You must master the 20 Python code, short and delicate, useless
  • 6). 30 python hambo skills
  • 7). I summarized 80 "rookie Python selection dry goods.pdf", all dry goods
  • 8). Goodbye Python! I want to learn Go! 2500 word depth analysis!
  • 9). Find a dog welfare! This Python reptile artifact is too cool, automatically download the girl picture